Find a file
Vyacheslav Egorov f4ec20abac Recognize and optimize a.runtimeType == b.runtimeType pattern.
Start by removing all get:runtimeType overrides in the patch files to have a single point computing the runtime type - Object.get:runtimeType. Handle string, double and integer types inside both intrinsic and runtime call to unify their handling and guarantee that code works even with intrinsifier disabled.

With overrides removed we can easily check that get:runtimeType is unique function name within the application that is being precompiled and use that to convert InstanceCall(get:runtimeType, ...) into StaticCall even nothing is known about the receiver.

This enables us to check if both left side and right side of comparison are StaticCall(Object.get:runtimeType, ...) when specializing InstanceCall(==, x, y). If they are we convert InstanceCall(==, StaticCall(get:runtimeType, a), StaticCall(get:runtimeType, b)) into StaticCall(Object._hasSameRuntimeType, a, b). A canonicalization rule will later delete unused get:runtimeType invocations.

Object._hasSameRuntimeType is implemented in C++ and intrinsified. It operates without creating new runtime types (except for Closures - where it does for simplicity). Cases of different class ids (i.e. a.[cid] != b.[cid]) and non-parameterized types are handled completely in the intrinsic. The rest is handled in the runtime code.

Microbenchmarking results:

Same parameterized classes: 15x improvement
Different parameterized classes: 300x improvement
Different/same non-parameterized classes: 2x improvement

BUG=
R=fschneider@google.com, regis@google.com

Review URL: https://codereview.chromium.org/2379733002 .
2016-10-25 10:03:06 +02:00
build [windows] Make most file_win.cc functions use malloc for string conversions. 2016-10-21 14:55:37 -07:00
client
docs/language Add = as default-value separator for named parameters. 2016-10-14 11:25:25 +02:00
pkg Extract _ReferencedUris information from UnlinkedUnit. 2016-10-24 14:05:45 -07:00
runtime Recognize and optimize a.runtimeType == b.runtimeType pattern. 2016-10-25 10:03:06 +02:00
samples Delete dart_backend from compiler. 2016-08-04 15:57:04 -07:00
samples-dev Untested hacks to swarm to avoid warnings. 2016-07-26 15:24:36 -07:00
sdk Change Set.difference API to accept Set<Object>. 2016-10-20 14:37:15 +02:00
tests Use different bug-number for skipped test. 2016-10-24 10:56:24 +02:00
third_party GN: Disable clang for simulators hosted on ia32 2016-10-07 09:55:58 -07:00
tools GN: Fix build 2016-10-22 00:05:39 -07:00
utils GN: Fix build 2016-10-22 00:05:39 -07:00
.gitattributes use pkg/dev_compiler in the build 2016-08-31 18:05:17 -07:00
.gitignore Ignore CMakeLists.txt 2016-10-07 15:38:08 -07:00
.gn Starting work on full GN build 2016-09-23 07:47:36 -07:00
.mailmap
.packages Use checked-in .package file for building and testing 2016-09-16 15:03:18 +02:00
.travis.yml Mark canary as failing 2016-10-24 09:10:36 +02:00
AUTHORS
BUILD.gn GN: Fix build 2016-10-22 00:05:39 -07:00
CHANGELOG.md Change Set.difference API to accept Set<Object>. 2016-10-20 14:37:15 +02:00
codereview.settings
create_sdk.gyp Delete dart_backend from compiler. 2016-08-04 15:57:04 -07:00
dart.gyp Remove package root target and support scripts 2016-09-20 13:32:50 +02:00
DEPS Fix dart_style version. 2016-10-20 13:26:18 -07:00
LICENSE
PATENTS
PRESUBMIT.py
README.dart-sdk
README.md
WATCHLISTS Remove tools directory from WATCHLISTS 2016-02-16 14:30:06 +01:00

Dart

Dart is an open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps.

Using Dart

Visit the dartlang.org to learn more about the language, tools, getting started, and more.

Browse pub.dartlang.org for more packages and libraries contributed by the community and the Dart team.

Building Dart

Learn how to get the source and prepare your machine to build the SDK.

There are more documents on our wiki.

Contributing to Dart

The easiest way to contribute to Dart is to file issues.

You can also contribute patches, as described in Contributing.

License

See LICENSE.