A recent fix for a use-after-free crash created a memory leak due to
Timeline::Clear() returning immediately as the timeline had already
entered its shutdown state. This change adds a new helper function to
bypass the shutting down check in Timeline::Clear(), allowing for the
recorder to be properly cleaned up.
TEST=CQ, local testing
Change-Id: Id2ea3992ea4c4544a2c1cf82b74ea6c3882fa670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243480
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
(Macro-)assembler helper PushRegistersInOrder generates series of
register pushes in an architecture-specific way:
* Using STMDB on ARM (if possible).
* Using STP on ARM64.
* Updating SP only once on RISC-V.
TEST=ci
Change-Id: I6cbd1dd5f8acf8ce8087ed899a311264a873ad37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243100
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This null char is inserted by _toNullTerminatedUtf8Array, and right
below that function is _toStringFromUtf8Array, which does the opposite.
But _toStringFromUtf8Array is currently dead code, so it looks like the
intent was always to use _toStringFromUtf8Array for this, and the fact
that utf8.decode was being used instead is just a mistake.
Bug: https://github.com/dart-lang/sdk/issues/34885
Change-Id: I1404c7783b055902b256176aa61971c0d6969f5e
Fixes: https://github.com/dart-lang/sdk/issues/34885
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243103
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
In particular, this removes the branch from Deserializer::Ref.
Startup.ReadProgramSnapshot(StartupTime): on a Moto x4
arm64c 46063 -> 44714 us (-2.93%)
TEST=ci
Change-Id: I1cdd6e8b36ad695f15552ebea0f3fc726b467863
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242500
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This will allow to remove the `.packages` file from the bots. See
for reference Jonas change here: https://dart-review.googlesource.com/c/sdk/+/240842
Change-Id: Ic4ec8d6192533756e0c7642240eea918e790f67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243360
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This situation was flagged as invalid by the kernel verifier.
Change-Id: I549e6fbb838e301f2a4c0f6203028ee03caa5c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243261
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
+ add a simple page to render the timings in server diagnostics pages.
Change-Id: Ie8537cd38166677967ebe461b91334259b8883ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243322
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
In case the environment is incorrectly set on Windows (e.g.
GYP_MSVS_OVERRIDE_PATH pointing to a non-existing path), the
setup_toolchain.py script may raise an exception.
The script attempts to run a subprocess to gather the environment
variables. But it does not check that the process actually
succeeded.
In case the process fails the environment data will be invalid and
the script will ultimately raise an exception.
This change adds a check for the process failing, and gracefully
warns and exits the script instead.
TEST=Manual build on Windows.
Change-Id: I3624bdf98e0ebe48b403825a90ce2e86c2ed8008
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242860
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Timeline::Clear() results in the linked list of events being destroyed
when using the endless timeline recorder. This call was not protected by
RecorderLock::WaitForShutdown() and could result in an event being
allocated after the recorder's list of events had been destroyed.
Fixes https://github.com/dart-lang/sdk/issues/48899
TEST=CQ
Change-Id: I7e3de2bc99535a560321159ded70aef3e8686526
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243140
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
The dart2/Isolate benchmark restricts the view of benchmark_harness
with a "show" clause. Removed it, and fixed the benchmark.
Change-Id: I99a4bdf00b88a3a69d8e6db1c0fa46dd85cc4aab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243264
Auto-Submit: William Hesse <whesse@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Users are getting confused by `allocate` and `call` in the `Allocator`s.
This CL clarifies the behavior by extending the documentation.
Unfortunately, we cannot expose the actual implementation of `call`. All
calls to `sizeOf<T>()` must have `T` as compile-time constants. So,
instead of `call` having a body in Dart, all call-sites get the behavior
inlined (`x.call<Int32>(3)` is transformed to
`x.allocate<Int32>(sizeOf<Int32>() * 3)`).
Change-Id: Ife169095d1648e9a353f3a4b75c9aff954bc04a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242800
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
This might be a compile-time error but it should at least not create
an Instantiation on a potentially nullable expression.
In response to https://github.com/dart-lang/sdk/issues/48323
Change-Id: I6682ddbb8db82623ac7bf4ecf37f8535377f4ca0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242869
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Add an example to `WeakReference` and `NativeFinalizer`. `Finalizer`
already contained an example.
Cross-link between `Finalizer` and `NativeFinalizer`.
Make the examples pass all the checks and enable syntax highlight in
VS Code again (https://github.com/dart-lang/sdk/issues/48926).
Change-Id: I54cc213fa3bbe7bf8f872ccfee9770fb36b96ab4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242873
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Change-Id: I9089b566082d06cb4947e9720cbafedccc901a60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242872
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
These places are fully covered with existing textual AST dumps.
Change-Id: I05960d7962d40024a4e978464280166e83dc3db7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243220
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
When a function literal is wrapped in parentheses, it shouldn't affect
how it interacts with type inference. This change ensures that
parenthesized function literals are treated the same as
unparenthesized ones by the logic that supports
https://github.com/dart-lang/language/issues/731 (improved inference
for fold etc.)
Change-Id: I672787a31addbfe3f3282b6e638e00b693eea46f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243000
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
These errors don't affect code generation, but they produce invalid
kernel which can't be serialized, so fixing them is a prerequisite for
emitting a platform dill for dart2wasm.
Also run the kernel verifier on the post-TFA kernel when asserts are
enabled. Due to the TFA tree shaking, this has a relatively minuscule
effect on the run time of the compiler.
Change-Id: I6e7ae0e098703695bc85cddf11050f68f6cd0c6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242545
Reviewed-by: Joshua Litt <joshualitt@google.com>
Such return statements are allowed in Dart, and they can be present in
kernel that has not been processed by the async transformation.
Change-Id: I8592cce58cb8fca2d78cdb0d5e5532715553c1ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242544
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Bug: b/208186791
Cq-Include-Trybots: luci.dart.try:dart2js-strong-mac-x64-safari-try
Change-Id: I654ce8a60746c79d2922eebbda4cced822c821cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242871
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>