Commit Graph

4835 Commits

Author SHA1 Message Date
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
Mayank Patke 5c99205769 [dart2js] Support required named parameters in weak NNBD function types.
We cannot simply discard the `required` modifier in weak mode function
types since function types that differ in the placement of `required`
cannot compare equal. Instead, we do that during subtype checks.

We continue to ignore `required` in the actual calling convention in
weak mode.

Change-Id: I7dbb28550095c635f65592f78e495e8e4e8d7026
Fixes: https://github.com/dart-lang/sdk/issues/42608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153386
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-07-07 21:00:40 +00:00
Johnni Winther b6a0c50bf6 [dart2js] Support conversion of local function type variables from K to J model
This CL adds support for converting local function type variables from
the K model to the J model. The entity use for the J model type variables
isn't created before the closure classes and closure call methods have
been created. Therefore, the [ClosureData] is now registered
with the [JsToFrontendMap] object, once computed, allowing conversion of
local function type variables. Conversion of [BackendUsage] is moved
after closure creation because [RuntimeTypeUse] can refer to local
function type variables.

Closes #42088

Change-Id: Ifc00e69b5db0dd05710ea97017c41e8c7f5e520e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153080
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-07 06:46:21 +00:00
Sigmund Cherem be0f94b218 [dart2js] include dart:_js_annotations into the platform file by default
Change-Id: I7d93347cc41e344213a5c62f72638d4d2fd18728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153366
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-07-06 21:41:02 +00:00
Mark Zhou b4c60e6e1c [dart2js] Removing switch class restrictions.
From the spec: `It is no longer required that the [case expression] evaluate to instances of the same class.`

Fixes #42409

Change-Id: Ieecd96cb75d683658ffc767d973b0ff2f5e6d834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153060
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-07-06 19:12:51 +00:00
Johnni Winther 34f5c9d0b4 [cfe] Implement new async return rules
Closes #41800
Closes #41900
Closes #42134
Closes #42282
Closes #42236
Closes #42169

Change-Id: Ia994bc07fba4e2342fcb59d44fc77608198a328b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152150
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-06 07:04:40 +00:00
Sigmund Cherem b83d06e4f8 Fix order of async callback arguments
This was noticed when running the benchmarks/Calls/dart/Calls.dart with
sound-null-safety.

The only fix that was needed is to swap the argument order, but I also changed
to add the type promotion to make these errors stand out statically.

Change-Id: If47b04596d2da9d30961705fd858f2f2ba2b12c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153062
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-07-01 23:06:24 +00:00
Mayank Patke e8daaefabf [dart2js] Ensure generic local functions are marked as potentially
needing type arguments.

Change-Id: I50831df2530395b9ec3562be171422b0b6455335
Bug: https://github.com/dart-lang/sdk/issues/42501
Fixes: https://github.com/dart-lang/sdk/issues/42501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152606
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-26 21:27:38 +00:00
Joshua Litt f4b19b8c2a [dart2js] Support package json files in modular_test_suite.
Change-Id: I6a17b9604d2a3e01d822a4872a2560f0aff0a63c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152361
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-26 15:08:52 +00:00
Mayank Patke 3b67681bcc [dart2js] Clean up (pre-)NNBD unit test configurations.
Change-Id: Ife85aafa90b1b0347fabb6e95f3d6c00c5307cd2
Bug: https://github.com/dart-lang/sdk/issues/42063
Fixes: https://github.com/dart-lang/sdk/issues/42063
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152440
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-06-25 18:44:32 +00:00
Mayank Patke cf62339751 [dart2js] Ensure type arguments are passed when invoking a generic
function property.

Change-Id: I387977e2f1fb7732d94331b7a97cceeec767aaae
Bug: https://github.com/dart-lang/sdk/issues/41449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151301
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-06-24 20:12:39 +00:00
Michael Thomsen f0c87e9f21 Clean up no-publish comments in pubspecs
Change-Id: I6cc1ab404de75cd02183b862842198c85b6d9256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152005
Reviewed-by: Alexander Thomas <athom@google.com>
2020-06-23 10:34:09 +00:00
Stephen Adams 9030ade7e2 [dart2js] Remove HIs and HIsViaInterceptor
Change-Id: Ieb0dc5bd0e48e40132ec3469bbc2204aa9556986
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152041
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-22 23:25:46 +00:00
Stephen Adams 8e2c51e8fd [dart2js] final locals may be assigned
A 'final' local can be assigned via definite assignment or via a
'late' initializer.

Fixed: 42422
Change-Id: I5e03ca534fb18fcb928db99daa6654c8942c9bff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151867
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-20 05:15:29 +00:00
Mayank Patke f2f3a256b4 [dart2js] Add support for Never as a type literal.
Change-Id: Ia543f33619ce46e42a6ac5d0b2d19f44b32525b2
Bug: https://github.com/dart-lang/sdk/issues/42344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151461
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-19 23:17:47 +00:00
Mayank Patke 6c593ac117 [dart2js] Visit type parameter bounds in the scope visitor.
Change-Id: Ief8cc2a88ef0833a10969237fa02cfdec869116d
Bug: https://github.com/dart-lang/sdk/issues/42344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151460
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-19 23:17:47 +00:00
Stephen Adams 7425b3de51 [dart2js] Remove more dead code.
Change-Id: Iff5b3921f40981c8122d7720ce80a5f01731aa47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151883
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-06-19 21:20:07 +00:00
Stephen Adams acf41746f5 [dart2js] More old-rti cleanup
Change-Id: Ia1bb661a255a9e3ea48b79ff33532d0d66e8e80e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151803
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-19 17:49:33 +00:00
Stephen Adams d8b7ec5163 [dart2js] Share large strings
On a per output-unit basis, repeated large strings are shared via a
`string$` pool.

TODOs:

- don't do it with strings passed to JS() code (they might need
  to be property accesses).

- tweak thresholds, using different thresholds for slow/run-once code.

Change-Id: Ib14245d9d428e52fb2ca23f34fa533de97fa2208
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136304
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-19 16:34:13 +00:00
Stephen Adams 1596bf3cd4 [js_runtime] Remove js_rti.dart
Change-Id: Ie28cca1b3b869e3bba55bbbd6ac8071ce22fb310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151800
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-06-18 21:11:12 +00:00
Stephen Adams a26ad7fb7c Remove more old-rti code
Change-Id: I9c9cf3d1a408138790176525cff4e8991cd1ba32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151632
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-18 16:24:10 +00:00
Stephen Adams 0ccc96f470 [dart2js] remove more old-rti code
Change-Id: I462dd6aec1bf39c16e340699b2803254fd4fc941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151345
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-06-17 20:31:01 +00:00
Leaf Petersen d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
Johnni Winther 7fce125300 [cfe,kernel] Add AstPrinter
This CL adds a Node.toText method together with an AstPrinter. These
facility and better toString implementation on AST nodes while allowing
for toString independent printing of AST to use in testing. This also
add support for an integrated toString of custom/internal nodes.

Some work is still needed in bringing the toString implementation on
all nodes to the old quality, and not all internal nodes have
customized textual representations yet. This work is left for future
CLs.

Change-Id: Ib0bf8a0bc02f489dfacdc8aa5f96da9c52f26058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150923
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-06-16 17:15:10 +00:00