Commit graph

70152 commits

Author SHA1 Message Date
Johnni Winther
88635446ec [cfe] Implement weak mode constants semantics
Closes #40124

Change-Id: Ia54490d9f5162a27e52c4e9c4d74c5cfaa28472b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134284
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-05 07:07:07 +00:00
Ben Konyi
37f4a44a27 Revert "[ VM / Service ] Added getClientName, setClientName and requireResumeApproval RPCs"
This reverts commit 48808f7dce.

Reason for revert: Unable to approve failures.

Original change's description:
> [ VM / Service ] Added `getClientName`, `setClientName` and `requireResumeApproval` RPCs
> 
> Add support for naming VM service clients which allows for resume
> permissions to be set for all clients of the same name. If a client
> name requires resume approval, an isolate won't be resumed until all
> clients which require resume approval have called the `resume` RPC.
> 
> Resume approvals can be set for the following pause events:
> - PauseOnStart
> - PausePostRequest (issued after `reloadSources(pause: true)`)
> - PauseOnExit
> 
> Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Gary Roumanis <grouma@google.com>

TBR=jacobr@google.com,bkonyi@google.com,rmacnak@google.com,asiva@google.com,grouma@google.com

Change-Id: I8e60416ad8cbec9ad93f4e34e9bf9af5a516c6dc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134465
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-05 01:13:17 +00:00
Mayank Patke
450924a8cd [dart2js] Remove typedefs from backend.
Change-Id: Ia170535b5d35d97003cff93acbf33cb3fe75725f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134206
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-05 01:09:47 +00:00
Nicholas Shahan
f831f121d7 Revert "[tests] Add tests for generic function type bounds with null safety"
This reverts commit 21535e540f.

Reason for revert: VM test bots are failing and the approval system is down so I can't turn them green again. Reverting until I can approve the failures.

Original change's description:
> [tests] Add tests for generic function type bounds with null safety
> 
> Testing that type arguments bounded by legacy types are equivalent
> with nullable and non-nullable versions of the same types.
> 
> Change-Id: Ibd1166af68a74041920940789464cbb8afb091ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132969
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Erik Ernst <eernst@google.com>

TBR=leafp@google.com,rnystrom@google.com,eernst@google.com,nshahan@google.com

Change-Id: Iad45fcd1498bdd46bfb908cd40df7ca38ef47d2d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134461
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-05 00:58:27 +00:00
Ben Konyi
48808f7dce [ VM / Service ] Added getClientName, setClientName and requireResumeApproval RPCs
Add support for naming VM service clients which allows for resume
permissions to be set for all clients of the same name. If a client
name requires resume approval, an isolate won't be resumed until all
clients which require resume approval have called the `resume` RPC.

Resume approvals can be set for the following pause events:
- PauseOnStart
- PausePostRequest (issued after `reloadSources(pause: true)`)
- PauseOnExit

Change-Id: I7dde3d8aaeccfcf47fa84f1f92159846f1560e16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133621
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
2020-02-05 00:02:17 +00:00
Vijay Menon
ce21fd034e [dartdevc,nnbd] fix type errors in dart:_interceptors
Change-Id: If842fbab8bc043c9331529d1280c57faa7ce6769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134407
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-02-04 23:46:37 +00:00
asiva
1f32305392 [VM/libraries] - Fix issues in ported patch files that cause dart2js to fail (https://github.com/dart-lang/sdk/issues/40463)
- List<String> should be List<Object?> because entries in the stack can be either Map or Strings
- _divRem has some cached values which are marked late but are used
before they are initialized resulting in exceptions, these four cached
values are now made nullable.

Bug: 40463
Change-Id: I469692e95bf6ef74665d14209dd3e2cd556c1f06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134408
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-04 23:43:27 +00:00
Sigmund Cherem
d798004ba3 [ddc,dart2js] remove web patches for dart:cli
Since dart:cli is not in the libraries.yaml/json for ddc and dart2js, imports to
it are not allowed on web code. The patch files were not needed and can be
removed.

Change-Id: I46acf8a540f4b2d0a2aa7dcc50b572adab564b68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134048
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-02-04 23:32:47 +00:00
Ryan Macnak
68d178f223 [vm] Remove FLAG_support_service and FLAG_support_reload, superseded by PRODUCT define.
When these were originally added, we thought we would be able to use them in place of ifdefs and rely on the compiler optimizations and linker GC to remove things. This turned out not to reliably remove what we wanted removed, so we ended up with the ifdefs anyway.

Change-Id: I62e74d60d92b18a688b9dffaf77b1440c10a07ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134402
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-02-04 23:31:17 +00:00
Nicholas Shahan
c438a48bc4 [dartdevc] Enforce more pedantic v1.9.0 lints and cleanup violations
- prefer_generic_function_type_aliases
- use_function_type_syntax_for_parameters

Change-Id: I138d4104c5de41acf44b7962d6e2ce58d78b8a75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134380
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-02-04 23:04:27 +00:00
Nicholas Shahan
21535e540f [tests] Add tests for generic function type bounds with null safety
Testing that type arguments bounded by legacy types are equivalent
with nullable and non-nullable versions of the same types.

Change-Id: Ibd1166af68a74041920940789464cbb8afb091ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132969
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 22:37:35 +00:00
Paul Berry
655fcda015 Migration: rework how ElementTypeProvider overrides element types.
Previously, each piece of analyzer code needed during the FixBuilder
stage of migration needed to use the ElementTypeProvider interface to
access element types (rather than reading the types from the elements
directly), in order to ensure that the proper post-migration types
were used when building fixes.  This required a lot of plumbing, and
there was a high risk that we would accidentally fail to use the
indirection mechanism in a key location and access the elements
directly.

This CL changes the approach so that the ElementImpl classes
themselves are responsible for indirecting through
ElementTypeProvider.  This means that we can back out all the
plumbing, and there is no risk of accidentally failing to use the
indirection mechanism.

Change-Id: Ic1a0acc37f0350fc13b487f73fc1ad5225d7a090
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-02-04 22:29:20 +00:00
Paul Berry
e218986f64 Sort declarations in assignment_expression_resolver.dart
Change-Id: I7c4b345132259f0d45621a8815fb9bc6e2877aff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134247
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-02-04 22:29:20 +00:00
Ben Konyi
bbe0e3b768 [ DartFuzz ] Quality of life improvements in log output
- Updated reproduction commands to not include bot paths (should be
copy-pasteable and runnable from $SDK_ROOT now).
- Fixed issue where Dart SDK revision wasn't being printed on the bots

Change-Id: Ia53986332eb7997d5b3911c5de4e5ce1d61e6eb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134420
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-04 22:06:30 +00:00
Erik Ernst
3fb7f6a724 Adjusted language/assign/to_type_test.dart to avoid irrelevant
nnbd type error.

By the way, I don't understand why the trybots didn't complain about
this, all trybots were green when
https://dart-review.googlesource.com/c/sdk/+/134224 was auto-submitted.

Change-Id: Id410fc18e9ebf9be6c180740067857e2309f47ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134291
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
2020-02-04 22:04:40 +00:00
Devon Carew
f51187a18d [migration tool] convert the javascript code in the migration tool to dart
Change-Id: I5145be275dda77de3c25d80a13812803217d6452
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134403
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-04 21:46:08 +00:00
Janice Collins
e402fc4a22 Do not require --enable-asserts for test_assertOnPathOutsidePackage.
There is a handy annotation designed just for this purpose.

Change-Id: I4a1e5e6320f6f3dd940ad43fc698a6ee41e6b44b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134249
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
2020-02-04 21:32:28 +00:00
Konstantin Shcheglov
05dcf371e7 Remove 'withNullability' from TypeImpl.toString()
Bug: https://github.com/dart-lang/sdk/issues/40460
Change-Id: Icd967df0252a9fd7ff9941ca7158b7df0190c961
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-04 21:19:06 +00:00
Martin Kustermann
e171ff4a6d [vm/concurrency] Speed up isolate communication via normal snapshotting
Do not lock forwarding table during snapshot writing:

This is a follow-up to [0], which made the [WeakTable] used during
snapshot writing per isolate. Since each isolate has it's own table
now, there's not reason to lock it during snapshot writing.

Furthermore we speed up RawObject::InVMIsolateHeap() which was super slow
due to locking "vm-isolate"'s page space and walking all pages.

[0] https://dart-review.googlesource.com/c/sdk/+/114858


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

Change-Id: I783ea6083c199058e76895fcde38dc06af6991d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134299
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-02-04 20:46:36 +00:00
Régis Crelier
dfce72bbf9 [VM/nnbd] Fix canonicalization of type 'Never' (fixes #40249).
Change-Id: Ib3dc4fc6d31aeadb331fda017fc8b4f1a8ae8221
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134382
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-02-04 20:31:56 +00:00
Jaime Wren
270829d7eb Refactor the CompletionMetricsComputer class into three classes: a subclass and two concrete classes, AbstractCompletionMetricsComputer, CompletionCoverageMetrics and RelevanceAnalyzerMetrics.
This change breaks up the lengthy algorithm, and greatly speeds up the Relevance Analyzer tests.

Change-Id: I4273bcabe7399f80aa751c5963a53fa04e1b4d25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-02-04 19:34:56 +00:00
Robert Nystrom
68e904e444 Migrate language_2/abstract to NNBD.
Change-Id: I265933f36f68df6f8e542a3f85ce0b04e1dfd549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134205
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-02-04 18:57:26 +00:00
Janice Collins
1d932f7450 Add a 'run' feature to MultiFutureTracker.
This makes a certain idiom using MultiFutureTracker more compact,
namely blocking on the completion of the closure.

Change-Id: I8872ce882da0b20775c416895047cc18abd2801a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134248
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2020-02-04 18:57:18 +00:00
Martin Kustermann
a5bb8b666a [infa] Respect --sanitizer flag in tools/test.py when running GN
Change-Id: I0c9fdc26983381111021bf1265ef58f31deb8ae2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134296
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-02-04 18:45:26 +00:00
Ryan Macnak
7c472c396c [vm] Speed-up the stack overflow check as used by reload stress testing.
Avoid calling Function::ToFullyQualifiedCString when it is not needed.

Change-Id: I7d8ed879bb47e5e06c456bec73e4e00ae0181cd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134241
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-02-04 18:16:59 +00:00
Konstantin Shcheglov
a1d232a9b4 Issue 40392. Report SWITCH_CASE_COMPLETES_NORMALLY when switch/case completes normally.
Bug: https://github.com/dart-lang/sdk/issues/40392
Change-Id: I15c80d0667be1c783cb21870b9f92ee98a4f3042
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134245
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-04 17:46:48 +00:00
Teagan Strickland
bb24f98616 Revert "[vm/aot] Remove object wrapping of bare instructions for AOT snapshots."
This reverts commit 7475c637c3.

Reason for revert: Breakage on simarm_x64 (and thus arm_x64)

Original change's description:
> [vm/aot] Remove object wrapping of bare instructions for AOT snapshots.
> 
> Now, when writing an AOT snapshot in bare instructions mode, only
> the actual instructions in the RawInstructions payload are serialized
> instead of the entire RawInstructions object.
> 
> Since there are no longer RawInstructions objects in these AOT
> snapshots, we also change how Code objects are serialized. Instead
> of just containing a reference to the RawInstructions object, we
> serialize two pieces of information: where the instructions
> payload for this Code object begins and whether there was a single
> entry for the instructions payload. (To save space, the single
> entry bit is serialized as the low order bit of the unchecked
> offset, which was already being serialized).
> 
> While we also need the length of the instructions payload, we
> approximate it for all but the last Code object by subtracting
> the next Code object's payload start from this Code object's
> payload start. For the last Code object, we assume it extends
> to the end of the instructions image.
> 
> Changes on flutter gallery in release mode:
> armv7: instructions size -2.66%, total size -1.68%
> armv8: instructions size -5.81%, total size -3.49%
> 
> Fixes https://github.com/dart-lang/sdk/issues/38451.
> 
> Change-Id: Ia458e8d99bae18f5c3b6e849df2519027f06f574
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131067
> Commit-Queue: Teagan Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,rmacnak@google.com,sstrickl@google.com

Change-Id: If2c8ca6b0993211b2509b275af7ff11a8fa2baa3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-simarm_x64-try, vm-kernel-precomp-android-release-arm64-try, vm-kernel-precomp-android-release-arm_x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134322
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2020-02-04 17:32:28 +00:00
Teagan Strickland
592e59691b Revert "[gardening] Fix assert failure on (sim)arm_x64 due to 7475c63."
This reverts commit 30e80f0a64.

Reason for revert: Other failures were hiding under the ASSERT failure.

Original change's description:
> [gardening] Fix assert failure on (sim)arm_x64 due to 7475c63.
> 
> Also since we write out a target word for the
> InstructionsSection::instructions_length_ field, make that field a
> uword, not a uint32_t.
> 
> Change-Id: I8032cf49aae9528702778ee3ed717c08cb281e54
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-bare-linux-release-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134290
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,dacoharkes@google.com,sstrickl@google.com

Change-Id: I694411d9e986062148888aaddedc75673039dfe0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm_x64-try, vm-kernel-precomp-bare-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134321
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2020-02-04 17:30:58 +00:00
Konstantin Shcheglov
8378042f19 Extract test for CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS.
Change-Id: I91641cee4320d4d21d121fc0d9494c090cbe2a76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134246
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-04 17:05:38 +00:00
asiva
0e5a7275d0 [VM/library] Fix signature of waitFor to account for potential null return value.
This should fix the breakage in the NNBD on test standalone/io/issue_32052_test

Change-Id: I58192dffa9a9d7f5c492dd58e7f570fabcb69b86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134243
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-02-04 16:55:08 +00:00
Liam Appelbe
a793c36c77 [test] Run late field tests in optimised mode
Fix the tests by disabling the optimisation that turns getter calls into
raw gets if the field is late, and by calling recording the null init
store in bytecode mode.

Change-Id: I8f12e3237cd32c890b5cef8d00c32940e937330d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134180
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-04 16:51:38 +00:00
Teagan Strickland
30e80f0a64 [gardening] Fix assert failure on (sim)arm_x64 due to 7475c63.
Also since we write out a target word for the
InstructionsSection::instructions_length_ field, make that field a
uword, not a uint32_t.

Change-Id: I8032cf49aae9528702778ee3ed717c08cb281e54
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-bare-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134290
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-04 16:01:52 +00:00
Robert Nystrom
c5cba24124 Migrate language_2/argument to NNBD.
Change-Id: Ic1963eb1962bc1341a68783e9c44f3e04bfbc43a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134223
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 15:07:11 +00:00
Jens Johansen
f0d16c3c31 [CFE] Parser test for class called late and required
Bug: #40288.
Change-Id: I5be3b949c954e071db4ad5418d23f56fdeb711ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134281
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 13:45:31 +00:00
Dmitry Stefantsov
500752d51a [cfe] Disallow default List constructor invocations in NNBD
Closes #40086.

Bug: http://dartbug.com/40086
Change-Id: I56606acfc7c0392f2aece930b1285f69a7594e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134287
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 13:21:31 +00:00
Johnni Winther
89967b83f5 [cfe] Update tests to show that inc/dec shorting is supported
Change-Id: I2c74003cf6bc9ca5dde7e982af053d6e9d54714d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134286
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-04 12:39:06 +00:00
Victor Lima
e076e793a7 [vm] Allow unboxed integer fields in AOT
flutter arm-v8:
  gallery instructions size: -0.46%
  gallery total size: -0.35%

  sync_star_generated (Pixel 2): -8.04% (less is better)
  velocity_tracker_bench (Pixel 2): -9.18% (less is better)

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

Change-Id: Ieb7bf426af37f77fd543ebc5314a94224da3aaeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132606
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-04 12:37:21 +00:00
Dmitry Stefantsov
5a8a3ad809 [cfe] Disallow late final fields and const constructors
Closes #40091.

Bug: http://dartbug.com/40091
Change-Id: I9e858ba4de096d230c40c2ff4136b173e46251cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134283
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 11:22:11 +00:00
Robert Nystrom
3414b51675 Migrate language_2/assign to NNBD.
Change-Id: I71947bc5726f168fc036a7fece8a3b6b7bf964f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134224
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 10:37:43 +00:00
Teagan Strickland
7475c637c3 [vm/aot] Remove object wrapping of bare instructions for AOT snapshots.
Now, when writing an AOT snapshot in bare instructions mode, only
the actual instructions in the RawInstructions payload are serialized
instead of the entire RawInstructions object.

Since there are no longer RawInstructions objects in these AOT
snapshots, we also change how Code objects are serialized. Instead
of just containing a reference to the RawInstructions object, we
serialize two pieces of information: where the instructions
payload for this Code object begins and whether there was a single
entry for the instructions payload. (To save space, the single
entry bit is serialized as the low order bit of the unchecked
offset, which was already being serialized).

While we also need the length of the instructions payload, we
approximate it for all but the last Code object by subtracting
the next Code object's payload start from this Code object's
payload start. For the last Code object, we assume it extends
to the end of the instructions image.

Changes on flutter gallery in release mode:
armv7: instructions size -2.66%, total size -1.68%
armv8: instructions size -5.81%, total size -3.49%

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

Change-Id: Ia458e8d99bae18f5c3b6e849df2519027f06f574
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131067
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-04 10:28:43 +00:00
Robert Nystrom
56ca547c8c Migrate language_2/accessor_conflict to NNBD.
Change-Id: I136befc5fa77bfa2a118f9bd032250abcde2da68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134222
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 09:52:03 +00:00
Vyacheslav Egorov
ab56c2f841 [runtime/docs] Add custom lexer for shell sessions in runtime wiki.
This was missing from the previous wiki related commit.

TBR=aam@google.com

Change-Id: Ib68ead3bab2841bb8e02cb93fd71bce7515ff335
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134285
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-02-04 09:16:52 +00:00
Vyacheslav Egorov
857b911f3b [vm/docs] Publish "Introduction to Dart VM" source and build tools.
Change-Id: I30068d6492bd6ec4ce42cc50d4a481960a0197fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133985
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-02-04 09:04:32 +00:00
Jens Johansen
18c281c624 [observatory] Allow to say 'break package:foo/file.dart:42'
This CL updates the parsing of "break" statements in the debug console
in observatory, as well as handling that the same script can be a part
of several libraries.

Before one could get stuff like this:
$ break package:front_end/src/fasta/scope.dart:389
Function 'package:front_end/src/fasta/scope.dart:389' not found
$ break scope.dart:389
Script 'scope.dart' is ambiguous

The first one is fixes by this CL: We now allow package uris and thus
no longer think it's a function. In this case it wouldn't have mattered
though, it would just say it was ambiguous, as the last case.
This is caused by the same script being found twice. By using a set
instead of a list, that's fixed too.

Change-Id: I3931c8f2abc0a3a5a77cff516da8767037196bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133593
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-02-04 08:57:01 +00:00
Jens Johansen
c6aa3a22a7 [vm] [debugger] Fix for not breaking in library with mixin
In the VM, a single script can belong to several libraries because of
mixins.

Previously, when setting a breakpoint, it found the function to set the
breakpoint in by taking the "scripts library" (script.FindLibrary) and
then tried to find a function in that library that matched.
Sometimes it found the "wrong" library and the breakpoint thus wasn't
set.

This CL changes that so it goes though all libraries, finds all maching
libraries and tries all of them.

This solves the issue at hand, but might not solve all corner-cases.

This added test demonstrates the resolved case where before it would
just say that it couldn't add the breakpoint on line 13.

Change-Id: Ie44b0dfb4ea3e8de767d1867ec432b2aef429b76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133592
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-02-04 08:43:21 +00:00
Martin Kustermann
83d7048600 [vm/concurrency] Disable isolate groups in AOT mode
This is a preparation for landing the shared heap CL (it will
temporarily regress the isolate spawning time and memory use).

Once the shared heap CL is in, we can make a follow-up change to actually take
advantage of it by sharing the entire program structure (cl in
preparation by aam@). Once that lands we will enable the isolate groups
in AOT and reduce spawning latency by 10x :)

Regarding testing: We have already made all our isolate related tests in the
SDK run with/without isolate groups (irrespective of the default), so we
should continue to have test coverage in both modes.

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

Change-Id: Ib7e5101dfe8527948cd9ceed09d50051b04fb874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134280
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-02-04 07:58:01 +00:00
Dmitry Stefantsov
3183573a79 [cfe] Account for signatures when inserting noSuchMethod forwarders
It is possible for an abstract member to be overridden with another
abstract member with different signature (that has, for example, more
optional parameters).  In such cases, the noSuchMethod forwarders should
be generated for each distinct signature.

Closes #40248.

Bug: http://dartbug.com/40248
Change-Id: I7974415f0ecb78f05d7265ecf9d57cc0d38e6c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132661
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 07:58:00 +00:00
Johnni Winther
7c837ce30a [dart2js] Remove all unneeded casts
Some of the implicit casts were need for covariance checks. Now these
can be identified and actively preserved.

Change-Id: Ibfff4f68cc4af7956372adb2f4d846b079f0b508
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134162
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-04 07:01:09 +00:00
Srujan Gaddam
851912cc1d Change nnbd_src files to be null-safe
Translates the forked nnbd_src files to address analyzer issues.

Change-Id: Ida21988bff63a6c5a037b548d0c8b11208317b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130131
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-04 01:57:39 +00:00
Ben Konyi
8f7d3fca69 [ VM / dart:typed_data ] Change fmaxf/fminf to fmax/fmin for Float64x2.clamp
Fixes https://github.com/dart-lang/sdk/issues/40446

Change-Id: Ic610ecd024a6fc9bab3095ceb049139e21a519f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134242
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-04 01:06:19 +00:00