Field::RecordStore inspects the object being pointed to. However,
it is not guaranteed that that objects has been initialized in
*DeserializationCluster::ReadEdges, that depends on the order of the
clusters.
In the reproduction, the TypedDataView cluster comes after the cluster
containing the instance. This leads to doing a field store while the
length field of the TypedDataView has not been read yet and is 0. This
causes a Field::RecordStore with value 0, which subsequently gets used
in compilation causing RangeErrors.
This CL delays the Field::RecordStore from ReadEdges to PostLoad so that
all objects are initialized before they are inspected by RecordStore.
TEST=tests/language/vm/regress_flutter_89584_test.dart
Fixes: https://github.com/flutter/flutter/issues/89584
Change-Id: I1d5fe25c4084d62d5e492446123987aee10200bb
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-linux-debug-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-nnbd-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216181
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The registration type has been changed from a Map to a Set, which can't
be encoded as JSON.
This broke the `/lsp_capabilities` diagnostics page.
Calling `.toList()` fixes the page by showing current registrations as
an array.
Change-Id: Ib20f422d55d29c4f10b52a09d0a9229a486b67b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216186
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
The current constructor allowed large numbers which overflows
when multiplied by 1000 to get microseconds, which then hid the
fact that the original value was out of range.
Now checks directly in the `fromMillisecondsSinceEpoch` constructor,
before multiplying by 1000.
Fixes#46966
BUG= http://dartbug.com/46966
TEST= Regression test added to date_time_test.dart
Change-Id: I4c6448666a49d51c285bd538e05e51a141b3b0b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214641
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Change-Id: Ie9b93497491dd44576f6e0e8c58499f98e7a74df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216021
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
These were unnecessarily added twice when I finished out the rest of the
constant rename fixes, but had already been implemented as the proof of
concept for core library fixes.
Change-Id: I4c5bb018ad344ccb4c393c656fed47aae2df4d16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214066
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
The existing lib/isolate/stacktrace_message_test was failing and also
incorrectly written due to "!" in front of the expected stringification
of the stacktrace.
Issue https://github.com/dart-lang/sdk/issues/46623
TEST=vm/dart{,_2}/isolates/fast_object_copy2_test, lib{,_2}/isolate/stacktrace_message_test
Change-Id: I169d8fd7a7c3cb3b8c57e00287565e3a5c622acf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216041
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Move the method body out of one giant JS foreign function and into
Dart code with small JS foreign function calls inside.
* Removes the confusion around what it actually means when we use
Dart String interpolation within the JS function template.
* Highlights the operations that actually need the JS foreign
function.
* Allows for syntax highlighting and automatic formatting of this
code.
* Allows for IDE "jump to definition" for class members that were
previously inside the template.
These changes were developed by diffing the compiled output to
ensure the changes were as minimal and inconsequential as possible.
Intentional diffs include:
* Add local variables for `args1Length`, `args2Length`,
`optionals1Length` and `optionals2Length`.
The only other diff was the loop variable incrementing:
`++i` -> `i = i + 1`
Change-Id: I92c6857580e0653578ceec4bd76a8e74231085cd
Issue: https://github.com/dart-lang/sdk/issues/46002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215246
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Follow-up to a6fb77f02e
Change-Id: I44f43a65ccec601990beef3a910590045df3ddc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215988
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Restore the behavior originally added in
https://dart-review.googlesource.com/c/sdk/+/172082 to call `.push()`
on Javascript Arrays directly when it is safe.
After some experimenting this optimization no longer appears to be
as effective for lists of native types (the type check is little
overhead) but is still observable for lists of user defined
interface types.
Change-Id: I034666a512a7886e5022498e2d6bd3f8aaceebbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215483
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
No tests were added or removed. I split the original class into three,
and renamed the test methods in the two new classes because the class
name now includes part of the information previously in the method
names. Nothing else changed.
Change-Id: Ie2b980906026b79c0ec24024e14fe328662e4900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216063
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This adds [sendMessage] and [receiveMessage] methods to [RawSocket] class. They are only supported on Linux at the moment as they require connection opened as unix domain socket connection.
This introduces [SocketControlMessage] class that represents a message sent via socket and also introduces [ResourceHandle] class that wraps [RandomAccessFile], [Socket]/[RawSocket]/[RawDatagramSocket], [Stdin]/[Stdout] for
marshalling/unmarshalling purposes.
Underlying OS implementation supports various kinds of control messages that can be passed via sockets, this CL only adds support for sending/receiving opened file description handles.
When receiving a message recipient can attempt to extract handles out of it via [tryExtractHandles]. It returns [null] if message has no handles to extract.
This is continuation of the work started on https://dart-review.googlesource.com/c/sdk/+/205067.
Bug: https://github.com/dart-lang/sdk/issues/46328
TEST=unix_socket_test
Change-Id: Ic9125b51dc80b677452e454366bae4118c298081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212036
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Previously, TFA used ClosedWorldClassHierarchy from CFE to look for
dispatch targets of invocations, and cached those lookups. However,
doing lookups via ClosedWorldClassHierarchy for the first time is still
slow. Now TFA builds maps of dispatch targets from AST and no longer
uses ClosedWorldClassHierarchy for the lookup.
Improves time of AOT compilation step 2 (TFA) on a large
Flutter application 170s -> 152s (-10.5%).
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/42442
Change-Id: I1a22d298e5b2c0ead57c38ddfbf5ebbd1876732f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215985
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
The current version points to a commit for v0.11.0-nullsafety.
It looks like a 0.11.0 release was never actually published. A
null safe version of the package was actually published as v0.10.10.
This also makes the version number in the package:dart2js_tools
pubspec match the version in the deps file.
Change-Id: Ibf495ed5e7388370b5cf950ed3559bf7749f42b9
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215982
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This makes parallel marking more like parallel scavenge and is preparation for allowing marking/scavenging to complete even if some workers haven't started.
Also improve work stealing of weak processing by processing the worker-local weak properties first.
TEST=ci
Change-Id: I73bfb930129e2d9848a3bbcf378303a51bd65a5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215681
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
It duplicates `get exists`, and there are no other states.
All other states are presented by various InvalidResult(s).
We could have NotExistingFileResult and return it instead of a
ResolvedUnitResult, but ResolvedLibraryResult uses
List<ResolvedUnitResult> as `units`.
So, instead we say that it is valid, just does not exist,
and its content is empty.
Change-Id: I435555595590299df55d0016451a1e037934750d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Previously, `pkg/analyzer/test/verify_diagnostics_test.dart` and
`pkg/analyzer/tool/diagnostics/generate.dart` extracted documentation
from the code of the analyzer error classes. However, since this code
is generated from `messages.yaml`, it's much cleaner to just extract
the documentation directly from the YAML.
Change-Id: I7dc3eb73abbf5d72f203abbf04e43856b60d2a89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215648
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Rename PointerKeyValueTrait<T>, which is used to create sets of pointers
to T instances where T <: Object and T has appropriate Hash and Equals
instance methods, to the more specific name PointerSetKeyValueTrait.
Create a PointerSet<T> alias for using this trait with
DirectChainedHashMap and use that alias in other code as a shorthand.
Remove PointerSetKeyValueTrait<const char> as a superclass of
CStringKeyValueTrait, as the only reuse from the former are the two
methods KeyOf and ValueOf which just return their argument, and having
this relationship is odd since const char is not a subtype of Object.
TEST=Renaming/refactoring, so existing tests.
Change-Id: I0274b16cb9fcb3939a28fb109fb8626c1ac8c0e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215761
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The web compilers now accept `@JS` annotations on classes and members
directly and no longer requires an additional `@JS` library annotation at the
library level. As a result, we no longer need the
`missing_js_lib_annotation` hint.
Support for this landed a few months ago in
0845ebaad8
and was released in Dart 2.12.0.
Change-Id: I39acbf6149499e561f18f909dd09f2d2499f5054
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215684
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This reverts commit b5922e6db4.
Reason for revert: vm/cc/AllocateZone fails on Mac
Original change's description:
> [vm] Streamline Zones.
>
> - Don't put a HANDLESCOPE right after a StackZone, as there's no state worth restoring
> - Remove remaining zone bookkeeping dead since e3a9d70591.
> - Remove unnecessary resetting of handle blocks before zone deletion.
> - Shrink initial chunk size to make Zone's overall size fit in a faster malloc size class.
>
> TEST=ci
> Change-Id: I920e12f5af93aa71fb876435764c60df485215f9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212261
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
TBR=rmacnak@google.com,asiva@google.com
Change-Id: Id23dcebb781791616e48e54d2dcd7e58159178bc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215943
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
- Don't put a HANDLESCOPE right after a StackZone, as there's no state worth restoring
- Remove remaining zone bookkeeping dead since e3a9d70591.
- Remove unnecessary resetting of handle blocks before zone deletion.
- Shrink initial chunk size to make Zone's overall size fit in a faster malloc size class.
TEST=ci
Change-Id: I920e12f5af93aa71fb876435764c60df485215f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212261
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>