No description
Find a file
Erik Corry ac6310d5f3 Inline instance object hash code into object header on 64 bit.
64 bit objects have 32 bits of free space in the header word.
This is used for the hash code in string objects. We take it
for the default hash code on all objects that don't override
the hashCode getter.

This is both faster and a memory reduction.  Eg it shaves about
70% off the running time of this microbenchmark:

List list = [];

class Thing {
  get hashCode => 42;
}

class Thing2 {
  get hashCode => 42;
}

class Thing3 { }
class Thing4 { }

main() {
  int sum = 103;
  for (int i = 0; i < 10000000; i++) {
    list = [];
    list.add("foo");
    list.add(123);
    list.add(1.23);
    list.add(new Object());
    list.add(new Thing());
    list.add(new Thing2());
    list.add(new Thing3());
    list.add(new Thing4());
    for (int j = 0; j < 2; j++) {
      sum ^= biz(list);
    }
  }
  print(sum);
}

int biz(List list) {
  int sum = 103;
  for (var x in list) {
    sum ^= x.hashCode;
  }
  return sum;
}

R=rmacnak@google.com, vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2912863006 .
2017-06-22 09:25:52 +02:00
build
client
docs/language
pkg Fix mocked operator methods 2017-06-21 16:54:08 -07:00
runtime Inline instance object hash code into object header on 64 bit. 2017-06-22 09:25:52 +02:00
samples
samples-dev
sdk
tests Fix mocked operator methods 2017-06-21 16:54:08 -07:00
third_party
tools
utils Mostly revert "[fuchsia] Prepare for setting the Dart target architecture appropriately in the host binaries." 2017-06-21 15:19:21 -07:00
.clang-format
.gitattributes
.gitignore
.gn
.mailmap
.packages
.travis.yml
AUTHORS
BUILD.gn
CHANGELOG.md
codereview.settings
create_sdk.gyp
dart.gyp
DEPS
LICENSE
PATENTS
PRESUBMIT.py
README.dart-sdk
README.md
WATCHLISTS

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

If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.

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 & patents

See LICENSE and PATENTS.