Commit graph

4305 commits

Author SHA1 Message Date
Mayank Patke 450924a8cd [dart2js] Remove typedefs from backend.
Change-Id: Ia170535b5d35d97003cff93acbf33cb3fe75725f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134206
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-05 01:09:47 +00:00
Sigmund Cherem 07675de0c0 Fix type error within _EventStream.onData
The constructor was wrapping the onData handler to hide the type-mismatch. This
copies the same logic to the onData handler.

In non-nnbd code this code was not exercised. The migration of dart:async
made this code reachable on our tests. That's because Stream.first used to
do:

  var subscription;
  this.listen(() => ... cancel subscription here, ...)

it now avoids making subscription nullable by registering the onData handler
later:

  var subscrition = stream.listen(null, ...);
  subscription.onData(() => ... cancel subscription here);

This change fixes the following 6 html tests under nnbd:
html/history_test/history/history
html/transferables_test
html/transition_event_test
html/websocket_test
html/worker_test/functional/functional
html/xhr_test


Change-Id: I095ea8d545e65b047504af0367586884bba84d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134120
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-02-02 05:58:24 +00:00
Mayank Patke ed441e48d0 Update all Slow tests to be Slow, Pass.
Change-Id: I610b272355b045eab80cf941210774fb12d775eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134103
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-02-01 00:17:42 +00:00
Mayank Patke a5cfdf6586 [dart2js] Use flags to choose between legacy/NNBD in RTI.
Change-Id: I42705320aabcdfecc12098f40ca16a2c623a1033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134091
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-31 20:04:52 +00:00
Mayank Patke a52d6ea9b9 [dart2js] Fork backend subtyping into legacy and null-safe variants.
Change-Id: I64a20b5c64d700b873ac6210e5845c8d59192991
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133331
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-30 17:02:38 +00:00
Stephen Adams deae9152e0 [dart2js] Use HInvokeExternal for native calls
A new instruction, HInvokeExternal, codes a variety of calls to JavaScript.
'native' and js-interop calls use this instruction instead of
HForeignCode. This leads to fewer places generating similar JavaScript
patterns, and slightly better scheduling around call sites.
More js-interop calls are now lowered to direct JavaScript calls rather
than interceptor calls.

Change-Id: I8d30827bb099d27f4cc2ad469449769418ccb6da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133021
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-29 21:19:00 +00:00
Sigmund Cherem bf6c439e9a [dart2js] SSA: Avoid emitting generate-at-use twice
This seems to happen in a check-chain when the input is unnamed.  I'd
rather name something than do this, since it interferes with counting
occurrences for sharing constants.

Fixed: 40349
Change-Id: I6a077707b172cee7505130119e41f856244f9424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133624
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-01-29 00:26:37 +00:00
Nate Bosch 534e85866d Assert that allowInterop is used with constructors
Fixes a missing case where DDC allows unwrapped functions to flow to
JavaScript through constructor calls or anonymous object instantiation.

- Pass the `Member` through to `_emitArgumentList` in the case of
  constructor calls and object literals so that `isJsInterop` can be
  determined.
- Pass an optional `isJsArgument` member through for emitting named
  expressions. Previously I thought that no named arguments would be
  used for javascript calls, but they are used to create object literals
  for anonymous JS types.
- Add both anonymous and non-anonymous constructor invocation examples
  to the JS interop test.

Change-Id: I004642f3b2caccc0d8c26786f2bdcb081d135898
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131462
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2020-01-28 16:59:58 +00:00
Stephen Adams 6b34a69496 [dart2js] Cleanup of a few dynamic calls
Change-Id: I8d616c98fedc12c9c4ee937bf5e6df55e8d9fe2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133338
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-01-25 02:14:34 +00:00
Mayank Patke e2a899e965 [dart2js] Add regression test for #40296.
Change-Id: I1bbcb5ea097fb5f844f67a8fb7474e8b3fc38a36
Bug: https://github.com/dart-lang/sdk/issues/40296
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133328
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-24 22:48:33 +00:00
Stephen Adams b099832be9 [js_runtime] Check Rti on JSArray is from same program
Bug: 40152

Change-Id: Ie54192e61dc255c02483142b606ab0a31e28a0b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131902
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-01-16 19:45:03 +00:00
Johnni Winther 99e2a348b3 [dart2js,cfe] Move filenames.dart to _fe_analyzer_shared
... and use it fix perf_test on Windows

`currentDirectory` is replaced by `Uri.base` (the former sounded more magical than it was!)

Change-Id: I5fb8dc5dba004ebad221d4b39d213d51964c5ea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131622
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-15 10:12:23 +00:00
Nicholas Shahan 773ebd220b [dartdevc] Update NNBD subtype tests to avoid wrapping legacy types
Wrapping a legacy type will cause the legacy-ness to be stripped off by design.
This causes confusion when trying to unit test the runtime subtype checks so we
are now simply avoiding it here.

Introduce a `unwrap()` helper method that will attempt to upwrap any type that
isn't legacy. Legacy types are simply returned unchanged because they are
already unwrapped.

Copies the other helper methods from runtime_utils.dart to
runtime_utils_nnbd.dart so they can be updated with the special unwrapping logic
for legacy types.

Change-Id: I21ff24b766a1f7a569181a2e1c47233320751c66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131707
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-01-14 22:38:46 +00:00
Johnni Winther d08f070b28 [cfe] Add canonical way to detect the synthesized redirecting factory field
Change-Id: Ied5ffe786558856c4e63881880cbd19fa0bd6c68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131620
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-14 09:42:45 +00:00
Vijay Menon 28c335d5a2 Move dart:js to patch format
This is prep for nnbd port to ensure APIs remain consistent across DDC and Dart2JS.

Change-Id: I8ec6c5b152eb87868038570f2275e82af3325fb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131000
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-12 01:13:53 +00:00
Mayank Patke b3457c8cc2 [dart2js] Fork the RTI subtyping algorithm into legacy and NNBD
variants.

Change-Id: I6344afdd7ed063e8672df93925e53b77921a560f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-11 02:27:22 +00:00
Sigmund Cherem a92a9f1ba2 (dart2js) initialize the receiver type to its static type during inference
This also reverts the use of indirection for `==` during global inference, as it
turns out the bulk of edges from that selector were added because of the missing
static type data.

Change-Id: I970fea214983c7b2350466fc932ef45d6f7ad96e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130501
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-01-11 00:28:31 +00:00
Sigmund Cherem 4bc9c8b52c (dart2js) rename typeOfSend, delete unused typeOfGetter
Change-Id: Ief7421845f89c2f6569230b8497981d96f46ce61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130520
Reviewed-by: Stephen Adams <sra@google.com>
2020-01-11 00:28:31 +00:00
Mayank Patke 7ad7e9aa55 [dart2js] Implement new subtype algorithm structure for DartTypes.
Change-Id: Ib5144c7960dda82a82a16da7cef0b302e34a4b18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130464
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-01-10 01:20:06 +00:00
Mayank Patke 9860a07ef7 [dart2js] New RTI: Use new algorithm structure for runtime subtype checks.
Change-Id: I266bc76240c65597bb46c372ccdfb70153a6a055
Fixes: https://github.com/dart-lang/sdk/issues/38907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125441
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-10 01:20:06 +00:00
Stephen Adams 3947b15b29 [dart2js] nnbd: Implement NullCheck
Use NullCheck for inlining and remove 'isNullCheck' from HFieldGet.

Change-Id: Ic9908739a26367243002c1c71f9193660a8c08e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130222
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-09 23:49:37 +00:00
Johnni Winther 008e6ae60b [analyzer,cfe,dart2js] Add skipMap to id-testing
This supports skipping tests per configuration, for instance to add
nnbd-only tests and skip these in non-nnbd configurations.

Change-Id: I7eaebaa16d67129ce60cffa3594c766ff5e5bc66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130376
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-08 14:47:28 +00:00
Johnni Winther 64dae246db [dart2js] Use CFE constant evaluator for non-required constants
Change-Id: Id363332caf29e98307553ec048c2dea36c739d95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129701
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-08 08:21:59 +00:00
Mayank Patke 497005dd05 [dart2js] Represent nullability as its own bit on UnionTypeMasks.
Change-Id: I2edab02eb6d611215e490defb6f4919ce19f0f3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130462
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-07 19:51:30 +00:00
Stephen Adams f43ab9bf75 [dart2js] Add sourcemap test for chained calls in generated code.
Tracking issue: https://github.com/dart-lang/sdk/issues/39998

Change-Id: I32662e665f90d8cba0783f21a17318d767eeb06c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-01-07 00:42:21 +00:00
Sigmund Cherem d735f1f12d (dart2js): enable new-rti by default
This change:
* adds the `--use-old-rti` flag to revert to the old behavior
* enables the new behavior by default
* changes the -rti- builders to run the old rti instead of the new rti
* documents the change in CHANGELOG.md

I've kept around the logic as `useNewRti` to avoid swapping all the conditions
in the compiler.

Change-Id: I773ac33b658cb60f72e0b6beef83375abec31bad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127492
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-01-04 00:44:25 +00:00
Mayank Patke 4bc01d0dd4 [dart2js] Treat type variable bounds checks as implicit is-tests.
Change-Id: I19e26c1d16f9515b9307073318532c6467af5cf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130126
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-01-03 21:47:29 +00:00
Johnni Winther e3a20bf361 [analyzer,cfe,dart2js] Support annotated code generation
Add support for generating annotations from actual data using
option -g

Change-Id: I88d9cdb62a38d579234b15097c9e9bb3d81ebe8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129708
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-03 13:57:39 +00:00
Sigmund Cherem 4eae39672a (dart2js) release some data-structures after resolution.
The resolution-world-builder and impact transformer were holding onto a
class-hierarchy-builder in dart2js, which uses a lot of space.

On a some artificial sample apps with thousands of classes this
reduces the overall memory capacity by 25%. On a large internal app
this reduced the overall memory capacity from 13G to 11G.

Change-Id: I5d0d40764649364f2cd2411ef1346812beb411c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129544
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-01-03 00:24:08 +00:00
Nate Bosch 113ff6c993 Enforce that allowInterop is used in DDC
Fixes #39074

DDC emits Dart code that can usually be called with the same semantics
as JS there is no guarantee that a function passed to JS and then
invoked successfully was wrapped with `allowInterop`. The wrapping is
always required in Dart2JS. To make DDC more strict, add interceptors
that check for the usage of `allowInterop`.

Whenever a JS interop function or setter is passed an argument which is
statically typed as a Function, but not wrapped with `allowInterop` at
the call site, wrap it with `assertInterop` which will check the
argument at call time and fail with a clear error if it was not wrapped.

Whenever a JS interop function is torn off, either at the top level or
from an instance, wrap it with a function that will also inject these
checks at runtime.

There are still holes where we can't catch the mistake:
- An argument which is statically dynamic and a Function at runtime
  won't be caught.
- A Function which is stored in a collection won't be caught.
- A JS interop definition where a getter returns a Function which takes
  a Function as an argument is not checked.
- A dynamic call through to javascript is not checked.

Changes:

- Refactor `_isJsLibrary` and add `isJsMember`, and `isAllowInterop`
  utilities to determine what needs wrapping.
- Update `assertInterop` to give a more clear error when it fails, and
  to ignore non function arguments.
- Add `tearoffInterop` to wrap a function an ensure that any function
  typed arguments are wrapped.
- Inject `assertInterop` around Function arguments passed to JS methods.
- Inject `assertInterop` around Function arguments passed to static or
  instance JS setters.
- Inject a runtime wrapper around static or instance Function tearoffs.
- Add a test covering all flavors of checks that are supported.
- Change the interop expando to an `Expando<dynamic>` in the NNBD SDK to work
  around a stricter type check. https://github.com/dart-lang/sdk/issues/39971

Potential improvements:

If the `tearoffInterop` turns out to be too heavy, we could loosen it so
that we only wrap methods if any of their argument types are statically
declared to be a Function.

Change-Id: Ibc92df5b54e1a041b4102a07b8398b774b6bd1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128462
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-01-02 20:24:26 +00:00
Sigmund Cherem 4502fb5a47 Cleanup sourcemap test
Change-Id: I8f1de7ae45e4579a6a0c074b981c4a3336db9497
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129022
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-12-19 23:53:13 +00:00
Nicholas Shahan 2aa6e73ae7 [dartdevc] Cleanup all temporary nnbd modular tests
All of these tests are now running under the regular test infrastructure.
The only reason they were created as modular tests was because we wanted more
control over the SDK sources used.

Change-Id: I2ad5aa616ff8bccd10cfac2d49bfaa39ab50c192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128801
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-12-18 00:43:44 +00:00
Sigmund Cherem 8ad8abfb74 Enable strong/weak strict checking in ddc runtime from the test runner
Change-Id: Ia7bad573f07ba7327907ab29d1301c2d004cbe0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128363
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-13 19:11:53 +00:00
Stephen Adams 11a910323c [dart2js] new-rti: Put sourceInformation on more nodes
Change-Id: I493c8f10d19ec1f1adc92a5d6ba12b3c4685ebf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128341
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-12-13 18:07:19 +00:00
Johnni Winther 818ec6db92 [cfe] Implement nnbd-top-merge
+ and use nnbd-top-merge and legacy erasure in hierarchy computation

Change-Id: I4bf06ce8d3c68a9926865ebf84b24b4029828d73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128065
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-12-13 17:19:59 +00:00
Sigmund Cherem 52e0bcce0b (dart2js): escape names when creating tearoff closures
The CFE recently changed the name of the top-level deferred load library method
from `__loadLibrary` to `_#loadLibrary` (see #39682)

We were properly escaping this name when generating the method itself, but we
didn't properly escape the name when creating tearoff closures derived from it.

This is why the issue was not detected earlier.

Change-Id: Ic1487a10f521a86a3466608b1825a2b632a191be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128260
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-12-12 20:37:01 +00:00
Mayank Patke 18b2d24887 Revert "[dart2js] Mark native classes as needed if they have new-rti is-tests or"
This reverts commit bcd18e67dc.

Reason for revert: Deoptimizes native classes.

Original change's description:
> [dart2js] Mark native classes as needed if they have new-rti is-tests or
> named type variables.
> 
> Change-Id: I12af7f8595d6580cac4bc98cad5cd7795f6a71ab
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127964
> Commit-Queue: Mayank Patke <fishythefish@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

TBR=sra@google.com,sigmund@google.com,fishythefish@google.com

Change-Id: Ia65ea6c32aef5f979d39ef83ab0af68ee503f510
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128011
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-12-11 01:36:55 +00:00
Mayank Patke bcd18e67dc [dart2js] Mark native classes as needed if they have new-rti is-tests or
named type variables.

Change-Id: I12af7f8595d6580cac4bc98cad5cd7795f6a71ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127964
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-11 00:04:08 +00:00
Mayank Patke 4c442cd73a [dart2js] Remove treatAsDynamic.
Change-Id: I361de27bcd61b18e0bf1ea07516e71a84a1c3807
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126604
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-12-06 21:30:24 +00:00
Jens Johansen 0dc6d59d52 [CFE] Fix crash caused by name clash of loadLibrary tearoff method
Fixes #39682

Change-Id: I0e326df9390e05ede939f0019e94f8abe1fb7983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127460
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-12-06 09:29:19 +00:00
Kallen Tu 53bbe6c88c [dart2js] Added variance support for static subtype checking.
Change-Id: I0731884aad68e3dd7f84658d75e946ca5db62bbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127063
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-12-04 20:54:16 +00:00
Johnni Winther 1454a67e09 [cfe] Don't use multiple null-aware guards in opt-out
Change-Id: I15bd991577ffcc309569ee4a5512dfb29c7874ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126732
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-12-02 12:19:27 +00:00
Kallen Tu 73fdf19b56 [dart2js] Add variance table to RTI and updated subtyping wrt variance.
Change-Id: Iac4c28d295e883997acdc2e6c7084739e60be9fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126403
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-11-27 18:45:25 +00:00
Mayank Patke eb6d7f51e2 [dart2js] Add DartTypes for T*, T?, and Never.
Type relations to be implemented in a later CL.

Also discovered some visitors were missing support for FutureOr.
Fixes: https://github.com/dart-lang/sdk/issues/38821

Change-Id: Iee494cfa2eff3b320a3fd1a2e7ffbf3f969b40e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125880
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-11-21 09:58:14 +00:00
Mayank Patke 539b0093e1 [dart2js] Remove unnecessary DartType predicates and replace with
is-tests.

Change-Id: I520d0893793e291d009e31ff32980194278bb0b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125923
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-11-21 08:58:54 +00:00
Robert Nystrom 4ee62c3479 Migrate all of the negative language_2 tests to not be negative tests.
Also, remove the three negative tests under compiler/dart2js_extra.

Change-Id: I5d285d1e5ed2016de4e0236ee89fe0399fc008c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125727
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-11-20 21:24:02 +00:00
Johnni Winther 4b5589e0cb Reland "[cfe] Use StaticTypeContext for getStaticType" and more"
This relands commits
 "[cfe] Use StaticTypeContext for getStaticType"
 45033c6ad9

 "[cfe] Move caching of thisType to CoreTypes"
 fab25cbe0c

 "[vm/bytecode] Notify static type context when entering/leaving library"
 c9f88ae253

Change-Id: I407d6b0e3b3df503cedc9fcb2c834d835cf083f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125343
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-16 05:50:58 +00:00
Johnni Winther ef5fb7d3f4 Revert "[cfe] Use StaticTypeContext for getStaticType" and more
This reverts commits
 "[cfe] Use StaticTypeContext for getStaticType"
 45033c6ad9

 "[cfe] Move caching of thisType to CoreTypes"
 fab25cbe0c

 "[vm/bytecode] Notify static type context when entering/leaving library"
 c9f88ae253

Change-Id: I6171f6a74b97f2f4a77a36c242330fc2db94c82f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125341
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-11-14 22:51:43 +00:00
Nicholas Shahan e040b6edc1 [dart2js] Cleanup dynamic calls and downcasts in _BigIntImpl
This is some preparation for the NNBD migration where the existing downcasts and
possible nullable accesses will be errors.

- Downcasts have been replaced with covariant parameters.
- Local variables have either been declared with a specific type or given
  initial values so that they can become non-nullable in the future.

Change-Id: Ie871095ee26771833318d1dfce2b5986afaf8c69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125227
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-11-14 21:23:11 +00:00
Dmitry Stefantsov fab25cbe0c [cfe] Move caching of thisType to CoreTypes
Closes #38225.

Bug: http://dartbug.com/38225
Change-Id: I0274bc390ca2d098896f578ea7ddf65527d82027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124325
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-14 16:01:26 +00:00