TEST=Standard CQ
Change-Id: I0eba9fa6eaa73bf9da8abdd93645a8e6eb8e601b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226691
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
A TypeParameterElement has node only when we are linking it.
Change-Id: Ib56ad8226aebab3b3376e8a85c5ac515ae87ab3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226965
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
When ffi code calls Dart code that requests the isolate to exit(via Isolate.exit, for example), we ensure that isolate indeed exits on return from ffi call.
This is implemented by introduction of new safepoint bit which, once set, forces ExitSafepoint to propagate unwind error.
TEST=isolate_exit_sandwich_test
Change-Id: I2e8f5ecec7f4e59ae5f99b9525cc566f20d4b6a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219846
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
VM queries the list of enum elements during class finalization
in order to be prepared for the future hot reload. This is done by
reading 'values' field. However, 'values' field can be missing if
running from a dill file which was tree-shaken. This change avoids
crash in that case and handles missing 'values' field as if it was
declared with an empty list.
TEST=Manually tested in g3.
Issue: https://github.com/dart-lang/sdk/issues/47861
Bug: b/213584901
Change-Id: Ic7271476ee115aa93a73a824af3a867784b820eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Providing `--log_service_response_sizes` will cause the VM to log VM service
response sizes to the provided file in CSV format.
Also added `--service_response_sizes_directory` to the service test
runner to allow for collecting response size data for the entire service
test suite.
TEST=Local
Change-Id: I7aaf4ba936e2593e67d46ff9052e2130374ef461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226805
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Processes on Windows can take longer to exit, taking longer for directories they use to become available for deletion. Accommodate this potentially lengthy by trying several times to delete temp directories before failing the test.
Fixes https://github.com/dart-lang/sdk/issues/47700
TEST=run_test on Windows
Change-Id: Id73d6ba3ff981ed59c89ab833f5775eff5375ae6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226980
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Change-Id: I348f07341600bb00f8878ab8d482a29b3a19d907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226690
Auto-Submit: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
The snippets analyze step in [flutter]/dev/bots/analyze.dart now uses our built SDK when analyzing the code snippets. The explicit duplicate command to analyze the snippets with our SDK can now be removed.
The temp directory created in the script is not in the builder cache
on swarming, so it is automatically deleted when the builder finishes.
So we remove the cleanup step, which was trapping signals. That trap
seems to have been responsible for these failures and exit code confusion.
Bug: https://github.com/dart-lang/sdk/issues/47881
Change-Id: I49406954af54a0fba1ceec230c3551f8ad14e8e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226685
Reviewed-by: Paul Berry <paulberry@google.com>
Change-Id: I5285a0afffa4629c2ab3f26c0bd58d377375316d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226686
Auto-Submit: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
In order to make sure static types in kernel AST are still correct
after tree shaking, tree shaker needs to insert no-op unsafeCast calls
when removing conditional expressions, as ConditionalExpression nodes
have explicit 'staticType' which may be different from static types of
sub-expressions.
Otherwise we might end up with an untyped function call
(FunctionInvocation with FunctionAccessKind.Function)
performed from a receiver with a known function type.
That would violate VM's assumptions about static type of receiver
being checked by the front-end and trigger assertion in
pkg/vm/lib/transformations/call_site_annotator.dart.
TEST=runtime/tests/vm/dart/untyped_function_invocation_with_known_function_type_test.dart
TEST=pkg/vm/testcases/transformations/type_flow/transformer/null_test_elimination2_nnbd_strong.dart
Change-Id: I6bf201a979d1b71eb48ed04f154adf2b62dac922
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226741
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This adds the abstract classes with external factory constructors,
and adds throwing constructors to all backed patch files.
Further implementation can add the functionality for the backends.
This addresses part of #47773, leaving the FFI class to the
FFI implementors.
Bug: https://github.com/47773
Change-Id: Id7ee0006b6ea5ed789867a143ee6266f6dbbef66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221502
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Change-Id: I3aece084b53a1a23c9c8d9ebaf40a8a7e4764a6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221081
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
When we cannot infer types, we leave `M<dynamic>` and report
other errors.
Change-Id: Ice6ebabf4bc844ee21aa1cc842e6496fcf8b3c11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
If we were to use ES6 Maps, we should try to use a single one for
all 'identity' keys (numbers, strings, enums etc).
Change-Id: Idc600b7cb48b58a074fd4c9bb6205d544f86dbc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226540
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
"an FileSystemException" -> "a FileSystemException"
Change-Id: Ic184ec0a2b7788c3ff04ff3d3db0b57a7316fa36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226740
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This adds a presubmit check for the consistency between
libraries_specification.yaml and libraries_specification.json.
Change-Id: Iea23952c92516317b179f7dbb7ba343779325a89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226681
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
For `asyncExpectThrows`, instead of taking a function,
then checking if that function can be called with zero arguments,
and then immediately calling it and checking that it returns a future,
just take the future as argument.
Since synchronus errors from calling the function were not caught
anyway, doing the entire `Future` computation directly shouldn't
change behavior.
Also make `asyncExpectThrows` and `Expect.throws` return the caught error,
so that you can use normal `Expect.something` checks on it afterwards,
instead of doing that in the `check` function.
That basically makes the `check` function unnecessary (but hard to remove
with the existing test corpus using it heavily).
This makes some uses of the `asyncExpectThrows` function slightly more
complicated, those that have no other way to create a future than calling
the argument function anyway, but other uses become simpler
when they can avoid adding the function wrapper.
TEST= Refactoring. If the tests keep running, it's successful.
Change-Id: I983eb65ea4805760339073fabc27f78c57f9a471
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226102
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
When loading and compiling a function for expression evaluation
we might reference synthetic class of that function in types
(e.g. receiver type). However, that class is not registered
(so it could be garbage collected) and it has kIllegalCid.
Types constructed using such class are not very useful and
may crash if class is queried (for example if type is finalized).
This change attempts to replace such synthetic classes with
real classes in types constructed during loading.
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/48024
Change-Id: I6c5c1b1d20ac2ce4c43e5a7e456d5a8756a43727
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226603
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL adds an initial framework for testing performance of programming
patterns. Included is a test of the pattern used to choose
implementation based on a runtime type, using either an if-then-else
sequence, dynamic dispatch on the runtime object, or visitor pattern.
The test framework runs the patterns on a range of inputs using a
predefined set of scenarios and outputs a table of the measurements which
can be copied into Google Sheets to visualize the results.
Further work is to use statistics to quantify the results, and expand
the framework to be used to detect asymptotic performance of algorithms
used in the compiler itself.
Change-Id: Ic99588d13adead309715957e1bc0aa6def46c9dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226104
Reviewed-by: Jens Johansen <jensj@google.com>
The TFA assumes that all parameters have a name, so in order to use the
TFA together with late field lowering in dart2wasm, the synthetic
parameter produced by late field lowering must be given a name.
Change-Id: If8d9aeee815ef4deebdd12b3ff9dbd820c0e282b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224527
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This is not yet enforced in analysis_options.yaml due to a just-closed
bug in linter.
Change-Id: I450ed2a24f1de7657b2f535a1dcdabdb1f9afbbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>