Commit Graph

79322 Commits

Author SHA1 Message Date
Daco Harkes 2376ab5186 [vm/ffi] Disallow Pointers and structs in finalizers and expandos
`Dart_NewWeakPersistentHandle` and `Dart_NewFinalizableHandle` in
`dart_api.h` do no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Expandos no longer accept `Pointer`s and subtypes of `Struct`s
as values passed in to the `object` parameter.

Cleans up unused object_store->ffi_struct_class.

Closes: https://github.com/dart-lang/sdk/issues/45071
Breaking change: https://github.com/dart-lang/sdk/issues/45072

TEST=vm/cc/DartAPI_FinalizableHandleErrors
TEST=vm/cc/DartAPI_WeakPersistentHandleErrors
TEST=tests/ffi(_2)/expando_test.dart

Change-Id: I1f11adfa073c7d2c979f3c2bb15c7444c7c767a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186280
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-12 14:04:16 +00:00
Johnni Winther 64460ec47f [kernel] Make Member.name non-nullable
Change-Id: Id2befd868e93985d6af463c2ccd410cd56b68187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194721
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-12 13:48:46 +00:00
Sergey G. Grekhov d30d9ed839 [co19] Skip in status files removed or replaced where it is possible
Change-Id: Iccf97f1a6a2753321c5d60db5e9c2291eeeb159b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194400
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-04-12 13:26:49 +00:00
Paul Berry 4d06516832 Introduce a "mini IR" representation for use in _fe_analyzer_shared testing.
This is a simple string-based intermediate representation for Dart
code, similar to kernel but with a far simpler structure and a compact
string encoding, suitable for use in unit tests.

I've integrated this representation into mini_ast.dart in a
preliminary way, so it is created as a by-product of running flow
analysis tests.  But as yet there are no tests that validate the
correctness of the result.  I plan to refine the representation, and
test it fully, in follow-up CLs.

Change-Id: Idda527efd005d0199ff88861c9e074eb651d82f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193881
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-12 12:46:06 +00:00
Paul Berry adc3c04e7b Flow analysis tests: add context parameter to Expression visit methods.
This paves the way for generalizing the "mini AST" code so that it can
do full type analysis.

For the moment, the context parameter is always `unknownType`.  In
later CLs I will thread the appropriate context types through the
system.

Change-Id: I5d5e0d6644dba590234e363d1d5d0720bdb71d30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-04-12 12:46:06 +00:00
Alexander Thomas 0b816ed13f [co19] Roll co19 to 42fe3fd9d6eb66702604dc38f4deca66245ee974
2021-04-12 irina.arkhipets@gmail.com Fixes #1071: test expectation corrected.
2021-04-09 sgrekhov@unipro.ru Fixes #1072. Remove excessive @compile-error
2021-04-08 sgrekhov@unipro.ru Allow both 254 and 255 result codes on Windows
2021-04-08 irina.arkhipets@gmail.com Fixes #1070: tests expectations corrected.

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-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Iccec27cb0050da7979b471d6a1bd63cbc4656220
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194785
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-04-12 08:14:42 +00:00
asiva f642761c54 [Runtime/Tests] - Do not output large amount of test data to stdout
- typed_data_isolate_test was printing received data to stdout which
causes trucation issues when running in the test script, changed test to
verify the received data and not print to stdout.

TEST=modifying a test.

Change-Id: I99357960e80fcdd2d65676c6bef326799f1d4d98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194884
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-12 04:51:05 +00:00
Brian Wilkerson 9b1583101e Migrate statement completion support
Change-Id: I9d6751888286e4a068fc1dac192c93ffb8089b69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194963
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-11 15:28:25 +00:00
Paul Berry a463217f0a Flow analysis tests: move most visitor logic into a new class.
The new class, _MiniAstTypeAnalyzer, currently only handles the "mini
AST" representation we use for flow analysis tests.  In follow up CLs
I plan to extract a base class from it that will be general enough to
form the basis of a shared type analysis engine for the analyzer and
the CFE.

Change-Id: I180e1484aff1733146ccf73bcab5604e9f4ef2f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194620
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-11 15:03:44 +00:00
Konstantin Shcheglov e1539dc3d4 Migrate several lib/src/services/correction/dart/
Change-Id: I49f43e801f13dbbfe67be79fea19073990acb658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194962
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 22:32:16 +00:00
Brian Wilkerson 5b6d517fe8 Migrate PropertyDescription
Change-Id: Id8f02d1e98897f3ba37fb0ebdb4cfff6bfe1a4a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 20:43:04 +00:00
Brian Wilkerson 52d3191dfd Make completionOffset non-nullable as per earlier feedback
Change-Id: I41eb78f804081b34799716a42c5d3d5e2ece51d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194902
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 19:54:24 +00:00
Brian Wilkerson d08c65be05 Migrate the completion metrics tool
Change-Id: I6d66ebd2d5cbb32147252927819f9d6533cb4012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194882
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 04:15:23 +00:00
Konstantin Shcheglov 7367c980a7 Migrate several lib/src/services/correction/dart/
R=brianwilkerson@google.com

Change-Id: Ie38a28ee77c2faeb50f9c46e54a64cef933e3916
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-10 01:05:23 +00:00
Robert Nystrom c8b3fb1e71 Roll dart_style to the new 2.0.1.
The reverts the change to flatted nested conditional expressions since
audience reaction to that was pretty negative.

See: https://github.com/dart-lang/dart_style/pull/1019
Change-Id: Ie9e4460f75c5b7e99e5a6d60e9c38b50ba0bc44a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194883
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-04-10 00:37:53 +00:00
asiva 6eaa34bad2 [VM/Runtime] - Fix product build warning
TEST=regular CQ tests

Change-Id: I2fe553de81b853997ae16654fe2a745c7f1d2950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194820
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-04-10 00:03:23 +00:00
Brian Wilkerson 08c5b9f8ff Migrate more completion support
Change-Id: Ia55132ef8f4cd6e80dfc4fe16689e8b4e50cf387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194821
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-09 22:40:03 +00:00
Nicholas Shahan 4e25e499c8 [ddc] Add library URIs to cast failure messages
When the two types have the same name but are from different libraries
showing the library URI will help users understand the failure better.

Change-Id: I5ab4412e676272111d41f688ef2d1cc83afbe627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194116
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-04-09 22:24:43 +00:00
Kallen Tu 0b175ed534 [cfe] Const constructors enabled with const functions.
Change-Id: Ic0597bf7ec69811ec822539ef5df1e24ef1b9884
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194560
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-04-09 21:10:53 +00:00
Mayank Patke c745c6d26a Revert "[dart2js] Implement Cell lowering for uninitialized static fields."
This reverts commit da42b0d323.

Reason for revert: g3 failures

Original change's description:
> [dart2js] Implement Cell lowering for uninitialized static fields.
>
> Change-Id: If0cd7c95a8e52de19893892acae662619075d87b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193835
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=johnniwinther@google.com,sra@google.com,fishythefish@google.com

Change-Id: Ic90ebf140b2105f06afa43ae7d332c01887cd8d5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194900
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-04-09 20:42:45 +00:00
Mayank Patke da42b0d323 [dart2js] Implement Cell lowering for uninitialized static fields.
Change-Id: If0cd7c95a8e52de19893892acae662619075d87b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193835
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-04-09 19:46:23 +00:00
Srujan Gaddam bd58cea90b [dart:html] Fix getContext3d nullability
Closes https://github.com/dart-lang/sdk/issues/45572

getContext3d should return a nullable value since getContext can
return a nullable.

Change-Id: Iaefff781976656db3765d526ec95305f2acfeecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194503
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-04-09 19:03:43 +00:00
Konstantin Shcheglov 8fb98b25c1 Migrate several lib/src/services/correction/dart/
Change-Id: I0db19c94d26c7c604d71663e2f2c944286898c0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194546
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-09 17:15:45 +00:00
Daco Harkes 189c36b82a [vm] Native effects
Adds a way to express native effects in Dart expressions in kernel.

This CL adds a `void _nativeEffect(Object)` to `dart:internal`.
The semantics of `_nativeEffect` are to not execute its arguments and
return `null`.

This CL uses this `_nativeEffect` to make sure that we never execute
the struct constructor invocations used to simulate the native behavior
of FFI trampolines.

Closes: https://github.com/dart-lang/sdk/issues/45607

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

Change-Id: Ie06de145e49f8b1cae9e148c2d5d97d5cd8e6878
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,dart-sdk-linux-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194421
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-04-09 16:45:13 +00:00
Aske Simon Christensen ea50eeb4be [vm/aot] Set type context for fields in signature shaker.
Fixes https://github.com/dart-lang/sdk/issues/45642

TEST=Regression test added.
Change-Id: Ib14b27674810ac22aad21c19647e68e7ad32ceaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194762
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-04-09 16:14:23 +00:00
Danny Tuppeny ea9c6484f1 [analyzer] Fix path format in test for windows
Change-Id: I20ddb29e18303ad38a29a98c8ace00ced858b120
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194763
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-09 14:11:28 +00:00
Alexander Thomas 37700c4314 [co19] Roll co19_2 to f7f583366396cb1457e58c9bfb6d6e53dc21d741
2021-03-29 sgrekhov@unipro.ru Fixes 1052. Typos in tests fixed
2021-03-29 sgrekhov@unipro.ru Fixes 1051. Fix invalid use of null in different expressions

Change-Id: Ibdf603c1ff556a328bdeb7e0af2a323bbcb6bf07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194720
Reviewed-by: William Hesse <whesse@google.com>
2021-04-09 11:49:32 +00:00
Martin Kustermann 3f7614f56f [gardening] Skip service tests that require expression evaluation in AppJIT
In AppJIT mode we run from a snapshot and won't have an incremental
compiler available. That also means expression evaluation is not
supported.

The specific test that was failing was

  service_2/evaluate_activation_in_method_class_test/service

though this CL skips all evaluation tests.

The CL also align the service and service_2 status files more.

TEST=Only updates status file to skips tests.

Change-Id: I8dbb3aeeb686370d898c59da3729f5e0c52df411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194685
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-04-09 09:58:43 +00:00
Konstantin Shcheglov 424e670576 Reland "Mark AstTestFactory as internal."
This is a reland of 553bfea531

Original change's description:
> Mark AstTestFactory as internal.
>
> I want to continue disallowing users to create AST nodes.
>
> Change-Id: I6597fcf4fbb767cde35320e3b8777873faf5c5bd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194600
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

Change-Id: I097fc5f665880666829eeb982f7fa3b450bb203e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194681
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2021-04-09 09:46:38 +00:00
Martin Kustermann 9722d3bb1e [gardening] Mark ffi test as slow in debug mode
TEST=Fixes flaky (turned into consistent) timeout of ffi test

Change-Id: Ic2444c797621e1f09153a68282c075fb874c2921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194683
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-04-09 09:39:51 +00:00
Johnni Winther 282a3ab70b [cfe] Handle ParserRecovery in beginTypeVariable
Closes #45329

Change-Id: I7e153e41891332bd8ea85849b993066de342eed5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194682
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-09 09:38:31 +00:00
Ivan Inozemtsev 9ce236a6cf Revert "Mark AstTestFactory as internal."
This reverts commit 553bfea531.

Reason for revert: b/184903321

Original change's description:
> Mark AstTestFactory as internal.
>
> I want to continue disallowing users to create AST nodes.
>
> Change-Id: I6597fcf4fbb767cde35320e3b8777873faf5c5bd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194600
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com,srawlins@google.com

Change-Id: I6c9e0f5d7863ac7481612d95a7fd414dec743b76
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194680
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2021-04-09 06:01:27 +00:00
Karl Klose c17da0065c [infra] Firestore: Resolve whole paths to avoid encoding of ':'
Change-Id: Icdc53787210a953c94ef9cd6fec69fe79b06c22e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194401
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2021-04-09 04:43:31 +00:00
Brian Wilkerson e461f937db Migrate most of the completion contributors
Change-Id: I2802422c59801134af342eed1d43367b8175b099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194543
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-09 04:14:21 +00:00
Paul Berry 1f43993294 Flow analysis tests: remove _TryStatement._bodyNode.
Now that we store the body of a try statement as a separate Statement
object, we can use it directly; it's not necessary to create a
synthetic node for it.  This is more similar to what the analyzer and
CFE do.

Change-Id: I7c9a62aa917e966f0dd176f90b72865a38addd65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194545
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-09 03:42:01 +00:00
Paul Berry ad4faa0e86 Flow analysis: in tests, stop storing type of this. property gets.
This makes the flow analysis tests more similar to the anaylzer and
CFE implementations, which look up the type of a `this.` property get
at the time it is analyzed, rather than storing it in the AST node.

Change-Id: Idee2a9c3ba0acbd2752db511c1aabfdff075b363
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194544
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-04-09 03:42:01 +00:00
Konstantin Shcheglov 553bfea531 Mark AstTestFactory as internal.
I want to continue disallowing users to create AST nodes.

Change-Id: I6597fcf4fbb767cde35320e3b8777873faf5c5bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194600
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-09 02:59:11 +00:00
Konstantin Shcheglov 579ae24fcd Prepare to publish analyzer_plugin 0.6.0
Change-Id: Ibffb027251f1a6033e80f09dc1cb130d34262c70
Bug: https://github.com/dart-lang/sdk/issues/45236#issuecomment-815514046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194542
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-09 00:47:00 +00:00
Ryan Macnak 1d369b5000 [vm, compiler] Support unboxed parameters for integer intrinsics.
TEST=ci
Change-Id: I7f29471043c049ef1acf7cd4bcb0890db6d33aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192728
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-04-09 00:30:10 +00:00
Paul Berry 0d64396707 Flow analysis: Rework visit methods in flow analysis tests.
Two changes:

- Eliminate the `_Visitable` class, which was no longer used.

- Stop passing flow analysis as an argument to the _visit methods;
  instead access it through the Harness class.  This paves the way for
  future changes that will generalize this code for testing things
  other than flow analysis.

Change-Id: I94e9208e9eec6f16c03160efa1f676e57d47a59f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-09 00:23:40 +00:00
Konstantin Shcheglov bbbe5bfc87 Migrate several lib/src/services/correction/dart/
Change-Id: I8c50c6e7664a7bd8ee7b0d881d9adeaf9c544f61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-08 21:17:10 +00:00
Paul Berry 9674ab8921 Flow analysis: expose typeOperations getter.
There's no harm in making the TypeOperations object available to
clients, and it will make it easier in the future to create other
shared analysis based on flow analysis.

Change-Id: Id6b603ab2a7baa64d423c87bf031ff6a12874840
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-04-08 20:17:20 +00:00
Sam Rawlins bc5d362959 analysis_server: Standardize on package:path/path.dart import prefix.
One file used 'pkg_path' which really threw me; I'd never seen it before. Two
more used 'pathos'. All other files in the package use 'as path', except a few
spots which do not use a prefix.

Change-Id: I94577c1783162c52c7f8dc3c6bf02e9a0b9159df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-04-08 20:02:50 +00:00
Brian Wilkerson beea8076cd Migrate more of server
Change-Id: I6342016847257ae95314e97b2f31186c43f10e6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-08 19:05:30 +00:00
Sam Rawlins a75fdd4d98 Remove unnecessary imports from analyzer_plugin, analysis_server, analyzer_cli, test_runner
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: I52753bf0ac8112e0a2e6864ca2bd3289e63d5cf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-04-08 19:02:31 +00:00
Danny Tuppeny e8d53cff92 [analyzer] Improve handling of loose files and context rebuilds
Change-Id: Ifd047a29953503a70216ce29b3fe4cdbfc4132df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192926
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-08 17:49:35 +00:00
Joshua Litt 28aa79ddd7 Reland "[dart2js] Add support for bundling fragments."
This is a reland of d0f55d0e42

Original change's description:
> [dart2js] Add support for bundling fragments.
>
> Also changes the default to bundling rather than interleaving fragments.
>
> Change-Id: Id79d03a8a8b5be7465b8535f6c9c47dfad120c9c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191484
> Commit-Queue: Joshua Litt <joshualitt@google.com>
> Reviewed-by: Stephen Adams <sra@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

Change-Id: I0347ddb6dd93eb57f0abc259fc477ec3a9d7231b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194323
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2021-04-08 17:46:50 +00:00
Daco Harkes 9d5846b86e [vm/ffi] Support Unions backend
This Splits the NativeCompoundType into NativeStructType and
NativeUnionType.

The calling conventions themselves did not have to be updated at all,
they rely on the 'queries' on NativeTypes.

Some interesting corner cases in the native calling conventions are:
1. Arm64 and arm hardfp still regard unions as homogeneous floats, even
   if the union members are different sizes.
2. Unions can be larger than their members if their largest member has
   a smaller alignment than a smaller member.
3. When a specific range in a struct contains floating points in one
   member, but integers in another, the integers take precedence.

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

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

Change-Id: Ib97769457d1ad0fce47601e9e4a3008bd837167f
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194422
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-04-08 17:41:30 +00:00
Stephen Adams 2f327a61e3 Redo "[dart2js] Avoid premature interceptor optimizations"
This reverts commit fc349bdbb5.

Change-Id: Idb991651abdd8a60a1a2ef838f7396ad6c892223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194207
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-04-08 17:01:10 +00:00
Lasse R.H. Nielsen 6af4987dc6 Change VM DateTime to-local-time computation to not fail for <1h changes.
The DateTime conversion to local time amounts to solving an
equation, finding an offset where the current local time is that offset.

The current approach doesn't actually do that, it just tries to simulate
the JS approach, with a tweak to avoid DST change issues, but that tweak
assumes that all time zone adjustments are one hour changes.

This CL should work correctly for time zone changes of up to one hour,
but might still fail for changes of more than one hour.
It works by trying more offsets, which obviously has a performance cost,
which depends on how efficient the operation system is at providing
the local time zone for a specific milliseconds-since-epoch.

Change-Id: I80dc6e62e0639d9966d3c5a06430787d8acc4ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182041
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-04-08 16:51:00 +00:00