Commit graph

93227 commits

Author SHA1 Message Date
Parker Lougheed b199896be5 Mark packageConfigSync and resolvePackageUriSync as released in 3.2
Closes https://github.com/dart-lang/sdk/issues/53285

Bug: https://github.com/dart-lang/sdk/issues/53285
CoreLibraryReviewExempt: dart:isolate is only supported on the VM and this CL only changes a Since annotation.
Change-Id: If525aed83d3ccd69558f348e6a4a287a35b1d2ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322040
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-08-22 08:05:19 +00:00
Jens Johansen 258ad10f30 [CFE] Weak suite fuzzes by default
Change-Id: Ibe549771430c44264893655d46a0206fd5e438e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321880
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-08-22 07:03:50 +00:00
Srujan Gaddam f73350d83e Add confuse statements for js_types_test
Some of these is checks can be optimized away by dart2js.

Change-Id: I76b5b253a24a4ded2394664985665fc875b60f52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321750
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-21 21:54:15 +00:00
Srujan Gaddam a38fb595cf [dart:js_interop] Add JS types for Symbol/BigInt
Adds JSSymbol and JSBigInt and erases to either their respective
interceptor types in the JS backends or JSValue in dart2wasm.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: Ib2c70d22a70c6308733cd170b91eafa8ec3b3aeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321749
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-21 21:54:15 +00:00
Srujan Gaddam c738fe1d7b [ddc] Add BigInt and Symbol interceptors
Adds the same interceptors from dart2js as JsPeerInterfaces
and handles typeof differences in getReifiedType. These must
be JsPeerInterfaces so that Object members can be stored in
their prototype. Tests are added so that dart2js and ddc are
consistent.

Change-Id: Iadc3dd26957c0a21b4039c49c1c1ff162ae286e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321748
Reviewed-by: Stephen Adams <sra@google.com>
2023-08-21 21:54:15 +00:00
Kenzie Schmoll caedf8214d Bump DevTools to 2.26.2 and devtools_shared to 3.0.0 in DDS
Change-Id: I8601b54fffa34d2c3dba678b3bc6d86f68223ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321620
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-08-21 19:43:52 +00:00
Devon Carew f61107b4f6 [deps] rev collection, dartdoc, http, mockito, protobuf, test, tools, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

collection (1ed009e..1a9b7eb):
  1a9b7eb  2023-08-15  ebraminio  Minor typo fix (#304)

dartdoc (5cfb1f3..e148373):
  e1483735  2023-08-14  Parker Lougheed  Adjust links to dart.dev class modifier documentation (#3476)

http (9f167a7..631d4ec):
  631d4ec  2023-08-18  Alex James  Add java_http .gitattributes file (#999)
  58a5462  2023-08-17  Alex James  JavaClient can stream the HTTP response body (#1005)
  df1f625  2023-08-15  Brian Quinlan  Add some additional header tests (#1006)

mockito (ff79de6..e54a006):
  e54a006  2023-08-18  Copybara-Service  Merge pull request #685 from LuisDuarte1:feature/build-extensions
  5f3a4ca  2023-08-18  Luís Duarte  Format files
  2d4ec1e  2023-08-17  Luís Duarte  Update lib/src/builder.dart
  bc06f9f  2023-08-17  Luís Duarte  Make builder not merge generic extension.
  af043a0  2023-08-16  Luís Duarte  Replace double-quotes with single quotes
  034e6c1  2023-08-16  Luís Duarte  Update lib/src/builder.dart
  4ff995f  2023-08-10  Luís Duarte  Make MockBuilder support build_extensions option.

protobuf (a852ba4..5e8f36b):
  5e8f36b  2023-08-16  Ömer Sinan Ağacan  Add dart2wasm targets to benchmark builder (#806)
  41d0156  2023-08-15  Ömer Sinan Ağacan  Document why we add '$' prefix to result local in constructors (#870)
  41193fd  2023-08-14  Devon Carew  Rename a local variable to avoid proto field name conflicts, re-generate protos (#869)

test (bc0a992..d0fc4bd):
  d0fc4bde  2023-08-16  Nate Bosch  Extend the timeout for runtime_matrix_test (#2084)
  cdf80280  2023-08-16  Nate Bosch  Add some console logging to browser test startup (#2083)
  6146c292  2023-08-16  Nate Bosch  Add an ignore for an SDK deprecation (#2082)
  27142079  2023-08-15  Parker Lougheed  Fix improperly rendered changelog entry (#2081)
  46cf4de0  2023-08-15  Nate Bosch  Timeout browser suite loads (#2080)

tools (295ff92..2be6c2e):
  2be6c2e  2023-08-16  Ben Konyi  Added `dartCliCommandExecuted` and `pubGet` events (#123)

webdev (19aad27..fc876cb):
  fc876cb0  2023-08-16  Elliott Brooks  Reset Webdev to 3.0.8-wip (#2197)
  1aa7c523  2023-08-16  Elliott Brooks  Prepare webdev for release to 3.0.7 (#2196)

Change-Id: Idc228d0f3f70f5b3e7bfc6e777260dfe84fe96f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322060
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-08-21 18:05:38 +00:00
Sam Rawlins c0dd7a0092 Remove duplicate keys in dartfuzz_api_table
Duplications introduced in
cfa03ed971

Change-Id: I9720822611aacefb9b1538d9fc59e234f96475bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321842
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-08-21 17:43:28 +00:00
Nicholas Shahan 7b6d9fb46e [ddc] Cleanup temporary fix in strSafe
Fix allowed it to accept null but it should never be called with a
nullable value.

Change-Id: I03b5d9b4906e9e4557a4f2720350c0c8176fec53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320841
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nicholas Shahan <nshahan@google.com>
2023-08-21 17:42:33 +00:00
Parker Lougheed ca9730325c Update generic issue template/info
- Consolidates "related to" section to what users are familiar with.
- Adds some other related repositories.
- Switches to `dart info` instead of `dart --version` for more information

Change-Id: I70eb03293e5946b51cee7d5a7f02634a593f3bc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320901
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-08-21 17:07:18 +00:00
Graciliano Monteiro Passos cb690e6698 Optimize thisOrAncestorOfType
Closes https://github.com/dart-lang/sdk/pull/53288

GitOrigin-RevId: 8fcdfaf9f6d64be0c91bdd49a57d64a516cf0778
Change-Id: Ic49d50594464fd1d7eccc6c1c98627d7854bc3e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321840
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-21 16:58:46 +00:00
Derek Xu eb7368356d [VM/Service] Improve documentation of reloadSources
TEST=Only changes documentation.

Change-Id: I00fa8afce200f53420c1b712c91768d586d31514
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322000
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-08-21 16:52:19 +00:00
Ryan Macnak 7920d53b89 [vm] Fix gcc 12.2.0 build.
TEST=local build
Change-Id: I9aa9830134d922465d7aa1194edc29bc857f97b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321747
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-21 16:46:46 +00:00
Danny Tuppeny cd4b9527eb [analysis_server] Fix "dart fix" not handling directives_ordering
Fixes https://github.com/dart-lang/sdk/issues/53261

Change-Id: I5b7f87efeee1046959b81f0a07f07ce1f81706d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-21 16:44:11 +00:00
Ryan Macnak 8fcd42096e [vm, fuchsia] Fix inconsistent alignment of callback trampolines.
Cf. a129675a0a

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/53275
Change-Id: Ieb0d80ee99a5a899eeb2487ed786d9cffaed930f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321744
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-08-21 15:47:39 +00:00
Paul Berry fdc4e301e3 [dartfuzz] Fix trybot breakage
`DartType.VOID` and `DartType.VOID_NULLABLE` are the same constant,
therefore only one of them should be listed in
`DartLib.typeToLibraryMethods`, to avoid an `equal_keys_in_map`
warning.

Change-Id: I65beef01f8a810af96be5e458eeecef7a7acff01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2023-08-21 15:18:24 +00:00
Danny Tuppeny 45d06f2302 [dds/dap] Include Isolate IDs in Threads when used over DDS
See https://github.com/dart-lang/sdk/issues/53086

Change-Id: I380744f9e0d604168f026684b31fe689bb8947c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317701
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-21 14:17:40 +00:00
Danny Tuppeny eda6963e4d [dds/dap] Revert using Isolate numbers for DAP threadIds
This reverts 95e6f1e110 (minus the changelog/version, which have been updated accordingly).

Fixes https://github.com/dart-lang/sdk/issues/53086 although a replacement for mapping threads/isolates needs to be implemented.

Change-Id: I5e4d71f3b4683a04cabec6bda9e6d23caa7901d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317700
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-21 14:17:26 +00:00
Ben Konyi dc6731ba20 [ CLI ] Add new cli template to dart create
This new template will create a simple project with basic command line
argument processing using `package:args`.

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

Change-Id: I70f370bc348bb85547e4fcf2131c007416a48262
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321800
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-08-21 14:09:39 +00:00
Martin Kustermann 4d4a922638 [benchmarks] Remove unnecessary utf8.encode() as Uint8List downcast
The return type of `utf8.encode()` was made more precise in [0] (from
`List<int>` to `Uint8List`)

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

TEST=ci

Change-Id: I3e578ac8dc5f3f66396cb374e3dcadd989919518
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321860
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-08-21 08:21:37 +00:00
Parker Lougheed 70310b06d0 [changelog] Move utf8 return type change to 3.2
The change (81df36216f) landed after the cut off and isn't in 3.1: https://api.dart.dev/stable/3.1.0/dart-convert/Utf8Codec-class.html#:~:text=inherited-,encode,-(String%20input

Change-Id: I4394c546e07727bfd54e2f397b755b7460833985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321260
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-08-21 07:38:02 +00:00
Sam Rawlins 2e9d983b15 analyzer: Add indented code blocks to Comment
I decided to unify the indented code block and markdown code block
classes, as there will be no functional difference between the two.


Work towards https://github.com/dart-lang/sdk/issues/52705

Change-Id: I6cd60f7a58a83e6a67ad187b5ff25868b6f84651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321785
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-08-21 04:43:49 +00:00
Ryan Macnak cfa03ed971 [dartfuzz] Don't try to instantiate Record.
Regenerate API and type tables.

Change-Id: I3fe630764edf774059c24cff645041452768a5db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321745
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-08-18 23:56:49 +00:00
Nicholas Shahan a0ebfb9c3c [ddc] Add canary benchmark configs to test
This should signal what is needed to add DDC canary mode
golem configs.

Change-Id: Id1fe8ed016641bda4bfa9e5fabacc78b26a35503
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315560
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
2023-08-18 23:15:55 +00:00
Nicholas Shahan f167e03ce5 [ddc] Update benchmark test to new build targets
Provides a signal for what needs to change in the golem configuration.

Change-Id: I1b77ec88ba3076cd4a0296a78950ed209e996661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316843
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-08-18 22:21:47 +00:00
Ryan Macnak 77903114d5 [test_runner] Extend rr support to cover dart2js, ddc, dart2wasm and AppJIT compilation.
Allows stress testing the VM with `test.py -c dart2js,ddc,dart2wasm -r none --rr`.

Change-Id: I328e6e6757378a6915e6c8b2fa67d99ecfcdb9bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321742
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-18 22:19:47 +00:00
Ryan Macnak c1256bec01 [test] Skip process_sync_test on MSAN.
Bug: https://github.com/dart-lang/sdk/issues/51271
Change-Id: If96167b559a16539cef40dfd6244b9623e921ea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321743
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-18 21:25:59 +00:00
Ryan Macnak 12e456cdeb [test] Remove some stale status entries.
Bug: https://github.com/dart-lang/sdk/issues/30618
Change-Id: Iadeac7d4b02256a638fec0919375e4115f4103a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321781
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-18 20:56:03 +00:00
Alexander Aprelev 40894511bb [vm/compiler] Tag non-ffi force-optimized functions idempotent.
This is follow-up to https://dart.googlesource.com/sdk/+/54234979a32368c2e6fe5a45468aae939ccc7700

BUG=https://github.com/dart-lang/sdk/issues/38985
TEST=ci
CoreLibraryReviewExempt: vm-specific pragma
Change-Id: Ib24d283634708902bbabfc750c7a4496745e69ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321300
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-08-18 18:27:58 +00:00
Nicholas Shahan 04f91f4ba7 [ddc] Skip casts that are unchecked
The flag was added recently marking casts that should not be performed
at runtime. DDC will skip these casts now.

Change-Id: Ied43653f43cebc91f093d7c6df10edabb2afc34b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321623
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-08-18 17:52:49 +00:00
Niklas Schulze f99af3ff88 [vm/io] Fall back to IfIndex if Ipv6IfIndex is zero
Closes https://github.com/dart-lang/sdk/pull/52906

GitOrigin-RevId: 430673ca03df64c3d4bcdc2a0284be39c455ccb0
Change-Id: I35a7098d6f677b2fde4988d091211c27f1471561
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313161
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-08-18 17:22:18 +00:00
Sam Rawlins 425182ccf8 analyzer: Correct a few fenced codeblock bugs
Work towards https://github.com/dart-lang/sdk/issues/52705

In particular:

* A fenced code block starts with three backticks, but those must be
  the first non-whitespace characters on their line.
* Same with the closing delimiter.
* A fenced code block can start with more than three backticks, and
  must always be closed with a line of at least as many backticks.

Change-Id: I0060be7d6e67edb7fe3f93f426e46f23daed75db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-08-18 16:48:09 +00:00
Keerti Parthasarathy 36a146f037 Add utility methods for format and sort imports
Change-Id: I6f0408d8da8592ad125bcb4b9c4ff90fc3a9540c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-08-18 14:55:59 +00:00
Johnni Winther 30cb4d44e4 [cfe] Handle extension type in fuzz testing
Closes #53115
Closes #53117

Change-Id: Id34594b246a86f1c62dfc41d55a783a737a300ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321680
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-08-18 12:49:53 +00:00
Aske Simon Christensen da758538d3 [dart2wasm] Make the index field in _HashFieldBase nullable
This is to allow `_HashFieldBase` to be used for immutable maps and
sets (which initialize their index lazily) without using an intrinsics
hack to allow a non-nullable field to be `null`.

This change is necessary for the upcoming optimization that will
use non-nullable Wasm types for non-nullable Dart fields.

Even though this code is shared with the VM, the change doesn't affect
VM performance in practice, since the VM compiler is able to infer
that the field is always non-null. Benchmark runs see no measurable
performance difference.

Change-Id: I3ba2f78044f965473a0ab10ddf864c78e7095634
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321400
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jess Lally <jessicalally@google.com>
2023-08-18 10:19:22 +00:00
Martin Kustermann 851e696270 [vm] Allow inlining of typed data view factories
TEST=ci

Change-Id: I88b9661437ad63d0fe2e56c30c621f59e84d8294
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321480
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-08-18 07:37:08 +00:00
Paul Berry b7dad56d7d Flow analysis: sort declarations in flow_analysis.dart.
There is no code change in this CL, only code motion.

Change-Id: Icf48c806b810545721fcf6a33ec595e54b4f2759
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321420
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-18 02:56:38 +00:00
Paul Berry b9adb3d398 Flow analysis: adjust nomenclature to reflect field promotion.
The class `VariableModel` is renamed to `PromotionModel` to reflect
that it tracks promotion information for both local variables and
fields. Variables and fields that map from a promotion key to an
instance of `PromotionModel` are renamed from `variableInfo` to
`promotionInfo`.

Also a few comments are re-worded to make them clearer.

There is no functional change--this is a rename-only CL.

Change-Id: Ie0e7147d290171407f31fe65af85ce96dd51694a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321362
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-08-18 02:48:47 +00:00
Stephen Adams 9d15643d7a [js_runtime] Fix for #53105
Avoid trying to add a property to a non-object exception value to
cache the stack trace.

In "use strict" mode this is an error.

Otherwise the property is added to an ephemeral Object and then lost.
The observable behaviour is unchanged - returning a fresh
`_StackTrace` object each time.

Bug: #53105
Change-Id: I406ff14db4ed24b71e0cfe95cd87783621a5b809
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321622
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-08-18 01:24:21 +00:00
Nicholas Shahan aac40f1776 [ddc] Fix runtime FutureOr normalization
Normalize when the type argument is nullable.

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

Change-Id: Iaa8b2f65b300962b1fd5d0d0c315d936b045cace
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321601
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-08-18 00:58:04 +00:00
Nicholas Shahan 06c0ccd67a [ddc] Fix compile time futureOr normalization
Ensure normalization of type argument isn't lost when the FutureOr
itself gets normalized.

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

Change-Id: I5acc616276def5652eec4c1338d92f75bbdffda4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321600
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-08-18 00:02:21 +00:00
Ryan Macnak 8c4e092180 [vm, gc] Avoid assertion failure during aborted scavenge.
TEST=ci
Change-Id: Ibd6c3b46c2f6bf6514d9ce14fe37870b215bfd3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321621
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-17 23:55:51 +00:00
Nicholas Shahan 7a93d80473 [ddc] Isolate function signature per app
Fix function signatures from one app leaking into another app when
communicating via JavaScript interop.

Change-Id: Iba881f78bbe5444e3888c55fd317b8eda8e19f18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321520
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2023-08-17 22:56:57 +00:00
Sam Rawlins 9f7de0dcd3 Fix nullable Future.value and Completer.complete cases
In these two cases, a nullable value is passed where a runtime error
will occur if the value is null. Make runtime check explicit.

Cleanup for https://github.com/dart-lang/sdk/issues/53253

Change-Id: Ia14bd345cbe20c50c75bdd2069f44449157bcc36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-08-17 21:35:38 +00:00
Ryan Macnak a129675a0a [vm, test] Fix using the NDK's assembler.
TEST=test.py without --use-elf
Change-Id: Ie7ff32eebea175cb389c23892146bc6a380be6ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321321
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-08-17 20:39:00 +00:00
Helin Shiah 6b03758f76 Collect analytics from VS Code remote usages
This is the ID sometimes sent for internal VS Code users, and we want to capture these users as well for some internal IDE tracking.

Change-Id: Id3b5aa89eacefb873e88b59745014454a89e6a73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2023-08-17 20:24:30 +00:00
Alexander Markov 6ca7cca807 [vm] Cleanup handling of for-in statements
For-in statements are desugared on kernel AST, so handling of these
statements in the VM is a dead code and can be removed.

TEST=ci

Change-Id: Ic06080ee5d1b2ab74c55c400746f38a420668531
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321560
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-08-17 19:58:39 +00:00
Alexander Markov 47bc86cdc6 [vm] Cleanup handling of const local variables
All constants including const local variables are evaluated
in the front-end.

TEST=ci

Change-Id: I0062f5ac021b335ceb60c93ef8c230b49ec11a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321540
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-08-17 19:50:48 +00:00
Kallen Tu 48245c1064 [analyzer] Issue 53163: Fix crash with unresolved object in String length for const expressions.
Unresolved types would throw in `stringLength` and we don't handle them the same way we do with the other operators. Throwing EvaluationExceptions is the problem here, but that's for another CL.

In the meantime, this CL makes `stringLength` consistent to the other operators in the DartObjectComputer.

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

Bug: https://github.com/dart-lang/sdk/issues/53163
Change-Id: Ib99b61736d699056fa3c379e4d9c79756a4425f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319562
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-08-17 19:48:28 +00:00
Paul Berry 7703609cc1 Flow analysis: fix interaction of field promotion and try/finally.
Try/finally statements have an unusual property that needs to be
handled in a special way by flow analysis: within the `finally` block,
the `try` block might not have run to completion, but after the
try/finally statement, the `try` block is known to have run to
completion. Therefore, even though the code that follows the
try/finally statement is immediately preceded by the end of the
`finally` block, the flow states of those two control flow points
might not be the same.

Flow analysis accounts for this situation by analyzing the `finally`
block as though it started executing right after the beginning of the
`try` block, but with all variables that are written within the `try`
block demoted. Then, after it finishes analyzing the `finally` block,
it builds a fresh flow model by starting with the flow state after the
end of the `try` block, and then applying any promotions that were
performed within the `finally` block. This is accomplished by the
`FlowModel.attachFinally` method.

The following changes had to be made to make this work with field
promotion:

- If a given promotion key appears in the "after try" model but not
  the "after finally" model, it might represent a field that was
  promoted during the `try` block, so the promotion needs to be
  preserved. Previously, this situation could only occur if the
  promotion key represented a variable declared in the `try` block
  (and therefore the variable would not be accessible after the
  try/finally statement), so the promotion could be safely dropped.

- If a given promotion key appears in the "after try" model and the
  "after finally" model, but not the "before finally" model, it might
  represent a field that was promoted within both the `try` and
  `finally` blocks, so the promotions need to be combined. Previously,
  this situation could not occur, so the promotion could be safely
  dropped.

- If a given promotion key is associated with the same SSA node in the
  "before finally" and "after finally" models, but a different SSA
  node in the "after try" model, that means that the corresponding
  variable was assigned in the `try` block but not in the `finally`
  block. If any properties of the variable were promoted within the
  `finally` block, those promotions were applied to the SSA nodes used
  by the `finally` block, and don't appear in the SSA nodes used in
  the "after try" model. So those promotions need to be
  transferred. This is accomplished by the new
  `SsaNode._applyPropertyPromotions` method.

- If a given promotion key appears in the "after finally" model but
  not the "after try" model, it might represent a field that was
  promoted during the `finally` block, so the promotion needs to be
  preserved. Previously, this situation could only occur if the
  promotion key represented a variable declared in the `finally` block
  (and therefore the variable would not be accessible after the
  try/finally statement), so the promotion could be safely dropped.

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

Bug: https://github.com/dart-lang/sdk/issues/53225
Change-Id: Ie4b635dbf838447d6964c326e1ecebfff99bed8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320961
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-08-17 19:16:48 +00:00