Commit graph

14 commits

Author SHA1 Message Date
Srujan Gaddam f5a98e7676 [ddc] Unify pkg:js types and allow subtyping between them
Removes the lazy loading of the underlying type in LazyJSTypes.
As such, this removes the need to keep AnonymousJSType and
LazyJSType separate, and is therefore refactored to
PackageJSType. Similarly, subtyping is fixed such that
PackageJSTypes are all subtypes of each other.

Change-Id: If489defdbeb5cb932db802a7d146ad2fc393b12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207982
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-07-30 00:33:54 +00:00
Nicholas Shahan c83eeac5b8 [ddc] Avoid sending messages to console.debug
Calling `postEvent()` or `registerExtension()` from the
dart:developer library now sends messages via global functions
that can be set by the development infrastructure. For example,
these hooks are set by package:dwds.

When there is no debugger attached to the app, calling `postEvent()`
or `registerExtension()` will produce a warning once each to avoid
spamming the debug log with messages that do nothing.

For backwards compatibility, when a debugger is attached but the
hooks have not defined continue to write the events to the
console.debug log. This support will be removed when package:dwds
no longer reads from the log.
https://github.com/dart-lang/webdev/issues/1342

Change-Id: I126446666b5a85c68424546b8b1198d1582bba74
Issue: https://github.com/flutter/flutter/issues/75225
Fixes: https://github.com/dart-lang/sdk/issues/36143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202540
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-15 23:28:03 +00:00
Sigmund Cherem 3a0c27b74c [ddc] Add a regression test for issue #45874
Expandos collide after a hot restart. This currently fails because
the DDC implementation uses a static field (_keyCounter) to compute a
unique name for each expando. After a hot-restart the counter gets reset
and keys get reused accidentally.

A hacky fix would be to ensure this field is not reset after restarts,
but a more robust fix would be to use a weak map implementation like
dart2js does.

Change-Id: I991874aabf836be66cbd44de07dd38e681415ae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199221
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-05-11 22:14:28 +00:00
Nicholas Shahan 4e25e499c8 [ddc] Add library URIs to cast failure messages
When the two types have the same name but are from different libraries
showing the library URI will help users understand the failure better.

Change-Id: I5ab4412e676272111d41f688ef2d1cc83afbe627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194116
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-04-09 22:24:43 +00:00
Anna Gringauze 14eeb7507f First version of incremental DDC mode for expression compilation
- Support evaluate() calls from VM service in expression compiler
  - emit all accessed symbols, types, constants, extension symbols,
    and imports as part of synthetic evaluation function
    - Note: this fixes missing symbol issues in evaluateInFrame()
      as well
  - update expression evaluation tests
  - fix expression compilation broken after hot reload

See widget inspector layout explorer, a result of evaluate() call:
https://drive.google.com/file/d/16UdSE5_V1ZRXAf2KeBxNwYNHMfo1RbnT/view?usp=sharing&resourcekey=0-HZcPm68VbsVzrZ672CApvA

Closes: https://github.com/dart-lang/sdk/issues/41480
Closes: https://github.com/dart-lang/sdk/issues/44979
Closes: https://github.com/dart-lang/sdk/issues/44713
Closes: https://github.com/dart-lang/sdk/issues/44933
Closes: https://github.com/dart-lang/sdk/issues/44813
Closes: https://github.com/dart-lang/sdk/issues/44686
Change-Id: I96c74578c51503adbc4bfe6d6e6112319addc959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188400
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2021-03-09 17:23:05 +00:00
Mark Zhou bd30532d82 [dartdevc] Creating container entrypoints for expression eval.
The expression evaluator should now index/read object containers (types and symbols right now) via accessors like 'A$Eval'.

Fixes #44494

Change-Id: I31d203cfe59a6e2c03eeb22e8c86270c28b5e2fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176923
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2021-01-06 00:20:29 +00:00
Nicholas Shahan e352744fa4 [ddc] Fix failing debugger tests
- Accept the existing output in the golden file as a new baseline.
- Copy the golden file for the null safe version of the test and
  enable running the full golden diff.

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

Change-Id: Ie5b3e7c7689d17fca8a01e970b28fc815a6b9851
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172688
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-11-20 23:14:33 +00:00
Nicholas Shahan bfe8aa8d5b [ddc] Add option to throw null safety violations
Allows sound-like null safety when running mixed applications in weak
mode.

This is not a specified option and is only intended to assist large
scale migration efforts.

Change-Id: Icd0abb0e876d16e719a01e8381eef55a2b511051
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171821
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2020-11-16 22:58:50 +00:00
Vijay Menon f346cb7f77 Fix ddc debugger_test
This CL:
- Fixes https://github.com/dart-lang/sdk/issues/43987 (an exception in custom formatting code)
- Restores (most of) debugger_test.dart to passing (which tests above)
- Fixes a type caching error also exposed by the above test

Note, this skips the golden file comparison.  That appears to be very broken
(see comment).

Change-Id: I283b66a710f17765faed47aa099b0b8570e6cac1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170022
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2020-11-02 23:31:30 +00:00
Mark Zhou 33044ddd9a [dartdevc] Resetting lazy js types on hot restart
Fixes https://github.com/flutter/flutter/issues/66361

Change-Id: I4e68963a36c71bb4dac964d8b0fdcd8ee9187e97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164101
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-09-30 00:08:23 +00:00
Nicholas Shahan 1332cf8c41 [ddc] Migrate tests in dartdevc suite
Change-Id: I2a35de7f79b8d768cdd0144b3bf5de87fa929942
Issue: https://github.com/dart-lang/sdk/issues/42107
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154301
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-07-15 00:16:03 +00:00
Nicholas Shahan 461d01cd80 [ddc] Fix variance test migration to null safety
Change-Id: I5f6e446c72ae1a41d92f419eb57a8dd030a70372
Issue: https://github.com/dart-lang/sdk/issues/42107
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154292
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-07-15 00:15:23 +00:00
Joshua Litt f0625ac010 [dartdevc] Move opted out tests to tests/dartdevc and optin.
Change-Id: Ia032182ae94e9215c22fe1627dc93495946d4074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151640
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-18 18:46:16 +00:00
Joshua Litt d14ab0779a [dartdevc] Migrate tests/compiler/dartdevc_native to tests/dartdevc_2.
Change-Id: I9c486f29f3bcf8a6ecf481eb25ea61d0468049b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150667
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-06-17 18:14:00 +00:00