Commit graph

85268 commits

Author SHA1 Message Date
Danny Tuppeny 4261df2dbd [analysis_server] Remove qualified static members from code completion
Change-Id: Ia8ef009fa99cd495ca0ed3f825f3d951136341e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-05-04 14:22:24 +00:00
Kenzie Schmoll 77002f991e Release DevTools 2.13.0
Change-Id: Ie2cd8657db334d18fb5ba034a9a7c11ebefa9581
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243564
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-05-04 13:10:09 +00:00
Sigurd Meldgaard 699ea58a42 Bump pub to 6068f47c264ef790e16411b31b2c94ad6beb1ab6
Changes:
```
> git log --format="%C(auto) %h %s" a949b32..6068f47
 https://dart.googlesource.com/pub.git/+/6068f47c Fixing link example "User-Agent" (#3400)
 https://dart.googlesource.com/pub.git/+/cd0d6992 Make tests more agnostic to the test environment (#3402)
 https://dart.googlesource.com/pub.git/+/1f8db828 Fix retrieval of name in `pub global activate -sgit` (#3407)
 https://dart.googlesource.com/pub.git/+/ed63f212 Limit the number of concurrent precompilations (#3396)
 https://dart.googlesource.com/pub.git/+/d82f80a5 Fix crash when checking code with bad import (#3392)
 https://dart.googlesource.com/pub.git/+/b9ae624e Relative urls in lockfile for git urls (#3385)
 https://dart.googlesource.com/pub.git/+/62bb2440 Fix `dependency_services apply` for packages with relative imports (#3374)

```

Diff: https://dart.googlesource.com/pub.git/+/a949b329b1b51f5f3973a790e0a0a45897d837de~..6068f47c264ef790e16411b31b2c94ad6beb1ab6/
Change-Id: Ib18c2647e27a34d84005214b844351f314698611
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243321
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sarah Zakarias <zarah@google.com>
2022-05-04 12:26:44 +00:00
Aske Simon Christensen dc66b9274e Update d8 to 10.2.78
With dart2wasm emitting nominal types by default now, we can move on
from 10.0.40. This newest version contains a fix to type conversion
when round-tripping a JS value through WasmGC plus some early stack
switching support.

Change-Id: I4744e0b9705dc0d3ee1a4a417e299b4eb8ed9b3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240405
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-05-04 10:15:44 +00:00
Sam Rawlins 9d456bf516 Basic client completion test
This involves a large refactoring of completion_metrics.dart, extracting
out some common code into completion_metrics_base.dart

The code in completion_metrics.dart and completion_metrics_base.dart is
largely unchanged, but restructured to fit the sub-class structure.

* Rename CompletionMetricsComputer -> CompletionQualityMetricsComputer,
  as this is focused on quality metrics.
* Extract out applyOverlay and removeOverlay methods.
* Extract out computeSuggestionsAndMetrics, code which is run per
  ExpectedCompletion.
* Extract out setupForResolution, for code custom to the quality
  computer.

The meat of this change though is in completion_metrics_client.dart:

* _AnalysisServerClient is code which was extracted from
  package:dartdev/src/analysis_server.dart. It may seem like an odd
  choice when we have package:analysis_server_client, but I think
  dartdev's client is fairly mature in creating a short-lived client,
  and handling crashes, etc. If this should be re-combined with dartdev,
  I think there are open questions about where that should live, and I'd
  like to address that in a follow-up.
* The client does not perform overlays yet.
* The client does not track slowest requests yet.
* The client does not have support for performance metrics which DAS
  tracks itself. Adding this is high priority.

Change-Id: Ib259f78e4646d10b61559bfd5700d98a95d14d43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243522
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-05-04 01:05:05 +00:00
Devon Carew ed7fd8a762 [deps] rev package:characters
Change-Id: I4df60c5c0c5f3571d910ffae1b1646c46cc8fb0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243565
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2022-05-04 00:12:26 +00:00
Mark Zhou bf5690dd0c [dart2js] Removing size checks from main output unit dump info tests
These were far too sensitive to code size changes and causing unhelpful failures.

Change-Id: I5293c7d281a5db2d36af35f67966f4d47413a78a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243561
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-05-03 23:14:04 +00:00
Paul Berry ce591d17c3 Resolve deferred function literals in stages.
This change allows function literals in invocations to be inferred in
dependency order.  For example, given the following code:

    U f<T, U>(T Function() g, U Function(T) h) => h(g());
    test() {
      var x = f(() => 0, (y) => [y]);
    }

The function literal `() => 0` is inferred first, causing the type
parameter `T` to be assigned the type `int`.  Then, `(y) => [x]` is
inferred with the benefit of this type assignment, so `y` gets the
type `int`, and consequently, `U` gets assigned the type `List<int>`.

This completes the support for
https://github.com/dart-lang/language/issues/731 (improved inference
for fold etc.)

Change-Id: I48c22693720a1cc8bbf435643e863834e07f02b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243002
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-05-03 22:04:39 +00:00
Mark Zhou 9c572f08ca [dart2js] Adding closure tests for dump info members
Change-Id: I73d6e262941fa1b8278f32c3e17689e45dea4ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243383
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-05-03 20:53:34 +00:00
Danny Tuppeny 98d74c1d54 [analysis_server] Filter completion items by prefix before mapping to LSP classes
Change-Id: Idcc8d91903185e274524d4cb7c4e81c4a750e27e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243463
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-05-03 20:47:44 +00:00
Nicholas Shahan f372f8cbbe [tools] Allow update.py to run on mac arm machines
Change-Id: I293f493ec10465ec8c2af071aef7aebff44bdf0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241692
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-05-03 20:29:17 +00:00
Nicholas Shahan 651350bc3b [ddc] Avoid emitting dead branches in conditionals
Don't emit dead code branches that are guarded by boolean literals.

Add a single level of simplification for !true -> false, and
!false -> true.

While this might not be very common in code, it does allow for a
useful pattern in the runtime libraries. Branches can be included
into the compiled code or not based on a compile time flag.

Change-Id: Ib90e1e951cea3ef8c75b944635776b292759594a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243363
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2022-05-03 20:17:44 +00:00
Konstantin Shcheglov c27086d567 Refactor the way we build and iterate macro targets with applications.
Change-Id: Icaeeb3021c6dc716aee2aad322a66e34a6fc912f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243523
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-05-03 19:28:08 +00:00
Konstantin Shcheglov fa2bceafb8 Support for named constructors in macro annotations.
Change-Id: I1879af284cb5c20368f5fb7bc7bfb2ff23d403c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243521
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-05-03 19:18:24 +00:00
Konstantin Shcheglov 7824e3b8c9 A few tests for macro as getter and arguments.
Change-Id: I1e400f71364dbbc2da3007f63447f4d2b456096a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243384
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-05-03 19:17:44 +00:00
Danny Tuppeny e82d6d1a4f [analysis_server] Improve performance of LSP completions
Change-Id: I5405b65c611cec2f97f425d2efdef83180fa0d05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-05-03 15:45:50 +00:00
Alexander Thomas 15085f5cf2 [infra] Bump chrome to 101.0.4951.41
Bug: https://github.com/dart-lang/sdk/issues/48934
Change-Id: Ifa26a0c360c78dcf394e2b4fe676bb92de74eae5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243324
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-05-03 15:39:59 +00:00
Ben Konyi 4d21c01e63 [ Timeline ] Fix ASAN failures due to timeline recorder not being freed
A recent fix for a use-after-free crash created a memory leak due to
Timeline::Clear() returning immediately as the timeline had already
entered its shutdown state. This change adds a new helper function to
bypass the shutting down check in Timeline::Clear(), allowing for the
recorder to be properly cleaned up.

TEST=CQ, local testing

Change-Id: Id2ea3992ea4c4544a2c1cf82b74ea6c3882fa670
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243480
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-05-03 15:38:34 +00:00
Danny Tuppeny 519a83dd29 [analysis_server] Apply fuzzy prefix matching to LSP YAML completions
Change-Id: I4b6a45d2601c10ed08c3bdcf4e5c007d5063dbff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243328
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-05-03 15:37:44 +00:00
Danny Tuppeny ace4135fa7 [analysis_server] Don't truncate unranked items from LSP code completion
Change-Id: I12ce64185c5008b48e40bac82a000c687220dc7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243327
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-05-03 14:02:54 +00:00
Stephen Adams 7836057041 [dart2js] Share late-check name strings
0.925% reduction in specific Dart Angular app.

Change-Id: Ic4828a3175775060397a8f9cb513b18f175f5c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242424
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-05-03 06:03:58 +00:00
Keerti Parthasarathy 630ad11de4 Add rename constructor
Change-Id: Ie4815ed4b4db93cfad9307702fc86172685cfb17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2022-05-03 04:51:37 +00:00
Robert Nystrom 65e751c5c3 Add 2.17 language features to CHANGELOG.
Change-Id: I64716576bf387d85f2e42e7ef439e3e9cff36392
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243400
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2022-05-03 01:24:46 +00:00
Konstantin Shcheglov 404e568787 Support for top-level getters that are instances of macros.
Change-Id: Ieda42930afa965ddc5170cea2755eb2559b8f34a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243381
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-05-03 00:19:26 +00:00
Ryan Macnak 706e62a1bf [vm] Canonicalize empty Class::interfaces_.
TEST=ci
Change-Id: I921eb1796b5e142aba8a8f8649a0105ef0e396e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243380
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-05-02 23:44:46 +00:00
Alexander Markov c9840a024f [vm] Introduce Assembler::PushRegistersInOrder to generate series of register pushes more efficiently
(Macro-)assembler helper PushRegistersInOrder generates series of
register pushes in an architecture-specific way:
 * Using STMDB on ARM (if possible).
 * Using STP on ARM64.
 * Updating SP only once on RISC-V.

TEST=ci

Change-Id: I6cbd1dd5f8acf8ce8087ed899a311264a873ad37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243100
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-05-02 22:34:19 +00:00
Mark Zhou 9925c72e55 [dart2js] Adding program-level info to dump info tests
Change-Id: I3df11ad508259ac12080bab6595377550124c8a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243023
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-05-02 22:00:52 +00:00
Liam Appelbe b6cfea8d8b Remove trailing null char from IOOverrides.fseGetType
This null char is inserted by _toNullTerminatedUtf8Array, and right
below that function is _toStringFromUtf8Array, which does the opposite.
But _toStringFromUtf8Array is currently dead code, so it looks like the
intent was always to use _toStringFromUtf8Array for this, and the fact
that utf8.decode was being used instead is just a mistake.

Bug: https://github.com/dart-lang/sdk/issues/34885
Change-Id: I1404c7783b055902b256176aa61971c0d6969f5e
Fixes: https://github.com/dart-lang/sdk/issues/34885
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243103
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2022-05-02 21:16:20 +00:00
Alexander Markov 4075e8b3f9 [vm] New async*/yield/yield* implementation based on suspend/resume stubs
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: I0c2ca9269b2c8f008a79c139a0ce10231996732d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242923
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-05-02 20:53:01 +00:00
Stephen Adams 0d5d34a2ed [dart2js] Migrate more serialization methods
Change-Id: I1fb46ff661197c321afad040d284d0da33ff2ed3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243024
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-05-02 20:14:12 +00:00
Sigmund Cherem 6eb527be4d [dart2js] migrate program split constraints to null safety
Change-Id: Ice2bcf15d55e0b9bff0a11376c0b9ff42e012b50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243025
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-05-02 19:30:54 +00:00
Ryan Macnak 49c039b5ab [vm] Remove the branch from pointer decompression in the runtime.
In particular, this removes the branch from Deserializer::Ref.

Startup.ReadProgramSnapshot(StartupTime): on a Moto x4
  arm64c 46063 -> 44714 us (-2.93%)

TEST=ci
Change-Id: I1cdd6e8b36ad695f15552ebea0f3fc726b467863
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242500
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-05-02 19:25:12 +00:00
Nate Biggs 017393ecdc [dart2js] Migrate member_data.dart and node_indexer.dart to nnbd
Change-Id: I0e80d9aacb6e2f15afa2388543ad3dcbd68065ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242700
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-05-02 18:02:28 +00:00
Sigmund Cherem 659459ba13 [dart2js] fix reference to package_config.json in helper script
This will allow to remove the `.packages` file from the bots. See
for reference Jonas change here: https://dart-review.googlesource.com/c/sdk/+/240842

Change-Id: Ic4ec8d6192533756e0c7642240eea918e790f67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243360
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-05-02 16:57:54 +00:00
Aske Simon Christensen 4e4cf39d3e [dart2wasm] Fix override of external method in string_patch
This situation was flagged as invalid by the kernel verifier.

Change-Id: I549e6fbb838e301f2a4c0f6203028ee03caa5c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243261
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-05-02 16:41:00 +00:00
Danny Tuppeny b7facb36d2 [analysis_server] Record more time in LSP completions
+ add a simple page to render the timings in server diagnostics pages.

Change-Id: Ie8537cd38166677967ebe461b91334259b8883ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243322
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-05-02 15:50:50 +00:00
Paul Berry 8566dbeb57 Fix spelling
Change-Id: I831388f23f907781b13c6026a8bcfae9fbcc7e18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243001
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-05-02 14:32:40 +00:00
Alexander Markov 0a2d611d39 [vm] Verify that frame size doesn't change between awaits (in AOT mode)
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: I05e1a55070d77fea4402a9db56fca5b3be7207b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243042
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-05-02 14:15:51 +00:00
Clement Skau 81f6cc144e [infra] Error, don't crash setup_toolchain.py
In case the environment is incorrectly set on Windows (e.g.
GYP_MSVS_OVERRIDE_PATH pointing to a non-existing path), the
setup_toolchain.py script may raise an exception.

The script attempts to run a subprocess to gather the environment
variables. But it does not check that the process actually
succeeded.
In case the process fails the environment data will be invalid and
the script will ultimately raise an exception.

This change adds a check for the process failing, and gracefully
warns and exits the script instead.

TEST=Manual build on Windows.
Change-Id: I3624bdf98e0ebe48b403825a90ce2e86c2ed8008
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242860
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2022-05-02 13:53:00 +00:00
Ben Konyi b1e453e069 [ Timeline ] Fix use-after-free error at shutdown when using endless timeline recorder
Timeline::Clear() results in the linked list of events being destroyed
when using the endless timeline recorder. This call was not protected by
RecorderLock::WaitForShutdown() and could result in an event being
allocated after the recorder's list of events had been destroyed.

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

TEST=CQ

Change-Id: I7e3de2bc99535a560321159ded70aef3e8686526
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243140
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2022-05-02 12:51:20 +00:00
Jonas Termansen 26c6550149 Roll benchmarks-internal 076df10d9b77..599aa474a03c
4e10eed661dceb7f21b3880bfd82fd3637e212b4 https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/2822
56bab6e5078aac7116f9c6278a94667758a3154f https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/2441
faa399c61bec4c51c9b219e510133d488c0dd747 https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/2440
599aa474a03c37be146f82dfbad85f34f25ffa47 https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/3140

R=athom@google.com, sra@google.com

Change-Id: I0275fc37ca3fdcbd177f747042d6c113b42a8d7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243260
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2022-05-02 12:48:39 +00:00
William Hesse 55082e9cd7 [benchmarks] Follow-up to "Roll benchmark_harness"
The dart2/Isolate benchmark restricts the view of benchmark_harness
with a "show" clause. Removed it, and fixed the benchmark.

Change-Id: I99a4bdf00b88a3a69d8e6db1c0fa46dd85cc4aab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243264
Auto-Submit: William Hesse <whesse@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2022-05-02 12:26:41 +00:00
Daco Harkes eeb8b3a343 [vm/doc] Add examples to WeakReference and NativeFinalizer take 2
Change-Id: Iabafdcc45052bf76f4d13e32566149efd8f71adf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243263
Commit-Queue: Michael Thomsen <mit@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2022-05-02 12:16:39 +00:00
Daco Harkes 8c390e55d5 [vm/ffi] Improve Allocator documentation
Users are getting confused by `allocate` and `call` in the `Allocator`s.

This CL clarifies the behavior by extending the documentation.

Unfortunately, we cannot expose the actual implementation of `call`. All
calls to `sizeOf<T>()` must have `T` as compile-time constants. So,
instead of `call` having a body in Dart, all call-sites get the behavior
inlined  (`x.call<Int32>(3)` is transformed to
`x.allocate<Int32>(sizeOf<Int32>() * 3)`).

Change-Id: Ife169095d1648e9a353f3a4b75c9aff954bc04a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242800
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2022-05-02 12:13:19 +00:00
Johnni Winther 7ab89309fb [cfe] Handle nullable expressions in implicit tearoff
This might be a compile-time error but it should at least not create
an Instantiation on a potentially nullable expression.

In response to https://github.com/dart-lang/sdk/issues/48323

Change-Id: I6682ddbb8db82623ac7bf4ecf37f8535377f4ca0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242869
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-05-02 11:58:19 +00:00
Daco Harkes 9dfeb36c96 [vm/doc] Add examples to WeakReference and NativeFinalizer
Add an example to `WeakReference` and `NativeFinalizer`. `Finalizer`
already contained an example.

Cross-link between `Finalizer` and `NativeFinalizer`.

Make the examples pass all the checks and enable syntax highlight in
VS Code again (https://github.com/dart-lang/sdk/issues/48926).

Change-Id: I54cc213fa3bbe7bf8f872ccfee9770fb36b96ab4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242873
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-05-02 10:36:09 +00:00
Joshua Litt b0f7dea9d9 [dart2wasm] Pass NnbdMode.Strong to CFE.
Change-Id: I27b6d5708f22cb89474a0a262cc0c4404f57ec50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243043
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2022-05-02 10:26:13 +00:00
Chloe Stefantsova 9d0da22184 [cfe] Report types after construtor name in redirecting targets
Closes https://github.com/dart-lang/sdk/issues/41842

Change-Id: I396067e955c9bad610af6c3690cfaa58659824bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242867
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-05-02 09:33:10 +00:00
Jonas Termansen 630302b710 Roll benchmark_harness and use AsyncBenchmarkBase.
Change-Id: I9089b566082d06cb4947e9720cbafedccc901a60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242872
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-05-02 09:27:49 +00:00
Sam Rawlins 2316c7291c Move existsSync into try/catch, to fix flake
Fixes https://github.com/dart-lang/sdk/issues/48271

Change-Id: Ie1eb59f0f5ba873822d9c277f00482a7d4cf74cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-05-02 03:37:59 +00:00