Vyacheslav Egorov
a2ab7ccea4
[vm] Avoid UB in FinalizeHash(hash)
...
FinalizeHash(hash) was trying to avoid UB in expression 1 << 32
by casting 1 to uintptr_t. This type however is not wide enough
on 32-bit platforms.
Instead just use explicit comparison hashbits < kBitsPerInt32 to
avoid overflow in left shift.
This bug went unnoticed for a while because it the only place
where we call FinalizeHash(hash) is in the snapshot profile
writer code and it only triggers when gen_snapshot is a
32-bit binary - which is only true on Windows, as Mac and Linux
seem to use simarm_x64 configuration instead.
This UB was explicitly affecting the code behavior because C++
compiler would either optimize out or change behavior of any
code that consumed value produced by FinalizeHash(hash).
Fixes https://github.com/flutter/flutter/issues/97764
TEST=vm/cc/DirectChainedHashMap
Change-Id: I39f2b09e7516c875b765e5a065d1c1331f89fa33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250741
Commit-Queue: Slava Egorov <vegorov@google.com >
Reviewed-by: Daco Harkes <dacoharkes@google.com >
2022-07-06 12:48:16 +00:00
方哲源
6b04cac19d
[vm] Bug fix in dedup optimization when build deferred components.
...
Closes https://github.com/dart-lang/sdk/pull/49393
TEST=vm/dart{,_2}/regress_49372
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try
GitOrigin-RevId: c6306f96ae2bafa25c45e5c7a818c71eb72d8d12
Bug: https://github.com/dart-lang/sdk/issues/49372
Change-Id: I7ec4b170819321cb74037e475006890259446744
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250720
Commit-Queue: Slava Egorov <vegorov@google.com >
Reviewed-by: Slava Egorov <vegorov@google.com >
2022-07-06 11:04:10 +00:00
Johnni Winther
f6846849b9
[cfe] Handle augment super expressions
...
This adds the generation of access to augmented procedures.
TEST=existing
Change-Id: I5efa9cc541b86c18735bb1f4c51c73976ffa42ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250164
Reviewed-by: Tess Strickland <sstrickl@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-07-04 12:37:50 +00:00
Daco Harkes
c48f6fea58
[vm] Small fixes
...
Some small fixes split off from
https://dart-review.googlesource.com/c/sdk/+/246241 .
* Print code comments on disassembly if the code object exists.
* Add Struct to the NativeType API.
* Fix typo.
* Add documentation.
TEST=Only cosmetic changes, build/run CI should be enough.
Change-Id: Ie193243573b034c52e41401b4d384d556c212fdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250165
Commit-Queue: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2022-07-04 07:53:39 +00:00
Zach Anderson
d7df61e042
Revert "[vm] Generate event ids for synchronous begin and end events."
...
This reverts commit 7fe44864d6 .
Reason for revert: https://github.com/flutter/flutter/issues/106957
Original change's description:
> [vm] Generate event ids for synchronous begin and end events.
>
> os_signposts needs explicit ids to match begin and end events, whereas all other trace systems do this implicitly.
>
> TEST=Instruments
> Bug: https://github.com/dart-lang/sdk/issues/49178
> Change-Id: Ifeeaa1dfe823a0d5668f48b8c584f8bdeef23212
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249951
> Reviewed-by: Siva Annamalai <asiva@google.com >
> Commit-Queue: Ryan Macnak <rmacnak@google.com >
TBR=rmacnak@google.com ,asiva@google.com
Change-Id: Id86959d08b5352b5446b6f294a8302b88b4fa0c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/49178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250403
Reviewed-by: Zach Anderson <zra@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
Reviewed-by: Liam Appelbe <liama@google.com >
2022-07-01 16:08:40 +00:00
Liam Appelbe
f7990bc0da
Revert "[vm] Forward dynamic events names to os_signposts as arguments."
...
This reverts commit 90da09e2db .
Reason for revert: Blocking this revert: https://dart-review.googlesource.com/c/sdk/+/250403
Original change's description:
> [vm] Forward dynamic events names to os_signposts as arguments.
>
> TEST=Instruments
> Bug: https://github.com/dart-lang/sdk/issues/49178
> Change-Id: Ice4a83f03dccb6c7dbd54c229f37d4ea7d0d8051
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250111
> Reviewed-by: Siva Annamalai <asiva@google.com >
> Commit-Queue: Ryan Macnak <rmacnak@google.com >
TBR=rmacnak@google.com ,asiva@google.com
Change-Id: I326fb50ead5c298e62666371adadb2b9f40d69c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/49178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250407
Reviewed-by: Siva Annamalai <asiva@google.com >
Reviewed-by: Liam Appelbe <liama@google.com >
Reviewed-by: Alexander Aprelev <aam@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2022-07-01 16:07:50 +00:00
Vyacheslav Egorov
ec9a660ccc
[vm] Avoid clobbering array length in AllocateArray stub on ARM
...
It was calling EnsureIsNewOrRemembered on the slow path which
was forgetting to preserve registers around a runtime call.
Fixes https://github.com/flutter/flutter/issues/106510
TEST=vm/dart{,_2}/flutter_regress_106510
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm-try
Change-Id: I621e392304fcd1fd643c009fbcde3f88b6f19b7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250168
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Slava Egorov <vegorov@google.com >
2022-07-01 12:31:47 +00:00
Alexander Markov
abedfaf62a
[vm] Fix soundness issue when awaiting a user-defined Future
...
TEST=language/async/await_user_defined_future_soundness_test
Issue: https://github.com/dart-lang/sdk/issues/49345
Change-Id: Ieaaa9baace13dad242c770a710d4d459e135af81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250222
Reviewed-by: Slava Egorov <vegorov@google.com >
Commit-Queue: Alexander Markov <alexmarkov@google.com >
2022-06-30 22:53:24 +00:00
Ryan Macnak
4308eb39cf
[standalone] Remove RISC-V linker hack.
...
TEST=ci
Change-Id: I5379bc3f537cab149742df138d76983b4f16a796
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250141
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-30 21:16:04 +00:00
Ryan Macnak
7004b1859f
[vm] Account for pool entries that are immediate objects.
...
Cf. 4c82eb5836
TEST=gallery
Bug: https://github.com/flutter/gallery/issues/545
Change-Id: I90935aba3737f7b6873368e5a8ebf1cc48d34a22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250320
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2022-06-30 20:32:44 +00:00
Ryan Macnak
90da09e2db
[vm] Forward dynamic events names to os_signposts as arguments.
...
TEST=Instruments
Bug: https://github.com/dart-lang/sdk/issues/49178
Change-Id: Ice4a83f03dccb6c7dbd54c229f37d4ea7d0d8051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250111
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-30 20:16:33 +00:00
Ryan Macnak
7fe44864d6
[vm] Generate event ids for synchronous begin and end events.
...
os_signposts needs explicit ids to match begin and end events, whereas all other trace systems do this implicitly.
TEST=Instruments
Bug: https://github.com/dart-lang/sdk/issues/49178
Change-Id: Ifeeaa1dfe823a0d5668f48b8c584f8bdeef23212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249951
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-30 16:48:36 +00:00
Ryan Macnak
1c461e06c1
[vm, gc] Make force-growth a thread-local property.
...
Don't evaluate concurrent marking on new-space page allocation or external allocation under force-growth scopes.
TEST=ci, tsan
Bug: https://github.com/dart-lang/sdk/issues/49344
Bug: https://github.com/dart-lang/sdk/issues/48377
Bug: https://github.com/dart-lang/sdk/issues/48607
Change-Id: Ieff3880bd29228804419ef292a41ba4d502c2c80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250223
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Alexander Aprelev <aam@google.com >
2022-06-30 00:21:36 +00:00
Alexander Aprelev
f51149eba3
[embedder] Clean up deprecated secure connection enforcement mechanism.
...
Addresses https://github.com/flutter/flutter/issues/54448
TEST=ci, flutter
Change-Id: If1ea8044cdfa8d593e0cd5b5201c2fbe71dd08ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248220
Commit-Queue: Alexander Aprelev <aam@google.com >
Reviewed-by: Michael Thomsen <mit@google.com >
2022-06-29 16:59:25 +00:00
Martin Kustermann
dd9a2dca24
[gardening] Mark vm/dart{,_2}/byte_array_test as slow
...
The test runs with --opt-counter-threshold=10 and can be very slow,
especially in debug mode.
TEST=Should address flaky timeout of this test.
Change-Id: I2e45681743c4660e20c765ec0fcf85424393f2c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250084
Reviewed-by: Aske Simon Christensen <askesc@google.com >
Commit-Queue: Martin Kustermann <kustermann@google.com >
2022-06-29 08:29:47 +00:00
Daco Harkes
a37502c1b8
[misc] Cleanup stale todos
...
TEST=tests/ffi
Change-Id: Iae97f62b1adb8dbe99ad075dfe750604db0de62c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249301
Commit-Queue: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com >
Reviewed-by: Tess Strickland <sstrickl@google.com >
2022-06-28 16:02:53 +00:00
Ryan Macnak
93a4247af3
Reapply "Account for @pragma("vm:entry-point") creating additional "root" libraries when partitioning the program into loading units."
...
Weaken assertion in gen_snapshot requiring all libraries to have a loading unit as there can still be unreachable libraries:
- Google3 and Fuchsia will compile all the sources in a package to a single dill file, then present multiple input dill files to the AOT compilation. Since the set of libraries was derived from package membership instead of imports, many can be unreachable.
- When the root library's main comes from an export, the frontend's representation will incorrectly report the library containing main as the root library and the true root library may be unreachable from it.
Instead, assert only that surviving compiled code is assigned a loading unit.
TEST=gallery
Bug: https://github.com/flutter/gallery/issues/545
Bug: https://github.com/dart-lang/sdk/issues/49325
Bug: https://github.com/dart-lang/sdk/issues/41974
Bug: b/237016312
Change-Id: Ia52563a6f517308d041368be11dcc85270f19acc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249724
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2022-06-27 18:56:12 +00:00
Alexander Markov
77ea9820aa
[vm] New implementation of sync* based on suspend/resume stubs
...
Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: I7f4b6b56d914a617dfd7ac724cd4414532073b4c
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249141
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Slava Egorov <vegorov@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Alexander Markov <alexmarkov@google.com >
2022-06-27 18:19:12 +00:00
Ryan Macnak
e7b77987ff
[vm, gc] Address TSAN warning on access to PageSpace::phase_.
...
TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/49323
Change-Id: I6e98cbd33b69332a01db4fdcceb0b3da164e725e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249760
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-24 23:00:00 +00:00
Martin Kustermann
0113970da0
[gardening] Mark some tests as Pass, Slow
...
The tests are generally slow and sometimes hit the limit to a timout
(e.g. recently on win-debug-ia32)
TEST=Should fix flaky timeouts.
Change-Id: I8879d0e6df94046e79e43957877877a3458deb3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249607
Commit-Queue: Martin Kustermann <kustermann@google.com >
Reviewed-by: Slava Egorov <vegorov@google.com >
2022-06-24 13:26:39 +00:00
Martin Kustermann
db6b2679e6
[gardening] Use .dart_tool/package_config.json instead of deprecated (and now removed) .packages
...
TEST=Fixes test after support for .packages was removed.
Change-Id: I44e077f06b62e3abb9f1a96cae0fbe576e44ef39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249682
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Martin Kustermann <kustermann@google.com >
2022-06-24 11:20:19 +00:00
Jens Johansen
b4e2012f5b
[CFE] Remove support for .packages file
...
This CL:
* Removed the redirect from .packages to .dart_tool/package_config.json
(whenever such a file existed).
* Removes support for the old format entirely.
* Updates all tests etc that were found.
Fixes https://github.com/dart-lang/sdk/issues/48939
TEST=Existing tests updated.
Change-Id: Iccf711c455ac1885189aa773ca74dd8f55012964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248603
Reviewed-by: Michael Thomsen <mit@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2022-06-24 08:20:39 +00:00
Emmanuel Pellereau
6c542eca22
Revert "[ VM / Service ] Add abstract flag to Function"
...
This reverts commit 921476edf3 .
Reason for revert: breaks google3 (b/236964692).
Original change's description:
> [ VM / Service ] Add abstract flag to Function
>
> Bug: https://github.com/dart-lang/coverage/issues/398
> Change-Id: I1f6e16483e28fb7a77aebae079fd62abe9d16099
> TEST=Added to get_object_rpc_test.dart
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249421
> Reviewed-by: Ben Konyi <bkonyi@google.com >
> Commit-Queue: Liam Appelbe <liama@google.com >
TBR=bkonyi@google.com ,liama@google.com
Change-Id: I1733080dadd6f283766dddbdbe1390d821f91f64
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/coverage/issues/398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249680
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com >
Reviewed-by: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com >
2022-06-24 07:35:29 +00:00
Emmanuel Pellereau
c13f7b0360
Revert "Account for @pragma("vm:entry-point") creating additional "root" libraries when partitioning the program into loading units."
...
This reverts commit 9c2a91fb72 .
Reason for revert: breaks google3 (b/237016312)
Original change's description:
> Account for @pragma("vm:entry-point") creating additional "root" libraries when partitioning the program into loading units.
>
> If a library contained an entry point but was not reachable from the root library, it was not assigned to any loading unit and caused a null dereference in gen_snapshot. This is not possible with the standalone embedder, but is possible in Flutter because it passes multiple sources to frontend_server. E.g., `--source dart_plugin_registrant.dart`.
>
> TEST=gallery
> Bug: https://github.com/flutter/gallery/issues/545
> Change-Id: I9c67f0e39f7509094ee873610d80851a702a0cf2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249640
> Reviewed-by: Alexander Markov <alexmarkov@google.com >
> Commit-Queue: Ryan Macnak <rmacnak@google.com >
TBR=rmacnak@google.com ,alexmarkov@google.com
Change-Id: I3e17bf29b8f29e4797abfca35fa82b9ca3b5a160
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/gallery/issues/545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249681
Reviewed-by: Daco Harkes <dacoharkes@google.com >
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com >
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com >
2022-06-24 07:35:08 +00:00
Ryan Macnak
9c2a91fb72
Account for @pragma("vm:entry-point") creating additional "root" libraries when partitioning the program into loading units.
...
If a library contained an entry point but was not reachable from the root library, it was not assigned to any loading unit and caused a null dereference in gen_snapshot. This is not possible with the standalone embedder, but is possible in Flutter because it passes multiple sources to frontend_server. E.g., `--source dart_plugin_registrant.dart`.
TEST=gallery
Bug: https://github.com/flutter/gallery/issues/545
Change-Id: I9c67f0e39f7509094ee873610d80851a702a0cf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249640
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-23 23:51:48 +00:00
Ben Konyi
95d1558109
[ VM / CLI ] Redirect users to use 'dart compile' for snapshot generation
...
Note: `--snapshot=` and related flags are still valid for non-DartDev
invocations of the VM (e.g., 'dart --snapshot=').
TEST=Local testing
Fixes https://github.com/dart-lang/sdk/issues/49276
Change-Id: I666f68bd46d5b22c691da15267f14f4ad5a53731
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249220
Reviewed-by: Ryan Macnak <rmacnak@google.com >
2022-06-23 20:35:15 +00:00
Ryan Macnak
0a8fda94b6
[vm, compiler] Use RISC-V's compare-and-branch for a shorter write barrier sequence.
...
dart2js.aot.rv64 25753840 -> 25721032 (-0.13%)
dart2js.aot.rv32 24891160 -> 24858368 (-0.13%)
TEST=ci
Change-Id: I252e0477f11b9198fe043f105a8745bc283aaaa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249062
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-23 15:58:15 +00:00
Liam Appelbe
921476edf3
[ VM / Service ] Add abstract flag to Function
...
Bug: https://github.com/dart-lang/coverage/issues/398
Change-Id: I1f6e16483e28fb7a77aebae079fd62abe9d16099
TEST=Added to get_object_rpc_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249421
Reviewed-by: Ben Konyi <bkonyi@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2022-06-23 15:46:05 +00:00
Emmanuel Pellereau
bb104f07fc
Revert "Reland "[vm] Remove warnings about non-standard stack traces.""
...
This reverts commit 6651c29779 .
Reason for revert: breaks google3 (b/236928633)
Original change's description:
> Reland "[vm] Remove warnings about non-standard stack traces."
>
> This is a reland of commit cc9d14d822
>
> TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy_non_symbolic_test
>
> Original change's description:
> > [vm] Remove warnings about non-standard stack traces.
> >
> > The language team has clarified in
> > https://github.com/dart-lang/language/issues/1212 that the content of
> > stack traces is not specified in a way that is violated by either
> > obfuscation or non-symbolic stack traces. Thus, we remove the warnings
> > about supposedly standard-violating stack traces.
> >
> > TEST=No change in actual functionality, so tested manually.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/43388
> > Change-Id: I2c7ac44cf2f9afafa85d902b2783e1173e727264
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249185
> > Commit-Queue: Tess Strickland <sstrickl@google.com >
> > Reviewed-by: Daco Harkes <dacoharkes@google.com >
> > Reviewed-by: Martin Kustermann <kustermann@google.com >
>
> Bug: https://github.com/dart-lang/sdk/issues/43388
> Change-Id: Ifa7915b4ba21cca592ed5645cd9ad6cda1575f12
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249192
> Commit-Queue: Tess Strickland <sstrickl@google.com >
> Reviewed-by: Martin Kustermann <kustermann@google.com >
> Reviewed-by: Daco Harkes <dacoharkes@google.com >
TBR=kustermann@google.com ,dacoharkes@google.com ,sstrickl@google.com
Change-Id: I65f3d84caee3ec9ac30f0ce058104bb24ef6ea11
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/43388
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249580
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com >
2022-06-23 09:25:00 +00:00
Alexander Aprelev
413f60a8b6
Reland "Update clang and gn to match Fuchsia."
...
This reverts commit a99b0f6c09 .
To fix culprit for the revert, it no longer rolls zlib, instead adds
an option to ignore clang warnings in zlib source code.
TEST=ci
Change-Id: I9a877ff0c08af961bc49fcacaad5b01f1ed0a743
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249542
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Alexander Aprelev <aam@google.com >
2022-06-22 21:54:25 +00:00
Ryan Macnak
2e4107c8ae
[vm, gc] Apply incremental marking back-pressure in proportion to internal allocation size.
...
In particular, do not apply incremental marking back-pressure for external allocations. External allocations do not cause additional marking work. If a mutator thread performs a storm of external allocations, this should not cause it to effectively become a marking thread.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/47492
Bug: https://github.com/flutter/flutter/issues/106305
Change-Id: Icace57e73d695143f7e295924b61b9b1c04be121
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249403
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
2022-06-22 15:41:04 +00:00
Tess Strickland
6651c29779
Reland "[vm] Remove warnings about non-standard stack traces."
...
This is a reland of commit cc9d14d822
TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy_non_symbolic_test
Original change's description:
> [vm] Remove warnings about non-standard stack traces.
>
> The language team has clarified in
> https://github.com/dart-lang/language/issues/1212 that the content of
> stack traces is not specified in a way that is violated by either
> obfuscation or non-symbolic stack traces. Thus, we remove the warnings
> about supposedly standard-violating stack traces.
>
> TEST=No change in actual functionality, so tested manually.
>
> Bug: https://github.com/dart-lang/sdk/issues/43388
> Change-Id: I2c7ac44cf2f9afafa85d902b2783e1173e727264
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249185
> Commit-Queue: Tess Strickland <sstrickl@google.com >
> Reviewed-by: Daco Harkes <dacoharkes@google.com >
> Reviewed-by: Martin Kustermann <kustermann@google.com >
Bug: https://github.com/dart-lang/sdk/issues/43388
Change-Id: Ifa7915b4ba21cca592ed5645cd9ad6cda1575f12
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249192
Commit-Queue: Tess Strickland <sstrickl@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Reviewed-by: Daco Harkes <dacoharkes@google.com >
2022-06-22 09:19:37 +00:00
Ryan Macnak
d45dde461e
[vm] Fix edge cases in simulating RISC-V's fmin/fmax.
...
TEST=ci (+ local qemu)
Change-Id: Ia7921c204cf2397fda785196731c93b627dee62a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249082
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2022-06-21 20:47:34 +00:00
Ryan Macnak
baa870bfa7
[vm, gc] Prevent multiple threads racing to finalize marking from triggering an extra (synchronous) GC.
...
TEST=ci
Change-Id: I844f23cbedfc99950b4dfadfb9a339865bea1a6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249080
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-21 19:56:34 +00:00
Alexander Aprelev
a99b0f6c09
Revert "Update clang and gn to match Fuchsia."
...
This reverts commit e9f629f607 as it break flutter build https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20iOS%20Engine/32804/overview
```
[1617/4268] CC obj/third_party/zlib/chrome_zlib.adler32.o
FAILED: obj/third_party/zlib/chrome_zlib.adler32.o
error: unknown warning option '-Wno-deprecated-non-prototype' [-Werror,-Wunknown-warning-option]
[1618/4268] CXX obj/third_party/skia/modules/skunicode/src/skunicode.SkUnicode_icu_builtin.o
[1619/4268] CC obj/third_party/zlib/chrome_zlib.compress.o
FAILED: obj/third_party/zlib/chrome_zlib.compress.o
error: unknown warning option '-Wno-deprecated-non-prototype' [-Werror,-Wunknown-warning-option]
```
TEST=ci
Change-Id: I3c4ce4a9c80be197dc50e70365e668e5b7a4e2fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249240
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Alexander Aprelev <aam@google.com >
2022-06-21 17:02:04 +00:00
Tess Strickland
140db2e0f3
Revert "[vm] Remove warnings about non-standard stack traces."
...
This reverts commit cc9d14d822 .
Reason for revert: Broken precomp async stack tests.
Original change's description:
> [vm] Remove warnings about non-standard stack traces.
>
> The language team has clarified in
> https://github.com/dart-lang/language/issues/1212 that the content of
> stack traces is not specified in a way that is violated by either
> obfuscation or non-symbolic stack traces. Thus, we remove the warnings
> about supposedly standard-violating stack traces.
>
> TEST=No change in actual functionality, so tested manually.
>
> Bug: https://github.com/dart-lang/sdk/issues/43388
> Change-Id: I2c7ac44cf2f9afafa85d902b2783e1173e727264
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249185
> Commit-Queue: Tess Strickland <sstrickl@google.com >
> Reviewed-by: Daco Harkes <dacoharkes@google.com >
> Reviewed-by: Martin Kustermann <kustermann@google.com >
TBR=kustermann@google.com ,dacoharkes@google.com ,sstrickl@google.com
Change-Id: I315ce10074109cf7f7cdbd94402673444b0fd6f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/43388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249191
Reviewed-by: Daco Harkes <dacoharkes@google.com >
Commit-Queue: Tess Strickland <sstrickl@google.com >
Reviewed-by: Tess Strickland <sstrickl@google.com >
2022-06-21 11:54:34 +00:00
Tess Strickland
cc9d14d822
[vm] Remove warnings about non-standard stack traces.
...
The language team has clarified in
https://github.com/dart-lang/language/issues/1212 that the content of
stack traces is not specified in a way that is violated by either
obfuscation or non-symbolic stack traces. Thus, we remove the warnings
about supposedly standard-violating stack traces.
TEST=No change in actual functionality, so tested manually.
Bug: https://github.com/dart-lang/sdk/issues/43388
Change-Id: I2c7ac44cf2f9afafa85d902b2783e1173e727264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249185
Commit-Queue: Tess Strickland <sstrickl@google.com >
Reviewed-by: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
2022-06-21 08:00:33 +00:00
Alexander Markov
1aa406869b
[gardening] Skip enable_mirrors_test on configurations with separate kernel compilation
...
Separate kernel compilation on sim* bots doesn't respect VM options, so
--enable-mirrors=false has no effect on those bots.
This change skips the recently added test for that VM option.
Issue: https://github.com/dart-lang/sdk/issues/49266
Change-Id: I2119c2c9623054fa24fdeee248c80b14287e7ee8
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249022
Reviewed-by: Ben Konyi <bkonyi@google.com >
Commit-Queue: Alexander Markov <alexmarkov@google.com >
2022-06-17 19:05:09 +00:00
Alexander Markov
8bc1cda3f7
[vm] Fix --enable-mirrors VM flag to affect environment and conditional imports
...
This change propagates --enable-mirrors VM flag to CFE via
TargetFlags.supportMirrors. CFE uses that to select conditional
imports and for constant evaluation of bool.fromEnvironment.
TEST=runtime/tests/vm/dart/enable_mirrors_test
Issue: https://github.com/dart-lang/sdk/issues/49266
Change-Id: I9f6b03f1ab224d13cbe9f035fb5b6fa6eb59055c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249020
Reviewed-by: Ben Konyi <bkonyi@google.com >
Commit-Queue: Alexander Markov <alexmarkov@google.com >
2022-06-17 17:20:09 +00:00
Martin Kustermann
a6b408d901
[gardening] Remove null safety flag from newly added test
...
This fixes an issue in our testing infrastructure: If // VMOptions
swiches the null safety mode explicitly, all tools/test.py runs that
require multiple steps (e.g AOT that compiles+runs or simarm that
compiles to kernel + runs) would fail with mismatch in null safety mode.
Instead rely on our test matrix to run this test in all null safety
configurations.
TEST=ci
Change-Id: I6e2f6963351a1a6c071cefb4444e64d2904c63f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249001
Commit-Queue: Martin Kustermann <kustermann@google.com >
Reviewed-by: Tess Strickland <sstrickl@google.com >
2022-06-17 13:37:48 +00:00
Martin Kustermann
4703d2c54e
[vm] Make _CastError.{_url,_line,_column} nullable fields
...
The ! operator causes _CastErrors to be thrown without the
_CastError.{_url,_line,_column} fields to be set (see
runtime/vm/runtime_entry.cc:NullErrorHelper).
This CL makes the fields nullable. An alternative would be to remove the
fields entirely since the fields are not used and the position of the
failed null check is visible from top frame in the stack frame as well.
Though the fields are visible in the debugger and there are other
situations where they are correctly set (e.g. in type errors that cause
_CastError to be thrown). To avoid changing this behavior, we make them
nullable.
Fixes https://github.com/dart-lang/sdk/issues/49279
TEST=vm/dart{,_2}/regress_49279_test
Change-Id: Ieff9e84819d5afa83c8950ad1f99d684d184340a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248980
Commit-Queue: Martin Kustermann <kustermann@google.com >
Reviewed-by: Tess Strickland <sstrickl@google.com >
2022-06-17 10:39:28 +00:00
Daco Harkes
2b700003d9
Reland "[vm] Only call .hashCode once when adding to Map and Set"
...
Relanding after https://dart-review.googlesource.com/c/sdk/+/244200 .
Original change's description:
> [vm] Only call `.hashCode` once when adding to `Map` and `Set`
>
> The methods to add to hash maps and hash sets are recursive: if the
> index needs to be rehashed then the same method is called again
> after rehashing.
>
> This CL nests the actual implementation in a private method that takes
> the full hashCode as an extra argument.
>
> No significant code size or run time changes are reported on our
> benchmarks. (Our benchmarks do not contain purposefully slow hashCodes.)
>
> Note that hashCode can be called again later if rehashing of the index
> is required on adding subsequent elements.
>
> Bug: https://github.com/dart-lang/sdk/issues/48948
> Change-Id: Ia3ccff9e592d675b4922ac78c4aa7ee0287ecb50
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243623
> Reviewed-by: Martin Kustermann <kustermann@google.com >
> Commit-Queue: Daco Harkes <dacoharkes@google.com >
Change-Id: I033bd7cc29fc812dccb6dccf0c3dca6e22cae2ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248802
Commit-Queue: Tess Strickland <sstrickl@google.com >
Auto-Submit: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Tess Strickland <sstrickl@google.com >
2022-06-17 10:05:18 +00:00
Ryan Macnak
01a7f207c3
[vm] Speed up the RISC-V simulator.
...
TEST=ci
Change-Id: I8ddba01117d21fcf915d77bc06765a0d576f55ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248682
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-16 17:56:02 +00:00
Alexander Aprelev
6d923dfd99
Revert "Deprecate outdated errors, drop CastError and NullThrownError."
...
This reverts commit 0f3dea33f9 .
Reason for revert: breaks dart->engine roller as flutter still uses NullThrownError, fails analysis step
Original change's description:
> Deprecate outdated errors, drop `CastError` and `NullThrownError`.
>
> Both `CastError` and `NullThrownError` becomes just (deprecated) aliases for `TypeError`.
>
> `FallThroughError` becomes deprecated. Fall-through was made a compile-time error in Dart 2.0, the error should no longer be used.
>
> `CyclicInitializationError` is deprecated. Null safe Dart doesn't specify which error a late initialization error throws. We use internal errors now.
>
> These errors should not be needed in sound null-safe mode (if they are even needed now), and so should be removed in Dart 3.0.
>
> TEST= No new tests, should not change behavior in a significant way.
>
> Bug: https://github.com/dart-lang/sdk/issues/49141
> Change-Id: I636e9a0d0c32021d40bb819a88a1f57db6efc5a9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247384
> Reviewed-by: Nate Bosch <nbosch@google.com >
> Reviewed-by: Brian Quinlan <bquinlan@google.com >
> Commit-Queue: Lasse Nielsen <lrn@google.com >
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/sdk/issues/49141
Change-Id: I1b2802ec69fe654525e683527ff3554ff972f0c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248741
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com >
Reviewed-by: Alexander Aprelev <aam@google.com >
Reviewed-by: Alexander Thomas <athom@google.com >
Commit-Queue: Alexander Aprelev <aam@google.com >
2022-06-16 17:12:19 +00:00
Ryan Macnak
e9f629f607
Update clang and gn to match Fuchsia.
...
Roll zlib for -Wno-deprecated-non-prototype.
TEST=ci
Bug: https://github.com/flutter/flutter/issues/103568
Change-Id: I969ab107e8917cc35645cfc9916db0d9ab61b203
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248720
Reviewed-by: Alexander Aprelev <aam@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-16 16:06:09 +00:00
Ryan Macnak
068d88b0d0
[vm, compiler] Emit constant-width addresses in IA32 disassembly for the absolute addressing mode.
...
TEST=ci
Change-Id: I1a3f6a4064ecc6d93e9cb21055d43e9cb698eea5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248721
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Alexander Aprelev <aam@google.com >
2022-06-16 16:03:19 +00:00
Alexander Aprelev
abeaa03148
[vm/heap/metrics] Remove deprecated isolate-based vm heap statistic messages.
...
Fixes https://dartbug.com/49211
TEST=ci
Change-Id: Icddbebccf84f226b2ac89acb9153353d84658079
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248680
Reviewed-by: Slava Egorov <vegorov@google.com >
Commit-Queue: Alexander Aprelev <aam@google.com >
2022-06-16 15:27:49 +00:00
Tess Strickland
73bc88f957
[vm/compiler] Fix bad check in CompilerType::IsAssignableTo.
...
In order to know whether a value is assignable to a given type,
we need the fully instantiated type. Thus, return false if the
type given to CompilerType::IsAssignableTo is uninstantiated,
similar to CompilerType::IsInstanceOf.
TEST=vm/dart{,_2}/regress_b_230945329_test.dart
Bug: b/230945329
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I7ff9eb2214debc274f09580d51c80f0921f8f77d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244200
Reviewed-by: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Tess Strickland <sstrickl@google.com >
2022-06-16 14:03:00 +00:00
Ryan Macnak
1a2dd17712
[vm, compiler] XMM0 is not just a scratch register on IA32.
...
In particular, it can be live across write-barrier calls.
TEST=ci
Change-Id: I9383cc775315d76d0dc0052fa8f91daa233cb413
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248681
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-06-15 20:16:58 +00:00
kanghuay
5daf8f21ed
[vm] Prevent empty range in coverage output
...
Closes https://github.com/dart-lang/sdk/pull/49251
GitOrigin-RevId: 4c399e9b8150bbce495b4f88e0546bdd40fff7ed
Change-Id: Ic16843edeeca9678a7caedbe8f675f7d0d20548d
TEST=Added a case to source_report_test.cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248349
Reviewed-by: Ben Konyi <bkonyi@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Liam Appelbe <liama@google.com >
2022-06-15 20:13:28 +00:00