Commit graph

92643 commits

Author SHA1 Message Date
Ryan Macnak 4949f6185e [vm, gc] The GC cares about immediate-ness not Smi-ness.
TEST=ci
Change-Id: Ib7bae6df6becf0ed696a4c00257cedaf46f750aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311148
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-27 19:47:04 +00:00
Alexander Markov dc30f815f1 [vm] Inline local functions declared in outer functions
Previously, inliner was able to inline closure calls only when closure
was allocated in the current function (or in a function which was
inlined so far). This is not true for local functions declared in outer
functions (they are allocated at declaration site).

Now, when calling local functions, target of closure call is always
known regardless of where the function is declared, so calls to local
functions can be inlined.

TEST=runtime/tests/vm/dart/inline_local_functions_il_test.dart
Fixes https://github.com/dart-lang/sdk/issues/52695
Fixes https://github.com/dart-lang/sdk/issues/15558

Change-Id: I0e51dbaf63a6d4427bff366b40414ca5fac3d418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311465
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-06-27 19:42:15 +00:00
Nate Bosch 8debcecb85 Mention that IOSink truncates List<int> to bytes
Closes #31670

In `add` and `addStream` mention that int values which are too large are
truncated to bytes.

R=lrn@google.com

Change-Id: Idf276fc65592e21766659e9d89dd687c441b7357
CoreLibraryReviewExempt: Doc changes only.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310768
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2023-06-27 19:39:01 +00:00
Nate Bosch db585cef2b Add a note about training run for JIT snapshot
Closes #50615

R=bkonyi@google.com

Change-Id: I488c9f232ab5b0138d25a66006b8f69a05ea9c05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311144
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2023-06-27 19:26:38 +00:00
Nate Biggs 6378357ef4 [dart2js] Fix failing web/deferred_fail_and_retry_test on d8 platform.
'document.body' is not defined on the d8 platform but 'document' is so this was throwing.

Change-Id: I6e4049d86beedf4dbadee466fa581e4d3426df41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-06-27 18:25:30 +00:00
Nate Biggs d9b676b0be [dart2js] Add retry mechanism to deferred loading when file fails to register as loaded.
In order to have the browser send a new request for each retry (each new appended script tag), a query token must be appended to the URI. We don't include any extra tokens on the initial request.

Change-Id: I846660894c16345a441193cd9c7b4784364a3c54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-06-27 18:18:43 +00:00
Devon Carew 9216f830c6 [deps] rev package:lints to the latest; address lints
Change-Id: I64032a39c589c291297decade18f6a46c08f9c5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310966
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-06-27 17:03:37 +00:00
Tess Strickland 3a9c1e6d6d [vm] Remove extra DEBUG-only checking in SubtypeNTestCache.
These checks convert what would likely be a segfault into a breakpoint
instead, but they're heavyweight enough on certain tests to cause
timeouts. Remove them as issues here are easily debugged without them.

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

TEST=vm/dart/regress_48523 on debug reload bots

Change-Id: Icf9ea6191eb82c254d9a01fbc9f8ba6255602084
Cq-Include-Trybots: luci.dart.try:vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311621
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-06-27 15:36:38 +00:00
Jens Johansen b2756f3aae [CFE] Tool for benchmarking adjacent revisions
E.g. if asking the tool to figure out any performance changes to
revision 5222bfd90c it will checkout 5222bfd90c and 2037563b94
(the previous commit), make aot-snapshots for both and run both on
the same (specified) target.

Change-Id: Ief56843326343ebaa681df596162d1d08457a8f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311602
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-06-27 14:58:03 +00:00
Danny Tuppeny 4d1b418230 [dds/dap] Fix breakpoint resolution races when there are multiple isolates
When there are multiple isolates, we may get breakpoint responses/events like this:

- Request/Response to add breakpoint to Isolate 1
- Request/Response to add breakpoint to Isolate 2
- BreakpointAdded for Isolate 1
- BreakpointResolved for Isolate 1
- BreakpointAdded for Isolate 2

Because Isolate 2 did not load the script, the last breakpoint was never resolved. However because the breakpoint ID matched, we would forward this event to the client and un-resolve the previously resolved breakpoint. This would result in odd behaviour in VS Code.

Additionally, the VM may return the same BM breakpoint ID for what the client thinks are two breakpoints (they are on different lines, but resolve to the same location) so when we get a resolved breakpoint, we need to handle both:

- Client breakpoints that have already been transmitted
- Future client breakpoints that may resolve to this same VM breakpoint

The previous code assumed that a BreakpointResolved event could be handled just once. Either for an existing breakpoint, or a future one.

This change swaps from storing queued events to storing the resolution information for each breakpoint, and it does this even if there was an existing breakpoint (in case the breakpoint is reused in future).

Fixes at least some of https://github.com/Dart-Code/Dart-Code/issues/4598

Change-Id: I53b92debfaa0c8f538dc8d67966854bb89634708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311480
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-27 14:54:10 +00:00
Ömer Sinan Ağacan f041dd4af4 [dart2wasm] Simplify a list intrinsic
Change-Id: I769d33ac838a09350427dcdc14e3c2a6daf37cc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311381
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-06-27 14:50:00 +00:00
Danny Tuppeny 06ade88478 [dds/dap] Update test to not set breakpoints on invalid lines
Fixes https://github.com/dart-lang/sdk/issues/51928.

Change-Id: Ifdffd1a90fa8d9a07f34742874064b2192d0005c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310880
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-27 14:46:05 +00:00
Tess Strickland a721944709 [gardening] Add LibTest/core/List/List_all_t02 to skipped slow tests.
It's been skirting the Pass/Timeout border for a while now, but has
finally become consistently Timeout.

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

Change-Id: I922fbb55b5a48f57f8071597e8082a12a0883331
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311640
Commit-Queue: Tess Strickland <sstrickl@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-06-27 14:16:40 +00:00
Brian Wilkerson 45572cf7dd Pull in a new version of unified_analytics and update server
Change-Id: I7f63b55fc6a74f2adfc97f00950ca0516bae68ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310965
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-27 13:35:08 +00:00
Slava Egorov 758727dd12 [vm] Rename tests causal_stacks -> awaiter_stacks and improve harness.
The main difference from the previous harness is that it
allows auto updating the expectations instead of
maintaining them manually.

This relands 0c1b2722ed with
changes to harness which fix issues on Windows.

Note: some amount of AOT failures are expected and should just
be approved. They will be fixed with the last CL in the series.

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-win-release-x64-try
Change-Id: I7ae84769ed54bc447ebf71acc68ba9d0b6717bac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311604
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Auto-Submit: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-27 11:50:32 +00:00
Slava Egorov 630482342f [infra] Fix goma detection on Windows
It was looking for gomacc in .cipd_bin but it should have
been looking for gomacc.exe

Change-Id: Idec9eb956513ad39a2d0b0b51aa39da063c75e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311601
Auto-Submit: Slava Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2023-06-27 10:31:50 +00:00
Tess Strickland 516f238aa6 Revert "[vm] Rename tests causal_stacks -> awaiter_stacks and improve harness."
This reverts commit 0c1b2722ed.

Reason for revert: Failures on AOT (stack expectations unmet) and Windows (parse errors due to Windows paths) trybots.

Original change's description:
> [vm] Rename tests causal_stacks -> awaiter_stacks and improve harness.
>
> The main difference from the previous harness is that it
> allows auto updating the expectations instead of
> maintaining them manually.
>
> TEST=ci
>
> Change-Id: I80e303d3ecbcc834ac94fa089cabe4f8834cc661
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311400
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Slava Egorov <vegorov@google.com>

Change-Id: I7311bf08403f4167f88f6204fde1a6fdee353f7d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311600
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-06-27 09:02:28 +00:00
Tess Strickland 1df39e243a [gardening] Marking test that creates several snapshots slow on TSAN.
Change-Id: Iba88e9807a7d58d17fe6b2cf103d0f18fe7dbef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311580
Auto-Submit: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-06-27 08:04:31 +00:00
Vyacheslav Egorov 0c1b2722ed [vm] Rename tests causal_stacks -> awaiter_stacks and improve harness.
The main difference from the previous harness is that it
allows auto updating the expectations instead of
maintaining them manually.

TEST=ci

Change-Id: I80e303d3ecbcc834ac94fa089cabe4f8834cc661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311400
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-27 07:47:39 +00:00
Vyacheslav Egorov 8d5dbbdf69 [vm/debugger] Rename "causal" to "awaiter" internally
The name is more accurately reflects what this stack trace
contains: despite what causal implies it does *not* actually
reflect the stack which initiated the async operation. Instead
it contains the chain of listeners which will run when
the async operation completes - its awaiters.

TEST=ci

Change-Id: Ie7309c9b1c39246e0fd4c14f7b9c515bcdfbbe10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311384
Reviewed-by: Derek Xu <derekx@google.com>
2023-06-27 07:47:39 +00:00
Vyacheslav Egorov 6e46d4f896 [vm/debugger] Cleanup HandleSteppingRequest
No need to pass parameter explicitly because it is always
equal to the field.

TEST=ci

Change-Id: I04d86786d5278ad4ab4ce6c67e61b1fc94f692d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311383
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-27 07:18:50 +00:00
Vyacheslav Egorov ec15052c7f [vm] Remove old async_debugger flag.
Effectively it is true for all environments where
debugger is actually present.

TEST=service tests

Change-Id: I0592e83004271ca32c107f4347f7bd82172b0a62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310622
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-27 07:18:50 +00:00
Ludi Zhan cdd1163b27 [analyzer] Address coding style comments for visibleOutsideTemplate change
Addressing additional comments got from:
https://dart-review.googlesource.com/c/sdk/+/304825?tab=comments

Change-Id: I973c2c33a9a850122542389fc65d66c6fb810deb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311300
Auto-Submit: Ludi Zhan <ludizhan@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-27 03:53:37 +00:00
Ryan Macnak bbeed85932 [vm, gc] Add some documentation about weakness.
Change-Id: I10ca59a29e3ac951b3e7830e6b90a36a6ac55a75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311524
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-06-26 23:14:26 +00:00
Ryan Macnak 95bd742546 [vm, gc] Fix missing longjump scope when parallel scavenge processes weak properties.
TEST=ci
Change-Id: I55661f92ec942a1adf36cff1cd020958b531bd8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311522
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-26 23:12:57 +00:00
Srujan Gaddam 14a3051552 [dart:html] Move NullWindowException to implementation
Window.open may open a null window in more cases than expected.
Users may not care that the window they get back is invalid if
they never use it. Therefore, this CL moves the exception to
the implementation of the returned window in order to reduce
noise, but still give a way for users to recover if they wish
to do so.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I005cf80630cfb4db2f5ec2012cfcd0161ad10ff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311460
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-06-26 22:58:08 +00:00
Anna Gringauze d2f5b3bfab [ddc] Add --canary flag to expression compiler worker
Closes: https://github.com/dart-lang/sdk/issues/52776
Change-Id: I639fe7fbadf3e938cc686aa8dbd2320a4cc7af7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311151
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-06-26 22:55:07 +00:00
Vyacheslav Egorov 4a6f9328a2 [vm/debugger] Simplify async breakpoints implementation
We no longer rewrite suspendable function into closures nested
inside the original function, so the whole synthetic async breakpoint
machinery is not needed.

Refactor `Breakpoint` class to make one-shot and per-closure
separate properties of breakpoint, which allows creating
one-shot-per-closure breakpoints.

TEST=existing service tests

Change-Id: I208afe13f36efa40f5746e44867bd24684cf5f03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310601
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-26 22:45:10 +00:00
Jake Macdonald d1ecf01f71 Cache remote objects by ID, only send IDs for already sent objects
This is done through a synchronized cache between the server and client. When serializing a remote instance, if the server has already serialized that object then it will only send the ID in the future.

These caches currently only live as long as a single macro application in a given phase, but could live longer in the future. They do need to get reliably cleared out to avoid memory leaks though, and the shorter lifetime is easier to manage consistently.

This also allowed me to remove the specialized server/client modes (clients would always only send back IDs previously).

Change-Id: I4e8a102403153829d66b0ac379636f5a95a70cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311420
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2023-06-26 22:36:37 +00:00
Vyacheslav Egorov 401a11d309 [vm] Remove obsolete code from inliner.
Described case no longer happens: either function
is marked as not-inlinable from the very beginning
or graph construction bails out entirely.

TEST=ci

Change-Id: I7e345dc948370050bd6e03a327f1fd1054fc8240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311401
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-26 21:55:40 +00:00
Stephen Adams eb2b7c6642 [js_runtime] Avoid reparsing in Uri.base
Repeated calls to Uri.base result in repeated calls to Uri.parse.
Reparsing is necessary only when the location changes.

Bug: b/281079996
Change-Id: I091a6f1ac2f454643e95bbfddf59b24172ef7da5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311155
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-06-26 21:32:48 +00:00
Nate Biggs fe73f0cf5d [dart2js] Reduce size of Dart2JS deferred loading event logs.
- Only include the script tag src if it differs from the previous log entry.
- Use single letters for each event field's key.
- Fix some typos.
- Remove 'uri' from download event as it can be inferred from script tag src and part file name.

Change-Id: Ib7916ea5e92720a10c7e1e1cab2e535fae2bbf49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-06-26 20:43:32 +00:00
Vyacheslav Egorov 1a582a6714 [infra] Fix update_line_numbers.dart script
TEST=manually tested

Change-Id: If2132e5610e8965f291b776bcc5cf5bc87a5001f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311341
Auto-Submit: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-06-26 20:01:31 +00:00
Parker Lougheed 5200d086d1 [pkg/analyzer] Add class to diagnostic messages for special highlighting
Will be used on dart.dev for customizing the highlight syntax in code blocks to be red underlines rather than yellow highlighting.

Related: https://github.com/dart-lang/site-www/pull/5006
Change-Id: Ib33ee8f6f7307efb649b627dfd9a5d90187cca1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-26 19:58:56 +00:00
Devon Carew 51ebea24ee [deps] rev dartdoc, ecosystem, leak_tracker, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (4757339..e04a6b3):
  e04a6b30  2023-06-23  Sam Rawlins  Remove grind_test; not important (#3453)

ecosystem (a2dac18..b1056e6):
  b1056e6  2023-06-13  Nate Bosch  Allow prerelease suffix in CHANGELOG versions (#112)

leak_tracker (2149e5c..c75b0a7):
  c75b0a7  2023-06-23  Yii Chen  make LeakTrackingConfiguration to const (#83)

webdev (6fe17fe..8360d50):
  8360d50f  2023-06-22  Elliott Brooks  Shard MV2 and MV3 extension tests (#2153)
  12e8aa2d  2023-06-22  Elliott Brooks  Reset Webdev to 3.0.6-wip (#2154)
  8ca3a891  2023-06-22  Elliott Brooks  Fix the Puppeteer tests for the Debug Extension (#2152)

Change-Id: I8f9ec79d99f375898b3ecd3330512fd39579f37b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311462
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-26 19:06:24 +00:00
Alexander Aprelev 238ce4685a [vm/debugger] Update service_2/* tests with debugger() expectations.
Follow-up to bbdf87d277
TEST=ci

Bug: https://github.com/dart-lang/sdk/issues/52785
Change-Id: Ia5c83743efe6222396f63d5df77ebb4e39cbd768
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311440
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2023-06-26 18:46:46 +00:00
Joshua Litt 64290e1052 [js] Add JSStringImpl box for JSString.
Change-Id: I63a2ecdf3fd2331f91632ae5b2cc51813cd44c66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307961
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-06-26 17:15:24 +00:00
Konstantin Shcheglov 76eb70963c Use 'UnitResult' type parameter instead of 'T' in CorrectionProducerContext.
Change-Id: I24c7f9450f6ad84de6e67a2fb2f70d6dea7983e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311158
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2023-06-26 16:05:14 +00:00
Tess Strickland 4aebac3d28 [vm] Verify STC input count matches stub expected input count in DEBUG.
If these checks fail, then a `SubtypeNTestCache` stub has been called
with a `SubtypeTestCache` that uses a different number of inputs
than the stub expects, which could lead to unexpected false negatives
or false positives, so catch it early.

TEST=vm/cc/TTS, ci

Change-Id: Ia9c48aad4c35872cad32b7b6f3eead3ee9e59680
Cq-Include-Trybots: luci.dart.try:vm-mac-debug-arm64-try,vm-linux-debug-x64c-try,vm-linux-debug-x64-try,vm-linux-debug-simriscv64-try,vm-linux-debug-ia32-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311380
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-06-26 11:54:00 +00:00
Vyacheslav Egorov f1cd87e58e [infra] Tool for updating LINE_* in service tests.
Some of the service tests contain LINE_*
constants which match line numbers of `// LINE_*`
comments in the body of the test. Previously
we would manually maintain these constants,
which is rather tedious.

This CL adds a scripts for updating the
constants automatically.

TEST=manually tested the tool

Change-Id: I3a5cdbd4cae2ab6eaec51c9bb5f48b351bfbbd7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310602
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-26 10:48:30 +00:00
Tess Strickland 719c0a91dc [vm] Remove UntaggedField::type_test_cache_.
This field is now only used when reloading to check assignability
during `ProgramReloadContext::ReloadPhase4CommitFinish()` (via
`PostCommit()` -> `InvalidateWorld()` -> `InvalidateFields`).

However, the method `DeoptimizeDependentCode()` is called near the
start of the actual reloading process in `Reload` prior to the
commit/rollback phases. This calls `DeoptimizeTypeTestingStubs()`, which
walks the heap and resets the contents of all `SubtypeTestCaches`
(`STC`s).

That means that the `STC` information isn't actually kept between
different reloads, so all this does is cause a number of `STC` objects
to be allocated during reload whose backing arrays are not used
post-reload for anything and so are unnecessary garbage.

That, and the creation of the `STC`s during `InvalidateFields` creates
all-input `STC`s, as they don't just check assignability to a given field type but also for checking elements of `RecordTypes`. That means
the per-field `STC`s contain way more information needed to check for
valid assignments to the corresponding field type, even if the `STC`
was used between reloads.

This CL removes the unnecessary field and changes `InvalidateFields`
so that the `STC`s used during reload are instead lazily allocated once
per `FieldInvalidator` object and now both the `STC` and its backing
array are now garbage post-field invalidation.

TEST=reload ci

Change-Id: I3ffa199551ba69f0afd4eba6303c6ff73d7473a3
Cq-Include-Trybots: luci.dart.try:vm-reload-linux-debug-x64-try,vm-reload-linux-release-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-reload-rollback-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-product-x64-try,vm-aot-linux-release-x64-try,vm-linux-release-x64-try,vm-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311220
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-06-26 09:27:59 +00:00
Tess Strickland 06e099884b [vm] Adjust default value of FLAG_max_subtype_cache_entries flag.
The round default value used in f7e26c50 means that we allocate
a new backing array shortly before hitting the cap, and once we
hit the cap the max load factor for the new backing array is only ~49%.

Instead, given a desired maximum, calculate an appropriate default
value that ensures the cap is only hit shortly before the array reaches
the max load factor that causes reallocation.

TEST=ci

Change-Id: I4c4fc3f5726aea3b260cf288cd00f886c2a1bd96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-26 09:24:57 +00:00
Tess Strickland cefda02d24 [vm] Specify default capture mode for closures used in stub generation.
Without this, when building on Windows using MSVC, we get `error C3493:
'kCacheArrayReg' cannot be implicitly captured because no default
capture mode has been specified`.

TEST=vm-msvc-windows builds

Change-Id: Iebc443ce887dd32b186d51695cbc0bfd95d09f35
Cq-Include-Trybots: luci.dart.try:vm-msvc-windows-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311320
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-06-26 08:40:50 +00:00
Martin Kustermann bee46896d8 [cfe] Use Uint8List instead of List<int> for representing bytes
Seems to reduce instruction count by 4% (when using AOT-compiled
pkg/vm/bin/gen_kernel.dart to compile pkg/compiler/lib/src/dart2js.)

Change-Id: Ica88716bd9c06ea446258cd3eb4f26ca1890805b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311121
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2023-06-26 08:07:13 +00:00
Sergey G. Grekhov 6dd135aacc [co19] Roll co19 to 3fdaddfde59604e21dcf66ab353fe867c7931133
2023-06-23 sgrekhov22@gmail.com Fixes dart-lang/co19#2080. Fix typo in correct_member_overrides_A03_t14.dart (dart-lang/co19#2097)
2023-06-22 sgrekhov22@gmail.com dart-lang/co19#2080. Move `Correct member overrides` to Superinterfaces folder (dart-lang/co19#2096)
2023-06-22 sgrekhov22@gmail.com Fixes dart-lang/co19#2083. Expect `unspecified` error in const_collections_A08_t01.dart (dart-lang/co19#2084)
2023-06-22 sgrekhov22@gmail.com dart-lang/co19#2080. Update assertion texts, add mixin syntax test (dart-lang/co19#2095)
2023-06-22 sgrekhov22@gmail.com dart-lang/co19#2080. Add correct member overrides tests. Part 2. Setters (dart-lang/co19#2093)
2023-06-21 sgrekhov22@gmail.com Fixes dart-lang/co19#2090. Add required final instance variable to a inline class (dart-lang/co19#2091)
2023-06-20 sgrekhov22@gmail.com dart-lang/co19#2080. Add correct member overrides tests. Part 1. (dart-lang/co19#2088)
2023-06-20 sgrekhov22@gmail.com dart-lang/co19#2080. Update assertion texts of overriding tests (dart-lang/co19#2089)
2023-06-15 sgrekhov22@gmail.com dart-lang/co19#1400. Add inline classes members override test (dart-lang/co19#2085)

Change-Id: I4a5a112cb11590b0c15032a65f5b80193a42b27b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311160
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-06-26 07:39:09 +00:00
Konstantin Shcheglov eeecd53fe2 De-duplicate refactoringContext in RefactoringProducer.
Change-Id: Ia1dcbaf301d37d977b22742bf8198c64f7d34159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311159
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-24 17:00:20 +00:00
Konstantin Shcheglov 69c62b1a31 Remove shipped features, and deprecated experiments from tests.
Change-Id: I428906a1d75a0dacedc8a5d5fd805f84ca8e3ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311156
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-24 16:23:28 +00:00
Tess Strickland f7e26c508d [vm] Add support for hash-based caches in SubtypeNTestCache stubs.
This also lowers the threshold for converting from a linear cache
to a hash-based cache from 100 to 30 on non-IA32 architectures.
(IA32 still goes to runtime if there's a hash-based cache.)

For SubtypeTestCache benchmarks above this threshold, we see an
improvement varying from ~50-100% to ~700-800% on all architectures,
from lowest number of checks (50) to highest (1000).

For SubtypeTestCache benchmarks below this threshold, no major
changes are seen: generally <5% improvement or <5% regression per
check at most.

TEST=vm/cc/TTS

Change-Id: I83aa7c085ab5a411e944ec660d6b8eba7a788ee0
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simriscv64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-product-x64-try,vm-aot-linux-release-simarm64-try,vm-aot-linux-release-simarm_x64-try,vm-aot-linux-debug-x64c-try,vm-aot-tsan-linux-release-x64-try,vm-aot-mac-release-arm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-release-ia32-try,vm-linux-debug-x64c-try,vm-linux-debug-x64-try,vm-linux-debug-simriscv64-try,vm-linux-release-simarm64-try,vm-linux-release-simarm-try,vm-mac-release-arm64-try,vm-mac-release-x64-try,vm-tsan-linux-release-x64-try,vm-reload-rollback-linux-release-x64-try,vm-reload-linux-release-x64-try,vm-ffi-qemu-linux-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308941
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-24 12:56:12 +00:00
Nate Bosch a92a1e5064 Use main branch for flutter engine clones
The master branch was renamed to main.

Change-Id: Ib38f3976b497c17e0bda904cb99864e127016272
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311153
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2023-06-23 23:31:36 +00:00
Konstantin Shcheglov b013a40f39 Add isInline to ClassElement.
Change-Id: I80dafc9ef0dc03b8090032a7b7168302a8d6ad66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311150
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-23 22:49:09 +00:00