This CL fixes crashes
../../runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc: 3637: error: expected: nnbd_mode == parsed_function()->function().nnbd_mode()
due to Function::nnbd_mode() returning incorrect result when function
belongs to a synthetic mixin application class.
Change-Id: I7860eb6120b7291848d655d8151af2472421920d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134785
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This cl simply adds a missing nullcheck to Math.exp
Change-Id: I5a5a145b1c60e31d956891c530cba2bb9a718b4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134761
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
This reverts commit eb075dcc21.
Reason for revert: Out of memory on IA32 and On MacOS, invalid path argument on MacOS.
Original change's description:
> fix hanging of write on Windows
>
> When using File::Write(), Var size in int64_t is casted to DWORD(unsigned long). When Var size is out of DWORD range, casted value will be zero. Before calling into File::Write() on Windows, validate the size.
>
> Bug: https://github.com/dart-lang/sdk/issues/40339
> Change-Id: I36fade62dfa3025f418405cb3e45c286dd6b7db1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134440
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>
TBR=zra@google.com,asiva@google.com,zichangguo@google.com
Change-Id: I9d515912ad99f523c6d19fac0c8fbbb23a897986
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/40339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134768
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
When using File::Write(), Var size in int64_t is casted to DWORD(unsigned long). When Var size is out of DWORD range, casted value will be zero. Before calling into File::Write() on Windows, validate the size.
Bug: https://github.com/dart-lang/sdk/issues/40339
Change-Id: I36fade62dfa3025f418405cb3e45c286dd6b7db1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134440
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
This is a fairly limited initial version of the assist. In addition to
implementation comments I'm interested in knowing whether there is value
in committing it as-is or whether it should be enhanced first.
Change-Id: Ia28328e1e5a759c0cec3936b334f719927f46dcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134620
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
So far tree shaking was removing fields which are not used at all.
This change improves tree shaking of fields so fields
which are only written or used as interface targets can be removed.
The following limitations apply:
* Field is not removed if there is a constant object with that field, as
it may impact identity of constant objects which is an observable
behavior.
* Field is not removed if it has a non-trivial initializer as it may
have side-effects.
* Late final fields are not removed, as writing such fields may have
side-effect.
* When field is removed, we may need to introduce an abstract getter
or abstract setter if field is used as a target of an interface call.
If a field was written, then setter would be non-abstract (but empty).
Fixes https://github.com/dart-lang/sdk/issues/35310
Change-Id: I79c00158b8eb658081a647c5dbdecde481fddb41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134204
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This (assuming it works right) tells Dart implementations to treat all
of the libraries in the legacy test directories as opting out of NNBD.
Change-Id: I36e5cd966921f759306f5b4bb50f18ae6049d4db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134409
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
The loop didn't correctly handle if the fd closed wasn't the last in the
list, instead it would skip an entry and would accidentally consider the
closed entry twice.
The error handling was also wrong, where a file descriptor could be
closed multiple times if an error occured after one of the file
descriptors had already been closed. Additionally the POLLERR and
POLLNVAL conditions were not handled.
Fixes https://github.com/dart-lang/sdk/issues/40441.
Change-Id: I4b4da067bbaf40af329e37ccf45d85f8bbf6c914
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134723
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: I70eb2c4ffcff7bf0ed788e9586694daca945e831
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134603
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
This CL makes experimental invalidation work on DillLibraryBuilders,
and solves all found issues (e.g. old references (aka leaks)) with it.
Note: This CL introduces a few writes that seems weird (e.g. setting
variables that's about to be out-of-scope to null). This is done to
prevent "leaks", or probably more likely, prevent a "false positive"
leak detection and it currently gives a "clean bill of health" from
the leak detector.
Change-Id: I5b01df6e9ede710a5b624a8a4c21015214140318
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134288
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The same instruction should be able to set different speculative
modes for its inputs when they are inserted by select representations,
e.g. static calls that have unboxed parameters might set unbox
instructions for those parameters as non speculative.
Change-Id: Ie450f0431e4dbbf0269869f520f59d5d5e946887
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134334
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Comparing floating point results from different architectures can lead
to false divergences due to floating point errors or slightly different
implementations of specific operations (e.g., Float32x4.clamp behaves
differently around 0.0 for ARM and x64).
Should fix false divergences related to https://github.com/dart-lang/sdk/issues/40426
Change-Id: Ife0ab07d20e87add4e754e328bb8f7389920021d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134573
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Gotta start somewhere.
All subject to revision. (Names especially.)
This gets us an end-to-end test and a starting point for client algorithm implementations.
Note that this was designed to run outside `test/`. We should be able to move it out if so desired.
Needless to say any thoughts on any of it are welcome!
Change-Id: Iecf5c7ce854f619aa5677454091ceb68dd45827b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134542
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
While a thread is outside a safepoint it should not perform any
long blocking operation and it must not acquire a Mutex/Monitor which
can be held while being inside a safepoint.
Right now we can have this situation
GC wants to safepoint
T1 is in a safepoint, acquires lock L and wants to leave safepoint (waits for GC to finish)
T2 is not in a safepoint and tries to acquire lock L
With this CL, we ensure to always transition to a safepoint before
performing Lock/Enter/Wait.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I79c55c79bfe828a319f5b035880f578ef62d913a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134323
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Now that typedefs are gone, unaliasing is a no-op.
Change-Id: I2fbe4555d06e11c12b1c1149af23a23e09df42b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134503
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Previously, if a function literal was used in a context where a
function returning non-null was expected, but the function literal
might return null, the migration tool inserted a cast that was
guaranteed to fail. Now it propagates non-null intent into the
function literal, so that the appropriate null checks happen inside
the function literal.
Change-Id: Ia62d18bc3b9955e84b09b846ea913607b305677d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134504
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>