Commit Graph

4835 Commits

Author SHA1 Message Date
Joshua Litt cfccd80ef7 [dart2js] Break out closed world computation from global inference step.
Change-Id: Id743ad11344e94ebc56f732d5580c33ae8e45e46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169123
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-11-09 21:35:14 +00:00
Dmitry Stefantsov d54e2bb568 [cfe,ddc,dart2js,vm] Add NullType
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/170342/
* https://dart-review.googlesource.com/c/sdk/+/170344/
* https://dart-review.googlesource.com/c/sdk/+/170345/
* https://dart-review.googlesource.com/c/sdk/+/170346/
* https://dart-review.googlesource.com/c/sdk/+/170347/

The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.

Closes #40122.

TEST=Verified by changes in .expect files in pkg/vm/.
Bug: https://github.com/dart-lang/sdk/issues/40122
Change-Id: Ib8197802fdc69694387ae47ac990c58b3aaab7a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170689
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-06 12:43:52 +00:00
Stephen Adams f387d24f68 [js_runtime] List.of improvements
`List.of` avoids per-element checks and no longer forwards to
the more expensive `List.from`.

Global type inference infers `List.of` and `List.from` as new
list allocations.

Bug: 40211
Bug: 32937

Change-Id: I54746610a1b0089ec54e43459301720105f872ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170127
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-11-05 01:47:17 +00:00
Johnni Winther d70796bae8 [kernel] Add caching ability to StaticTypeContext
Dart2js is changed to use the caching scheme in preparation for dart2js
to use the static types computed by the CFE instead its own custom
static type computation.

Change-Id: I1d45eda2f67ce4b23d669ec49e476ee357b37fc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166845
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-30 17:55:21 +00:00
Leaf Petersen a6faf8f2f9 [Language] Enable null safety in Dart 2.12.
Closes https://github.com/dart-lang/sdk/issues/22

Change-Id: I662dd17fda0ff62a871314896fbf1dbe220f41de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166790
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2020-10-29 18:25:56 +00:00
Srujan Gaddam 2fd4b4f562 [dart2js, ddc] Emit native null checks in sound mode only
Bug: https://github.com/dart-lang/sdk/issues/42536
Bug: https://github.com/dart-lang/sdk/issues/42535

Since ddc would require a potentially breaking change to emit these
checks in unsound mode without opt-in and it's currently not possible
to emit these checks only in opt-in with dart2js, both are changed
to only emit checks in sound mode. In ddc, calling convention is
changed conditionally on sound mode as well to avoid emitting
unnecessary code in unsound mode.

Change-Id: I42f7bb5a53550f4ee5412fbbbfb6ca533c393e96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169247
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-10-28 21:35:45 +00:00
Stephen Adams ee740fae4a [dart2js] Inference of List.generate elements
Change-Id: I9c13eac75df1016229ca560175b72efd77b3a2d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169257
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-10-28 16:33:15 +00:00
Srujan Gaddam ed009afc4c [package:js] Add static errors for invalid extends
Bug: https://github.com/dart-lang/sdk/issues/37896

dart2js disallows JS interop classes from extending Dart classes,
and ddc does not work as expected. Dart classes that extends JS
interop classes can't be declared in ddc and throw an error on
usage in dart2js. This CL adds static errors for both cases.

Change-Id: I72001d2e8bec046c0e1ab4c06fed8fcf84ade259
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164840
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-10-28 16:04:15 +00:00
Jens Johansen ae5fc78992 [kernel] Remove 'addMember'
Most of the time one already knows at the call site if it's a Field,
a Procedure etc --- so use that instead.

For now I'll leave the corresponding getters that are basically
documented as "don't use" ("[...] for convenience, not efficiency.
Consider manually iterating the members [...]").

Change-Id: Ib732759432c62963e6645f85f6df301c4281df9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168826
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-27 11:36:58 +00:00
Riley Porter 520fd2059a [dart2js] Remove unused JS interop check enum.
Change-Id: If8b3fce59277aac42cdb453a1f270d5600581a5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168990
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2020-10-23 23:15:42 +00:00
Srujan Gaddam 1c1fef8d68 [dart2js] Add negatable flag for native null assertions
Allows build systems to turn off native null assertions if the
default value ever changes.

Change-Id: I7265b2328e4e8834d8bbe19159fcac7ea916b451
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168763
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-23 00:07:21 +00:00
Srujan Gaddam d201c33f69 [ddc, dartj2s] Exclude null checks on non-web native members
Modifies ddc and dart2js logic to only include null-checks on native
members inside the web libraries. Modifies tests to account for this
change.

Change-Id: If9c164fb90b761d3c4611d87ffeb02c2fa884457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168585
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-23 00:07:21 +00:00
Johnni Winther b42f954364 [cfe] Use experiment release version when non-nullable is enabled explicitly
Even when non-nullable is enabled by default, enabling the experiment
explicitly should result in the experiment release version (and not
the experiment enabled version) to be used for opting in.

For this change, the semantics of parseExperimentalFlags was change
to _not_ normalize the flags to a full mapping including default values.
For this reason all uses of such maps are renamed to
'explicitExperimentalFlags'.

Closes #43879

Change-Id: I0d0262e68ec1403549abcfd305ae3a4404fe93e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168654
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-22 06:17:39 +00:00
Stephen Adams ba6a17ab29 [dart2js] Make --benchmarking-x imply --csp
This is a temporary assignment of the meaning of `--benchmarking-x`.

Change-Id: I453aca3fa2782498664aad05f0d637af5e91bd34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168402
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-10-21 17:54:13 +00:00
Joshua Litt 043bebcd02 [dart2js] Fixes to dart2js unit tests to support nnbd by default.
Change-Id: I440dddd34a62bfe8c0f3fd563888acb680c2b031
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168141
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-20 18:40:44 +00:00
Lasse Reichstein Holst Nielsen 48c73d82bf Clean up annotations and update @override documentation.
Fixes #43622

Bug: http://dartbug.com/43622
Change-Id: I4adea2995146ecd317d5c90a514cb564afa4f846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165800
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-20 15:56:13 +00:00
Anna Gringauze f04bc85e4f Refined scope calculation in expression compiler
- make sure nested blocks scopes are visited
- make sure variable definitions do not leak beyond block scopes
- properly collect scopes for loops, if statements, constructors
- add calculation of fileEndOffsets for blocks
- save block file offsets to dill
  - update binary format version
  - change kernel readers and writers to read and write block offsets
  - change vm readers to read and block offsets for new version
- add missing fileOffsets and fileEndOffsets on functions for
  late fields
- add missing fileOffsets and fileEndOffsets on functions for
  extensions
- add errors on failures to find scope
- find libraries for private fields correctly
- add more expression compilation tests
- add test to verify fileOffsets and fileEndOffsets are set for
  SDK summary (will add full dill tests later)

Closes: https://github.com/dart-lang/sdk/issues/40278
Related: https://github.com/dart-lang/sdk/issues/34942

Change-Id: I5bc1bb645543045b689d8d61069ee77dc4ee9025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167541
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-20 01:44:52 +00:00
Stephen Adams d5e790b2b1 [dart2js] Add golden function codegen tests
As with other 'id_equivalence' tests, the information can be generated
via the '-g' flag.

Bug: 43778
Change-Id: I316d539f7575e349dc55ecb564de7b65f0f21575
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167480
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-10-14 22:32:38 +00:00
Stephen Adams ee5a1534d3 [dart2js] Fix for List length forwarding
Change-Id: I8bffac06c835aa73eb041661518944d1be9d8385
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167723
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-10-14 22:19:48 +00:00
Stephen Adams 8f3b2e1853 [dart2j2] Rewriting optimizations of bit operations
Various algebraic simplifications of bitwise operations.
Together they allow the Flutter Color class to be well optimized.

Change-Id: Icf7f4f14f77045f943cdec41c6a526a42c179538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150268
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-10-14 20:15:58 +00:00
Stephen Adams 6a4fa8b4ac [dart2js] Avoid opt-out test directory
The _2 directory caused a forced opt-out of non-nullable preventing dart2js iq_equivalence
tests from working with non-nullable features.

Change-Id: Ie69ac1e31d8164f7f3e85f19920fabe3c238a58a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167540
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-10-14 02:34:27 +00:00
Joshua Litt d2b0e39144 [dart2js] Add stressful unit / integation tests for deferred loading.
Change-Id: I456af72961803bb24b089c6f3655e9d8ef2a7396
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167044
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-10-13 17:55:58 +00:00
Stephen Adams 8224b60a9c [dart2js] Recognize length argument to more list constructors
Recognize `List.filled` and `List.generate` and typed list constructors
as having a length argument as first argument.

Change-Id: I6f77ce3e38fa50d663f78432807f83aaccb93503
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163360
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-10-13 06:17:03 +00:00
Joshua Litt cbbd76ef2c [dart2js] Port deferred_loading_test to features.
Change-Id: I683f82fe1096963392f78f9dd3b640b66765b8b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166604
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-09 21:10:17 +00:00
Loren Van Spronsen 2a649d3ef0 Update README.md comments concerning constants.
The existing comments contain references to abstractions (constant system) and implementations
(dart2dart constant folding), which no longer exist.

Change-Id: Iaea64225ec82a12333e791fbb1df0ed5c70c8757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166141
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-07 00:31:43 +00:00
Johnni Winther 8b07d1902c [kernel] Remove DirectPropertyGet/DirectPropertySet/DirectMethodInvocation
These nodes are no longer used.

Change-Id: I40c8df7376f0c40a4122c22d934fb3c6f6fd520d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165902
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-03 19:15:41 +00:00
Jens Johansen fc7de901ee [kernel] Make LogicalExpression operator an enum (and rename)
Change-Id: I6054e8e44133d2419582d74700c4223d51495978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165606
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-02 09:41:12 +00:00
Jens Johansen 8cdbfe947e [CFE] Remove contextChain from constant evaluator; don't use try-finally
Change-Id: If62e71ae1aee5b33d00a361e5221f871331407aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165603
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-02 09:37:56 +00:00
Mayank Patke b1bc7c73d5 [dart2js] Register findType static uses for constants.
We need to register `findType` with the codegen registry whenever we
construct a `TypeReference` so that the function is available at
runtime. We primarily do this whenever we encounter an `HLoadType`.
However, it's possible that we only construct a `TypeReference` during
constant emission, and therefore never register a static use.

We can use the `CodegenImpactTransformer` to register a static use for
`findType` whenever we encounter a `ConstantUse` whose value requires
it. These correspond to the uses of `_reifiedTypeNewRti` in the constant
emitter.

Change-Id: I93dade3c326f7e2c9d4806d8bdc2ee576a20d1c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165480
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-10-01 02:57:02 +00:00
Mayank Patke cea8843939 [dart2js] Ensure null safety experiment is enabled before inferring
sound null safety.

Change-Id: Idad92bcbad97623c7b2a6b9b3218052e877e6ffb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164941
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-09-30 00:00:18 +00:00
Johnni Winther fc158b1616 [dart2js] Evaluate implicit constants in scope visitor
Change-Id: I2351571a665c8ffff8e9d57649fbf42b483e747b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142983
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-09-29 20:13:08 +00:00
Johnni Winther 4025dee2f8 [cfe] Ensure that default values on synthesized constructor are included in outlines
Closes #43538

Change-Id: I58f03d6d71e6de4744003cc28519a20c7e9e7f12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164787
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-29 11:09:14 +00:00
Srujan Gaddam c990450628 [package:js] Add checks for external keyword
Checks to see if a JS interop member is correctly annotated with
the `external` keyword. If it is not, it must be one of several
exceptions to be allowed.

This CL also changes static errors to first check for `JS` and
`external` before processing the member as a JS interop member.
This makes it clearer whether a member is a JS member.

Change-Id: I412eeafbfe8773847bfb9c864e4fb9b65e2d632a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158083
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-25 23:30:34 +00:00
Joshua Litt f767363767 [dart2js] Remove obsolete flags.
Removes 'new-deferred-split', 'no-new-deferred-split',
'report-invalid-deferred-types', 'defer-class-types', and
'no-defer-class-types'.

Change-Id: I8d7dd4500c776b2016697bf6c7342846041cc9fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164040
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-25 17:04:14 +00:00
Mayank Patke 5be3a355e7 [dart2js] Clean up --experimental-trust-js-interop-type-annotations
flag.

Change-Id: I8622e88afdd1fc3f65f36814eebc8e124de2bc25
Fixes: https://github.com/dart-lang/sdk/issues/43470
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164422
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-25 00:17:09 +00:00
Mayank Patke 7eeab86287 [dart2js] Consolidate constant folding logic for null is T.
Change-Id: Ie2a73528c215e2760257ce726d49efc7462ef62f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163900
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-09-24 20:01:57 +00:00
Mayank Patke cd118d19db [dart2js] Clean up useNullSafety option.
Change-Id: I300fc04daa28add93d2f15998fc972db69e153c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163880
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-24 20:01:57 +00:00
Mayank Patke fed7fcc0c8 [dart2js] Default useNullSafety flag to true.
More cleanup to follow.

Change-Id: I90a0679adc97d3ea3f89e20f5c7045158fd420ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157562
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-24 20:01:57 +00:00
Srujan Gaddam 04e2482696 [dart2js] Add null checks on JS() expressions
Bug: https://github.com/dart-lang/sdk/issues/42536

Adds null checks on `JS()` invocations in dart:html and related
libraries if the static type is non-nullable. Renames option to
enable this to be consistent with DDC and adds tests.

Change-Id: Ia8c170cf0e1e4135966f36b25a83ec62becad701
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163210
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-23 17:49:49 +00:00
Johnni Winther 5d8a9340ae [cfe] Add support for using backend defined sentinels in late lowering
Change-Id: Iabcd0c79fb8f09c9de99856e50518eb7ace38464
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163860
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-09-23 08:07:26 +00:00
Stephen Adams 64939041f2 [dart2js] Make length-forwarding work with Arrays that have Rti
The type-tagging code was confusing the optimization, so we failed at:

    t1 = setRuntimeTypeInfo(new Array(size), type$.xxx);
    t2 = t1.length
-->
    t1 = setRuntimeTypeInfo(new Array(size), type$.xxx);
    t2 = size

Change-Id: Iba5442112aea18ee45b501f5ddded39637d61c85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163363
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-09-18 21:12:26 +00:00
Ben Konyi a44409615f [ Service / dart:io ] Rework previously unused dart:io service extensions
This CL is mostly modernizing existing Process and File profiling code
that was never made public. Updated the service extension responses to
be more consistent with the rest of the service protocol.

Related to https://github.com/dart-lang/sdk/issues/41455.

Change-Id: I116b3cd1424980e4ec8133672901990776c1d9c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157160
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-09-18 20:15:56 +00:00
Mayank Patke 4d9b3b54c6 [dart2js] Add support for LateInitializationError.
Change-Id: I15f2ec292096824a0c61026d4a8fcdd752456410
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163131
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-09-17 23:20:51 +00:00
Stephen Adams ec4ccb7051 [dart2js] Update inferrer with current List constructors
Use the 'growable:' argument or its absence to pick a better type for
List.of, List.from, List.generate, List.empty and List.filled.

Fixes a bug where it was assumed that List.filled was always fixed length.

Slightly better type analysis on some apps, but nothing that is measurable on benchmarks.

Change-Id: Ibe029a93488412956273fc981f626d33bd295386
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163132
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-09-17 20:37:53 +00:00
Johnni Winther f4501b6e83 Reland "[kernel] Rename Name.name to Name.text"
Including a deprecated getter to avoid breaking dependent code outside
the Dart repo.

Change-Id: I365957b7c2da6e0cb5c71eb8d2906b0dc6ff18ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163062
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-17 06:10:49 +00:00
Johnni Winther 644df9b9fb Revert "Reland: [kernel] Rename Name.name to Name.text"
This reverts commit c430a0ac0b.

Reason for revert: Will break flutter_frontend_server when rolled into google3

Original change's description:
> Reland: [kernel] Rename Name.name to Name.text
> 
> Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

TBR=jensj@google.com,johnniwinther@google.com

Change-Id: Ib6961f49dd416171c5d5935c490d79d6f7be779e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162748
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 08:22:55 +00:00
Johnni Winther c430a0ac0b Reland: [kernel] Rename Name.name to Name.text
Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-16 07:42:42 +00:00
Stephen Adams 62987736e8 [dart2js] Add --experiment-unreachable-throw
If a method appears unreachable because a parameter is inferred
'[empty]', compile the body to a throw.

Playing with the flag found some cases where the inferrer was not
inferring parameters because the call sites are not visible in Kernel.
The first example is _isTestViaProperty, which is referenced as a raw
function. To fix this we consider RAW_DART_FUNCTION_REF to escape the
function. The inputs are now inferred to be TOP, and we can remove the
dynamic entry checks with 'trust' annotations.

Other cases are functions that are injected into generators by a
JavaScript-level transform. Annotate these to prevent bad codegen.



Change-Id: I991fe85936ffde6fc2c794f753171df141dde8f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162822
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-09-16 01:46:42 +00:00
Daco Harkes 7302e01a79 Revert "[kernel] Rename Name.name to Name.text"
This reverts commit 3ff8dd2f51.

Reason for revert: Fails all CI builders. Possibly something landed
in the mean time.

Original change's description:
> [kernel] Rename Name.name to Name.text
> 
> Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
> Reviewed-by: Jens Johansen <jensj@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

TBR=jensj@google.com,johnniwinther@google.com

Change-Id: I2ffe526dabf37ae09d5e4ab1fbe514925f6e8768
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162744
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2020-09-15 15:21:35 +00:00
Johnni Winther 3ff8dd2f51 [kernel] Rename Name.name to Name.text
Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-15 14:27:22 +00:00