[vm] Do not zero the code units of strings allocated by the runtime

Object::InitializeObject no longer zeroes the code units of a OneByteString
or TwoByteString. Debug builds fill them with kZapUninitializedWord instead.
Extends 50948617e6c from large strings to all strings.

Product AOT, GB/s, best of 7 processes. Apple M5 Max (macOS arm64) and
Intel i5-4670K (Linux x64, on an older main that includes 578420):

                       4 KiB  64 KiB 128 KiB 256 KiB   1 MiB  16 MiB  64 MiB
  String.fromCharCodes(Uint8List)
    M5 Max    before    30.3    32.1    33.9     8.0    10.7    15.2    15.5
              after     32.3    54.7    57.1     9.1    10.6    15.9    15.1
                         +6%    +70%    +69%    +14%     -1%     +5%     -2%
    i5-4670K  before    20.8    11.4    11.4     1.7     2.0     2.2     2.4
              after     22.0    21.9    21.7     1.7     2.1     2.2     2.4
                         +5%    +91%    +90%      0%     +1%     +1%      0%
  String.substring
    M5 Max    before     4.3    42.1    42.4     8.6     8.8    15.6    17.3
              after      4.3    91.8    84.0     8.4     8.9    16.5    18.6
                         -1%   +118%    +98%     -2%      0%     +6%     +7%
    i5-4670K  before     3.2    11.4    11.3     1.7     2.1     2.2     2.5
              after      3.2    22.2    21.2     1.7     2.1     2.2     2.5
                         +1%    +95%    +88%     -1%      0%     -2%      0%

Issue: https://github.com/dart-lang/sdk/issues/64954
Issue: https://github.com/dart-lang/sdk/issues/64170

TEST=corelib/string*, vm/dart/string_equals_test, lib/convert, vm/cc/String*

Cq-Include-Trybots: luci.dart.try:vm-msan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-linux-debug-ia32-try,vm-linux-release-simarm-try,vm-linux-debug-x64c-try,vm-aot-linux-debug-x64c-try,vm-linux-debug-arm64-try,vm-mac-debug-arm64-try
Change-Id: Ie0f1945ee80aff4d0f3af71059c1e9fbff6fd699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/579582
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Auto-Submit: Modestas Valauskas <valauskasmodestas@gmail.com>
1 file changed
tree: 3a335eb52c4829470a34aac36738f356c750e492
  1. .agents/
  2. .dart_tool/
  3. .github/
  4. benchmarks/
  5. build/
  6. docs/
  7. pkg/
  8. runtime/
  9. samples/
  10. sdk/
  11. tests/
  12. third_party/
  13. tools/
  14. utils/
  15. .clang-format
  16. .gitattributes
  17. .gitconfig
  18. .gitignore
  19. .gn
  20. .mailmap
  21. .style.yapf
  22. AUTHORS
  23. BUILD.gn
  24. CHANGELOG.md
  25. codereview.settings
  26. CONTRIBUTING.md
  27. DEPS
  28. LICENSE
  29. OWNERS
  30. PATENT_GRANT
  31. PRESUBMIT.py
  32. pubspec.yaml
  33. README.dart-sdk
  34. README.md
  35. sdk.code-workspace
  36. sdk_args.gni
  37. sdk_packages.yaml
  38. SECURITY.md
  39. WATCHLISTS
README.md

Dart

An approachable, portable, and productive language for high-quality apps on any platform

Dart is:

  • Approachable: Develop with a strongly typed programming language that is consistent, concise, and offers modern language features like null safety and patterns.

  • Portable: Compile to ARM, x64, or RISC-V machine code for mobile, desktop, and backend. Compile to JavaScript or WebAssembly for the web.

  • Productive: Make changes iteratively: use hot reload to see the result instantly in your running app. Diagnose app issues using DevTools.

Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:

  • Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.

  • Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).

Dart platforms illustration

License & patents

Dart is free and open source.

See LICENSE and PATENT_GRANT.

Using Dart

Visit dart.dev to learn more about the language, tools, and to find codelabs.

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

Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).

Contributing to Dart

See the contribution guide for details.

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 in our repo at docs.

Roadmap

Future plans for Dart are included in the combined Dart and Flutter roadmap on the Flutter wiki.