We have added more examples, and some of them uses the structure of:
````dart
/// ```dart
/// var x = something;
/// ```
/// and then you can also floo the thing
/// ```
/// x.floo(...);
/// ```
````
The following chunks of the same example can now be written as:
````dart
/// ```dart continued
/// x.floo(...);
/// ```
````
Change handling of imports,
and introduce a `top` template different from `none`.
The `none` template gets nothing for free.
The sample must be completely self-contained.
Is triggered by the sample containing a `library` declaration,
because we can't add anything before that.
The `top` template allows top-level declarations,
but does introduce automatic imports and "samples can expect"
code if the sample doesn't contain `import`s.
Is triggered by top-level declarations other than `library`.
Also some restructuring of the code to make this feature easier
to implement.
Change-Id: If2288147face01efad2ad656aa52183cb4c8b3bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221343
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
This CL extracts part of the IncrementalCompiler into subcomponents.
This is part of an effort to make the state and state changes of the
incremental compiler more explicit.
Change-Id: I59cbb30558082f4db392d925bb704d03c31ccb90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221940
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This replaces the previous implementation (and the topological sort of
classes, on which it was based) which was O(|vertices|*|edges|). The new
implementation is O(|vertices|+|edges|).
Change-Id: I4f5f1e63b4c7dd67d6f17c087724c20d4d33bf83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221820
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The results are now updated by the builder, so the builder status
does not need to poll the database for the results to finish processing.
The script is also migrated to null safety.
Change-Id: I7913f7fb0a8eedc074a4b79eb75c1c2813525c17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221780
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
When ABI-specific integers are introduced, their mappings can be
partial. We need to account for this in the marshaller.
This CL refactors the marshaller API to take an char** error return
parameter and changes the return type to a pointer (nullable) rather
than a reference.
Note that with only this CL we can not generate errors yet, because all
native types are still complete.
TEST=runtime/vm/compiler/ffi/native_type_vm_test.cc
TEST=tests/ffi*
Bug: https://github.com/dart-lang/sdk/issues/42816
Change-Id: Id97e73795c357e129e6280e8c5b528d18072c14d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221632
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
In https://dart-review.googlesource.com/c/sdk/+/221360 I requested using
macros for repetitive cases in switch statements.
Turns out that this is harder to read than just the list of cases.
Also, it forces an extra level indentation by the formatter because the
braces cannot be part of case statement, which again makes it harder to
read the code.
TEST=This is just a formatting change.
Change-Id: I0b2d8c6b1e73da371dba215c2e0c1ad28fd0903f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221822
Reviewed-by: Ryan Macnak <rmacnak@google.com>
When ABI-specific integers are introduced, their mappings can be
partial. We need to account for this in the transformation and the code
we generate.
In the transformation, all sizes and offsets become nullable.
In the generated code we add `null` constants and a call to check
whether the value is not-null at runtime.
Note that with only this CL we can not generate nulls yet, because all
size and offset mappings are still complete.
TEST=pkg/front_end/testcases/nnbd/ffi*
TEST=tests/ffi*
Bug: https://github.com/dart-lang/sdk/issues/42563
Change-Id: I80d45f3f52001670bc0679a033f7daa22198d55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221631
Reviewed-by: Ryan Macnak <rmacnak@google.com>
We're going to extend this logic in subsequent CLs, so lets give this
abstraction its own place to live.
TEST=just moving file contents
Change-Id: Ie6b267e77dd3a772bb3bbf0b79b33946ee767b0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221630
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This reverts commit ab0d8dc3b1.
Reason for revert: Speculating this is the cause for hangs in Flutter's `test/integration.shard/timeline_test.dart: Can connect to the timeline without getting ANR from the application`.
Original change's description:
> [vm] Emit timeline events around virtual memory allocation / deallocation.
>
> TEST=ci
> Change-Id: I0b29e2e6f7f530e29af0962f1243d708a1ca2225
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220804
> Reviewed-by: Dan Field <dnfield@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ia8af447babd7291df4be746e8b8010242cbccc63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221861
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Dan Field <dnfield@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
I was pretty confused about what was being compared until this change
was able to highlight that no edits were made.
Bug: https://github.com/dart-lang/sdk/issues/47678
Change-Id: I1d37070437658063d4b84f2fb5f4a33923bf5d92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Sets and gets to late variables count as uncovered even when they are
covered, because they have internal branches that throw exceptions.
These exceptions should not be hit in well formed code, so they
shouldn't count towards coverage totals.
These exceptions are all thrown using static functions on the internal
LateError class, so we can just ignore any calls that target a function
on this class.
Bug: https://github.com/dart-lang/coverage/issues/341
Fixes: https://github.com/dart-lang/coverage/issues/341
Change-Id: I1dfa5d64b7a2030121d84d7aad7c7a1649b900a8
TEST=Added a unit test
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221740
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
This does not fix#42641, but removes a recursion that can make #42641
look different.
Change-Id: Id070cea0eb10501f1750b2719ed710a938170038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221480
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This CL changes the handling of late static fields to be similar to the
handling of late instance fields. That is, if the field does not need a
load guard and has an initializer, the new InitLateStaticField and
InitLateFinalStaticField stubs are used, which directly call the
initializer function instead of going to the runtime. Thus, the only
runtime call left in these cases is when a late final static field is
modified by the initializer function, in which case an appropiate
exception is thrown.
In the case where a late static field might call the initializer
function but no initializer exists, a LateInitializationErrorSlowPath is
generated to be called if the field value is the sentinel, also similar
to the late instance field case.
TEST=Refactoring, so existing tests.
Change-Id: I95887022d8ece1164a8f7c34b77d9de8c53aa898
Bug: https://github.com/dart-lang/sdk/issues/45138
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-ia32-try,vm-kernel-linux-release-x64-try,vm-kernel-nnbd-linux-release-ia32-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-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-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220009
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
TEST=Manual. AFAIK, the cause of this error is the socket receiving a TCP RST from it's peer and, AFAIK, I can't do that from Dart.
Bug: https://github.com/dart-lang/sdk/issues/47766
Change-Id: Ia423ee951b96bdb140c321fbc87b6bd59e39d84d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221222
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
This adds the following commits:
b9edfa5e28
Change-Id: Ia52dd2b6aa797006ddb3e686cfccf4d382dc9355
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221626
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This fixes two issues:
1. When a user navigates into SDK sources using the analyzer (Go-to-Definition) and sets a breakpoint, we map it to a URI that the VM understands
2. When the VM breaks inside an SDK source, we map it back to a local file path (so that the user doesn't end up with two versions of the same file - one downloaded, and one the analyzer sent them to)
Change-Id: Ic1bdbed29196f98e612d81c383ad31ce241446b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221082
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
ReferenceName is used in equivalence testing to match reference
reguardless of whether the reference have associated nodes or
canonical names. The implementation didn't previously account for
fields, getters and setters with the same simple name, and would
wrongfully equate them.
Change-Id: Iacc8e0eb2c5c04a3cf11c3b5104a8f0441cf3ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221621
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This avoids have tracked dill libraries as part of the incremental
compiler state, and avoids the need for public mutable state on the
incremental compiler.
Change-Id: Ia61f22499f619d7ead4eed23d3d1eb24b8caec9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This is a move towards fully encapsulating the state of the incremental
compiler from outside usage.
Change-Id: I1243602aa6c4bcc3e6fbf8450bd8cdf7fa5ad5d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221327
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
The heuristic was introduced in b870dafa4f, but gets in the way of maintaining Slot(extended with field guard information) immutable during compilation.
Existing set of benchmarks doesn't seem to show any reasonable regression with this heuristic removed.
Bug: https://github.com/dart-lang/sdk/issues/47722
Change-Id: Ie94050d96852b7ffef2dc81248cda23e84d41f4b
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221544
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
strict-casts is mostly a drop-in replacement for the deprecated
`implicit-casts: false` option. One big difference, seen in this CL, is that
strict-casts will report a non-Iterable (or non-Stream) in a for-each loop.
Change-Id: Ibc463ae9c870b6a795483c5dea0d2b856e7fd883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221546
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
- DartDev is not available on Android.
- DynamicLibrary.process() is not available on Windows.
Change-Id: I6606159168dd01e0fa0b9bc97b5316641123d42b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-android-release-arm64c-try,vm-ffi-android-release-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-win-release-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-product-x64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-win-debug-x64-try,pkg-win-release-try,dart-sdk-win-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221500
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>