Commit graph

21587 commits

Author SHA1 Message Date
Stephen Adams 5c582f82f0 [dart2js, js_runtime, js_dev_runtime] NaN-safe range checks.
`int` variables can attain NaN values because web int arithmetic
implemented by JavaScript numbers (doubles) is not closed under many
operations. It is possible get NaN using only addition:

    int a = 1, b = -1;
    while (a + a != a) { a += a; b += b; }
    int nan = a + b;

On the VM, a, b and nan are all zero.
On the web, a, b and nan are Infinity, -Infinity and NaN, respectively.

Since NaN can leak into int arithmetic, is it helpful if bounds checks
catch NaN indexes. NaN compares false in any comparison, so a test
of the form

   if (index < 0 || index >= a.length) throw ioore(a, index);

fails to detect a NaN value of `index`.
This is fixed by negating the comparisons, and applying De Morgan's law:

   if (!(index >= 0 && index < a.length)) throw ioore(a, index);

These changes have been applied to JSArray.[], JSArray.[]= and String.[]

For dart2js the change is a little more involved. Primitive indexing is
lowered to code with a HBoundsCheck check instruction. The code generated
for the instruction now uses, e.g. `!(i>=0)` instead of `i<0`.
This leads to a small code size regression.

There is no regression at -O4 since bounds checks are omitted at -O4.

At -O3 (where the regression is largest) the regression is
   0.01% for cm
   0.06% for flutter gallery -- array-heavy diff and layout
   0.21% for Meteor          -- array-heavy code
   0.30% for Box2DOctane     -- array-heavy code

I believe the regression can be largely alleviated by determining if
NaN is impossible at the index check, and if so, reverting to the smaller
code pattern. The analysis could be global, incorporating NaN into the
global abstract value domain, or a much simpler a local dataflow
analysis. Many indexes are loop driven and cannot reach infinity because
they are incremented by a small bump and eventually (even without a loop
guard) the index would stop growing when the increment falls below the
rounding error in O(2^53) iterations.


Change-Id: I23ab1eb779f1d0c9c6655e13d69f65d453db9284
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210321
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-08-27 00:37:56 +00:00
Erik Ernst 9b5db137a9 New test: Testing ambiguity management for explicit instantiations
Change-Id: I3ea0be4032c3f9999239f2ae58514d21df9045d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211281
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-08-26 17:36:19 +00:00
Johnni Winther ce4e7705f2 [cfe] Handle explicit instantiation in implicit creation syntax
Closes #46719
Closes #46887

Change-Id: I4ad0f1bb4ab847a44f749113c6446f62a474143c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211260
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-26 11:59:48 +00:00
Erik Ernst 054ae83903 Add test for constant factory constructor feature, cf. #46984
Change-Id: I750345600d3b47de44c060511be35aea8744eca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211140
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2021-08-26 09:27:31 +00:00
Paul Berry d2b313227d Flow analysis: Pin down initialization behaviors before fixing #1785.
https://github.com/dart-lang/language/issues/1785 has a wide enough
impact that its fix will have to be bundled in with a language version
(i.e. future versions of Dart will have to reproduce the old buggy
behavior for code that's not opted in to the latest language version).
Therefore, we'll have to maintain tests of the behavior both before
and after the fix.  This CL is the first step in that process, adding
tests that validate the current (buggy) behavior.

Bug: https://github.com/dart-lang/language/issues/1785
Change-Id: I78f17999ac1cbc096a312ef977db24654e06a263
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-08-25 20:32:02 +00:00
Johnni Winther b3af778a38 [cfe] Add UnresolvedKind for fine grained unresolved reporting
- including tests for issues 46719 and 46887

Change-Id: I601fcfcb956e059f502cbece29fb2a6a00f68846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-08-25 09:51:54 +00:00
William Hesse 637e14006c Revert "[VM/Runtime] Fix 'File' object leak in async file open operation"
This reverts commit b67f45f955.

Reason for revert: This seems to cause a crash on ARMv7 aot compiled code.

Original change's description:
> [VM/Runtime] Fix 'File' object leak in async file open operation
>
> The 'File' object created in the async file open method is leaked
> if the operation is not completed when the isolate shuts down
> with an unhandled exception.
> This change adds a finalizable state for the 'File' object so that
> the message deletion that happens when ports are closed could run
> the callback to clean up the 'File' object.
>
> TEST=new tests added
>
> Change-Id: I4a3cb28370d27306c795c1914aeb5c18a1d85e2b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210761
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

TBR=aam@google.com,rmacnak@google.com,asiva@google.com

Change-Id: Ie91aadd318ef19a0bb4d7f769c9e876e76d719d8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211021
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2021-08-24 12:49:23 +00:00
Johnni Winther ae4543fcb9 [cfe] Report all compile-time errors found during constant evaluation
Closes #46925

Change-Id: I81e97cae05c39c24b24dae82a222f857d4730ac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210465
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-24 11:42:53 +00:00
Sam Rawlins 419d70afb2 Fix message of RETURN_IN_GENERATOR; stop double reporting.
* This message should only be reported by the parser; the
  error raised in the analyzer was strictly duplicate.
* This message theoretically used to mention "async*" or
  "sync*" depending on the modifier that the function in
  question listed. However, listing one modifier or the
  other is a red herring, and may confuse the user; any
  function declared with one or the other is a "generator",
  and the error applies equally to a "generator" using one
  or the other modifier.

Bug: https://github.com/dart-lang/sdk/issues/43665
Change-Id: I6ef1f5c055473170e7563222f6f0a6c56a4ad5f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210801
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-08-24 01:43:48 +00:00
asiva b67f45f955 [VM/Runtime] Fix 'File' object leak in async file open operation
The 'File' object created in the async file open method is leaked
if the operation is not completed when the isolate shuts down
with an unhandled exception.
This change adds a finalizable state for the 'File' object so that
the message deletion that happens when ports are closed could run
the callback to clean up the 'File' object.

TEST=new tests added

Change-Id: I4a3cb28370d27306c795c1914aeb5c18a1d85e2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210761
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-08-23 20:57:48 +00:00
Sam Rawlins f274c79333 analyzer: Rewrite function tearoff followed by a method call
Today, the parser reads `a<...>.b()` as a constructor call with
explicit type arguments for the class. This could be a method call
on a function tearoff (however unlikely).

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

Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: I16681171a7d99adf3fd080a235fcedc46c5fb1ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210780
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-08-23 18:10:47 +00:00
Dmitry Stefantsov d3c3e92740 [cfe] Add error on misplaced type arguments in constructor tear-offs
Closes #46890.

Bug: https://github.com/dart-lang/sdk/issues/46890
Change-Id: Idf0c4e5ef6380541aaccba9f74755572b2fa9549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210460
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-23 14:36:47 +00:00
Sam Rawlins c86bfe3e2c Correct type of CONSTRUCTOR_TEAROFFS_NOT_ENABLED code
Additionally, sort the UNUSED_RESULT_* codes.

This addresses comments in
https://dart-review.googlesource.com/c/sdk/+/209300

Change-Id: I4d3fd25703f6df59f8ad985352c87406e218b544
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-08-19 22:22:06 +00:00
Konstantin Shcheglov 4d42e73295 Report EXPERIMENT_NOT_ENABLED instead of ANNOTATION_WITH_TYPE_ARGUMENTS.
On one hand this is less precise, OTOH this tells which feature and
the language version it requires.

Change-Id: I1d24a2d7cf2c7b7ca305d5bfc9f094fce0734bc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210644
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-08-19 20:20:26 +00:00
Nicholas Shahan a899525bdc [tests] Add regression tests
Issue: https://github.com/dart-lang/sdk/issues/46867
Change-Id: I7e2912752ac8c48df233f27869599280e2c322fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209853
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-08-17 17:32:52 +00:00
Paul Berry f5a3bce734 Fix scope resolution of metadata on type parameters
Previously, when encountering identifiers in metadata on a class's
type parameter, the analyzer would resolve them using the type
parameter scope, but then fall back on using implicit `this`.  The CFE
would resolve them using the class body scope.  In both cases, the end
result was that the annotation could refer to static class members.

This change brings the behavior of both the analyzer and the CFE in
line with the spec, by preventing the use of implicit `this` in these
annotations, and resolving them in the type parameter scope.

This is not expected to break any code in practice, because
annotations on type parameters are rare, as are annotations referring
to static class members, and the overlap between these two should be
negligibly small.

Fixes https://github.com/dart-lang/language/issues/1790.

Bug: https://github.com/dart-lang/language/issues/1790
Change-Id: Ibe5a421e04a53d29074a8b1509e1390658ed72e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-08-17 15:17:02 +00:00
Alexander Markov cfb057ddca Reland "[vm] Hide internal implementation List types and expose them as List"
This is a reland of 824bec596f

Original change's description:
> [vm] Hide internal implementation List types and expose them as List
>
> When taking a type of an instance with x.runtimeType we can map
> internal classes _List, _ImmutableList and _GrowableList to a
> user-visible List class. This is similar to what we do for
> implementation classes of int, String and Type.
> After that, result of x.runtimeType for built-in lists would be
> compatible with List<T> type literals.
>
> Also, both intrinsic and native implementations of _haveSameRuntimeType
> are updated to agree with new semantic of runtimeType.
>
> TEST=co19/LanguageFeatures/Constructor-tear-offs/type_literal_A01_t01
> TEST=runtime/tests/vm/dart/have_same_runtime_type_test
>
> Fixes https://github.com/dart-lang/sdk/issues/46893
> Issue https://github.com/dart-lang/sdk/issues/46231
>
> Change-Id: Ie24a9f527f66a06118427b7a09e49c03dff93d8e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210066
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Tess Strickland <sstrickl@google.com>

TEST=co19/LanguageFeatures/Constructor-tear-offs/type_literal_A01_t01
TEST=runtime/tests/vm/dart/have_same_runtime_type_test
TEST=lib/mirrors/regress_b196606044_test
Fixes https://github.com/dart-lang/sdk/issues/46893
Issue https://github.com/dart-lang/sdk/issues/46231

Change-Id: I79b587540338808bd73a6554f00a5eed042f4c26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210201
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-08-16 22:52:21 +00:00
Irina Arkhipets 79be5898b4 [co19] LibTests/typed_data tests skipped for dart2js
[co19_2] LibTests/typed_data tests skipped for dart2js

Change-Id: I2e8a93f7991b36367b84678bbfebda36babaf96f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209915
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2021-08-16 08:07:34 +00:00
Ryan Macnak e6b05a7a90 [vm, isolate] Also apply fast copying to an isolate's initial message.
Add missing checks for FFI types disallowed in isolate messages.
Align error messages with the other serializer and test expectations.

TEST=ci
Change-Id: I3813dd8f26e5122524bdf41f9ce6e0785fdd260b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209840
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-08-12 20:25:30 +00:00
Alexander Thomas 1c06d14fce [co19] Skip broken tests also in co19_2
https://github.com/dart-lang/co19/issues/1137

Change-Id: I32e81daed87ad8943023ad923fddd686b3b2362e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209961
Reviewed-by: William Hesse <whesse@google.com>
2021-08-12 10:55:21 +00:00
Erik Ernst cc84bb3e28 Adjust type_parameter_test to expect caller-side check on tearoff
language/covariant/type_parameter_test.dart performed a tearoff which
should incur a run-time error (because the dynamic type of the
tearoff is not a subtype of the static type, so it would be a
soundness violation to pass that value on to the next step of
evaluation).

Change-Id: Ia4ec813606e711cab0bdcc68d24bbac3c9a2d8c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209910
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-08-11 16:37:51 +00:00
Johnni Winther 3befe682e9 [cfe] Fix message offset on unresolved prefix access
Bug: b/195806584
Change-Id: I0d607ceef8d17433df00f5a71cc5b37d6f5c899f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209907
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-11 16:12:01 +00:00
Erik Ernst ef1f4c78db Remove expectation that instantiated local function tearoffs are notEqual
This CL changes the test
language/generic_methods/explicit_instantiated_tearoff_test.dart
such that it no longer expects a generic instantiation of a local
function tearoff to be notEqual to another function object which is
the same local function, same enclosing invocation, same type
arguments.

The rationale is that we should not preclude an optimization whereby
these function objects are canonicalized (at run time, or if they
can be lifted to the top level even possibly at compile time).

Change-Id: I5845a19ce9ccf931c4d3abe4ab619f3ed2a2fbc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209860
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-08-11 16:07:51 +00:00
Alexander Thomas ef850dbdec [co19] Skip flawed tests on latest co19 roll
The top_level_main tests starts themselves via
Platform.resolvedExecutable which causes them to turn into a fork bombs
on AOT. On web, dart:io is not supported.

https://github.com/dart-lang/co19/issues/1137

findProxy tests are timing out on all relevant platforms.

https://github.com/dart-lang/co19/issues/1129

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-win-release-x64-try
Change-Id: If1e4d0c26d5d40cd60e5e8a8dd4600b85668da5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209706
Reviewed-by: William Hesse <whesse@google.com>
2021-08-11 13:29:59 +00:00
Sam Rawlins 3393591b3f Rewrite AST w/ Constructor reference w/ explicit type args
This should handle all cases of constructor reference w/ explicit type
args; there aren't too many cases:

* named and unnamed constructors
* referencing class and referencing type alias
* prefixed class names and not-prefixed
* null-aware access (weird)
* bound on type parameter of class, and on type parameter of alias

error cases:

* cascade
* wrong number of type arguments

Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: If257eb561a9ad854709b6e9a7d81faa9d084d6ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209622
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-08-10 23:54:49 +00:00
Nicholas Shahan 7ff8c6c6be [tests] Remove not-identical expectation for Type values
The instantiation at runtime implies non-constant type expressions
but canonicalization is unspecified so backends should be allowed
to optimize by canonicalizing types.

Change-Id: I2f1cab6ac68a1ce156b15af0b99e02d03b7b3dca
Issue: https://github.com/dart-lang/sdk/issues/46837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209663
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-08-10 18:47:31 +00:00
Martin Kustermann d7c0271ac0 [vm/concurrency] Add missing WeakProperty support to transitive copy
The transitive copy algorithm was missing support for [WeakProperty]s,
thereby ensuring that we only copy the values if the keys are reachable.

Furthermore we might need to re-hash [Expando]s - since the copied
objects start with no identity hash codes.

The CL also makes us avoid calling to Dart for each [Expando]
separately and instead use a list - just as we do in the re-hashing of
maps/sets.

We also move the C++ code to invoke rehashing logic into
DartLibraryCalls::*.

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

TEST=vm/dart{,_2}/isolates/fast_object_copy{,2}_test

Change-Id: I836745feef8a6d7573faa94e29a19c1eca0c39f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209106
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-08-09 23:56:19 +00:00
Sam Rawlins 9b586a3da6 analyzer: add constructor references from PrefixedIdentifier
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Ifafea6edb6c9ce7fdf1c1f092ff278738c273bb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-08-09 15:03:48 +00:00
Clement Skau bf2691c2fe [VM] Moves FfiNative fields to function parent.
Previously the synthetic field that holds the FfiNative
function pointer was injected into the current library.
This change makes sure we instead add the field to the
relevant parent - Class or Library.

TEST=Added regression test for name collision.

Bug: https://github.com/dart-lang/sdk/issues/43889
Change-Id: Ifbf2d70de00e4748c179fe7d626c495675c2b338
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208502
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-08-09 09:13:38 +00:00
Alexander Markov 3097b72b2b [vm] Ignore differences in generic-covariant-impl flags of type parameters when doing a subtype check
We might get different flags on lhs and rhs of a subtype check as
lhs might come from a tear-off which has generic-covariant-impl type
parameters and rhs is a standalone function type.

TEST=language/regress/regress46816_test
Fixes https://github.com/dart-lang/sdk/issues/46816

Change-Id: Ic0f1b4a9fdf0f4c9ae65c8c372d12c1e51ad8050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209265
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-08-07 21:03:46 +00:00
Alexander Aprelev 003e79752c [gardening] Ensure directory_fuzz_test creates test directories in temp folder, not in check-out location.
Fixes https://github.com/dart-lang/sdk/issues/46737

This is similar to https://dart-review.googlesource.com/c/sdk/+/208285

TEST=directory_fuzz_test

Change-Id: Ia74e221ac7095fd6fc4729aec51770df5eabdbe0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209105
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-08-06 15:32:22 +00:00
Erik Ernst 167cd029e2 Restore function object equality related tests
This CL restores the equality related tests in
tests/language/closure/identity_equality_tearoff_test.dart that we had
in https://dart-review.googlesource.com/c/sdk/+/202243, but removed
in order to finalize language team discussions about equality of
function objects, based on language issue #1712.

Note that these additional test cases do not include any cases involving
tearoffs of extension methods, they will be dealt with separately.

Change-Id: I84daaf91229bd0d0f4c64446bb71cb87f32eedfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205081
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-08-06 15:31:19 +00:00
Erik Ernst 844bdde9d9 Adjust aliased_type_literal_instantiation_test to expect dynamic
Said test expects a raw type literal (e.g., `Direct`) to evaluate to an
instantiation where the type argument is `Object?` (`Direct<Object?>`),
but the type argument is actually chosen by instantiation to bound,
so the resulting type argument is `dynamic` (`Direct<dynamic>`). This
CL adjusts the test to expect `dynamic`.

Bug: https://github.com/dart-lang/sdk/issues/46811
Change-Id: I06af0bf87ccb5e980e88416085921948dd5234d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209081
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-08-05 10:05:38 +00:00
Stephen Adams 5ff2459d88 Remove obsolete internal dart2js annotations
These annotations have all been replaced with @pragma('dart2js:xxx')
versions:

@ForceInline, @NoInline, @NoThrows, @NoSideEffects, @AssumeDynamic.

Change-Id: Ia4730670c6864ccbe0fa4120108c3c16ab887c23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208863
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-08-04 23:27:18 +00:00
Alexander Markov 300a2ea952 [cfe] Create normal bodies for redirecting factories
Replace bogus body created for redirecting factories with a
normal body which calls target factory or constructor and
forwards all arguments. Such a body can be used by back-ends
if they choose to treat redirecting factories as ordinary
factories.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/41915
Issue https://github.com/dart-lang/sdk/issues/46231

Change-Id: I62c83bcc9005995e85de049d3d929ca86a75297f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208681
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-04 17:51:07 +00:00
Erik Ernst 996f1c945e Adjust constructor and type literal instantiation tests
The test aliased_constructor_tear_off_test.dart expected torn off
constructors to be unequal even in cases where the same constructor
is torn off and instantiated with the same type argument (albeit a
non-constant type). That equality _should_ hold, and this PR makes
the change needed to give the test that expectation.

The test tear_off_test.dart was adjusted similarly.

Change-Id: I79c8dbd312a393b4f509aa28fc46c06ffc77da5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208658
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-08-04 12:53:30 +00:00
Johnni Winther 43c00097c2 [cfe] Remove isOptOutTest work-around
Change-Id: I7dd125508bba256eb4c78b02fb24e433f45b129a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205420
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-04 10:44:00 +00:00
Ryan Macnak d9bb68f93a [vm] Fix serialization of SIMD vectors.
Broken by bbefc05748.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/46793
Change-Id: I8e5869caee2d705cecaf974cca3ee3f0c542ad3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208840
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-08-03 19:48:50 +00:00
Erik Ernst 0edf000b87 explicit_instantiated_tearoff should expect unequal ext. method tearoffs
Extension method closurizations are specified to be unequal unless they
are identical (because the extension itself may have different type
arguments, so it's not enough that it is "the same method").

This CL changes the test
language/generic_methods/explicit_instantiated_tearoff_test.dart
such that its expectations match that property.

Change-Id: Ife31646623099ad5d1b970d0097d37d6b00c5814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208645
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-08-03 14:11:29 +00:00
Riley Porter d63c2dfa83 [package:js] Allow external extension members for Native classes
Change-Id: I5baf81c3c2b6b3a112327e1aea084a93677bd9b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208380
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-07-30 18:43:47 +00:00
Srujan Gaddam f5a98e7676 [ddc] Unify pkg:js types and allow subtyping between them
Removes the lazy loading of the underlying type in LazyJSTypes.
As such, this removes the need to keep AnonymousJSType and
LazyJSType separate, and is therefore refactored to
PackageJSType. Similarly, subtyping is fixed such that
PackageJSTypes are all subtypes of each other.

Change-Id: If489defdbeb5cb932db802a7d146ad2fc393b12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207982
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-07-30 00:33:54 +00:00
Ryan Macnak bbefc05748 [vm] Rewrite isolate message serialization.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/25559
Bug: https://github.com/dart-lang/sdk/issues/27285
Bug: https://github.com/flutter/flutter/issues/84691
Change-Id: I04608c5d337144195748d5f3509a29eb3116585d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207865
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-07-29 16:55:55 +00:00
Alexander Aprelev 2f0c35ea0b [vm/gardening] Revert changes to datagram test to accommodate unreliable nature of datagram packets delivery.
On Windows even on localhost datagrams are being sometimes dropped, which is a little surprising but not impossible.
So this CL reverts changes to the test that expects all datagrams to be received.

This is follow-up to https://dart.googlesource.com/sdk/+/d8839511737dbd1775f37cb5a13862bd7d6f4b88

TEST=raw_datagram_read_all_test on Windows

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

Change-Id: I498b9d8c2ea7849de0f3e91acc952043a9312589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208345
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 19:53:14 +00:00
Alexander Aprelev 828cd72cd8 [vm/gardening] Ensure test waits for files to be deleted before deleting temp folder.
This is follow-up to d883951173.

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

Change-Id: I342402cbe959e4f0422d84df39e4368117fd9ca5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208342
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 19:03:44 +00:00
Alexander Aprelev d883951173 [vm/gardening] Cleanup file_fuzz_test and raw_datagram_read_all_test.
This is follow-up to https://dart.googlesource.com/sdk/+/babfe05e4a9e892d71f8f6ebcb6df82095bea0da and https://dart.googlesource.com/sdk/+/f424f3a4cca306513e77c7747682f1c1c99e3307.

TEST=ci

Change-Id: Ic4143f9eec90cd2a6218d4f33fdc29d298ef3c05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208340
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 16:52:54 +00:00
Alexander Aprelev f424f3a4cc [vm/gardening] Fix file_fuzz_test so it doesn't create files in the dart sdk checkout root.
Fixes https://github.com/dart-lang/sdk/issues/46737

TEST=Ensure file_fuzz_test doesn't create 'a' file

Change-Id: I200bc63a86f75e0b770f1a2240a9e2bfdc99aef6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208285
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 02:20:13 +00:00
Alexander Aprelev babfe05e4a [vm/gardening] Increase wait on receive side for all datagrams to make it.
The test seems to flakily fail on regular bots, fail on reload bots because of aggressive hardcoded wait on receive side of RawDatagramSocket test.

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

TEST=raw_datagram_read_all_test on ci

Change-Id: Ic9c7cec619783b102b14396fb694467d5030b5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208284
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-28 00:57:43 +00:00
Riley Porter 16ac19d097 [package:js] Add checks for external extension members.
Reports an error if there are external members in an extension,
where the extension on type is not a JS interop class. A follow
up change will allow extensions with external members on some
Native classes, like dart:html classes.

Change-Id: I01c645aa46e46071aae5f380c5e36329f61d3e18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207722
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2021-07-28 00:41:43 +00:00
Irina Arkhipets d96335f874 [co19_2] Tests skipped according to issues 46483 and 42222
Change-Id: Ie81359c91e39834799cfd8cba0026fe2d0f3b345
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207130
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-07-27 08:20:57 +00:00
Daco Harkes db90fd784b [test] Replace non-implemented @DontInline() annotations
Remove the `@DontInline()` annotation. None of the backends implemented
it. (Searching for "DontInline" yields nothing in our code base.)

Instead replaced the use sites with `@pragma('vm:never-inline')` and
`@pragma('dart2js:noInline')`, which are implemented in the backends.

Original suggestion:
https://dart-review.googlesource.com/c/sdk/+/208080/4..6/tests/language_2/const/map_hashcode_override_test.dart#b11

Change-Id: Ifdcfc8ef3413d0b5964edc1bc1fa47c5ce306935
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208082
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-07-26 13:22:31 +00:00
Daco Harkes a5d4e010af [test] const types and null in const maps and sets
We were lacking tests for doing a `null` lookup in const maps and sets.

Also, we were lacking tests for having type literals with user-defined
classes in const maps and sets.

Bug: https://github.com/dart-lang/sdk/issues/45908

Change-Id: I1665420ddcc71df7b47a87ee9e16d7ebbe9e13f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208080
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-07-26 12:42:20 +00:00
Johnni Winther 51d10c8c04 [test] Fix constructor tear off tests in language
Change-Id: Icf5f6e99df68cd4194e9f4d9314757eab3d3fe11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207661
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-23 08:41:09 +00:00
Alexander Markov 6128a39d85 [vm/compiler] Fix handling of delayed type arguments in case of inlined closure call
Previously, prologue builder omitted loading of delayed type arguments
from closure object in case of inling. This would effectively switch
from using delayed type arguments of an instantiated generic closure to
type arguments passed on the stack (null/all-dynamic if none), which is
not correct.

The fix is to load delayed type arguments from closure object even
in case of inlining.

TEST=tests/language/regress/regress46550_test.dart
Fixes https://github.com/dart-lang/sdk/issues/46550

Change-Id: Ibe50b0bc2ebda1d3638c4940fe9a26cd5ba7ce32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207704
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-07-22 17:33:39 +00:00
Sam Rawlins ea5333a23f Do not report const ctor with a mixed in abstract final field
Additionally, reduce duplicated errors regarding invalid const constructors.

Fixes https://github.com/dart-lang/sdk/issues/46641
Change-Id: Ica397ad6e28a05bc5340d5ceca236fbedf1e95f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207621
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-07-21 17:56:08 +00:00
Clement Skau 2f0b352e98 [VM] Adds compile-time error for non-static FfiNative
This makes it a compile-time error to add @FfiNative annotation
to any non-static function, such as an instance method.

TEST=tests/ffi/ffi_native_test.dart,pkg/analyzer/test/src/diagnostics/ffi_native_test.dart

Bug: https://github.com/dart-lang/sdk/issues/43889
Change-Id: Ib9ec61345bb47e735ed635c5ceea15ab643f65a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207306
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-07-20 11:54:30 +00:00
Nicholas Shahan 9c6b1ea4e9 [tests] Add regression tests for #46568
Two different const functions should not be identical.

Change-Id: I3974574c8d0cb34b9cf886532c41e1a77ae632a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206422
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-07-19 21:49:49 +00:00
Stephen Adams cfc8ad4e7f [js_runtime] Use custom hashCode for GeneralConstantMap
Fixes #46580

Change-Id: Ida2b7df75415881973085f9afeacd9ee384fd910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207160
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-07-16 22:58:02 +00:00
Martin Kustermann 6a87d049ac [vm] Use unique names for process-anonymous unix domain sockets in test
This will allow running the same test concurrently in multiple isolates
without causing name collisions.

It also aligns the NNBD and non-NNBD test.

TEST=Making test more robust. Fixes one issue in iso-stress builder.

Change-Id: Ic0c15a0f47de8e255d2bdfb96547d44d016b2a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207125
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-07-16 14:23:37 +00:00
Martin Kustermann 627292bcc0 [vm] Remove --experimental-enable-isolate-groups-jit, only guard via --enable-isolate-groups
The JIT support has progressed and is no longer unstable. We'll
therefore remove the experimental flag and rely on the same
--enable-isolate-groups flag as in AOT mode.

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

TEST=Existing test suite.

Change-Id: Iff0dd5b64d9b6ab91ad9ffc0ae445efc802d3908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207122
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-16 09:13:28 +00:00
Martin Kustermann 91ac6475cb [vm/concurrency] Enable more isolate tests, remove outdated TODOs, fix 2 tests
This CL

  * Removes conditional Skip markers in status files
  * Removes some outdated TODOs in the code
  * Deletes tests/lib_2/isolate/isolate_stress_test
    => It's skipped everywhere, we no longer support isolates on web
  * Fixes standalone{,_2}/io/directory_list_sync_test:
    => Instead of relying on the Platform.script which could be an ELF
       file lying somewhere else, use Platform.executable instead
  * Fixes standalone{,_2}/io/unix_socket_test:
    => The server used `sub.cancel()` to close it's reading end while
       the client tried to write to it. This is racy.
       If the server goes first, the write on client will throw (since
       no error listener was installed on socket.done)
       Avoid the race by coordinating client/server.

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

TEST=Enables more tests.

Change-Id: I0464f81f540f2eda23ef4199cc536e53e6a809b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207120
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-16 07:51:58 +00:00
Martin Kustermann 1ab1438431 [vm] Fix incorrect socket/unix-domain-socket binding code for shared sockets
When creating a binding socket with `shared: true` there will be one
underlying [OSSocket] used. Any following bind on the same address with
`shared: true` will re-use that [OSSocket].

The code that was searching for existing sockets is correct, but the
code that increments the refcount, ... was incorrectly using the start
of the linked list instead of the found existing socket instance.

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

TEST=standalone{,_2}/io/unix_socket_regress_46634_test

Change-Id: I3ce1bdc98ecd4b5311f826ab2597a62fe048be09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207083
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-16 00:27:27 +00:00
Srujan Gaddam 839408f00b Test extensions on and semantics of JavaScriptObject
Tests static extension methods on JavaScriptObject work as
expected, as well as making sure it works with package:js. Once
extension types are added, these tests need to be changed to use
those instead.

Change-Id: I9504c8a3a8e466c680b221e259d93c1df5474218
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199601
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-07-16 00:15:09 +00:00
Mayank Patke c559cf04c3 [dart2js] Some DartTypeVisitor cleanup.
This CL deletes BaseDartTypeVisitor and makes all of the visit* methods
in DartTypeVisitor abstract. This forces subclasses of DartTypeVisitor
to provide definitions for all of these methods rather than relying on
some default.

The old code led to a series of bugs with the same root cause: when a
new kind of DartType was added (and a corresponding visit* method added
to DartTypeVisitor), not all concrete implementations of the visitor
were updated to handle the new DartType. This didn't produce static
errors because DartTypeVisitor provided default no-op implementations
for visit* methods. In some cases, this was the desired behavior anyway,
but in practice, any time a new DartType is added, we want our tools to
yell at us until we've validated that it's properly handled everywhere
(even if the proper handling turns out to be "do nothing").

This CL also updates Namer.getTypeRepresentationForConstant to use a
visitor pattern.

Fixes: https://github.com/dart-lang/sdk/issues/46589
Change-Id: I451b592ae1ce4afff40de913535798a62e17b8b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206943
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-07-15 19:04:25 +00:00
Clement Skau 06a35b8c2e [VM] Adds test for FfiNative leaf calls.
- Tests that non-leaf calls transition generated -> native,
  and that leaf calls don't.
- Tests that leaf calls with Handle argument or return type
  results in a compile-time error.
- Adds note explaining why there is no ffi_2 version.

TEST=tests/ffi/ffi_native_test.dart

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-win-release-try,analyzer-analysis-server-linux-try,analyzer-win-release-try,analyzer-nnbd-mac-release-try,analyzer-nnbd-linux-release-try,analyzer-mac-release-try,flutter-analyze-try
Change-Id: I9af60e21f5122f2479c909a52249809850824692
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206788
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-07-15 16:14:45 +00:00
Martin Kustermann 6f8304d1f5 [vm] Fix test to use sync file system operations
The test uses a temporary directory that gets deleted once the test
finishes. Though some calls to async methods are not await'ed, so the
directory might get removed before the async methods are completed.

We instead change the test to use synchronous methods consistently. The
regression test is still testing the `rename` method as before.

TEST=Fixes iso-stress builder failures where this issue occurs.

Change-Id: Ide3098fa67de619756417e83df056cf5d1299189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207003
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-15 09:31:39 +00:00
Srujan Gaddam c261b6574a Filter is_check_and_as_cast_test from CSP target
It uses eval, which is disallowed.

Change-Id: Ib125276560903846eefa3b86125350294ff5d8fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206661
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-07-14 18:10:41 +00:00
Martin Kustermann d6d00b344a [vm] Fix standalone{,_2}/io/issue_30687_test to operate in custom temp directory
All of our tests relying on filesystem operations should operate in a
randomly created temporary directory. This ensures the test will not
interact badly with other tests - running in parallel.

This particular test couldn't be run multiple times concurrently,
since it would cause races to FSE creation/deletion.

TEST=Fixes iso-stress builder issue (which runs tests repeatedly in parallel)

Change-Id: I8b2e015bf4b6a9ecdfa471eb2ec887e634c2b233
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206783
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-14 12:45:00 +00:00
Clement Skau 460e00a6a6 [VM] Adds leaf call option to FfiNative.
This change essentially exposes `asFunction`'s `isLeaf` in
`@FfiNative`, allowing us to declare FFI Natives as leaf calls.

TEST=Adds tests/ffi/ffi_native_test.dart

Bug: https://github.com/dart-lang/sdk/issues/43889
Change-Id: I2a396fae2ab28d21df282f3afb35fa401485ed52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206375
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-07-14 09:13:51 +00:00
Ryan Macnak 09cc09cb85 [vm] Don't block OOB messages or reload during field initialization; make interrupts lock-free.
- Account for initialization-in-progress sentinel when checking static field types for reload.
 - Don't read the true stack limit when setting or clearing interrupts.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/46596
Change-Id: I80adb4d7d69f01125b7eae8215b5da4d2e467bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206662
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-07-14 00:09:10 +00:00
Srujan Gaddam f7c284b9f0 [pkg:js] Add tests for inheritance type checks/casts and subtyping
Adds tests for type checks/casts for pkg:js types that inherit each
other. Similarly, adds subtyping tests for both when types are made
live and when they are not.

Also adds extends_test to lib_2.

Change-Id: Ia3ca03ad9c0291092998d1d3e98d672711fcf8e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205602
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-07-13 20:02:49 +00:00
Martin Kustermann 430aa20a1f [vm/concurrency] Implement a fast transitive object copy for isolate message passing
We use message passing as comunication mechanism between isolates.
The transitive closure of an object to be sent is currently serialized
into a snapshot form and deserialized on the receiver side. Furthermore
the receiver side will re-hash any linked hashmaps in that graph.

If isolate gropus are enabled we have all isolates in a group work on
the same heap. That removes the need to use an intermediate
serialization format. It also removes the need for an O(n) step on the
receiver side.

This CL implements a fast transitive object copy implementation and
makes use of it a message that is to be passed to another isolate stays
within the same isolate group.

In the common case the object graph will fit into new space. So the
copy algorithm will try to take advantage of it by having a fast path
and a fallback path. Both of them effectively copy the graph in BFS
order.

The algorithm works effectively like a scavenge operation, but instead
of first copying the from-object to the to-space and then re-writing the
object in to-space to forward the pointers (which requires us writing to
the to-space memory twice), we only reserve space for to-objects and
then initialize the to-objects to it's final contents, including
forwarded pointers (i.e. write the to-space object only once).

Compared with a scavenge operation (which stores forwarding pointers in
the objects themselves), we use a [WeakTable] to store them. This is the
only remaining expensive part of the algorithm and could be further
optimized. To avoid relying on iterating the to-space, we'll remember
[from, to] addresses.

=> All of this works inside a [NoSafepointOperationScope] and avoids
   usages of handles as well as write barriers.

While doing the transitive object copy, we'll share any object we can
safely share (canonical objects, strings, sendports, ...) instead of
copying it.

If the fast path fails (due to allocation failure or hitting) we'll
handlify any raw pointers and continue almost the same algorithm in a
safe way, where GC is possible at every object allocation site and
normal barriers are used for any stores of object pointers.

The copy algorithm uses templates to share the copy logic between the
fast and slow case (same copy routines can work on raw pointers as well
as handles).

There's a few special things to take into consideration:

  * If we copy a view on external typed data we need to know the
    external typed data address to compute the inner pointer of the
    view, so we'll eagerly initialize external typed data.

  * All external typed data needs to get a finalizer attached
    (irrespective if the object copy suceeds or not) to ensure the
    `malloc()`ed data is freed again.

  * Transferables will only be transferred on successful transitive
    copies. Also they need to attach finalizers to objects (which
    requires all objects be in handles).

  * We copy linked hashmaps as they are - instead of compressing the
    data by removing deleted entries. We may need to re-hash those
    hashmaps on the receiver side (similar to the snapshot-based copy
    approach) since new object graph will have no identity hash codes
    assigned to them. Though if the hashmaps only has sharable objects
    as keys (very common, e.g. json) there is no need for re-hashing.


It changes the SendPort.* benchmarks as follows:

```
Benchmark                                     |              default |                        IG |                  IG + FOC
----------------------------------------------------------------------------------------------------------------------------
SendPort.Send.Nop(RunTimeRaw):                |        0.25 us (1 x) |       0.26 us    (0.96 x) |       0.25 us    (1.00 x)
SendPort.Send.Json.400B(RunTimeRaw):          |        4.15 us (1 x) |       1.45 us    (2.86 x) |       1.05 us    (3.95 x)
SendPort.Send.Json.5KB(RunTimeRaw):           |       82.16 us (1 x) |      27.17 us    (3.02 x) |      18.32 us    (4.48 x)
SendPort.Send.Json.50KB(RunTimeRaw):          |      784.70 us (1 x) |     242.10 us    (3.24 x) |     165.50 us    (4.74 x)
SendPort.Send.Json.500KB(RunTimeRaw):         |     8510.4  us (1 x) |    3083.80 us    (2.76 x) |    2311.29 us    (3.68 x)
SendPort.Send.Json.5MB(RunTimeRaw):           |   122381.33 us (1 x) |   62959.40 us    (1.94 x) |   55492.10 us    (2.21 x)
SendPort.Send.BinaryTree.2(RunTimeRaw):       |        1.91 us (1 x) |       0.92 us    (2.08 x) |       0.72 us    (2.65 x)
SendPort.Send.BinaryTree.4(RunTimeRaw):       |        6.32 us (1 x) |       2.70 us    (2.34 x) |       2.10 us    (3.01 x)
SendPort.Send.BinaryTree.6(RunTimeRaw):       |       25.24 us (1 x) |      10.47 us    (2.41 x) |       8.61 us    (2.93 x)
SendPort.Send.BinaryTree.8(RunTimeRaw):       |      104.08 us (1 x) |      41.08 us    (2.53 x) |      33.51 us    (3.11 x)
SendPort.Send.BinaryTree.10(RunTimeRaw):      |      373.39 us (1 x) |     174.11 us    (2.14 x) |     134.75 us    (2.77 x)
SendPort.Send.BinaryTree.12(RunTimeRaw):      |     1588.64 us (1 x) |     893.18 us    (1.78 x) |     532.05 us    (2.99 x)
SendPort.Send.BinaryTree.14(RunTimeRaw):      |     6849.55 us (1 x) |    3705.19 us    (1.85 x) |    2507.90 us    (2.73 x)
SendPort.Receive.Nop(RunTimeRaw):             |        0.67 us (1 x) |       0.69 us    (0.97 x) |       0.68 us    (0.99 x)
SendPort.Receive.Json.400B(RunTimeRaw):       |        4.37 us (1 x) |       0.78 us    (5.60 x) |       0.77 us    (5.68 x)
SendPort.Receive.Json.5KB(RunTimeRaw):        |       45.67 us (1 x) |       0.90 us   (50.74 x) |       0.87 us   (52.49 x)
SendPort.Receive.Json.50KB(RunTimeRaw):       |      498.81 us (1 x) |       1.24 us  (402.27 x) |       1.06 us  (470.58 x)
SendPort.Receive.Json.500KB(RunTimeRaw):      |     5366.02 us (1 x) |       4.22 us (1271.57 x) |       4.65 us (1153.98 x)
SendPort.Receive.Json.5MB(RunTimeRaw):        |   101050.88 us (1 x) |      20.81 us (4855.88 x) |      21.0  us (4811.95 x)
SendPort.Receive.BinaryTree.2(RunTimeRaw):    |        3.91 us (1 x) |       0.76 us    (5.14 x) |       0.74 us    (5.28 x)
SendPort.Receive.BinaryTree.4(RunTimeRaw):    |        9.90 us (1 x) |       0.79 us   (12.53 x) |       0.76 us   (13.03 x)
SendPort.Receive.BinaryTree.6(RunTimeRaw):    |       33.09 us (1 x) |       0.87 us   (38.03 x) |       0.84 us   (39.39 x)
SendPort.Receive.BinaryTree.8(RunTimeRaw):    |      126.77 us (1 x) |       0.92 us  (137.79 x) |       0.88 us  (144.06 x)
SendPort.Receive.BinaryTree.10(RunTimeRaw):   |      533.09 us (1 x) |       0.94 us  (567.12 x) |       0.92 us  (579.45 x)
SendPort.Receive.BinaryTree.12(RunTimeRaw):   |     2223.23 us (1 x) |       3.03 us  (733.74 x) |       3.04 us  (731.33 x)
SendPort.Receive.BinaryTree.14(RunTimeRaw):   |     8945.66 us (1 x) |       4.03 us (2219.77 x) |       4.30 us (2080.39 x)
```

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

TEST=vm/dart{,_2}/isolates/fast_object_copy{,2}_test

Change-Id: I835c59dab573d365b8a4b9d7c5359a6ea8d8b0a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203776
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-13 19:04:20 +00:00
Srujan Gaddam 0fc2d929e3 [pkg:js] Add subtyping tests with liveness
Adds tests for subtyping between pkg:js types. Also runs tests
for both when types are made live and for when they are not.

Also adds these tests to lib_2.

Change-Id: I25fdc293e422eb21fa8a80dea66ae5d492c5aafd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205601
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-07-13 18:51:34 +00:00
Daco Harkes 21af69a7a5 Revert "[vm] Don't block OOB messages during field initialization; make interrupts lock-free."
This reverts commit 4d789f60d1.

Reason for revert: TSAN races
https://github.com/dart-lang/sdk/issues/46596

Original change's description:
> [vm] Don't block OOB messages during field initialization; make interrupts lock-free.
>
> TEST=ci
> Change-Id: I51d0f51995e197ab71c059f17d22259eea19c286
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206566
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I777f5a0bbeb3cd60e03aff46183b19ab4e286664
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206545
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-07-13 11:30:08 +00:00
Srujan Gaddam 8f11985c47 [pkg:js] Test runtime is checks
The is checks in is_check_and_as_cast_test.dart are currently optimized
by dart2js at compile time. In order to test them at runtime, is checks
are added after confusing the instance.

Also adds this test file to lib_2.

Change-Id: I3a77c779799f77342297508b89367ab8b64c3241
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205600
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2021-07-13 01:28:55 +00:00
Ryan Macnak 4d789f60d1 [vm] Don't block OOB messages during field initialization; make interrupts lock-free.
TEST=ci
Change-Id: I51d0f51995e197ab71c059f17d22259eea19c286
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206566
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-07-13 00:43:05 +00:00
Daco Harkes d5a97be466 [test] Fix getValueNonOptimized in tests
Addressing https://dart-review.googlesource.com/c/sdk/+/206202/4/tests/language/const/set_hashcode_override2_test.dart#12

Change-Id: I08948507b702dd0885b98ae31b1a7d22536e9ce1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206224
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-07-12 10:23:14 +00:00
Clement Skau ffde1585da [VM] Removes types from reused temps in async.
When we detect that a temporary variable is being reused
with a different type, we change the type of the temp
to dynamic.
This allows us to retain types for any non-reused temps.

For any dynamic temps we still have type information available
for use sites, which we can pass on via unsafeCast.

One drawback of this approach is that we don't know ahead
of time which temps are reused, and get turned into dynamic,
so we have to unsafeCast all uses.


This change is similar to what was done in:
https://dart-review.googlesource.com/c/sdk/+/138500

TEST=Adds tests/language/vm/regress_flutter_85311_test.dart,
updates relevant expect files.

Bug: https://github.com/flutter/flutter/issues/85311
Change-Id: I821c5266327892d5c3fd5bae1bebba7f3fe3931b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205647
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-07-12 08:55:53 +00:00
Erik Ernst 72d8a215e7 Adjust test on super-bounds to avoid error-on-error situations
Bug: https://github.com/dart-lang/sdk/issues/46516
Change-Id: I8df54ebd4743ed93a81bb13fc43816d85b7b3aa6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205789
Auto-Submit: Erik Ernst <eernst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-07-10 00:44:10 +00:00
Daco Harkes 2a68e31ffb [test] Non terminating hashCode override in const
The language spec only mandates operator== to not be overridden for
instances used in const maps as keys or const sets. However, hashCode
_can_ be overridden.

This adds a test that exercises this behavior.

Bug: https://github.com/dart-lang/sdk/issues/45908

Change-Id: Id64c0722872bb916963b71057a06309bf3b8b559
Cq-Include-Trybots: luci.dart.try:dart2js-csp-minified-linux-x64-chrome-try,dart2js-minified-strong-linux-x64-d8-try,dart2js-nnbd-linux-x64-chrome-try,dart2js-strong-hostasserts-linux-ia32-d8-try,dart2js-strong-linux-x64-chrome-try,dart2js-strong-linux-x64-firefox-try,dart2js-strong-mac-x64-chrome-try,dart2js-strong-mac-x64-safari-try,dart2js-strong-win-x64-chrome-try,dart2js-unit-linux-x64-release-try,ddc-linux-release-chrome-try,ddc-mac-release-chrome-try,ddc-nnbd-linux-release-chrome-try,ddc-win-release-chrome-try,vm-kernel-precomp-nnbd-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206085
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-07-08 12:18:48 +00:00
Daco Harkes c8c41f72a0 [test] const instances in non-const sets
The language spec only mandates operator== to not be overridden for
instances used in const maps as keys or const sets. However, hashCode
_can_ be overridden.

This CL adds tests that uses these const instances in non-const maps.
(As follow up of https://dart-review.googlesource.com/c/sdk/+/206085)

Bug: https://github.com/dart-lang/sdk/issues/45908

Change-Id: I3caf5afd45aaec24b3e89e4645b00841a2075ca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206202
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-07-08 11:30:53 +00:00
Martin Kustermann c133aa8660 Reland "[vm] Remove --causal-async-stacks flag"
The flag isn't used anywhere in our tests or in embedder code. Turning
it on will result in a VM startup error.

We should therefore remove all uses of the flag and the flag itself.

This is a unmodified reland of

  https://dart-review.googlesource.com/c/sdk/+/204500

after some remaining g3 usages have been fixed (the flutter
roll didn't port the GN changes to BUILD changes in g3)

TEST=Existing test suite.

Change-Id: Ic28c9b334a0b04524ee57e2554cc8d713a83fbfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204785
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-07-02 14:26:46 +00:00
Erik Ernst 9371fd9fc8 Adjust vm test about the Symbol constructor
The `Symbol` constructor has been changed to accept any string as the
actual argument (it used to require strings similar to the ones that we
can use with `#` to create a symbol literal). This CL change a vm test
such that it has the updated expectations.

Cf. https://github.com/dart-lang/sdk/issues/46207.

Change-Id: I25fa5a145b7d476372b4c2f8502eabb36ec82fec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205781
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-07-02 12:41:41 +00:00
Alexander Aprelev b1db8a3c65 [io/gardening] Marking large_file_read_small_file_test slow.
Fixes https://github.com/dart-lang/sdk/issues/45388.

TEST=io/large_file_read_small_file_test

Change-Id: Ib3512f3005a820ff69e8cbe4c5e3f6b0b5e1a0df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205841
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-07-02 03:53:13 +00:00
Erik Ernst 47502de6b0 Remove two tests using a deferred type
This is a compile-time error today, and that is tested already
elsewhere, so the test serves no purpose.

Bug: #46526
Change-Id: If098f8dc308ae4532b22f786f14a1986e2899251
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205720
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-07-01 20:53:05 +00:00
Erik Ernst 166d474257 Adjust symbol tests to new semantics
Cf. https://github.com/dart-lang/sdk/issues/46207, the semantics of
the platform class `Symbol` was changed such that all string argumnts
are accepted (previously, only some strings were accepted).

Change-Id: I1d2b093e4fdbb5dabf17b7a53c70e9787a7a76a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205480
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-07-01 18:43:14 +00:00
Konstantin Shcheglov 32f9d0c404 Issue 46529. Annotate imports unresolved because of errors in .packages files.
Bug: https://github.com/dart-lang/sdk/issues/46529
Change-Id: I05dc36914adddb6196ade294650ec683dc4a593d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205628
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-01 16:15:18 +00:00
michaellee8 4160a6b361 [Http] Fix handling of ipv6 address in host header
The current implementation of _HttpHeaders._addHost does not handle
ipv6 address correctly. This patch fixes the handling and add test
case for that.

References:

- https://github.com/flutter/flutter/issues/83609#issuecomment-870356766

TEST=http_headers_test.dart has been updated with new cases.

Bug: https://github.com/flutter/flutter/issues/83609#issuecomment-870356766
Change-Id: Idc4e9bbe66d66f0d846c7a32a40854201c3b0153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205280
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-07-01 01:18:44 +00:00
Riley Porter eaafc3deb0 Skip tests using eval to inject JavaScript on CSP build
Change-Id: I3084fa1056550e78ad09009c5c507dfa03bae78d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205631
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-06-30 23:29:17 +00:00
Riley Porter 63ac437e99 Optimize js_util callMethod calls for 0-4 arguments.
Change completes initial set of js_util optimizations. Some usages
of `getProperty`, `setProperty`, and `callMethod` with <= 4
arguments will have unnecessary checks removed by the compilers.

Change-Id: I94d5402ca9a64ad2818fd6d6a5f7f114f87348c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204562
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-30 20:11:44 +00:00
Jens Johansen 7e183b64a9 [test] Fix bug in export/duplicate_import_libd
`git show fc1b1ecc712d` shows - among lots of other changes - this:

```
diff --git a/tests/language_2/duplicate_import_liba.dart b/tests/language_2/export/duplicate_import_liba.dart
similarity index 100%
rename from tests/language_2/duplicate_import_liba.dart
rename to tests/language_2/export/duplicate_import_liba.dart
```

and

```
diff --git a/tests/language_2/duplicate_import_libd.dart b/tests/language_2/export/duplicate_import_libd.dart
similarity index 91%
rename from tests/language_2/duplicate_import_libd.dart
rename to tests/language_2/export/duplicate_import_libd.dart
index ccec81e0ff6..14f1ff413fb 100644
--- a/tests/language_2/duplicate_import_libd.dart
+++ b/tests/language_2/export/duplicate_import_libd.dart
@@ -8,6 +8,6 @@ import 'duplicate_import_liba.dart';
 import 'duplicate_import_libb.dart';
 import 'duplicate_import_libc.dart';

-export 'duplicate_import_liba.dart';
+export '../duplicate_import_liba.dart';
 export 'duplicate_import_libb.dart';
 export 'duplicate_import_libc.dart';
```

Change-Id: I806ba94ae251d574981e06ea88e6189063719785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205264
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-06-30 07:44:52 +00:00
Lasse R.H. Nielsen 42238ecfb8 Reland "Add some operator based tests."
This is a reland of 8a57112091

Original change's description:
> Add some operator based tests.
>
> Change-Id: Id9aa12854621eab68227b64bebf507f25b07ea1e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154683
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

Change-Id: I69f9810d7539b309ee7c1b87c13cd4153c590f2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205263
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-29 16:28:48 +00:00
Lasse R.H. Nielsen 5eb5d78a63 Revert "Add some operator based tests."
This reverts commit 8a57112091.

Reason for revert: Wasn't calling the new test function at all.

Change-Id: Ibb49de7a6f40b740d8a70200babce76811d2bf61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205262
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-06-29 10:25:53 +00:00
Ben Konyi 71c61ea24c [ VM ] Add delay between SIGINTs to fix flakiness of regress_42092_test
Change-Id: I1cce3f37491567bd13c9f64d4d15afed23a35a10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204901
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-06-29 01:36:32 +00:00
Lasse R.H. Nielsen 8a57112091 Add some operator based tests.
Change-Id: Id9aa12854621eab68227b64bebf507f25b07ea1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154683
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-06-28 15:06:52 +00:00
Erik Ernst 070e32e553 Add test on identity and equality of tearoffs
Change-Id: Ief2313b6c7f859622f8970cb3abb42ba98c89084
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202243
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-06-28 14:57:02 +00:00
Mayank Patke 58ad941a5a [dart2js] Fix interface subtyping bug.
Previously, when checking S <: T, we only checked if S and T had the
same interface name once. However, it's possible that redirections
eventually cause them to become equal. For example, if S is an interop
type and T is JavaScriptObject, after following the redirection from S
to JavaScriptObject, we end up checking JavaScriptObject <:
JavaScriptObject. Therefore, we need to recheck after following each
redirection.

Change-Id: Ie3eb9530627a0e48a5ea704fd4078ae238a65c78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204744
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-25 22:34:06 +00:00
Johnni Winther 268290725d [cfe] Support explicit instantiation
+ add bounds check for implicit instantiation

Closes #46458

Change-Id: I032f79d8ae4ed6944fbad999e067976ff72d94fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204802
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-06-25 14:47:45 +00:00
Lasse R.H. Nielsen 43cff26365 Add supertype to enum classes.
TEST= language/enum/enum_test

Change-Id: I83b7fd1c29103c3aa4dc7ad3e41141fb8c62339e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203564
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-06-25 14:08:16 +00:00
Lasse R.H. Nielsen 83376bf1ee Add Object.hash and Object.hashAll static helper methods.
Fixes #11617.

Bug: http://dartbug.com/11617
Change-Id: Id06fb5b3914bee24713427edbd3b9b7e86f86449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/73360
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-06-25 11:40:35 +00:00
Stephen Adams 8fda1d6cf3 [js_runtime] Don't modify inputs to Function.apply
In some cases adding default arguments modified the 'positional'
arguments input List.  Since there are 'accelerated' paths for small
numbers of arguments, this bug did not show in any other tests.

Change-Id: I5075c96ecfdc9645b85b9beeeb38305415153d20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204747
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-06-24 03:29:38 +00:00