Made more of the tests consistent in `evaluation_test` (slowly, but surely).
Change-Id: I515c4d6d81cedcc1d8d20080e231ac1e0afb5ec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
I still haven't found yet the fix for this, but might as well add the regression
test for it.
Change-Id: I84821f6615a26faf95e6f7c498aa3670f5d48a54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312701
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This code was older, and was a prototype of NodeTextExpectationsCollector,
but we have it now, it is better, and we can de-duplicate.
Change-Id: I428abb04687f2e3ff5142907a71fcf80e460b830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Not all methods that create FfiTrampoline functions set this, and if not
set, it'll default to a byte from the address of Object::null() due to
Object::InitializeObject, which can break the determinism of the build.
Fixes b/290012924.
TEST=ci
Change-Id: I71ee2eb937b288ec3c6e6a0534e9d870511cf968
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312266
Commit-Queue: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
- Increment index to avoid infinite loop when the first named elements
in the two record types are equivalent.
- Add some test cases for record types.
Fixes: https://github.com/dart-lang/sdk/issues/52817
Change-Id: Ifbf3505c74a1f130c9c90ddbb6b1d96d9641e51e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311929
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
"[dart:html] Move NullWindowException to implementation"
This is a revert of bd3e6fa1a3 and
2b250992f9.
This adds some small code change to avoid a null-assertion being emitted
that would lead to a browser SecurityError.
CoreLibraryReviewExempt: Reland.
Change-Id: Iab52bb728b14fd0b2378b8923b0e1ea8ea930b12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311922
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
We can use ElementPrinter now for printing elements as references.
Change-Id: Ie75dc96940cf3a1e60f87e34801494f55145901f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312350
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Allows for use of new language features.
Change-Id: Ic66cb6d2e8bfbf5ff505cc72c0a23deb32026bbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312601
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
This fixes a bug where we'd produce the wrong absolute path for stack frames that had absolute paths (because `package:stack_trace` uses `path.absolute()` on them).
It also adds support for making stack frames in printed stack traces faded if they are not part of the users own code. This is something the legacy DAPs did. I've also made it possible to perform this stack parsing on non-error events because I'd like to use it on Flutter structured errors (again, something we supported in legacy adapters and was missing here).
Fixes https://github.com/Dart-Code/Dart-Code/issues/4573,
Change-Id: I6c1c3ab69915eca9a1eeef5dcba7f1eb558086de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311842
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This currently only allows "textDocument/hover". Handlers may need some tweaks to remove any dependencies on LspAnalysisServer before they can be enabled.
Capabilities and config are hard-coded to a very basic set (which I suspect will expand as new handlers are added). Reverse requests and notifications are not currently supported (I suspect these will be added when there are more concrete use cases for them because they may need to be conditional based on real client capabilities/needs).
Change-Id: I8a096f9530ad1518ac5ee876aea2560d269a27ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312303
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The goal here is to ensure tests can't accidentally check only a subset of edits made during the command execution.
Not all tests have been migrated (only refactorings and a few that happened to use some of the same methods for verification).
Change-Id: I5589e8e667e957aee3ea55f741b1b49a3859d6bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312304
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
The VM has two parts related to TSAN: compiler & runtime.
So far both parts used self-detection whether running with TSAN. This
implies that if AOT runtime runs under TSAN that the AOT compiler then
also has to run under TSAN (which is slow).
We separate the two by making the compiler use
`TARGET_USES_THREAD_SANITIZER`. It will be auto-detected by-default
except when `DART_PRECOPMILER` is set. In the precompiler case we
require the build rules to pass in whether the target runs under
TSAN or not.
Issue b/287638965
TEST=ci
Change-Id: Ib333a8a69ed2d7bdca7596014a0d25b103af25b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312480
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
The CFE may return super-bounded types (types that are a strict
supertype of the rare type) for certain type positions like the right
hand sides of `is` and `as` checks, so we can't assume that all types
involving a given class is a subtype of its rare type. Note that this is
only for uses that do not involve instantiation, as all instances of a
class must have runtime types that are a subtype of its rare type.
Keeping this in mind, here are the changes being made in this CL.
-----
In the flow graph builder when producting unoptimized code, we
previously assumed that if the checked type is not equal to the rare
type, then the code can't use _simpleInstanceOf, which only performs
class ID checks. However, if the checked type is a supertype of the
rare type, we can, because any instance is guaranteed to be a subtype of
the checked type.
Note that this didn't cause incorrect behavior, just more work than
needed in some cases.
-----
In the generation of optimized type testing stubs, we assumed that the
null type argument vector (TAV) is a possible instance TAV for any
instance. However, if the rare type for a class has a non-null TAV, then
no instance of that class can have a null TAV and we can skip the null
check. (We keep it in the DEBUG case, but just to immediately trigger
a breakpoint if seen.)
Again, no incorrect behavior caused here previously, just an unnecessary
check that we now remove in some cases.
------
Also when generating optimized type testing stubs, when checking for the
null TAV prior to instance type argument checks, the code assumed that
it was possible to have to check type arguments if the checked type was
a super type of the rare type for the instance's class. However, that's
backwards: if the checked type is a super type, then the runtime type of
any instance of the class is guaranteed to be a subtype and we shouldn't
be checking type arguments at all.
Thus, add an ASSERT that checks this, and instead only generate the code
that goes to the runtime if the null TAV is seen, as the runtime type of
the instance is the rare type and the rare type is guaranteed to not be
a subtype of the checked type.
Again, the previous version of this wouldn't have caused incorrect
behavior either, because the VM should never generate type arguments
checking in the type testing stub if the checked type is a supertype of
the class's rare type. Thus, that branch in the code generation was
just dead code.
-----
TEST=vm/cc/TTS, ci (especially DEBUG bots)
Issue: https://github.com/dart-lang/sdk/issues/52848
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-linux-debug-x64-try
Change-Id: I86d159693d6218f88dd1f04dd34cba702744b4d2
Fixed: 52848
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312500
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
The issue here was that isInMask does not hold inversely. The key is that we want to verify which refinements to skip, therefore we want to calculate *in*valid refinements. We want to skip refines where the new type is a Union AND the old tpye is a supertype of the new type. after.isInMask(before) gives us that but !before.isInMask(after) does not.
I've renamed isValidRefinement to isInvalidRefinement to more accurately capture this distinction.
Change-Id: I0d99479357a140095a5d0dfb7e2f987556097891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312160
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Add ClassAugmentationElementImpl, no any tests yet because it
required parsing, AST, etc. And it is also not ready yet.
Change-Id: I601141545e9bf0638771f28bb9498be9de664659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312345
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
These are intended to be applied by annotating a library directive.
Note that some parameter types had to be widened since `Library` is not a subtype of `Declaration`. Ultimately I think that is fine though.
Bug:https://github.com/dart-lang/language/issues/2839
Change-Id: Ia1311c8aea729f2bd8b76173ce4c7595a6a37a42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312140
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
I started initially with the idea to move 'mixinInferenceCallback'
to `ClassElementImpl`, but then realized that we do it for enums too.
So, it should stay in `InterfaceElementImpl`.
I left with code that I think slightly modernized, so decided to
send it for review.
Change-Id: Ib990392dc4985a71ffba1f4080237872d9a65ad2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312521
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Previously, the FFI transformer could produce is checks where the
type to check against was Pointer<dynamic>. However, given that
the Pointer class is defined as:
abstract class Pointer<X extends NativeType> ...
the instantiated to bounds version of its type is Pointer<NativeType>.
Pointer<dynamic> is not a subtype of Pointer<NativeType>, and thus is an
invalid instantiation, but the only place this type could occur was as
the right hand side of an is check.
Before 7cc005ea1, Class::RareType() returned the class instantiated with
the null (all-dynamic) type arguments vector. Among other things, this
"rare" type was compared to the right-hand side of is checks and, if it
matched, performed a simple (cid-only) check of the instance type
arguments in unoptimized code.
Afterwards, Class::RareType() returns the class instantiated with a type
arguments vector where each type parameter is instantiated to bounds, so
now the "rare" type check fails and it falls back to the full check of
the instance type arguments, which causes a ~25% regression in some
unoptimized benchmarks.
This CL fixes the generation of those is checks in the FFI transformer
to use the instantiated to bounds version of the Pointer type instead.
TEST=pkg/front_end/test
Issue: https://github.com/dart-lang/sdk/issues/52843
Issue: https://github.com/dart-lang/sdk/issues/52848
Cq-Include-Trybots: luci.dart.try:vm-ffi-qemu-linux-release-riscv64-try,vm-ffi-qemu-linux-release-arm-try,vm-aot-linux-debug-x64-try,vm-linux-debug-x64-try
Change-Id: Ic9ac6d75ba2743e233065444fad13ab098094349
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312400
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
OSError has a destructor so we need to be careful when
using it with Dart_ThrowException which does not
invoke destructors.
Fixes https://github.com/dart-lang/sdk/issues/52816
TEST=standalone/regress_52715_test with ASAN
R=sstrickl@google.com
Cq-Include-Trybots: luci.dart.try:vm-aot-asan-linux-release-x64-try
Fixed: 52816
Change-Id: I8933c1ae41991586571bc76c35ec7dfc28bab7f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312301
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
The iterable is used for the `keys` and `values` of `LinkedHashMap`.
The original code remembered the internal data list and used-count
when the iterable was created, and if the iterable was modified
between creating and iterating, the iterated values would not match
the map.
The solution is to not cache those values, and read them from the
hash table when creting the `Iterator` instead.
Fixes#48282
Tested: Added regression test to corelib/map_test
Bug: https://dartbug.com/48282
Change-Id: I79310615e7090556e6f45b0d7f297755951ef046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312263
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
It's not supported, as it would prevent the value from being
garbage collected, defeating the purpose of Finalizer.
Not sure if an exception is worth it, so added the assert
as suggested in the bug tracker.
TEST=vm/dart{,_2}/finalizer/finalizer_attach_checks_token_test
Bug: #52731
Change-Id: Id7b457ca1a95e71c1a43d2d2c8569c35659952b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311020
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>