Commit graph

19354 commits

Author SHA1 Message Date
Jonas Termansen b3a06c1933 [dart:_http] Fix http_cookie_date_test.dart compile errors.
Fixes https://github.com/dart-lang/sdk/issues/28843
Change-Id: I544f9d13e68a41412b0a7dd00b7a6d20ce3ef99e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/91222
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-05-27 12:46:39 +00:00
Samir Jindel afc54e23e3 [vm/ffi] FFI callbacks on ARM64.
For design context and motivation, see go/dart-ffi-callbacks

Change-Id: Ie463a462c8676c4a1973f377acee067253aca9f0
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101825
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-27 11:05:18 +00:00
Samir Jindel 0a5e5995e8 [vm/ffi] FFI callbacks on IA32.
Second part of implementing FFI callbacks, see go/dart-ffi-callbacks for design context.

Change-Id: Ibe8195e8cb40e0c1932b179fbc6df2b9668e2fa2
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try, vm-kernel-win-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100582
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-27 10:49:48 +00:00
Johnni Winther 0e5ebcaa96 Add InlineData and InlineDataCache
Merges InlineWeeder and InlineReductive into one visitor and computes
an InlineData object from which all decisions can be made.

Next step is to compute InlineData in the scope visitor (the first visitor
of the first modular phase).

Change-Id: I0c435ae1b3d7afdff1cee7abac657c9362995a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103632
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-27 09:01:25 +00:00
Régis Crelier 21b74fdf79 [dart2js] Update expectation file after BigInt fix in core lib.
Change-Id: I3a68b24357104b75f85a6a5c46852e2924437727
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103722
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Auto-Submit: Régis Crelier <regis@google.com>
2019-05-26 01:01:33 +00:00
Régis Crelier 735669190e [corelib BigInt] Fix implementation of BigInt.modInverse (fixes issue #37008).
A negative result was wrongly returned as a positive value.
Since positive values are preferred, the implementation now adds the modulus
enough times to make the result positive.

Change-Id: I87a2ceb359345846740a749ab6b46b1d45e7ba21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103664
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-05-25 22:05:51 +00:00
Sigmund Cherem baa721ba23 Add an sdk module to the modular_test pipeline
+ and use it in the dart2js modular tests

Change-Id: I66cf29dcea7fb705135049e7a6ea4eb17052f3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103575
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-24 19:09:12 +00:00
Paul Berry 0e5d18f281 Ensure that nullability promotion of the Null type yields Never.
Change-Id: I2232f80bbf5c8a9e51f305a603c06ca2b3ad8aea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103573
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 14:57:15 +00:00
Lasse R.H. Nielsen eca6c8953f Allow async as an identifier everywhere.
Fixes #37063

Bug: http://dartbug.com/37063
Change-Id: I2253c3088fbe33eca1072f2480cf0cf3cc363362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-05-24 08:21:14 +00:00
Johnni Winther 7580e77ef2 Support modular code generation
Change-Id: Id5511296eb0b6acf812bc464d71efa4019f211d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103523
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-24 07:38:13 +00:00
Samir Jindel 225a301637 [vm/ffi] Re-land "[vm/ffi] FFI callbacks on X64."
There are minor fixes for dartkb and windows.
The original revision is in patchset 1.

Change-Id: I9ab6e5fdb33fb4e84ea520c283fe94323616a8ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103129
Commit-Queue: Samir Jindel <sjindel@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-24 02:39:13 +00:00
Sigmund Cherem edadc9c881 Add support for caching results of shared modules.
This is important as we will soon add support for compiling the sdk as a
module and we would like to only compile it once when running a suite of
tests.

+ also enable caching in the dart2js pipeline test.

Change-Id: Ic9043f868123164f3ab425ba73f7428416b05fc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103485
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-24 01:27:13 +00:00
Mike Fairhurst 704446d159 Disable implicit casts but keep dynamic casts when NNBD enabled
Change-Id: Ia0a3271c9137bc8c7fa4cdbd469cf93d9453b69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-23 23:41:52 +00:00
Jonas Termansen df95340f0c [dart:_http] Fix parsing of empty cookies and double quotes.
Commit a9ad427 introduced a bug that assumed the cookie value was at least
one character, but the cookie value can also be empty.

RFC 6265 5.2 does not specify any special behavior for double quotes and as
such they should be considered part of the value. This change stops
stripping those double quotes and instead preserves them.

The io/http_cookie_test test was skipped because it was considered flaky.
This change dusts it off and tests the new behavior.

This change adds the exact offsets and source to the FormatExceptions to
help the caller understand why a malformed cookie was rejected.

Fixes https://github.com/dart-lang/sdk/issues/33327
Fixes https://github.com/dart-lang/sdk/issues/35804
Change-Id: I3479ba48be5763c485bd3ca5b5d2d86d283df971
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/91221
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-05-23 10:05:36 +00:00
Sam Rawlins b22cd05c51 Reland fix for #28233: add hint for missing returns to function expressions
The bulk of this change is actually correcting missing returns in the Dart SDK.

Bug: https://github.com/dart-lang/sdk/issues/28233
Change-Id: I52bcbc6c6f4a129d3fc22003f4448a7c3d4487ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100301
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-22 18:12:30 +00:00
Mike Fairhurst 6457ac1d4b Test potentially-nullable access errors
Change-Id: Ia166dbb6fb353120e30555f60b7bea186537b05b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-22 03:17:00 +00:00
Aske Simon Christensen f051cd5b4d [CFE] Transform spread and if in const collections early.
This makes sure that the AST before constant evaluation only contains
official kernel nodes.

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

Change-Id: Ic4e8e15adeaea8ad4700d6feb67e31f5f0a54f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103123
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-21 11:07:26 +00:00
Sigmund Cherem 2a85d595ba Split global analysis and backend in dart2js pipeline tests
Change-Id: I99c1464f7fb58f5edd9f726c86f29832cce2e6f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103001
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 23:25:22 +00:00
Sigmund Cherem 0c2738f616 Allow steps to declare more than one result
Change-Id: Ifd2a19f8ff771d464737bb27e22cf05a43cc2a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103020
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 23:25:22 +00:00
Sigmund Cherem 84fd1254ec Add tests for only-main behavior
+ move computeTransitiveDependencies to a shared location

Change-Id: I9bfad3d1799df2be36f28fac1a6ea9a8b4c4b023
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102225
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 23:25:22 +00:00
Lasse R.H. Nielsen 82c8c78739 Make StreamTransformer(..) transformed stream mimic original's isBroadcast.
BUG= http://dartbug.com/36965

Change-Id: I5dd156a635c1750d136206b030ee71a78b0e2ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102369
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 12:44:05 +00:00
Johnni Winther 09b46aa084 Support in-memory CodegenResult serialization/deserialization
The serialization/deserialization is performed in test-mode.

Change-Id: I90f31a6a88dbdf2c38beb9b5409ce3c52557e227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102740
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther c69d0c6e30 Flatten DynamicUse and StaticUse class hierarchies
Change-Id: Ib325425dfab7d7001a1a6133df1d50dddfadcbab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther 6757d0c6d9 Use ModularNamer/ModularEmitter to generate code separate from codegen enqueuing
Change-Id: I35dc4c0370622c63f2100e22517149cb0629423e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102367
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther c0b967d7da Refactor Namer and ConstantEmitter to prepare for modular compilation
Change-Id: I2fa8928d7c7d845df2507c9ad034107ec4bc21de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102364
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Samir Jindel ed169c4bb0 Revert "[vm/ffi] FFI callbacks on X64."
This reverts commit be209f7846.

Reason for revert: failures on dartkb and windows bots

Original change's description:
> [vm/ffi] FFI callbacks on X64.
> 
> For context on the design, see go/dart-ffi-callbacks
> 
> Change-Id: I2482e3c932e73f9a4c00fa7e218ff85f9328fc51
> Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100240
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Daco Harkes <dacoharkes@google.com>

TBR=sjindel@google.com,ajcbik@google.com,dacoharkes@google.com

Change-Id: I4cb3d93675d68a51ac9e125ad1d572c47e8b5903
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102983
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-05-18 15:29:19 +00:00
Samir Jindel be209f7846 [vm/ffi] FFI callbacks on X64.
For context on the design, see go/dart-ffi-callbacks

Change-Id: I2482e3c932e73f9a4c00fa7e218ff85f9328fc51
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100240
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-18 06:15:46 +00:00
Sigmund Cherem 475f55d46b Add dart2js modular test suite under a unit test.
At this time this only compiles to .dill and then compiles from multiple modular
dill files.

Next steps: add the global split and add the modular data bits

Change-Id: I3399776dbd5187ddb0a3e2fdd307622a736570c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102126
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-17 22:21:05 +00:00
Nicholas Shahan 86c7165969 [tests] Avoid use of $strong because it is always true now
* Remove all `&&  $strong` clauses.
* Delete all sections that include a `&& !$strong` clause.

Change-Id: Idd32cf5623793e3f98e3e998025bac079d88e2f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102223
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-05-16 17:41:27 +00:00
Mike Fairhurst a3073fc581 check null condition in assert
Change-Id: I4de11a7de3e5106ce9d5fbaf89d0b0965d637b08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102221
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-14 22:24:34 +00:00
Mike Fairhurst b91a4f5423 [analyzer] Resolve methodName staticType when Function to check Function?
Change-Id: I85d43821d4b792c269f386616dcc21d144772c5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-10 21:45:29 +00:00
Sigmund Cherem fb29d0e96d Move async_minitest to package:async_helper.
This allows to break a circular dependency between package:expect and

package:async_helper, which will simplify the support for modular tests using
package:modular_test.
Change-Id: Ie48723d3f35d51a8fbe622e0158450e8104fe3f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-10 19:43:58 +00:00
Mike Fairhurst 1a9d38be41 Fix improper unchecked_nullable test cases
Change-Id: I31aa8f1f53b8960550b9ab8d8cc63f670a20558b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-10 19:30:38 +00:00
Johnni Winther 0db620a2a5 Decouple Namer from RuntimeTypesEncoder and Tracer
Change-Id: I1c52b6740b590b1089201c3d0d8286d8e0912c48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101824
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-10 08:58:29 +00:00
Alexander Markov 477ad3c0ea [vm/bytecode] Eliminate asserts from bytecode unless --enable-asserts
Total size of a large app:
Before: 23681504
After: 23207344 (-463K/-2%)

Size of bytecode instructions:

Before: 6282376
After: 5981716 (-4.8%)
Change-Id: I57703616ecc91301c928672c83571482500dc365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101883
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-05-09 20:41:21 +00:00
Mike Fairhurst 536ecbac7b Add language 2 tests for null access errors
Change-Id: Icde35448c183a3b9311811aab388909d17e36ceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101461
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-09 18:59:11 +00:00
Daco Harkes a8b93d9e78 [vm/ffi] DBC support on x64 Linux/MacOS hosts
Issue: https://github.com/dart-lang/sdk/issues/35773

Change-Id: Ib58fb8df6c5c18e604fbf2a156ab69025e5f57d7
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97221
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-05-09 11:46:03 +00:00
Johnni Winther 9203ad5e89 Include receiver method invocation receiver type in static type test
Change-Id: I61227e694ca2a19d268705e7a79ae0e696e3a79b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101524
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-08 12:12:40 +00:00
Johnni Winther 5ce8402b0d Handle let variable like normal variables in static type computation
Change-Id: Ie6eb1eafd5677207163e22c2f428487b4e55b090
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101522
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-08 12:12:40 +00:00
Johnni Winther 27d806b5a2 Add CodegenResult as the result of FunctionCompiler.compile
+ delete CodegenWorkItem
+ remove use of WorkItem in the compilation pipeline

Change-Id: I035fb8428b7bbdea9411c087e80c81e3d46d00c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101662
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-08 08:15:59 +00:00
Mike Fairhurst a8b6e18b62 Resolve x ?? y as LUB(X!, Y) instead of LUB(X, Y).
Change-Id: I081d8ec153916fb37e2a949d9fa85a6ea778438e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/92390
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
2019-05-07 16:34:17 +00:00
Aske Simon Christensen dd6da838f1 [CFE] Avoid cloning bodies of lazy if elements.
Fixes https://github.com/dart-lang/sdk/issues/36812

Analyzer/DDC failures: https://github.com/dart-lang/sdk/issues/36873

Change-Id: I36d61d3035c9275078b368637d53f6385cf8c487
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101262
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-07 13:48:48 +00:00
Johnni Winther 3d7405f198 Separate CodegenImpl from JavaScriptBackend
Change-Id: I9644ca0cd6cb60bf20142d7fa74a559dc516a22d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101292
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-07 07:57:06 +00:00
Johnni Winther 1c1af2808f Introduce Codegen interface to decouple JavaScriptBackend from the codegen phase
Change-Id: I7effc20d34fa5d5da799c690182eb6f09948c6ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101288
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-07 07:57:06 +00:00
Sigmund Cherem 9ac7bd7855 Ensure we have a scope for variables when visiting fields
Fixes https://github.com/dart-lang/sdk/issues/36864

Change-Id: I66d70cc30b26bd069d4ab5e2b98f0f5954f3ef59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101460
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-06 21:43:42 +00:00
Brian Wilkerson 821c75c584 Update a test comment
Change-Id: I6bb053a128a689d35ae1c21b29c6a7e8bb869fad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101321
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-06 21:19:20 +00:00
Mike Fairhurst 36c315eacc [analyzer] resolve x?.y to return T?
Change-Id: I3ef319621753364b8d70e79b2ab32d7ec9c1e8d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/92383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-06 21:09:39 +00:00
Stevie Strickland 9486e99114 [vm/compiler] Forward typed data view constructor arguments.
Also adds tests for load optimizer fixes in 836c04f.

Bug: https://github.com/dart-lang/sdk/issues/36570
Change-Id: Ie8ea7f944bc789b4c0894f9d96010113fb3ec4b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99466
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-05-06 10:12:48 +00:00
Johnni Winther 28faf8c7ca Merge GraphBuilder into KernelSsaGraphBuilder
+ avoid use of `compiler` and `backend`
+ make members of KernelSsaGraphBuilder private when possible

Change-Id: Ia069a8c3b4167c1ae55554baadb857975aeff67f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101287
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-06 08:53:24 +00:00
Jens Johansen 7ea75ab0e0 Const fields doesn't introduce setters; look for setter
Fixes #28268.

Change-Id: I43ccc4072be2fba3ee9273d451fc767876191e16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100964
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-06 07:09:24 +00:00
Mark Zhou 86d47dc5b4 Fixing some tests that are failing in all/most backends.
Change-Id: I91bac2a5597b654082c734decdb948c21d1f5e59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100927
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-05-03 23:36:30 +00:00
Brian Wilkerson dbe80f3397 Add tests for late and final variables without an initializer
Change-Id: I65c40b9e994e602f6133e100d0e8896cb9dce75c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101071
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-03 14:51:54 +00:00
Vijay Menon 8866165950 [dartdevc] Reify bottom as Null
Fixes https://github.com/dart-lang/sdk/issues/36832

Change-Id: Ie0869ca350d1951e0736a9d6c92da4a7984117ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101180
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-05-03 13:39:43 +00:00
Johnni Winther 102f4addda Include the static type in the receiver type of dynamic invoke
- and preserve the original receiver type information during type propagation updates.

Change-Id: I20087b282a3d018947043d7a3ab7c45f003eaee6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100966
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-03 07:52:22 +00:00
Brian Wilkerson b8fb787994 Add a test for uses of the default List constructor
Change-Id: I3b1452186e00f930d5da7c64f3a64f08cd6f4589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101066
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-02 20:46:55 +00:00
Nicholas Shahan 9df061524f [tests] Update expected error NoSuchMethodError --> Error
Most (all?) implementations now throw ArgumentError since the
StreamIterator constructor no longer accepts null but the actual
type is not specified.
https://dart-review.googlesource.com/c/sdk/+/98001.

Change-Id: I10a24a67aa7353552c56d435ef206a2bc4f842fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100987
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-05-02 19:26:55 +00:00
Brian Wilkerson 36b2520ca9 Add a test of creating a subtype of Never
Change-Id: I9d28868667667cca5eb122e33226b21850b062bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101067
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 17:53:59 +00:00
Johnni Winther 1577b95c93 [CFE] Substitute types in unevaluated as-expressions and instantiations
As expressions and instantiations lose the connection to the current type environment when put into an unevaluated constant expression. This leaves type variables unsubstituted when the expressions are lazily evaluated leading to invalid compile-time errors. This is avoided by substituting the type variable when creating the unevaluated constant. If the type variables are not substituted by concrete types, this is flagged as a valid compile-time error during the lazy evaluation.

Change-Id: I46264da4332ea1d5b783531d89a5e6f85b8f90e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100963
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-02 13:14:21 +00:00
Sergey G. Grekhov 8c2390089e [co19] DEPS updated
Change-Id: I4c7e62401f9ca3e40f9320772602ca8a247b4eff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100642
Reviewed-by: Sergey Grekhov <sgrekhov@unipro.ru>
2019-05-02 09:08:33 +00:00
Lasse R.H. Nielsen dd19353abb Update test of operator >>>.
Change-Id: Idd8c6dfcf875a53c536aa3535561f259cf7bcd1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98005
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 09:04:18 +00:00
Johnni Winther 8053c43dde Compute static types for for-in loops
Change-Id: I47e98eaf6df7d04286cb737bfdff135e6c0d34d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100843
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-01 14:06:39 +00:00
Johnni Winther 8d4816b7ff Reimplement member usage tracking
We now track member usage in terms of static, dynamic and super access
for reads, writes and invocations. The information collected during
closed world computation is now the basis for the potential member usage
in codegen, thus ensuring that we cannot conclude in codegen that for
instance a field is read dynamically when the closed world knows that
it is never read dynamically.

Closes #36516

Change-Id: I3a1cb87c71268c34bcd67e14a035d9d1be324ab0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100840
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-01 08:58:34 +00:00
Aart Bik a32fee5d8e [dart/vm] GenericCheckBound (AOT) may throw
Rationale:
Previous CL inadvertently removed the may-throw tag
from the AOT version of check bound. But, unlike its
speculative counterpart, this non-speculative check
will throw when out of bounds. Optimizations like LICM
rely on this property for correctness. Found with fuzzing!

https://github.com/dart-lang/sdk/issues/36803

Change-Id: I05952f423ffa1917a08dbb6191d0d1533450bc9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100921
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-30 22:32:07 +00:00
Ryan Macnak ac4fd50446 [vm, compiler] Check for length overflow when eliminating write barriers for variable-length objects.
Bug: https://github.com/dart-lang/sdk/issues/36778
Change-Id: I03bd00dd5a035309807e16911dcd7602b4de5e44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100900
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-04-30 21:36:07 +00:00
Ryan Macnak e178b0726a [test] Speed up unicode-regexp-zero-length_test.
After 347b72c260, this test began timing out on dartk-mac-debug-simdbc64.

Change-Id: I84fc6457c7e10068f761d25cbb1241e2c2f8ab49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100902
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-30 20:45:42 +00:00
Ryan Macnak 347b72c260 [vm] Bypass malloc for large Zone allocations to avoid jemalloc leaks.
Revert 9a07ad88f4.

Bug: https://github.com/flutter/flutter/issues/29007
Change-Id: I6a5f51f0c3a54d354ec5f8495677d46f94d8a1d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100568
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-30 16:17:18 +00:00
Alexander Markov 0b9060ec1d [vm] Fixes for flaky crashes when querying source or source location
There were no checks for missing source or source position, which
caused flaky crashes while running test mirrors/mirrors_reader_test.

Change-Id: I73497414ebe7b030ba308851038e0ef9e133aa48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100781
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-29 22:10:38 +00:00
Brian Wilkerson b83902d51b Add a language_2 test for missing arguments related to required named parameters
Change-Id: I4d08c5a7d7bd7950fab001281f26f2e838335339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100724
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 21:19:08 +00:00
Stevie Strickland 4028fec3b5 Reland "[vm] Finish adding support for ECMAScript 2018 features."
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-29 09:11:48 +00:00
Johnni Winther a1dd732ec6 Extract WorldBuilder results into an immutable BuiltWorld object
For resolution this is the KClosedWorld and for codegen this is the new
CodegenWorld object. This change removes the use of the world builders
after the world building has ended. It prepares for computing more of the
result data from the collected member usages.

Change-Id: I80032e3fc0e29179137b8c0380f09f68ab6fa03b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100540
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-26 07:52:58 +00:00
Keerti Parthasarathy 9238e25305 Revert "[vm] Finish adding support for ECMAScript 2018 features."
This reverts commit 5ebb640a67.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm] Finish adding support for ECMAScript 2018 features.
> 
> This work pulls in v8 support for these features with
> appropriate changes for Dart and closes
> https://github.com/dart-lang/sdk/issues/34935.
> 
> This adds support for the following features:
> 
> * Interpreting patterns as Unicode patterns instead of
>   BMP patterns
> * the dotAll flag (`/s`) for changing the behavior
>   of '.' to also match line terminators
> * Escapes for character classes described by Unicode
>   property groups (e.g., \p{Greek} to match all Greek
>   characters, or \P{Greek} for all non-Greek characters).
> 
> The following TC39 proposals describe some of the added features:
> 
> * https://github.com/tc39/proposal-regexp-dotall-flag
> * https://github.com/tc39/proposal-regexp-unicode-property-escapes
> 
> These additional changes are included:
> 
> * Extends named capture group names to include the full
>   range of identifier characters supported by ECMAScript,
>   not just ASCII.
> * Changing the RegExp interface to return RegExpMatch
>   objects, not Match objects, so that downcasting is
>   not necessary to use named capture groups from Dart
> 
> **Note**: The changes to the RegExp interface are a
> breaking change for implementers of the RegExp interface.
> Current users of the RegExp interface (i.e., code using Dart
> RegExp objects) will not be affected.
> 
> Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
> Commit-Queue: Stevie Strickland <sstrickl@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=lrn@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sstrickl@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I1eda0fee4fd9e94df095944049833a67b07277e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100560
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-04-25 14:29:51 +00:00
Johnni Winther 5fc8029587 Remove StaticMemberUsage and cleanup codegen world builder
Change-Id: I4fdc6148af671010d1aca55c05d08e55e9c1e9fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100245
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-25 08:45:20 +00:00
Alan Knight f3bd910e10 Only use MapFormatter for SDK maps (HashMap and LinkedHashMap)
For classes that implement Map, using MapFormatter can result in many,
many custom format operations. Also, the presentation is not that
useful. We get e.g. a list of indices that then have a name and value
beside them, so it just duplicates the Object view, but with extra
non-useful data.

Change-Id: I74ed34521778bddae9cdad975339925d7c181bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100282
Commit-Queue: Alan Knight <alanknight@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-04-24 22:08:45 +00:00
Dan Rubel f82000dfb1 pre-nnbd modifier as identifier tests
Change-Id: If44d1b0ac3279124e81e9c34e20f7bd9d399d1ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-24 21:29:13 +00:00
Stevie Strickland 650cd2ed1d [gardening] Fix multitest comments on this file.
Change-Id: I56560943c536d5f2a3358745f4b73e0660b3bd90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100361
Auto-Submit: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-24 12:02:56 +00:00
Stevie Strickland 5ebb640a67 [vm] Finish adding support for ECMAScript 2018 features.
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-24 09:24:16 +00:00
Aart Bik 2eb36e8879 [dart/vm] What's in a (register) name?
Rationale:
Under heavy register pressure, a Q register was
selected for which the corresponding D register
had no proper overlap with S registers, which
was required by integer division.

Test:
Real reproducer when use_integer_division=false.

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

Change-Id: I54162f4d6aee6ef9827907d9e97f2a476e9cbe4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100272
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-04-24 00:21:55 +00:00
Dan Rubel 174395a49e NNBD "late" modifier language_2 tests
Change-Id: Iffcd2ef8042576bcfc195ab72f2743f2c3e7be07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100261
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-23 20:58:31 +00:00
Régis Crelier 7c18fc0c3d Revert "[gardening] Mark ffi/function_stress_test/1 test as slow."
This reverts commit 7388c3e3db.

Reason for revert: Marking as Slow is not sufficient. Filed issue instead.

Original change's description:
> [gardening] Mark ffi/function_stress_test/1 test as slow.
> 
> Change-Id: Ic5130781a75250165f92d86729c2d83c436db30e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100280
> Reviewed-by: Régis Crelier <regis@google.com>
> Commit-Queue: Régis Crelier <regis@google.com>

TBR=sjindel@google.com,regis@google.com

Change-Id: I35afabb3207f094f37a9d4b32e027060070f2f91
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100284
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-04-23 20:14:56 +00:00
Régis Crelier 7388c3e3db [gardening] Mark ffi/function_stress_test/1 test as slow.
Change-Id: Ic5130781a75250165f92d86729c2d83c436db30e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100280
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-04-23 17:40:31 +00:00
Brian Wilkerson b4d17f2eee Add diagnostics related to default values
Change-Id: I4b30580e34fbf302a53778010fada54a2e100409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99887
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-23 17:16:50 +00:00
Aart Bik dbfcb97fa5 [dart/vm]: sometimes a smi is just a smi
Rationale:
The IA32 codegen has the concept of "safe smis", which
can actually be larger "mints" that can be constructed
in a safe way (e.g. shifting). However, at a few places,
this caused confusion, since following code assumed
that such values can be casted to "smis" always.
This CL fixes that. Found with DartFuzz.

https://github.com/dart-lang/sdk/issues/36589

Change-Id: I6bf308897abfb0aad965c7fbaf8f374a1ba30d41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100089
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-23 16:39:02 +00:00
Dan Rubel 293c0f42f7 NNBD "required" modifier language_2 tests
Change-Id: I2c0d53fd321dea7ed74cf9fac422ec32f9dea641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-04-23 15:28:12 +00:00
Alexander Markov 5ee20c99ac [vm/aot/tfa] Workaround for crash in getStaticType
Issues: b/131091988, https://github.com/dart-lang/sdk/issues/34496
Change-Id: I9ef8edfff39848e6f240402682d119fe35f7f776
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99972
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-22 22:49:24 +00:00
Jenny Messerly 2c304d997f [dartdevc] fix #36372, make JS Array constructor property usable from JS
The `new array.constructor()` pattern is occasionally used in JS
(presumably, to get the array subtype if one is available). GopherJS in
particular does this. This fixes DDC's generic `JSArray<T>` to support
this pattern, for all values of T. This also makes JSArray work like
all other "native" types in DDC, where the "constructor" property
is the JS constructor for that native type.

Change-Id: I5270bd648d3d60cf07b8548fcd8c9b9d1a3018d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99940
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-22 22:43:14 +00:00
Paul Berry 17db9f986a Simplify type tests in nullable_type_ambiguous_test.dart
Change-Id: I6612a83550acf5f1920bb0467425cfb2977ea2e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99882
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-22 18:50:11 +00:00
Ryan Macnak 9d376de55a [vm] Remove code collection.
Code collection interacts badly with
 - warming up compiled code
 - retaining pre-compiled code
 - code coverage
 - hot reload (deopting to an old version of a function)

Change-Id: Id269a6c3281e577d4f600f0c158af9e62f6b49ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99722
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-18 20:12:09 +00:00
Aart Bik 3cf3e4edde [dart/vm] Reduce trip count of osr test
Rationale:
Test was borderline timeout. The reduced tripcount
still triggers OSR consistently, but runs a lot faster.

https://github.com/dart-lang/sdk/issues/36421
https://github.com/dart-lang/sdk/issues/36218
https://github.com/dart-lang/sdk/issues/36214

Change-Id: I60917bb6bdd51dee6bd11d1fe5beede4753c2147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99783
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-18 19:52:20 +00:00
Brian Wilkerson 836efd6520 Add a language_2 test for having an invalid type in an on clause
Change-Id: Ia073e6a85f6f5cc54ecb45ab5d4e11e7976c3134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99701
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-17 18:35:20 +00:00
Paul Berry 37285467db Improvements to null_assertion_ambiguous_test
Change-Id: I164d0815262d9c861c3b4ad3532808409004ea0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99660
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-17 15:36:26 +00:00
Paul Berry bc99f1ca28 Test a few more uses of the nullable type decorator
Change-Id: I902caac00961514637b77f70200103618662b325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-17 12:15:35 +00:00
Nicholas Shahan 9d15138c91 [tests] Revert the previous deletion of UI-as-Code const tests
Returning since they should be valid with the `constant-update-2018` experiment
flag:
* control_flow_collections/if_const_test.dart
* control_flow_collections/if_const_error_test.dart
* spread_collections/const_test.dart
* spread_collections/const_error_test.dart

Should be deleted when UI-as-Code is supported in constant collections:
* control_flow_collections/if_const_syntax_error_test.dart
* spread_collections/const_syntax_error_test.dart

Change-Id: I595333782630122ae4f3d021841b062b27e1cccb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99600
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-16 23:04:37 +00:00
Sigmund Cherem 8e73b3c006 Enable ui-as-code features.
Change-Id: I97781ffe5144c4b959cb3cb720e9cd06c22928ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99283
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-04-16 21:29:55 +00:00
Sigmund Cherem 4b7d256a06 Revert "Enable constant-update-2018 by default." and "Update .expect files in pkg/front_end after e9ca6a53"
This reverts commit e9ca6a5335 and d3e00fd35e.

Change-Id: I346d6156be19c4fceffa202a7ce9bfa931c7c14b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-04-16 20:20:12 +00:00
Nicholas Shahan 6dc209e858 [tests] UI-as-Code in const collections is a compile time error
* Update tests to expect compilation errors when `if` `for` or `...` are used in
  const collections.
* Remove constant-update-2018 flag from tests.

Change-Id: I477c30f07c7e3da6139f263e1855c3908c1bce2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99485
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-16 20:02:29 +00:00
Aart Bik 9070d6ae61 [dart/vm] Inspect shift constant in absence of range analysis
Rationale:
Queries the constant of a shift operation to determine if it
is in range when range analysis has not run. This seems in general
a good idea, since some optimizations occur *after* range analysis,
and we were missing those cases. In this particular case, it also
avoids an assert fail on a shift by one without env() that was
introduced by a pass that has no subsequent range analysis. In
this case, it is unclear whether not having an env() was an
accident, or on purpose since the shift factor is known to
be well-behaved. Please have a careful look!

https://github.com/dart-lang/sdk/issues/36587

Change-Id: I12b4cb773f31899e17bfce8506bce599ccbef8ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99382
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-16 19:07:15 +00:00
Johnni Winther 5af34ea93d [CFE] Handle invalid constant string interpolation in unevaluated constant expressions
Non-primitive constants were incorrectly stringified in an unevaluated
context. These are now, as with unevaluated constants, checked when the
string concatenation is fully evaluated.

Closes #36609

Change-Id: Ia3266ebcb9d497b277690244569812f7cd3e30c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99461
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2019-04-16 16:05:05 +00:00
Paul Berry 4b19ca1489 Add language_2 tests for NNBD null-assertion operator (!)
Change-Id: I06ffbfae376210ca0428181f567be3702defbe5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99185
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-16 15:16:44 +00:00
Johnni Winther 58ff41ad33 Add test for static tear-off
- to document the change (for the better) with CFE constant

Change-Id: I9b6673497fe07ccd4f92fc4c22df0ae3205f72a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99152
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-04-16 07:06:12 +00:00
Brian Wilkerson 0314d86af4 Add errors when a nullable type is used as a supertype
Change-Id: I82471ba67dd74db6425bb2081bd761eb2b490333
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99284
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-12 21:13:21 +00:00
Sigmund Cherem 1ca57fc729 Update cfe_constant_evaluation_test and remove old constant-expression tests now that constant-update-2018 is on by default
Fixes https://github.com/dart-lang/sdk/issues/36597

Change-Id: Iaaadbacb71fdaddb5486bf0cf85188a30d088e50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99280
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-04-12 19:46:50 +00:00
Aske Simon Christensen e9ca6a5335 Enable constant-update-2018 by default.
Fixes https://github.com/dart-lang/sdk/issues/32517
Fixes https://github.com/dart-lang/sdk/issues/34189
Fixes https://github.com/dart-lang/sdk/issues/34192
Fixes https://github.com/dart-lang/sdk/issues/34205

Unskipping the skipped tests is tracked by
https://github.com/dart-lang/sdk/issues/36433 and
https://github.com/dart-lang/sdk/issues/36595.

Expectation files for front-end tests will need to be updated to make
front-end builders green. They are part of unapprovable suites.

Change-Id: I311f449af6feff5bf40740227a95aa06e0a9d84f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99169
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-04-12 13:30:15 +00:00
Paul Berry d81783ff5f Begin writing language_2 tests for NNBD.
These tests validate simple uses of trailing `?` syntax, and exercise
the ambiguous cases mentioned in the draft spec.

Change-Id: If2526c7f4c898495d667d7e16a2005bd8432f8df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99183
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-12 12:42:48 +00:00
Johnni Winther 394f88d5cf Create source information from ConstantExpression
(now that it has a fileOffset)

Change-Id: I057ca3cf04a941ccdb03a6d8ca58947650b1cbec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99161
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-04-12 07:37:17 +00:00
Jenny Messerly fe6897ab7f [dartdevc] fix #36252, export private name symbols
This adds support to DDC's Kernel backend for instance constants
inlined across module boundaries, by saving private name symbols
so they can be referred to from outside of the current module.

Change-Id: I28d45d1844f5351f506cc7606dd1c4803037304e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98926
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-11 23:45:17 +00:00
Samir Jindel 4be9357966 [vm] Harden function_stress_test.dart
Change-Id: I0aa9600f79be608881b450fb976bd5f2c958d479
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99146
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2019-04-11 19:46:12 +00:00
Samir Jindel a7a87df513 [vm/ffi] Replicate transition to/from native code around FFI calls.
Change-Id: I49be874b47b63a0863ed58d26f417cb957b89380
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98463
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-04-11 11:59:54 +00:00
Mayank Patke ab66a3808b Add more JS subtyping semantics to CFE constant evaluator.
If we're targeting a JS backend, `isSubtype` considers every int to be a
double. We need to additionally allow any integer-valued double to be an
int. This mainly allows us to handle signed zeroes correctly.

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

Change-Id: I00d1e693bb3f1268ac100a76c9bec8fcc612b182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99101
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-10 21:09:03 +00:00
Aart Bik 9876e92c7d [dart/vm] Support OSR on non-empty expression stack
Rationale:
This enables OSR even in the presence of block expressions,
which are introduced by the new CFE control-flow collections
and spread operations. Faster is better!

https://github.com/dart-lang/sdk/issues/36421
https://github.com/dart-lang/sdk/issues/36218
https://github.com/dart-lang/sdk/issues/36214

Change-Id: I363a0b0a5becbbd5743f8fb47ff24dcebc0e4d64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98744
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-10 19:40:49 +00:00
Samir Jindel f4e63990cb [vm/ffi] Support FFI on ARM32.
Fixes dartbug.com/36311.
Addresses dartbug.com/35760.

Change-Id: Ib6c4db69f31dfb5317e4162b80d3e30a996e3a2e
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97631
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-04-10 13:15:16 +00:00
Sergey G. Grekhov 66477b9fcf [co19] DEPS file updated
Change-Id: Iba9bb0fcffa27730cbceb0970177323503151ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98851
Reviewed-by: Alexander Thomas <athom@google.com>
2019-04-10 08:22:32 +00:00
Mayank Patke 919461badd Ensure boolified SSA nodes are non-null first.
Fixes https://github.com/dart-lang/sdk/issues/34147.

The Dart language specification says we should ensure booleans are
non-null in the following (non-exhaustive) situations:
* (ternary) conditional expressions - this includes the `!` operator
since `!x` is equivalent to `x ? false : true`
* arguments to logical boolean expressions (`||` and `&&`), modulo
short-circuiting
* `if` conditions
* `for` loop conditions
* `while` conditions
* `do`/`while` conditions

With control-flow-collections enabled, this CL will also cover
conditions in `if` elements and `for` elements. Tests for these already
exist in
language_2/control_flow_collections/{if,for}_null_condition_test.dart.

Change-Id: I2ce9a30adeb16a0a68411f358f69aeca08656dab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98780
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-10 00:28:10 +00:00
Johnni Winther 45a5349175 Track constant field initializers for field analysis.
Change-Id: I536975d235cbf7722b03aa7b0e2c9edd7c206484
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98852
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-09 16:30:27 +00:00
Johnni Winther 4fc0e1f13d Use .nullType as type of null and fix null type handling in getStaticTypeAsInstanceOf
The .getStaticType results for NullLiteral and NullConstant are inconsistent. The former returns `const BottomType()` and the latter return `TypeEnvironment.nullType`.

To avoid this inconsistency and since `const BottomType()` is really the "unreachable" type, used for instance of for the type of a throw expression, the implementation is changed to consistently use the .nullType.

For this to work, getStaticTypeAsInstanceOf (and the equivalent dart2js implementation), and the `Type.fromStaticType` constructor in the VM type flow analysis have to special case the .nullType.

Change-Id: If6b806d4a39ef7b906275c43fa2089b9d140523b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98563
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-09 06:49:17 +00:00
Sergey G. Grekhov 4ca7401604 [co19] Roll to 7e743ef29b4c06f1a2b8b9dc70ead60b31aab526
Change-Id: I6d52b5820139e83df157e00114b51c0d53a990a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98674
Reviewed-by: Alexander Thomas <athom@google.com>
2019-04-08 14:17:43 +00:00
Aske Simon Christensen d75a49a44f [CFE] Ignore abstract methods when looking for operator '=='.
Fixes https://github.com/dart-lang/sdk/issues/36515

Change-Id: I7e6717b8cde7341c482e5eeb52c2ab4fe8fdcb9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98842
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-08 11:11:08 +00:00
Stevie Strickland 50f3a6c960 [gardening] Make deferred imports part of the corresponding tests.
See https://github.com/dart-lang/sdk/issues/36418 for more info.

Change-Id: I5e26b295699c52db2e542330c23f8ec3095d78e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98840
Reviewed-by: Stevie Strickland <sstrickl@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-08 09:58:27 +00:00
Jenny Messerly da4ccd0855 [analyzer] fix #32918, eliminate type variables during const inference
This brings Analyzer's type inference in line with the language spec.
Similar to CFE, the inference function now takes an isConst parameter,
which if set, tells it to eliminate type variables from the context
type.

Change-Id: Ied67bac39d73c9ecd7e0a482a0c8db77272637cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98707
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-04-05 19:30:54 +00:00
Alexander Markov 07482eeb5e [bots] Run all tests on vm-dartkb-* bots
Bytecode configurations should have the same test coverage as default mode.

The following tests are excluded in dartkb mode as there are too many crashes:
 - service/* (debugging capabilities are not supported);
 - lib_2/mirrors/* (mirrors are not supported);
 - vm/cc/* (bytecode modes are not wired up in run_vm_tests).

Change-Id: I11eead94b96f43ab454acd6e6f6861af943c0488
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97847
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-05 18:25:34 +00:00
Alexander Markov 652a8be7a7 [Tests] Fix inifinite replication of Dart processes in tests
When tests are executed on certain configurations like dartkb or simarm,
the test script is first compiled into a dill file, so the VM command
line for running a test looks like

dart .../generated_compilations/dartkb/foo_test/out.dill

Certain tests have the logic to replace '_test.dart' in Platform.script
with '_test_body.dart' and execute the resulting script.
However, as out.dill does not contain '_test.dart', the script remains
the same after replacement. As a result, test was infinitely re-executing
itself, overloading bots and not making any progress.

Change-Id: I7257d3553a7f0a0de2f6d8218a9eb5c8981af17d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98685
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-04-04 19:14:44 +00:00
Martin Kustermann a112b11e2e [gardening] Disable dwarf_stack_trace_test on product mode because symbols can be wrong
Change-Id: I4e3a7fd12afddf44f69e4da066585866e8770e47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98671
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
2019-04-04 14:47:20 +00:00
Aske Simon Christensen 313e0f5410 [CFE] Check if set element or map key overrides operator '=='.
Fixes https://github.com/dart-lang/sdk/issues/36444

Change-Id: I38b485ca538c65072e2ec3386e30c5ce49671fe4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98666
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-04 14:39:50 +00:00
Aske Simon Christensen a069ddda21 [CFE] Produce InstanceCreation from unevaluated constructor invocation.
Thread assert enable flag through in dart2js to make the dart2js cfe
constant evaluation unit test properly pass the flag.

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

Change-Id: Ie4ac86ce96feda1548120fed54ece9ca03387496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98570
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-04 12:22:50 +00:00
Mayank Patke 2f77af1c6f Fold identical(double.nan, double.nan) => false in dart2js.
Change-Id: Idc6b064e330af71bbc8525a48874d332d84f404a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98607
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-04-03 21:14:31 +00:00
asiva f1cfcc621a [test/vm status files] Update vm status file to remove all entries related to spread and control_flow
Change-Id: I45469fea64f1d5144c3cbe2f800f1eb2be7e90d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98525
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-04-03 21:00:36 +00:00
Mayank Patke 11a3dd7332 Split up language_2/control_flow_collections/for_test.
This helps triage/resolve various issues in testRuntimeErrors:
* for_non_bool_condition_test isolates the code causing a crash on the
dart2js-production-linux-d8 configuration. (See
https://github.com/dart-lang/sdk/issues/36442 and the status file.)
* for_null_condition_test will be an approved failure for all dart2js
configurations due to https://github.com/dart-lang/sdk/issues/36446.
* for_runtime_error_test contains all the remaining expected type
errors. On the dart2js-production-linux-d8 configuration (which runs
with -O3), we assume no type errors exist - even ones guarded by
Expect.throwsTypeError - so the optimized code produces runtime errors
instead. See https://dart-review.googlesource.com/c/sdk/+/97820 for a
similar discussion.
* for_test contains the remaining tests, which are valid on all dart2js
configurations.

Change-Id: Ifef4f7d2e27e2731cdd4a3fec03754ea63b6328d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98606
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2019-04-03 19:40:32 +00:00
Mayank Patke 82f8477314 Split up language_2/control_flow_collections/if_test.
This helps triage/resolve issues in testRuntimeErrors:
* if_null_condition_test will be an approved failure for all dart2js
configurations due to https://github.com/dart-lang/sdk/issues/34147.
* if_runtime_error_test contains all the expected type errors. On the
dart2js-production-linux-d8 configuration (which runs with -O3), we
assume no type errors exist - even ones guarded by
Expect.throwsTypeError - so the optimized code produces runtime errors
instead. See https://dart-review.googlesource.com/c/sdk/+/97820 for a
similar discussion.

Change-Id: Iaf2df85af16cc03fcd7ec7ef2a9e57a2bc3ce081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98622
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-04-03 19:33:26 +00:00
Bob Nystrom ab065aedda Fix a potential infinite loop in type_error_test.
Change-Id: Id5806187d82aeaf07462df1bfd5ae095f1542611
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98454
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-04-03 17:13:31 +00:00
Johnni Winther 93d0e8279a Include liveness of type arguments in supertypes in RTI needed checks computation
Including supertypes (and not just superclasses) this time.

Change-Id: Ib398f6f2fab0ae502dd754727b482641793dd225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98569
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-04-03 15:03:46 +00:00
Dmitry Stefantsov 9f3e9f37a0 [cfe] Make checks on individual leaves of collection element sub-trees
Closes #36456.

Bug: http://dartbug.com/36456
Change-Id: Ic604fecbabe78eede44cedb2251a68b71f608c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98567
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-04-03 13:54:03 +00:00
Vijay Menon fad85a6bfa Broken test fixes
These tests break on all backends.  It looks like the original intent was to run to completion.

Change-Id: I895638c522285f280cbb608c82a8a496bfd11d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98302
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-04-03 13:12:23 +00:00
Martin Kustermann 592aee4838 Revert "Reland "Temporary revert of two changes which potentially caused performance regressions in Flutter.""
The change was already reverted and I accidentally relanded this.

Change-Id: I62ff3367db7aaaf3a470727fdb587830a23fe53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98566
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-03 12:50:57 +00:00
Ben Konyi debd918696 Reland "Temporary revert of two changes which potentially caused performance regressions in Flutter."
This is a reland of 49c94d3600

It appears that the major regressions were introduced not by the typed data unification
changes but rather by 3fd124db1f "[vm] Repair the resolver abstraction." which got
reverted in e979895efb "Revert "[vm] Repair the resolver abstraction."


Original change's description:
> Temporary revert of two changes which potentially caused performance regressions in Flutter.
>
> Revert "[vm] Re-number class ids for internal/external typed data and typed data views"
>
> This reverts commit a062221b76.
>
> Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"
>
> This reverts commit 94362f1af0.
>
> Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
> Reviewed-by: Ben Konyi <bkonyi@google.com>

Change-Id: I758775ccc426a02bce538d07ea04d9c67e8933d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98562
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
2019-04-03 12:04:23 +00:00
Kevin Millikin dbb6bf0237 [cfe] Ensure that async for map entries are marked
When disambiguating between maps and sets, ensure that `await for`
loops are marked as asynchronous.  Otherwise, there will be a spurious
type error because we have a Stream and would expect an Iterable.

Change-Id: Ie97eaf74ff7a9e4dfb262ab0447f4322d04701aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98467
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-03 10:27:22 +00:00
Johnni Winther 78fca5b2fa Include liveness of type argument in supertypes in RTI needed checks computation
Change-Id: Ifdde3e8694f8d39ccf10cac0d5dc2cb3cb9225bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98560
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-04-03 10:23:53 +00:00
Dmitry Stefantsov e1e5bb59c9 [cfe] Check that the condition in if-elements is a bool
Change-Id: If089fa603d586169ca2a368ba7fbf7fffc7ec8d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98484
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-03 09:17:24 +00:00
Dmitry Stefantsov c5f1614bcc [fasta] Don't use invalidCollectionElement when ui-as-code is enabled
Closes #36413.

Bug: http://dartbug.com/36413
Change-Id: Ie9f0b82bab63c802fddb4c5642d374d7cc43455e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98466
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-03 09:17:24 +00:00
Mayank Patke 7f09c40db4 Add builder tag to dart2js-production-*-d8 and mark
language_2/control_flow_collections/for_test as Crash on
dart2js-production-linux-d8.

Change-Id: I672daf323a908f7f333fed71c96525dde6f68d91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98504
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-04-03 04:05:10 +00:00
Ben Konyi d63d0b4bcd Revert "Temporary revert of two changes which potentially caused performance regressions in Flutter."
This reverts commit 49c94d3600.

Reason for revert: Relanding

Original change's description:
> Temporary revert of two changes which potentially caused performance regressions in Flutter.
> 
> Revert "[vm] Re-number class ids for internal/external typed data and typed data views"
> 
> This reverts commit a062221b76.
> 
> Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"
> 
> This reverts commit 94362f1af0.
> 
> Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Change-Id: I5c5be67fcec05434283153cb2592ba41afd1f41f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98505
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-04-02 23:53:42 +00:00
Ben Konyi 49c94d3600 Temporary revert of two changes which potentially caused performance regressions in Flutter.
Revert "[vm] Re-number class ids for internal/external typed data and typed data views"

This reverts commit a062221b76.

Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"

This reverts commit 94362f1af0.

Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-04-02 23:53:12 +00:00
Mayank Patke 335a854696 Implement JavaScript semantics for frontend constant folding.
Change-Id: I8232d0f5875d8471d8110582c44fc9d9b8a735f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98240
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-02 22:37:46 +00:00
Nicholas Shahan 2ee8bb87e4 Remove control flow collections test skips for all platforms
Issue: #36005
Change-Id: Ibbc1f22c8e4dad9b5a72f97001638772622b74ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98430
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-04-02 19:17:47 +00:00
Alexander Markov 8fb77ec84d [vm/bytecode] Preliminary support for new language features in bytecode
Issue: https://github.com/dart-lang/sdk/issues/36214
Issue: https://github.com/dart-lang/sdk/issues/36218

Change-Id: I39149b82cb93c1cb87c64cf9c41c56b753bba13a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98400
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2019-04-02 19:11:09 +00:00
Mayank Patke 50d4e489d4 Fix type comparisons in language_2/control_flow_collections.
Types are compared with `Expect.equals` instead of `Expect.identical`
since they are not always canonicalized.

Change-Id: I43c878986d190c361efaae321621f204a4bb8495
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98425
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-04-02 17:24:49 +00:00
Johnni Winther 14fd3b7d6a Report errors on invalid constants in == and !=
Invocation of == and != is only constant on receivers of types bool, int, double, and String or null operands. This is now handled correctly in constant evaluation. The case for method invocation of `a != b` is removed since it is parsed as `!(a == b)`.

Change-Id: I65d8ddf2716f319f61fc0609803a5237f4aba644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98349
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-02 13:54:28 +00:00
Dmitry Stefantsov 4a1b153fe1 [cfe] Enable type promotion in if-elements of literal collections
Closes #36396.

Bug: http://dartbug.com/36396
Change-Id: I223267cdee1aca38d69354e4f97df7dcc76e9553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98461
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-02 13:33:19 +00:00
Dmitry Stefantsov 45bd79c119 [cfe] Fix inference on variable declarations in for-elements
Closes #36395, closes #36393.

Bug: http://dartbug.com/36395
Change-Id: Ifd35ce2e1a646b484b7fcc83d9fb1a0f9d3ae978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98333
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-02 13:33:19 +00:00
Kevin Millikin c71888d537 [cfe] Async translation of block expressions
Translate block expressions in the VM's async translation.  Closes
https://github.com/dart-lang/sdk/issues/36277

Change-Id: I606b155bfe1364e948d18043c167a272007411e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98339
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-04-02 10:00:53 +00:00
Mayank Patke ba473d579f Unskip co19_2/Control-flow-collections for dart2js.
We fail the following:
* type_promotion_A01_t01
* static_errors_A04_t01/01
* static_errors_A04_t01/02
* const_collections_A02_t02/01
* const_collections_A02_t02/03
* const_collections_A02_t02/04

Change-Id: Id568d5ab6ea2047f4bc0ff0d212ae22b6a9ee22f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98444
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-04-02 01:16:53 +00:00
Sigmund Cherem c26f1c6bf7 Do not assume stack trace is not null
Change-Id: Ib795cfdbcf9599f7e4bc2688b9a965f50c0b7c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98421
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-04-02 00:02:53 +00:00
William Hesse 1e77c187c8 Update front-end status for added tests and changed results
Added tests and changes to constant implementation have changed
the result of the front-end compiler on some tests.

Change-Id: I112027f2ca5ed72cc640ce01f577e498020866f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98356
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-04-01 15:52:08 +00:00
Johnni Winther 1a3e8dda3b Handle nested unevaluated constants in constant evaluator
The constant evaluator assumed that any ConstantExpression met during evaluation of a sub expression was not an unevaluated constant. This do occur, for instance when a field is initialized to an unevaluated constant. With the change, unevaluated constants met during evaluation are themselves evaluated.

This change also fixed handling of assert initializers in unevaluated constants.

Change-Id: Id9e676f40bc829c4d234f34a74ef0ca5c4c6ec48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98348
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-01 14:29:32 +00:00
Johnni Winther 05dd851566 Test late CFE constant evaluation.
Tests that dart2js can handle evaluation of unevaluated constants from CFE, including handling of potential compile-time errors found during evaluation.

The CL fixes a bug in the constant evaluator where it created map literals that were not marked as constant as needed.

Change-Id: I7df77a3c68e52392a143478b3567d19e09ebe6bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98347
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-04-01 13:05:52 +00:00
Lasse R.H. Nielsen 413315cacd Add some tests for constants.
Change-Id: I5f06c2849ed3f610023a399f65c0cbfaf1921b34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97510
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2019-04-01 13:03:42 +00:00
William Hesse dc1f6b352a Update front-end status for co19 roll
This adds some missing status file fixes for the latest co19 roll.
That roll was https://dart-review.googlesource.com/c/sdk/+/98344

Change-Id: I0b7f6ecd993d1a7bfeced7ca4f4d1a7b6a118cd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98354
Reviewed-by: Alexander Thomas <athom@google.com>
2019-04-01 12:02:55 +00:00
Samir Jindel 154c324786 [vm/ffi] Lock out structs on 32-bit platforms.
Addresses https://github.com/dart-lang/sdk/issues/36334

Change-Id: I880812941748207ea93a789db2f2d4d2938d3f37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97961
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2019-04-01 10:30:58 +00:00
Martin Kustermann 94362f1af0 [vm] Unify internal/external/view typed data into new RawTypedDataBase class
This moves the length field as well as an inner pointer to the start of
the data into the RawTypedDataBase class.  The inner pointer is updated
on allocation, scavenges and old space compactions.

To avoid writing more assembly the typed data view factory constructors
will be generated using IL, which will update the inner pointer. This
required adding new IR instructions and changing the existing
UnboxedIntConverter instruction.

This is the foundation work to de-virtualize calls on the public typed
data types, e.g. Uint8List.


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

Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try, vm-dartkb-linux-debug-x64-try, vm-dartkb-linux-release-x64-try, vm-kernel-asan-linux-release-x64-try, vm-kernel-checked-linux-release-x64-try, vm-kernel-linux-debug-ia32-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-debug-x64-try, vm-kernel-linux-product-x64-try, vm-kernel-linux-release-ia32-try, vm-kernel-linux-release-simarm-try, vm-kernel-linux-release-simarm64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-linux-release-x64-try, vm-kernel-optcounter-threshold-linux-release-ia32-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try, vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-obfuscate-linux-release-x64-try, vm-kernel-precomp-win-release-simarm64-try, vm-kernel-precomp-win-release-x64-try, vm-kernel-reload-linux-debug-x64-try, vm-kernel-reload-linux-release-x64-try, vm-kernel-reload-rollback-linux-debug-x64-try, vm-kernel-reload-rollback-linux-release-x64-try, vm-kernel-win-debug-ia32-try, vm-kernel-win-debug-x64-try, vm-kernel-win-product-x64-try, vm-kernel-win-release-ia32-try, vm-kernel-win-release-x64-try
Change-Id: I1aab0dd93fa0f06a05299ab4cb019cf898b9e1ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97960
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-30 14:02:50 +00:00
Dmitry Stefantsov e0a2651ce0 [cfe] Fix downcasts added during set/map disambiguation
Change-Id: I79d559c756994424eb395ecc8f12f84c1bf1e257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98327
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-29 17:18:55 +00:00
Aske Simon Christensen fb58826aa3 [CFE] Compensate for lowering and desugaring in spread.
This fixes a problem where a set or map in a spread would not be
properly recognized by the constant evaluator when compiling for a
VM target.

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

Change-Id: I01efc932994c143fa5a5a2fbacda21fe9206e3e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98330
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-29 16:59:06 +00:00
Johnni Winther 7ef28f0b03 Handle constant field init registration correctly.
+ avoid side-effects of checking enqueuer invariants

Change-Id: Id327371bc70e4b1b5fd4d326b8c8cf8caf50ea0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98142
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-29 16:44:15 +00:00
Johnni Winther da0de0a867 Handle native field impact correctly from ir constants
Change-Id: I0393fd57b78c7cb417888ec3e0ff139b888bf3a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98322
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-29 16:41:55 +00:00
William Hesse 00d65e2d84 Roll co19 to revision c3b33ee
Rolls the version of co19 tests in the SDK checkout to
c3b33ee90c5ee7f88fdb0ead08fdbb40c54954d2

Change-Id: I11a181e2fb1e37ff73fb038cd51b3ad38e2a0ae9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98344
Reviewed-by: Jonas Termansen <sortie@google.com>
2019-03-29 16:22:42 +00:00
Erik Ernst 69790e7eb4 Updated Dart.g, tests & status files to support ui-as-code collections
Change-Id: I9ba3aa4e3ebaedee3a2cd20ccdcc533af96b9bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98018
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2019-03-29 13:33:52 +00:00
Sergey G. Grekhov a506c708f2 [co19] DEPS updated
Change-Id: Idf7c5bab05f7247853bf3e2f2accbc96e2f8550f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98181
Reviewed-by: William Hesse <whesse@google.com>
2019-03-29 10:31:48 +00:00
Bob Nystrom 0eb76a5b5a Move await for of null tests to a different file.
Those will be failing in 2.3, and we don't want that to make the entire
await_for_test to fail.

Change-Id: I5f81ada877a5ecef8a3034f071313a6729b53aaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98242
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-03-28 23:45:29 +00:00
Sigmund Cherem 8d699db9af Update spread_collections/inference_test to use Type.== instead of identical
dart2js doesn't canonicalize types so comparing with identical causes the test
to fail.

Change-Id: I3e6f19f8ab95d949402c3bf0caf0c31cc0fccbad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98241
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-03-28 21:58:49 +00:00
Vijay Menon bc0148cf87 [ddc] Skip unsupported co19 tests on ddc/ddk
Change-Id: I3a365828a6e7c0f5060238bf65eb11512b66934b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98160
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-03-28 19:03:33 +00:00
Ben Konyi ac2c934563 Reland "[ VM / dart:isolate ] Added ability to set names for spawned isolates."
This reverts commit 638f13ff3d.

Change-Id: Ib5015539b1c93791c2469be6995789f8f0362806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97845
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-28 16:39:50 +00:00
Aske Simon Christensen 018fd36557 [CFE] Handle spread and if in const map literals.
Change-Id: I5250a115c1c98849a695e1d159532a49605c7caf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98014
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Aske Simon Christensen b5be157e09 [CFE] Handle spread and if in const set literals.
Change-Id: I7db79282c1caafb2f8f07cd676e4bbe0941cd264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98009
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Aske Simon Christensen 102b1fa39e [CFE] Handle spread and if in const list literals.
Change-Id: I534dcd2e02d8d70b83b55a4890fb1a6e1bf6170d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97307
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Aske Simon Christensen 665d2d0003 [CFE] Leave const collections to the constant evaluator.
Change-Id: Ib828bfa7f5695657e9e5ca67f7a9c3868a2a8fa1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97936
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Dmitry Stefantsov 864b22d3ce [cfe] Add inference and type checks to if-elements in maps
Change-Id: I3cacaee173320dd52bead6688fac24e4e4a01f0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97962
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-28 12:30:41 +00:00
Johnni Winther 05f3b12960 Add test for native declarations
Change-Id: Iea9d8d27e6fdefa6f47471a459cdb4363aab65e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98011
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 10:29:11 +00:00
Johnni Winther 7baae76480 Always use ir constants in annotations when constant-update-2018 is enabled
Change-Id: Ib5ba6a908904c36a8580f6f47424b6982800dddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 09:34:21 +00:00
Johnni Winther 10abacba10 Use hasOnlyNonDeferredImportPathsToConstant to add deferred constants
Change-Id: Ifd8b733c526fe4e7ae837a7d17c682e91717feb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98013
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 09:17:31 +00:00
Nicholas Shahan add5a27120 [infra] Add constant-update-2018 flag to v2.3 lang features tests
Patched changes from https://dart-review.googlesource.com/c/sdk/+/97939

Removed the change to the language_2_kernel.status

Kernel team can update as needed.

Change-Id: Icc347081e6c00fb2ae7616afb452e2c652f9d6b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97942
Reviewed-by: Vijay Menon <vsm@google.com>
2019-03-28 01:35:53 +00:00
Bob Nystrom ffee99d79b Add asyncExpectThrows<T>() to async_helper.
This lets you test that a callback returns a Future that completes to
a given error. Like Expect.throws(), but async.

At first, I added support for this directly to Expect.throws(), but I
think it's better to minimize the amount of dynamic logic going on in
the language test framework.

I was worried about having to duplicate all of the Expect.throws___()
convenience functions but now that we have generic methods, those
functions aren't that much more convenient.

Change-Id: I8b288945611fa16f8d27056f3cf79181fc22d256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97881
Reviewed-by: William Hesse <whesse@google.com>
2019-03-27 18:26:15 +00:00
Bob Nystrom 9ea9612ce8 Object can be used in for-in and await for elements.
It's not a compile error. Instead, a runtime cast is inserted.

Change-Id: I871191d9f6fdb72276449abe7016c86ac098fd60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97946
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-03-27 17:46:10 +00:00
Sergey G. Grekhov f12715354a [co19] DEPS updated
Change-Id: Ic4b915c1b1fe355577da564ca57d1d6a5c714ee6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97980
Reviewed-by: Alexander Thomas <athom@google.com>
2019-03-27 14:49:31 +00:00
Johnni Winther 8a92d2a8d9 Collect types deeply for deferred loading
Change-Id: I7bbd9499975c78fcdcfa88ceba31cb2e8e5a7cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97639
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-27 11:08:37 +00:00
Sergey G. Grekhov 4256a97a3d [co19] DEPS file updated
Change-Id: I9a691a5efc92cc3a32feca683df7c6ec934cce11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97900
Reviewed-by: Alexander Thomas <athom@google.com>
2019-03-27 08:08:05 +00:00
Mayank Patke 419243fc4e Add support for BlockExpression.
Since we already have support for Block in our visitors, we can extend
them to support BlockExpression fairly easily.

co19_2 and language_2 tests still need to be unskipped, but we can't do
that until CFE respects the --enable-experiment=control-flow-collections
flag.

Change-Id: I48da19cc33dbf35c5ead3ea13266b01d3e0de959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97820
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-26 21:56:51 +00:00
Alexander Markov 61f0f5bc43 [vm/bytecode] Declare members in bytecode
This change replaces kernel AST declarations of fields and functions
with bytecode declarations.

Size of dilp files is reduced by 11-12%.

Startup latency:
Time to the first full frame: 1.945s -> 1.687s
FinalizeClass: 554ms -> 277ms
FinishClassLoading: 296ms -> 156ms

There are following regressions in bytecode mode, which will be fixed
in future:

* dart:mirrors are not supported yet (implementation of mirrors relies
  on reading kernel AST in certain cases).

  As the result, lib_2/mirrors/* tests fail.

* native extensions are not supported yet (annotations on libraries
  and classes in AST are cleaned up as they could reference members
  which are now removed from AST).

  As the result, standalone_2/entrypoints_verification_test test fails.

* language_2/spread_collections/const_error_test/* tests fail
  due to https://github.com/dart-lang/sdk/issues/36286.

Change-Id: I5130f401fd7b84038b136136e7ccc1a6e51b6cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97561
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-26 21:40:10 +00:00
Dmitry Stefantsov fbc70da0d3 [cfe] Add inference and type checks in for-elements in lists and sets
Change-Id: Ib8e85f674caf0565b25cf29642f4981a4a1534e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97934
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-26 17:23:10 +00:00
Dmitry Stefantsov 49a7fa1c11 [cfe] Add inference and type checks for if-elements in lists and sets
Change-Id: Iad4e6a6ed86e17f97f6bb7ad16f2bff20ab84fae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97925
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-26 17:23:10 +00:00
Bob Nystrom 73d5c6bab0 Make the collection await for test actually return a stream.
Change-Id: Ie4991915be68500f5edcb7e2cf9a50b84c8ba7e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97880
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-03-26 16:42:25 +00:00
Kevin Millikin 1af9f99a5f [cfe] Compile loops in map literals
Add support for compiling for and for-in loops in map literals.  They
are lowered to block expressions.

Change-Id: I555401257ba028543310edbd0547166d7c6a26a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97929
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-26 13:45:52 +00:00
Johnni Winther a8e51c5868 Bypass use of dart2js_platform.dill when experimental flags are non-default
Change-Id: I95e654c6c2a430f7aebb30ced92b33cd35aadca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97634
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-26 13:18:24 +00:00
Kevin Millikin ac21076110 [cfe] Implement compilation of loops in lists and sets
Implement the translation of for and for-in loops in non-const lists
and sets.  They are lowered to block expressions containing a loop.
It is impossible to target these loops with a break or continue
because they do not contain statements in their body.

Type inference is not yet implemented.

Change-Id: I35ff1650fde54cd376fe0b444891010435c74507
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97922
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-26 12:16:22 +00:00
Johnni Winther 0a3cd80d41 Reland "Change default of 'keepFields' in constant transformation to true"
Reviewed in https://dart-review.googlesource.com/c/sdk/+/97632

Change-Id: I042a81ffcf60b3dfb0666f69dcb97a8835036afc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97921
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-26 11:48:41 +00:00
Kevin Millikin 12d789fa52 [cfe] Update test status files
New tests were added without status file updates.

Change-Id: Ibd8e48d6a3818e69649e881594be78afd490ba91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97920
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-03-26 10:50:01 +00:00
Kevin Millikin e5374a688c [cfe] Add front-end support for for and for-in
In collection literals, support for and for-in in Fasta's body
builder.  They are removed when encountered during type inference and
their lowering to block expressions is not yet implemented.

Change-Id: I41e6a7a4aca7ffafdc12119e1503e9c0df5a6589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97628
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-26 09:45:29 +00:00
Bob Nystrom f09097bab8 Add tests for "await for" in collection literals.
This doesn't cover all of the corner cases around the synthesized
stream subscription and stuff, but I honestly don't know if I'm
qualified to write those tests. This should cover all of the basic
static and runtime semantics that users care about.

Change-Id: I7237f0ccb9bf02af291d3175ab2c0074d0547c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97548
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-03-25 21:48:25 +00:00
Vyacheslav Egorov c9ecdabe5d Revert "Combine override checks and override-based inference in one phase"
This reverts commit 9db4119b67.

Revert "Change default of 'keepFields' in constant transformation to true"

This reverts commit b1e14cbe5f.

Revert "[fasta] Don't create forwarding stub if there's already a member"

This reverts commit 51da94da76.

These commits are reverted to unblock rolls into Flutter.

b1e14cbe5f is reverted because it contained
changes that prevented clean revert of the other CLs.

Change-Id: I8d3c00f0c1b146f4debe7f1a1a7de75be154e265
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97802
Commit-Queue: Alexander Aprelev <aam@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-25 19:40:26 +00:00
Samir Jindel 580f44aa83 [vm] Enable running FFI tests on Android in JIT-mode.
* Move FFI tests into a separate test suite.
  They never belonged in standalone_2/ since they are not only available in
  the standalone VM. Also, we want to have a separate status file.

* Add new "SharedObjects" option to test files to copy needed shared objects
  to the Android device for testing.

* Add support to compiler/runtime_configuration.dart for testing JIT-mode on Android.

* Add new configurations and builders to test_matrix.json to test JIT-mode on Android.

* Clean up status file entries for FFI (we didn't need to special-case stress & subtype tests).

Change-Id: Ifb32ef7051754f477d00ecd7a0f9b19ca8a66eae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97334
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-03-25 16:14:18 +00:00
Aske Simon Christensen 2ce1af9cbe [CFE] Constant evaluation of newly added operators
Change-Id: I2fa73e458035a5703536faccbe8b90eb5e86d2be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97509
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-25 12:56:10 +00:00
Johnni Winther b1e14cbe5f Change default of 'keepFields' in constant transformation to true
This is necessary to support modular constant transformation as
needed for instance of for platform dill files.

This change also restricts the removal of additionExports to fields.

Change-Id: Ie7379f09672d8caeaf0689d42af9e1246b9678fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97632
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-25 10:05:18 +00:00
Aske Simon Christensen 133d1b5afe [CFE] Allow 'as' and 'is' expressions as constants.
Also clean out obsolete status file entries due to renamed constant
update test directory.

Change-Id: I135d8c9cac19342143bf8154d1b2e72cf0b8dd01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/93161
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-03-25 09:17:58 +00:00
Jenny Messerly dfae23d205 [dartdevc] fix #36293, call nSM on callable objects if the lookup fails
Given `obj.foo(1, 2, 3)`, if `obj.foo` succeeds but `call()` on the
resulting object fails, DDC should call `noSuchMethod()` on the result
of `obj.foo`, not on `obj`. This CL also adds a few more test cases that
DDC was failing on.

Change-Id: I76c3cc73e4cc81791f961c6b2a55cbfea7a5240b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97701
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-03-22 22:55:11 +00:00