Commit graph

4608 commits

Author SHA1 Message Date
Mayank Patke 1cec77f0a6 [dart2js] Fix impliedClasses logic during RTI resolution.
This code was inadvertently falling through to the `throw` if `VoidType`
was encountered (although this case currently never happens). In
addition, we were missing cases for some of the newer `DartType`s.

This CL fixes those cases and removes Object from the classes implied by
`DynamicType`.

Change-Id: Ibfecd92c0113d11eb8870d511d60cbc34ac1bfa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159020
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-18 23:20:00 +00:00
Stephen Adams e09249f97d [dart2js] Clean up old code in types_propagation
This code worked around bugs in how TypeMasks were generated 4+ years
ago. Now subtype cones are generated from the least upper bound of
instantiated subtypes, resulting in TypeMasks that are no longer
disjoint for 'double' and 'int'.

Change-Id: I7189c4447f2c41db7abb7a0ea1240eca6e28aa7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159000
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-08-18 16:56:10 +00:00
Mayank Patke 41953c8835 [dart2js] Rewrite lib/html/js_typed_interop_type_test to use external
fields.

This brings it more in line with the lib_2 version.

Change-Id: I99e4f6a467fa5b58d6e7c5206e1f6d9956fc60bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158961
Auto-Submit: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-18 15:46:20 +00:00
Mayank Patke bd672a90af [dart2js] Improve simplification of type tests.
Change-Id: I29fd8e32145df61816bf98dd9fdc2dac33cafc75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157662
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-18 09:14:10 +00:00
Mayank Patke e0c956065a [dart2js] Fix nullability handling in createFromStaticType.
Previously, we were creating nullable typemasks and then stripping off
the nullability if non-nullability was specified. We should be assuming
non-nullability as the default and adding nullability in if required.

The former approach has the issue that typemasks for `Null` keep getting
converted to empty typemasks when we try and remove the nullability.

Change-Id: I58907c1c45c756f023d67043ce88eb82c4b1589c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158371
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-18 09:14:10 +00:00
Stephen Adams d2057a0b57 [dart2js] Check non-nullable native call values
When `--null-assertions` is enabled, values returned from @Native
methods and getters with non-nullable return types are checked.

Change-Id: I4b38e651a9a6b370ebed5420a3cfac0a53cfeb60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158527
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-08-18 01:52:55 +00:00
Stephen Adams 6d2390ad8c [dart2js] Add some codegen metrics
- count decided conditions
- count various kinds of interceptor use

Change-Id: Iea8fde8555cfa7247ef78651fb11262e9295c876
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158503
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-08-18 01:52:05 +00:00
Jacob MacDonald 35e9e8f5b8 Support windows uris for multi roots, using nativeToUri instead of Uri.base.resolve
Specifically this allows passing the result of `someUri.toFilePath()` on windows as a multi-root.
These paths have drive letters which are not understood by `Uri.base.resolve`.

Change-Id: I66d452be1e1c6923e61c1843bdfbce83a7c12f94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158900
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2020-08-17 21:41:59 +00:00
Joshua Litt eab26cd2bd [dart2js] Flip flag to defer class types.
Change-Id: Ia1f913a01f2be006158967b145db3ee34b297cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155660
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-17 20:25:09 +00:00
Joshua Litt c060abfa45 [dart2js] Add regression test for 43055.
Change-Id: Ia83ada924f63ae7d8dfbe034415e5fd8f241cd2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158680
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-15 00:01:00 +00:00
Stephen Adams 588f168164 [dart2js] Add framework for gathering Task metrics
Adds `--report-metrics` and `--report-all-metrics`.
These options print all the Metrics objects exposed by CompilerTask.

This CL has counts and durations and adds metrics to two tasks to
demonstrate the 'framework'. More task metrics will be implemented
as needed. As we do so, we will experiment to see if it is possible
to make it easier and more efficient collect metrics.

```
$ dart2js ... --report-metrics
Info: Metrics:
  type_inference.time: 1.429s
  deferred_load.time: 0.424s
...

$ dart2js ... --report-all-metrics
Info: Metrics:
  type_inference.time: 1.300s
  type_inference.time.analyze: 0.695s
  type_inference.time.refine1: 0.361s
  type_inference.time.refine2: 0.175s
  type_inference.count.exceededMaxChange: 5
  type_inference.count.overallRefines: 90827
  deferred_load.time: 0.270s
  deferred_load.hunkListElements: 1
```




Change-Id: I2ba66f65af604758b0cbd71a688133cb562e32ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156842
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-08-13 00:18:08 +00:00
Srujan Gaddam e51623f81a [package:js] Add errors for missing @JS on class
Adds errors for class members that have a @JS annotation but the
enclosing class does not.

Change-Id: Id693af71678510047a723863846d89aa29cebe26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157004
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-07 17:09:23 +00:00
Srujan Gaddam 57a522eaaf [dart2js] Allow multiple errors in native_test
native_test is set up so that it validates only one error per static
error. This CL allows multiple errors to be reported and validates
that all are reported.

Change-Id: I97e9abbfbd8273c0c436e44d08f5768eea3f7785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157663
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-07 17:09:23 +00:00
Joshua Litt d384b7a0a6 [dart2js] Gather only required classes in deferred_load.
Currently we are gathering classes for all supertypes, but we only need
to gather classes for applied mixins and super classes.

Change-Id: Ie55a6587b0bc9cacf5061a52d2d9a9ec5fdbf2eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156761
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-07 16:26:15 +00:00
Christian Altamirano 7689769bfc [dart2js] Started skeleton for a powerset abstract value domain
This is based on the wrapped version that also includes a bit integer.
Right now the methods use the old abstract value domain but will use the integer bits in later CLs.
Also added and updated a flag so that now there is one for a wrapped domain and another for a powerset domain..

Change-Id: Iab6b93584a9a644dfef92f689c4be8c42ce8076a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157620
Commit-Queue: Christian Altamirano <coam@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-07 16:01:55 +00:00
Jacob MacDonald b67d0531e4 Add multi root source provider for dart2js
Bug:https://github.com/dart-lang/sdk/issues/42932
Change-Id: I565b2900fca05d3b88fc24e4cfb46944ef1d4ae4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157475
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-07 00:34:29 +00:00
Joshua Litt e5af4c88e9 [dart2js] Defer loading of class types.
This cl implements deferred loading of class types. The bulk of the
logic is hidden behind a flag.

Change-Id: I7d5139eff72c7d29226a7e46c427c82fc5bda728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154580
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-06 18:07:02 +00:00
Mayank Patke fcd88b5b6d [dart2js] Remove late from final fields in
lib/html/js_typed_interop_type_test.

Also update the error produced when an interop type contains a
non-external member in case users run into it via a late field.

Change-Id: I5968f4c8b3a71a3d467412c4499524ec4cc9d838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157161
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-08-05 23:40:05 +00:00
Mayank Patke 2f1711c798 [dart2js] Reuse SSA optimization for is-tests to optimize as-checks.
Change-Id: Ic33dec84e531f45522069032994d41862d923300
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156620
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-08-05 23:13:35 +00:00
Mayank Patke 909643dd65 [dart2js] Fix throwing lazy initializers.
If an initializer throws, the variable should be treated as
uninitialized so that the next access reevaluates the initializer.

Change-Id: I8428383a7f99527a915962f7be348f4f33b83163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157040
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-08-04 23:03:31 +00:00
Srujan Gaddam 7bb0d1f39a [package:js] Add error for params in factories of anon classes
Adds a static error to check that factory constructors in anonymous
classes contain no positional parameters.

Change-Id: Iae7c5c1d9e2dc91390c85c58eb5e96718e808f9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156145
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-08-03 23:20:42 +00:00
Christian Altamirano 352262e630 Added a wrapped abstract value domain strategy:
It will be used as a base for the upcoming powerset abstract value domain
Tests that do not depend on the detailes of the TypeMask abstract value will be fixed in a follow-up CL

Change-Id: I42398504d7c09a0b7c3b3d6b0682e1e813ea4d1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154520
Commit-Queue: Christian Altamirano <coam@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-08-02 18:39:43 +00:00
Christian Altamirano 1d1a775620 [dart2js] Refactored readFromDataSource for TypeMask
This function only uses the CommonMasks and not the JClosedWorld.

Change-Id: I315da588612499324894dbecba7a7983de009ffb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156802
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-08-01 00:20:41 +00:00
Christian Altamirano 63fc596ee1 [dart2js] Tiny cleanup
Inside masks.dart using '_closedWorld.abstractValueDomain' is the same as using 'this'

Change-Id: I30384f6f542283bc770bbf2b0bebdbb12c3c0306
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156800
Commit-Queue: Christian Altamirano <coam@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-31 23:29:00 +00:00
Mayank Patke 9b5f0f32ee [dart2js] Fix folding of x is Object when x may be null.
Change-Id: Ie45dae49c936e6a163963773747a17006f9554c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156481
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-31 00:45:54 +00:00
Mayank Patke 4ac2a5a213 [dart2js] Avoid constructing redundant closure fields.
When a captured local type variable was used in more than one context
with different nullabilities, we would construct a separate field for
each one. Because the localToFieldMap is keyed by the local, each field
would clobber the previous one when it was written to the map.

This is a side effect of the CFE storing nullability on each type rather
than as a wrapper. Consider the following function:

void Function<S1 extends T, S2 extends T?>() f<T>() =>
  <S1 extends T, S2 extends T?>() {};

Although the closure that f returns has a single free variable (T), we
end up with two distinct TypeVariableTypeWithContexts - one for T% and
one for T? - even though they're both keyed by the same local - T.

Change-Id: I7ea3ca7132ad51201beeb3c2a52311a97ce45875
Bug: #42847
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156445
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-30 23:56:14 +00:00
Stephen Adams c6deb3793f [dart2js] Remove AbstractValue from DummyInterceptorConstantValue
The stored AbstractValue is unused and removing it makes it possible
for the dummy to be independent of the AbtractValueDomain.

The actual receiver type is stored independently on the HInvokeDynamic
node, and would also be available via the 'interceptor' input, since
the dummy is used only on 'self-intercepted' call sites.

Change-Id: I04ff0a50f3afd399a6994ebe7f006687d57c84f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156585
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-07-30 22:42:04 +00:00
Joshua Litt 7e39d33f05 [dart2js] Add type use for using a class only for its constructor.
Change-Id: I8a7e031045811962998229d25463c74b88ca311e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156140
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-30 22:30:14 +00:00
Stephen Adams 30a7f00f0b [dart2js] Add --null-assertions flag
With --enable-asserts, does automatic debug assertion insertion:
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/feature-specification.md#automatic-debug-assertion-insertion

Without --enable-asserts, does a NullCheck instead of an assert.

Change-Id: I57b8c9ce9e7605b9d2355b1d96a10db3fd631917

Fixes: 42403
Change-Id: I57b8c9ce9e7605b9d2355b1d96a10db3fd631917
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156044
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-07-30 22:13:04 +00:00
Stephen Adams 1fa926d44c [dart2js] Move operator== null check before argument checks.
Change-Id: I906ba0239aef74f48273d5e242e68a8ccb8eb831
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156366
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-07-30 20:23:34 +00:00
Christian Altamirano 9750492969 [dart2js] Added two functions to JClosedWorld and some refactoring
These two functions (includeClosureCallInDomain and locateMembersInDomain) are similar to existing ones but take an AbstractValueDomain as a parameter. This is done so that the abstract value parameter belongs to the abstract value domain passed, for the wrapped version this did not happen.

Change-Id: Id085c1d589beccbf95fd2a0251b3b884f1dc2d30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156220
Commit-Queue: Christian Altamirano <coam@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-07-30 18:50:18 +00:00
Mayank Patke ca743398c2 Ensure CFE provides correct setter name to instantiateInvocation.
All of the backends (dart2js, DDC, VM) were checking if the invocation
name was tagged with "set:" and appending "=" to the name if so.
Instead, we can simply have the CFE perform this logic at the callsite.

Note that the name of the setter itself is still unchanged. Backends may
still need to generate the correct name themselves when handling NSMs
via code paths other than instantiateInvocation.

Change-Id: Iae42c849d3557be3e3b77c3af6f3993347ba0b6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156142
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-07-30 06:21:20 +00:00
Mark Zhou 0ef03fdc82 [dart2js] Adding null-safe semantics for static fields.
* Adds a bool `isNonNullableByDefault` field to Library entities.
* Adds a bool `usesNonNullableInitialization` to the JS emitter's StaticField.
* Emits two lazy-variable initialization functions: one for
  pre-null-safety and one for post

New issues:
* Always emits both lazy init functions - even when only one is ever used.

Fixes #42419

Change-Id: I6a76798946b13842fbb2ad566d4505bbcd9ca0d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156063
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-07-29 18:39:25 +00:00
Christian Altamirano d983751b77 [dart2js] Refactor a few methods for type masks
Pass the CommonMasks abstract value domain instead of the JClosedWorld to TypeMask methods that need access to *their* abstract value domain. It is wrong to get the abstract value domain from the JClosedWorld because when we try to wrap abstract values, the abstract value domain in the JClosedWorld is the wrapper domain, not the domain being wrapped.

Change-Id: I5bbd0f4c56abe45714dd0a2657f73ef240efae0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155640
Commit-Queue: Christian Altamirano <coam@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-28 17:25:40 +00:00
Johnni Winther 33378492e5 [cfe] Implement new static types for arithmetic operations
Closes #41559
Closes #42577

Change-Id: I22da02731c106ec354d72a649c5b6ac6091b9292
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155324
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-27 18:40:24 +00:00
Stephen Adams 73748636ab [dart2js] Canonicalize empty collections in FunctionType
This reduces the number of _CompactLinkedHashSet objects by ~15% and
the number of _GrowableList objects by ~10% in Phase1.

Change-Id: I88ebe1b1c842977214985e23a1f3672ad43bdfdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155826
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-07-24 23:04:45 +00:00
Stephen Adams f4053e3811 [dart2js] Use Maplet in deferred_Load
On a very big partition this reduces the memory footprint of the
ImportSets by 70% and is slightly faster.

This is because most ImportSet._transition maps have one entry.

Change-Id: I318a5675d8c3cf135c4937b2b0f63409e5c2d754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155725
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-07-24 20:49:55 +00:00
Mayank Patke 4fcd77cbf3 [dart2js] Ensure setter Invocation names end with "=".
This is the same approach DDC and the VM take. Longer term, it may make
sense to move this logic into the CFE.

Change-Id: I9118747f187ca7bfa7eabe74d45e69a8c4cf240c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155823
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-07-24 19:28:35 +00:00
Mayank Patke 7e8348f4ce [dart2js] Assume isPotentialSubtype is always true.
The current implementation of this check is incorrect and produces false
negatives. Conservatively assuming that one type is always a potential
subtype of another is a simple fix to get this working.

The main downsides are that we may emit signatures and provide type
arguments to functions even when they're not needed because we no longer
statically deduce that a type check must fail. This may cause size
regressions.

I've added a TODO to add proper constraint solving per the local type
inference spec, but this is not currently a priority since no regression
is observed on large Google apps.

Change-Id: Ie5065596331c33a030e06e66481f258ef937e659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155544
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-07-24 11:13:05 +00:00
Mayank Patke 5671730c5a [dart2js] Pass type arguments to callable properties even with
--omit-implicit-checks.

When the default check policy is "trusted" instead of "emitted", we skip
checking every function during the RTI need computation. This works
because if the type arguments are needed for some other reason, like the
literal being used in the body, we see the type use and go back and
update the RTI need of the function. We can't do this for callable
properties because we don't know which function will be assigned at
runtime, so we need to conservatively provide type arguments no matter
what.

We could optimize this slightly by only providing type arguments if we
know a type use occurs in a function which is assignable to the type of
the property, but I expect this to save little for the amount of
overhead during compilation.

We also update the dependency computation to ensure that if a callable
property needs type arguments, then they're available for the enclosing
context to pass along.

Bug: https://github.com/dart-lang/sdk/issues/41449
Fixes: https://github.com/dart-lang/sdk/issues/41449
Change-Id: I98d9024dfa64cbfe33bd43172ffa905a8537649e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154284
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-07-24 11:09:15 +00:00
Joshua Litt cb428a7a02 [dart2js] Remove old bug work around in collector.
Bug: http://dartbug.com/18175
Change-Id: Ife479c390e02d30a37a19288a381df9b3e4de958
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155222
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-22 17:51:00 +00:00
Srujan Gaddam 7c40665f91 [package:js] Add static errors for named parameters and tests
Adds error for named params in JS interop functions, static error
tests, and removes redundant code from dart2js.

Change-Id: Ie16ebdd7a816983c1250579ea346e31e77227112
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154752
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-20 20:27:07 +00:00
Stephen Adams 9c4dce340b [dart2js] Fix super.getter / super.setter targeting field with interceptor
This is only material for custom elements since no other intercepted
classes have actual fields.

Change-Id: Iae9a9af7dc0289c3fd28c38c517a642f8b16fa3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-07-20 20:08:41 +00:00
Sam Rawlins e9c04cc0a4 Compiler: Remove two unused fromDataSource constructors
Change-Id: Id7096531e030e13ea0d8499244aff0ad59e3cecf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154821
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-17 18:02:47 +00:00
Christian Altamirano 6a201a7789 [dart2js] Refractored ConstantValueTypeMasks
ConstantValueTypeMasks will now contain a CommonMasks domain as a field which will be used in its visitor methods

Change-Id: I2913148794cce868f48ba4bf6fc5015cbb8f186b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154600
Commit-Queue: Christian Altamirano <coam@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-15 23:40:52 +00:00
Stephen Adams 3c0422d02c [dart2js] Constant-fold some cases of x.toInt()
Change-Id: Ibb574ab971ccee3be22fc8e2b33394f50e96122c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154127
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-07-14 19:11:20 +00:00
Sigmund Cherem ca7dd9654f [dart2js] fix crash in program emitter
The emitter creates classes in bulk, and then later connects them together
except for adding stubs for JS-interop is checks. We assumed the class for
JavaScriptObject was previously created and stored stubs eagerly while creating
classes.

We believe this caused a crash with flutter because the class was not yet
defined in that case.

One theory why this wasn't hit as much externally is that we sort classes by
location and process dart:* classes first. Flutter is the first use case where
JS-interop classes can be defined within SDK libraries.

Fixes #42612
Fixes #25517

Change-Id: Icad0a9a16ec0d05481ed60f581a23c9eeb1ed5d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153943
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-07-10 17:08:54 +00:00
Stephen Adams cf7a63afe6 [dart2js] inlining heuristics for generative constructor factory
Account for the size of the a generative constructor factory.

The factory evaluates all the initializers up the inheritance/mixin chain,
allocates the object, and then calls all the constructors down the
inheritance chain. All this is missed by the old code looking at the
immediate constructor body, sometimes causing extremely large
constructors to be inlined.

Change-Id: I8803b0f4b4155dec0f7878fd5527c1dd507b9c80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153560
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-07-10 01:40:08 +00:00
Christian Altamirano 4f66bb07e2 [dart2js] Added a powerset flag for new experiment
This experiment will use a powerset abstract value domain in the inferrer


Change-Id: I216ff9c24d1e7292688426ae7bcb52b15aa2714e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153720
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Christian Altamirano <coam@google.com>
2020-07-09 18:01:02 +00:00
Stephen Adams a38e265f04 Fix #42531
Bad identifier for async closure generator body names in extension methods.

Fixed: 42531
Change-Id: Ice29bb5ac03c67b1024c0fd53ffdb9b9b1d2131f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153484
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-07-08 19:29:45 +00:00