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
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
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
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
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
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
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
Stephen Adams
dfc411cb90
[dart2js] global type analysis for unreachable closure calls
...
The return value of a closure call on `null` or bottom should be
bottom.
Change-Id: I4520a8d6b13575172cf5407b0fbcbaa0b6be5e63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162384
Commit-Queue: Stephen Adams <sra@google.com >
Reviewed-by: Mayank Patke <fishythefish@google.com >
2020-09-12 00:05:35 +00:00
Mayank Patke
6e30428829
[dart2js] Add tests for https://dart-review.googlesource.com/c/sdk/+/162420 .
...
Change-Id: Ifc4f060a72dc273d130ba33d5f61cd4c7e014fdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162580
Reviewed-by: Stephen Adams <sra@google.com >
Commit-Queue: Mayank Patke <fishythefish@google.com >
2020-09-11 22:53:35 +00:00
Stephen Adams
8d68480746
[dart2js] Fix global type analysis
...
https://github.com/dart-lang/sdk/issues/43366
Fixed: 43366
Change-Id: Iac8247c31fa268186c8f2e3f52e0be1cac062598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162247
Commit-Queue: Stephen Adams <sra@google.com >
Reviewed-by: Mayank Patke <fishythefish@google.com >
Reviewed-by: Sigmund Cherem <sigmund@google.com >
2020-09-11 04:07:41 +00:00
Mayank Patke
39b9a76323
[dart2js] Ensure generator return types are included in closure RTI need
...
computation.
This fixes the failure on
https://dart-review.googlesource.com/c/sdk/+/73360 .
Change-Id: I5f082307abf7e93038d5c03ee54015c59c6b3564
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162420
Reviewed-by: Stephen Adams <sra@google.com >
Commit-Queue: Mayank Patke <fishythefish@google.com >
2020-09-11 00:38:01 +00:00
Johnni Winther
082295a61e
[cfe] Support lowering of static fields with initializers
...
This adds support lowering the encoding of top-level/static fields
with initializers as if they were marked as late fields. This ensures
that LateInitialization is thrown if final fields are written to during
initialization.
Closes #42956
Change-Id: I488fdddd87ebd935a0cdaf82a724e9b87d5f91ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160724
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-01 07:20:58 +00:00
Christian Altamirano
c026589e69
[dart2js] Added interceptor bits to powerset domain
...
Change-Id: Ia949732ffd431461eb8dc9f14bf398bc85b71dff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160800
Commit-Queue: Christian Altamirano <coam@google.com >
Reviewed-by: Stephen Adams <sra@google.com >
2020-08-29 02:14:13 +00:00
Stephen Adams
c1cbcdc52a
[dart2js] Removed redundant check from canUseSelfForInterceptor
...
Change-Id: I4bc4ea014b6390d1d925598877a7ff010c37eb3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160700
Reviewed-by: Mayank Patke <fishythefish@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2020-08-28 22:00:23 +00:00
Stephen Adams
0be0517f4f
[dart2js] Add AbstractValueDomain.isTruthy
...
In spec-mode, conditions are forced to be true/false if necessary by a
HBoolConversion check. The refined output of HBoolConversion can be a
constant, allowing a branch of an if-then-else to be deleted.
If production-mode (-O3), this check is omitted, making it possible
for `null` and other values to flow to the condition. Without the
refinement of the HBoolConversion, the abstract value might not even
be a constant. To enable a branch of the if-then-else to be deleted as
an optimization (i.e. without changing the behaviour), we need to be
able to predict the JavaScript interpretation of the condition.
Change-Id: I44200adb7270a3feb26ce110ad4930cfa127f8c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160402
Reviewed-by: Mayank Patke <fishythefish@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2020-08-28 17:16:38 +00:00
Stephen Adams
6fcd615a26
[dart2js] Fill out PowersetBitsDomain.createFromStaticType
...
Change-Id: I5488873a619aa4727c6890fb7680a1eb15817f6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160706
Reviewed-by: Mayank Patke <fishythefish@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2020-08-27 23:28:57 +00:00
Stephen Adams
fd44ff7229
[dart2js] Prettier printing of powerset values
...
Print the bits with names, e.g.
{null,other}[null|exact=JSString]
{true,false}[exact=JSBool]
Change-Id: I4e940ae903329ca550ea9ff4afebd6eb59c0d62d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160480
Reviewed-by: Christian Altamirano <coam@google.com >
Reviewed-by: Stephen Adams <sra@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2020-08-27 04:16:39 +00:00
Stephen Adams
a64a453bf9
[dart2js] Don't call isJsIndexableAndIterable with null
...
Change-Id: I50a50dbe8f68c7f3408b421589b8a7fd5ea5f151
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160442
Reviewed-by: Christian Altamirano <coam@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2020-08-27 02:40:58 +00:00