Commit graph

78603 commits

Author SHA1 Message Date
Ben Konyi
96cf91bea3 [ package:dds ] Update DDS dependencies and set SDK requirement to >=2.12
Also updated non-migrated libraries to include @dart=2.10.

Change-Id: Idcf4e54f9aa37b9b016133144af594cc932418a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192122
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-03-19 19:49:08 +00:00
Ben Konyi
a62e144882 [ VM ] Ensure shared timeline objects are protected by locks
Timeline::Clear() could cause an user after free error if trying to allocate a timeline
event immediately after clearing the timeline buffer.

Timeline::Cleanup() could result in recorder_ being freed while timeline events are still
being processed.

Should fix https://github.com/flutter/flutter/issues/78076

TEST=tests/lib/developer/timeline_recorders_test.dart

Change-Id: Ia61b9c93986788c79ef6f2ff1907625b66fb4ea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191802
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-03-19 18:47:32 +00:00
Nate Bosch
c5d20296b5 Update to the latest package:http
Change-Id: I324e5eed5e9324cb4477cc56a523e881f750a021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192121
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-03-19 18:43:48 +00:00
Konstantin Shcheglov
78d9ce7820 Add myself to watch for tools/experimental_features.yaml changes.
Change-Id: I72ab91bde46b9b6181801c4ab0bfd591aabeddbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192047
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-19 18:09:38 +00:00
Kallen Tu
45c9d8a25e [cfe] Enable recursive function calls for const functions.
Change-Id: Ia164adaf5da313cae4db2b3b326a909e57d8c07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192200
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-19 17:56:17 +00:00
Johnni Winther
5c65c68669 [cfe] Handle cyclic bounds on generic function types as type arguments
This also handles reporting of cyclic bounds in parts and sets the
bound of a cyclic type parameter to InvalidType to avoid looping on
the bound later, as for instance in computation of NORM.

Closes #45330

Change-Id: Ida20dc5b44b08a6f8674a402d801314a9172fa8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192142
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-19 17:54:37 +00:00
Daco Harkes
77dc74bcd5 [vm/ffi] Support packed Structs
Closes: https://github.com/dart-lang/sdk/issues/38158

This CL implements unaligned access for float/double on arm32, but does
not expose it in an API. Rather it only uses these loads/stores inside
the getters and setters of packed structs.
Bug: https://github.com/dart-lang/sdk/issues/45009

Besides unaligned access for float/double, this CL is mostly a CFE
change. The only VM change is reading the packing in the
`_FfiStructLayout` annotation.

The implementation of using the packing in the VM, and analyzer changes
have landed separately in earlier CLs.

tools/test.py ffi ffi_2
TEST=tests/ffi(_2)/(.*)by_value_(*.)_test.dart

Change-Id: Ic3106ecc626d2e30674a49bf03f65ae12d2b3502
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186143
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-03-19 15:34:42 +00:00
Daco Harkes
e7acc69507 [vm/ffi] Support packed Structs backend - part 2
With packed structs, the x64 non-Windows ABI only put structs in CPU/FPU
registers when all it fields happen to be aligned. The previous CL did
not check the alignment of nested structs and structs in inline arrays
based on their offset in an outer struct.

Follow up of: https://dart-review.googlesource.com/c/sdk/+/186142.
Split off: https://dart-review.googlesource.com/c/sdk/+/186143.

Bug: https://github.com/dart-lang/sdk/issues/38158

tools/build.py run_ffi_unit_tests && tools/test.py ffi_unit
TEST=runtime/vm/compiler/ffi/native_type_test.cc
These tests are exercised on vm-precomp-ffi-qemu-linux-release-arm-try.

Change-Id: Ic64bdef2c13ac737dbf58864911f043fc7a3d831
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191720
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-03-19 15:34:42 +00:00
Tess Strickland
6d1ea68cc9 [build] Move from the C++11 to the C++17 standard.
Also includes some example changes using C++14/C++17 features.

TEST=vm/cc/BitField_Assert

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,dart-sdk-win-try,vm-kernel-win-release-x64-try,vm-kernel-win-release-ia32-try,dart-sdk-mac-try,vm-kernel-mac-release-x64-try
Change-Id: Icf5c5267431daf9cea2e61b67131021557675f3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192183
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2021-03-19 15:29:57 +00:00
Martin Kustermann
caa31f55be [vm/compiler] Make codegen of InstantiateTypeArgumentsInstr sharable
Simplifies work for adding deopt info to this IR instruction.

Issue https://github.com/dart-lang/sdk/issues/45213

TEST=Existing test suite.

Change-Id: Ia0936647f8f025397131b6d89764885a79cba9c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192185
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-19 15:04:37 +00:00
Brian Wilkerson
c5d01ec4f7 Remove a couple of ignore-in-file comments and make one more unnecessary in generated code
Change-Id: I8313fe2b4c3908dd5751f7eeca417adfcb2e5790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192040
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-19 14:44:27 +00:00
Jens Johansen
20cfdeffe5 [CFE] Include .crash_dart in weak tests; better handling of erroneous -D parameters and expectationFileMismatchSerialized on -DupdateExpectations=true
Change-Id: I00da3e4cf8859c65a8d93600804c7dbc56ec0bca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192180
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-19 13:34:17 +00:00
Martin Kustermann
3930eb8fce [gardening] Mark class as entrypoint to preserve name in obfuscation mode
Fixes https://github.com/dart-lang/sdk/issues/45385

TEST=Fixes service/allocation_test in obfuscation mode.

Change-Id: I80ac204866c5224cf88d2f5f2079655e224691c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192143
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-03-19 13:15:29 +00:00
Tess Strickland
d504084f42 [vm] Fix uses of NullIsAssignableTo at runtime.
NullIsAssignableTo only takes the type to check for nullability.
However, while a type parameter may itself be non-nullable, its
instantiation with a nullable type is nullable.

Thus, this CL adds type instantiation before runtime uses of
NullIsAssignableTo in Function::DoArgumentTypesMatch.

Fixes https://github.com/dart-lang/sdk/issues/45270

TEST=vm/dart/regress_45270

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try
Change-Id: Iaefffe9ab6d4d3ad889c4962489b2153d2bbaee1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190443
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2021-03-19 12:29:27 +00:00
Alexander Thomas
f38081d1ff [sdk] Add analysis_server.dart.snapshot to ARM SDKs.
Fixes https://github.com/dart-lang/sdk/issues/41845.

Change-Id: Ib1558472dfef0d4c815e5ba870d087fdf18f6862
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191922
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-03-19 12:03:48 +00:00
Johnni Winther
9ad76fe7bd [cfe] Support annotations on function type parameters
The fix includes processing of type parameters elsewhere and also
adding support for annotations on extensions.

Closes #28981

TEST=existing

Change-Id: I71ab5640bd3a16f4a024b6edd047a525eed1c399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191404
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-19 11:52:57 +00:00
Alexander Markov
c665bac02d [vm/compiler] Follow-up to SupportsUnboxedInt64 cleanup
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/191761.
That change removed FlowGraphCompiler::SupportsUnboxedInt64() which is
always true, but incorrectly changed

  return (compiler::target::kSmiBits >= 32) ||
         FlowGraphCompiler::SupportsUnboxedInt64();

to

  return (compiler::target::kSmiBits >= 32);

in CanUnboxInt32(). That resulted in a performance regression on
golem benchmarks as certain methods were not inlined.

This change cleans up CanUnboxInt32() as it is also always true.

TEST=Manually verified one of the benchmarks on IA32.

Change-Id: I9fd72f3adc27e2e31340559cf79df1701bd98da7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192062
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-03-19 03:56:14 +00:00
Martin Kustermann
dbd2c76e22 [vm/compiler] Remove InstanceOf runtime call from IL instruction, call stub instead
Having pushed arguments inside generated code makes deopt environments
incorrect, so we'll move all runtime calls out of IL instructions into
stubs.

Issue https://github.com/dart-lang/sdk/issues/45213

TEST=Existing test suite.

Change-Id: I843ba1ba626c3d704d75d4a7088752100ddfb906
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191900
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-03-19 03:53:24 +00:00
Nicholas Shahan
453b06d222 [tests] Remove triple shift test skips from status files
There are also skips for these tests in the legacy (*_2) suites.
I'm leaving those as skips because I think they will never be
expected to work since you have to opt into a newer language
version to get the feature.

Change-Id: I1631b1523c6a9be9a14c69c8cf772ea58309c706
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191482
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-19 02:32:34 +00:00
Konstantin Shcheglov
8fd3962363 Fix for accessing CompilationUnitElement.mixins without types.
Bug: b/182750371
Change-Id: I6e15f5f1551b9817eaab503a81597e0d13c77d01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-19 00:27:46 +00:00
Ryan Macnak
da5fa77042 [vm] Avoid populating page table entries for the compressed heap up front.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/45331
Change-Id: I1bb8e7ea3fce88dceb28edf8a81cee48db83f144
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191982
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2021-03-18 23:04:14 +00:00
Ryan Macnak
19e5899a02 [vm] Switch most non-Instances to compressed pointers.
The following are not compressed: Code, ObjectPool, Context, CallSiteData and subclasses.

Code::instructions_ is uncompressible because the VM doesn't control the address of Instructions when they are loaded via dynamic library.

Loads from the ObjectPool are a frequent occurrence in generated code, and shrinking ObjectPool entries would be offset by longer code sequences to decompress them. Also, some ObjectPool entries contain uncompressible pointers to C functions.

Context is not compressed based on reports from earlier work on compressed pointers that compressing them is disproporately bad for performance. The earlier work used a different, more-expensive compression scheme, so we should reinvestigate this.

CallSiteData et al. are on the hot path for unoptimized code but make up a comparatively small portion of the heap size.

TEST=ci
Change-Id: I9a425fa4e12113c9fd0b51999525d32a7e589a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190600
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2021-03-18 22:52:04 +00:00
Ryan Macnak
c5eaf317b6 Revert "[vm, compiler] Convert binary Smi ops to graph intrinsics."
This reverts commit 051ec30ff0.

Reason for revert: Failures on ARM32 AOT

Original change's description:
> [vm, compiler] Convert binary Smi ops to graph intrinsics.
>
> Keep left shift as an ASM intrinsic because it includes fallbacks to Mint operations on 32-bit architectures that graph intrinsics aren't good at expressing.
>
> This should be close to neutral on performance, but removes a fair amount of redundant code.
>
> TEST=ci
> Change-Id: Ic9c7d3b2d015ebf31972163a58c6bc9a27bad4ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187164
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com

Change-Id: I2a08df5b4aa0269a6237a3d967729c155c88a1c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192061
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-03-18 22:11:56 +00:00
Konstantin Shcheglov
2cbb67e5db More tests for resolution and evaluation of metadata.
Change-Id: I4435936d98764650e2f7a278f92e452e3dbfda23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191986
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 21:21:43 +00:00
jonahwilliams
48e952470a [vm_snapshot_analysis] bump dependency constraints
Flutter cannot update args dependency due to <2.0.0 constraint in package:vm_snapshot_analysis.

TEST=pkg-linux-release-try

Fixes #77856

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try
Change-Id: I93a057d023efe95a13a9a95d85b9405bf9de5ece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191988
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
2021-03-18 21:18:53 +00:00
Sam Rawlins
ef7a1cb60f analyzer: Allow excludes list which includes some non-Strings
Remove top-level toStringList yaml utility.

Add related TODOs.

Change-Id: I6da4f70ed4f2823c156edd3ae3b803b581e5d9be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191984
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-18 21:12:03 +00:00
pq
5b5ed5793f bump to linter 1.1.0
EDIT: see discussion below about breaking changes in `prefer_const_literals_to_create_immutables`.

EDIT2: looks like this was fixed upstream in analyzer 👍

Change-Id: I3fca9d074cece9cb60b8e97bdb72aa3bd3b2c2a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191762
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 20:49:33 +00:00
Ryan Macnak
051ec30ff0 [vm, compiler] Convert binary Smi ops to graph intrinsics.
Keep left shift as an ASM intrinsic because it includes fallbacks to Mint operations on 32-bit architectures that graph intrinsics aren't good at expressing.

This should be close to neutral on performance, but removes a fair amount of redundant code.

TEST=ci
Change-Id: Ic9c7d3b2d015ebf31972163a58c6bc9a27bad4ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187164
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-03-18 20:33:34 +00:00
Brian Wilkerson
ec04c1f335 Remove some unnecessary ignore comments
Change-Id: Iafa4b9c8aa5dc696c5746248a8701b4f6e875979
TEST=Existing tests.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191980
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-03-18 19:58:43 +00:00
Paul Berry
847b2b1e11 Move "argument not assignable" checking to ResolverVisitor.
This should make it easier to implement "why not promoted" logic for
arguments, since we'll be reporting the errors at a time when flow
analysis information hasn't been discarded yet.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I8499d711acc88b8397597b6116e5f6cfde43dc53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191805
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-18 19:52:13 +00:00
Paul Berry
681d3e2a43 Allow the expensive parts of "why not promoted" computation to be deferred.
This is necessary because `whyNotPromoted` needs to be called right
after visiting a subexpression, but it's not always possible to tell
that the type of that subexpression will result in an error until more
code has been visited.

Change-Id: If44e2bb55612c1ba7996b523c3ec078d7b80c865
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 19:52:13 +00:00
Brian Wilkerson
d00ef8611a Update the server protocol to support passing back the line and column numbers for the end of a range
Change-Id: I8310e4a32cacbe98310c1dbaa3b3563b1ff1a1ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191862
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 19:22:23 +00:00
Kevin Moore
4616f47c4d dart: library spelling fixes
Change-Id: I3974094d611df8401941eba35ff0071b48d9e44f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191981
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
2021-03-18 19:11:33 +00:00
Ryan Macnak
08295a8cb3 [vm, compiler] Consider T{_IntegerImplementation} as equivalent to T{int} for optimization purposes.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/45297
Change-Id: Ic6a8956ad6344058c480e20018e876f5aae4c610
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191662
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-03-18 17:59:03 +00:00
Michal Terepeta
9933192f36 Move watching generated Bazel files to an isolate
This does a few optimizations to improve the performance of the analyzer
when watching for generated files:

- We do all the polling in a separate isolate.

- We detect when Bazel finished running and only poll afterwards.

- We use a batch interface and deliver all changes at once (instead of
  one by one). This allows us to avoid resetting caches more often than
  necessary.

I had to remove one of the larger tests and created an integration test
instead, since the code for detecting the Bazel builds relies on
`dart:io` directly (`ResourceProvider` does not expose a way to
check for symlink targets).

Since this required a bit more code, I've decided to create a separate
file for it (`bazel_watcher.dart`).

Change-Id: I6c2383e7fd4348ab8af1af639b10db519c7a2f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183010
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 17:50:58 +00:00
Alexander Markov
817582a155 [vm/compiler] Cleanup --no-unbox_mints flag and SupportsUnboxedInt64()
Unboxed int64 are supported on all architectures which Dart VM supports.
The only was to disable support for unboxed int64 is to use
--no-unbox_mints flag, which is not used and not tested.
This change cleans up this flag and corresponding compiler predicates.

TEST=ci

Change-Id: Ib667319eaf87f0ded8bf9d9505272a3693a9e63e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191761
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-18 17:49:28 +00:00
Tess Strickland
5fc2ba5fc4 [platform] Adjust Utils::StringHash() for misaligned starts.
Fixes https://github.com/dart-lang/sdk/issues/45290

TEST=vm/cc/StringHash

Cq-Include-Trybots: luci.dart.try:vm-kernel-ubsan-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try
Change-Id: I7c1ef59cece77c6c9b705116e956e945bfcb55d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190882
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-03-18 17:42:53 +00:00
Mark Zhou
ce473df469 [dartdevc] Adapting expression evaluation test suite for end-to-end evaluation.
The full workflow for an end-to-end test:
  1) Perform test/compiler options pre-initialization.
  2) Start an instance of Chrome (with 1 tab) and save a persisted debug connection for use in all tests.
  3) For each separate Dart program to be tested:
    1) Create inside a temp directory the HTML bootstrapper, DDC-compiled JS sources, and auxiliary JS files (dart_library.js or require.js).
    2) Initialize a DDC ProgramCompiler/IncrementalCompiler and perform a full compile of the program, saving the compiler's state for subsequent incremental compiles.
    3) Enable the debugger and set a URL breakpoint at the program's main JS entrypoint.
    4) For each test for this Dart program:
      1) Navigate to the HTML bootstrapper, pausing when the target module is loaded (at the breakpoint set above).
      2) Set a breakpoint at a JS location translated from a Dart breakpoint ID via source maps.
      3) Resume the debugger, pausing at that breakpoint. Remove the breakpoint.
      4) Reconstruct the local JS scope, then evaluate the Dart expression.
      5) Evaluate the JS expression inline, then compare results with expectations.
    5) Disable the debugger to clear its state.
  4) Shut down Chrome and clean up any temporary directories.

Other notes:
  * Supports bootstrapping/compilation on AMD and DDC module systems only (though expression eval is only supported on AMD)
  * Requires that Dart breakpoint IDs be set declaratively (no support for columns)

The test structure/flow is subject to change. While I port existing tests, Dart programs will consist of inline source file strings with simple breakpoints. In the future, we want to allow more complicated Dart programs to be specified (like in the modular test framework) and more complicated expression evaluation test patterns (rather than allowing only a single evaluation per test).

Change-Id: I5de7cfa66991fd14b24fa16edd1615f55c041ae3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190962
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-03-18 17:41:23 +00:00
Konstantin Shcheglov
5a313c2595 Support for type arguments and inference in metadata.
Change-Id: Icb019326d73f5d1380c732b36239555a6bcb39d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191483
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 17:26:43 +00:00
Kallen Tu
3c5c1cd3f4 [cfe] Break, continues and labels for const functions.
Change-Id: Id8fce4088042b4acf9eadebe7aa99abd5565a471
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191680
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-18 17:06:13 +00:00
Johnni Winther
d59c8bc4fd [cfe,dart2js] Handle LocalFunctionInvocation in ListFactorySpecializer
The CloneVisitorNotMembers contains a mapping from variables to their
corresponding clones. The ListFactorySpecializer special cased access
to this mapping to support conditional cloning. When dart2js switchted
to used the new method invocation encoding, this left the
LocalFunctionInvocation unhandled, leading to null check error when
local functions where invoked in the closure passed to List.generate.

This CL makes this mapping private and adds getter/setter methods for
lookup and registration. The ListFactorySpecializer now instead overrides
the getter to support conditional cloning instead of handling each use
case.

Bug: b/183083319
Change-Id: I2fd3b79137c51a424f17127b502e6a945c6796a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191901
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-18 14:34:33 +00:00
Daco Harkes
fbaf439b75 [vm/ffi] Fix ScopeBuilder uninitialized read
Closes: https://github.com/dart-lang/sdk/issues/45362

TEST=MSAN build

Change-Id: Ic51eba97b94656e75261001134e75db2fd2e352d
Cq-Include-Trybots: luci.dart.try:vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191882
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-03-18 12:37:48 +00:00
Daco Harkes
55082199e7 [vm/ffi] Fix Array<Pointer> loads and stores
Closes: https://github.com/dart-lang/sdk/issues/45198

TEST=tests/ffi(_2)/regress_45198_test.dart

Change-Id: I15cf5a4d48b1bfb33de039cc8b17be8e01fba752
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191881
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-18 12:26:38 +00:00
Johnni Winther
9e23810b77 [kernel] Migrate more libraries in package:kernel
Change-Id: I249c9fa9f2727544f940b3d954ce49bf38ee4918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191402
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-18 11:06:18 +00:00
Mayank Patke
679e214f51 Fix nullability issue in id_testing.
Change-Id: Id1703aabbe6f6e425f3965770292e32ad664664b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191861
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-18 11:00:58 +00:00
Alexander Thomas
4b1994bdb7 [co19] Roll co19 to 1abf208ef6428aac8fee6f3175d65b1c59cd15c8
2021-03-18 irina.arkhipets@gmail.com Fixes Issue #1020: SharedOptions comment corrected.
2021-03-18 sgrekhov@unipro.ru Fixes #1014. Expect compile error on dart2js for big integers

Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: I6ca1c23cbc3e2f7ed87efb8062c19d1b0c819bd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191880
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2021-03-18 10:31:49 +00:00
Kevin Moore
d59e280a62 Fix spelling mistakes in core classes
Uri, StringBuffer, int, RangeError

Change-Id: I6d22d4707aed3a871af78c584ae3a06894d8b632
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191804
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-03-18 10:19:48 +00:00
Sergey G. Grekhov
7c29dd9583 [co19] status file normalized
[co19] turn off tests that use big numbers on web configurations

Change-Id: Iceda118a4c06b5edf3bd97559a88559301920019
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191721
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-03-18 10:16:08 +00:00
Konstantin Shcheglov
14327ea035 Handle NON_CONSTANT_MAP_ELEMENT as a const error.
Bug: https://dart-review.googlesource.com/c/sdk/+/191762
Change-Id: I55c52a364079fbf797b285c48bb7eed070c00b9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191803
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 06:24:48 +00:00
Mark Zhou
e692b26c7e Adding SDK dependencies required for expression evaluation tests.
This is part of a series of changes to add support for SDK expression eval tests.

This change:
  * Adds SDK dependencies on webkit_inspection_protocol.dart and browser_launcher.dart
  * Adds dev dependencies to DDC

Change-Id: I025a1f1b59e00858a33016818b6746c57c9caec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190961
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2021-03-18 00:30:37 +00:00