Commit Graph

4835 Commits

Author SHA1 Message Date
Stephen Adams f27d4f2f7a [dart2js] Create list constants with implementation type
This is now consistent with Set and Map constants.

Change-Id: I4a65f372eeeaaba5d6b7c229c452ba4dc7870708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119582
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-10-02 19:30:30 +00:00
Dmitry Stefantsov bdf6b9505e [cfe] Ask for subtype checking mode explicitly
The interpretation of the subtype check result depends on the mode.  In partial
NNBD mode all type errors that wouldn't be errors in non-NNBD programs should
become warnings.  In full NNBD mode all such errors are errors.  This CL adds
the mode explicitly to the interface of the subtype check as a parameter.

Bug: http://dartbug.com/38673
Change-Id: I14bcdd260618530cfdd8189c01abba7469a16679
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119545
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-02 11:30:29 +00:00
Mayank Patke b9b5139b9e [dart2js] Delete unused parts of class stub generator.
Change-Id: I0204afe624fcbe29cd7a295b9e9ec0f6f5277838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119461
Commit-Queue: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Auto-Submit: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-30 19:58:03 +00:00
Mayank Patke 75eb947bc8 [dart2js] New RTI: Support redirection in ruleset.
Change-Id: I6b11dbd826f9b47febcb0cd2716d93ff5cd8b74c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118887
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-26 22:24:52 +00:00
Mayank Patke 0c6249de26 [dart2js] New RTI: Remove converted closure classes from subtype
metadata.

Change-Id: Idf8671bb412bdddfbfaacab4b4ef808e2a3ee6d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118884
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-26 22:24:52 +00:00
Mayank Patke c1fdf3bde0 [dart2js] New RTI: Treat erased class type variables as dynamic.
Change-Id: Icb97f281a70098e681a1d37b0105ca409be93f54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117776
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-26 22:24:52 +00:00
Mayank Patke e578b68b23 [dart2js] New RTI: Don't emit $as methods.
Change-Id: I91d7b7e8216e3643d3b92908f690b199b0e3e20f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119084
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-26 22:23:42 +00:00
Dmitry Stefantsov e034104f04 [cfe] Remove TypeEnvironment.*Type getters
The getters were returning types of undefined nullabilities.  Now the
nullability-aware getters on CoreTypes should be used instead.

Closes #38224.

Bug: http://dartbug.com/38224
Change-Id: I617a0ef8ee17ebd792c2bc1ec6477a5ee469fee1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118570
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-09-25 13:28:28 +00:00
Stephen Adams 9754f19eb6 [dart2js] dead code elimination can create GVN candidates
Change-Id: Ia2dc35a0f953198f10ae306801910aaa0048e743
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110344
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-25 01:19:53 +00:00
Stephen Adams acba8cf7a1 [dart2js] new-rti: Simplifications for HTypeEval
Simplifications

load(T).eval(E) -->  load(E')
  i.e. constant folding

env.eval(E1).eval(E2)  -->  env.eval(E3)
  i.e. composition

env.bind(load(T)).eval(E)  --> env.eval(E')
  i.e. partial constant folding or specialization

environment(instance).eval(E)  --> environment(instance)
  where E reconstructs the instance environment



Change-Id: I54699c4b5104d16912446faa28a1c1e8615b946a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117680
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-24 21:25:06 +00:00
Mayank Patke a42a2412b4 [dart2js] Add JS-interop classes as supertypes of JavaScriptObject.
Change-Id: I6c279295c30c27a6355959359781eb9474e33205
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117594
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-20 21:43:16 +00:00
Mayank Patke dd948188f7 [dart2js] Implement type relations for AnyType.
Change-Id: I9f0fb34e3ebc815283c5933843586479318112f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117593
Reviewed-by: Stephen Adams <sra@google.com>
2019-09-20 21:43:16 +00:00
Sigmund Cherem ff0e8f8035 Make extension methods more readable on dart2js stacktraces
Change-Id: I776b78c5a8742aad5ccc9aa4ffbc86827aacba96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118205
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-20 19:01:36 +00:00
Mayank Patke 34253ce388 [dart2js] New RTI: Treat JavaScriptFunction as subtype of all function
types.

Change-Id: Ibf97fe3d42e78f7f533c6057f03d31db0dba1ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117661
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-19 19:42:38 +00:00
Dmitry Stefantsov 515a597710 [cfe] Remove Class.rawType
Bug: http://dartbug.com/38224
Change-Id: If0af5487b1d43125738575ee3e0fcd747db54fa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117546
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-19 10:42:10 +00:00
Mayank Patke 4f1b0fdd0f [dart2js] (New RTI) Check all subtypes for trivial substitutions only when necessary.
Change-Id: Ic434db1efa58d361b92acfed0cf33a119e394837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113520
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-09-18 00:47:36 +00:00
Aske Simon Christensen 41ad840e48 [dart2js] Fix constant folding of overflowing truncating divide
Change-Id: I2f18ba780166ca1177999ebd856230d36bbf4d15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116980
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-09-16 13:10:59 +00:00
Johnni Winther 2c6f779a76 [cfe] Remove legacyMode
Change-Id: I9384631af94feaf1a345958ff23e6d35c2ba4049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116202
Reviewed-by: Jens Johansen <jensj@google.com>
2019-09-13 07:38:25 +00:00
Johnni Winther 4122034ada [kernel] Make accept methods generic
Change-Id: I50f3c2b5c09a1266811e1fe5a5b2042c77584e43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114514
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-09-05 07:46:10 +00:00
Jens Johansen 9f57cf71d7 Add a blacklist to spelling tests; spell-check all packages and sdk with blacklist
Change-Id: I5bf3d5784d2ba48568a2699bb09ae39a85be17c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115214
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-09-03 12:39:24 +00:00
Mayank Patke 5148afa2fa [dart2js] Treat classes instantiated by a NativeBehavior as native.
Change-Id: Ib1d19a6047492cd1a0e0d93e45107eb74f1b4306
Bug: https://github.com/dart-lang/sdk/issues/37576
Fixes: https://github.com/dart-lang/sdk/issues/37576
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114466
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-08-29 00:53:55 +00:00
Johnni Winther 71f1a615f4 [dart2js] Handle non-identifier characters in member names
These occur in the top members generated for extension members.

Change-Id: Ief2e2be0af3c30d7040a9239171db76e49ad0224
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114505
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-08-27 10:41:54 +00:00
Aske Simon Christensen 21cf0f5f90 [cfe] Clean out all uses of expired flags.
Change-Id: Ib9096f1a8628d78444bc0847b453dd4032864e09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114073
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-27 09:24:23 +00:00
Mayank Patke 72ba7461d0 [dart2js] Emit 'getIsolateTag' when 'allowInterop' is invoked.
Change-Id: Ic4de2cfc75a90b3adb3c4a978db20ee70f589914
Bug: https://github.com/dart-lang/sdk/issues/37576
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114302
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-23 20:07:11 +00:00
Mayank Patke afc259ea6b [dart2js] Add 'any' to DartType.
Change-Id: I430a754d0eb312b3f6509de72c91425da8291280
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113755
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-08-20 22:18:43 +00:00
Mayank Patke 38ca72a3e7 [dart2js] TrivialRuntimeTypesNeed should not say non-generic classes need type arguments.
Change-Id: Idb791d3ec93ba7eedad0d85a3e12eb51318dd48f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113484
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-08-20 18:35:30 +00:00
Mayank Patke b52b2c3910 [dart2js] Don't produce '-2' for default type argument values with new RTI.
TBR=sra@google.com

Change-Id: I20ea2b530285090ef8fb4bbb025c632b74be994b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113759
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-08-19 23:49:21 +00:00
Stephen Adams 0537c9d326 [dart2js] Fix DartType.subst
DartType.subst would accidentally drop FunctionTypeVariables that had
bounds modified by substitution.

Use a visitor for printing, with changes that make it possible to see the accidentally
free FunctionTypeVariables that were dropped.

Change-Id: Ie6c8d0bb8f2a22b11db6f009067cf64e38ab93c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113600
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-19 18:11:42 +00:00
Mayank Patke c179fa106e [dart2js] (New RTI) Handle extractTypeArguments.
Change-Id: I3fcafa879e41f814962457cfb6bf9373b6c17528
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113481
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-08-17 01:43:52 +00:00
Mayank Patke 6b531b2ba4 [dart2js] (New RTI) Fix JSInvocationMirror.typeArguments
Change-Id: I198463b7b8b4f15b57133fc5d7481956da2793c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113269
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-08-16 22:09:10 +00:00
Mayank Patke 562e4ee216 [dart2js] Fix instantiation stub generation.
If the new RTI is enabled, then to access an Instantiation's type
arguments, we need to index into the _rest property instead of directly
into the Rti.

While we're at it, clean up the impacts/static uses for instantiation.

Change-Id: I34b3e439792410773b1eed6746da83d529c9a58f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113218
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-08-15 23:55:52 +00:00
Mayank Patke 326139b729 [dart2js] Add new RTI instantiation entry point.
Change-Id: I6960d8ec2b1b859236542e20935de66259d0d7d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113125
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-08-14 23:17:46 +00:00
Stephen Adams d0c24059c6 [dart2js] new-rti: Specialize some cases of instanceType
Depending on the receiver type, HInstanceEnvironment can be a field reference,
or a call to a specialization of instanceType.

Change-Id: Ie895c42a811ca8e71206ecb1e9a5445883d7188d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113048
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-08-14 23:10:31 +00:00
Stephen Adams 762f049479 [dart2js] new-rti: fix merge problem
CQ didn't re-run the tests.

TBR=fishythefish@google.com

Change-Id: I6b8a2d51dc806510f241a95e98e2f1000ef3d79c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112820
Reviewed-by: Stephen Adams <sra@google.com>
2019-08-12 22:37:23 +00:00
Stephen Adams 576ef913e4 [dart2js] new-rti: lower field setters
Replace calls to field setters that don't need a check with HFieldSet.

Change-Id: I3408e87fc82686e66cf01d53a4ae10f94279041d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112704
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-08-12 21:39:26 +00:00
Stephen Adams bd47ec2f37 [dart2js] new-rti: Simplification and branch-strengthening for 'is'
Change-Id: I49d712b303400fe2f2109b6c9f8fb684917df0ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112701
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-08-12 20:40:06 +00:00
Stephen Adams e29d6d0ecb [dart2js] HValidator - k-limit inputs and usedBy validation
Change-Id: I73207f8bb82e70222ac058ac2fcf9cbb026cbad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112603
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-08-09 23:41:25 +00:00
Mayank Patke 8af17ed9ff [dart2js] Collect named type variables from recipe generator.
Change-Id: Ie056f605f710f7942973c1a8cd219d94c28e74b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112480
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-08-09 21:22:06 +00:00
Stephen Adams d8f5970f0f [dart2js] prepare validator for k-limiting
A few tests have huge methods where an instruction is used tens of
thousands of times. We can probably k-limit the validation in
assertion mode to a few thousand and greatly speed up those tests.

When I added k-limiting for an infeasibly large k, the program got
faster for no good reason, so I'm making this change as a baseline for
filing an issue on the VM optimizer.

Change-Id: I708d08be20652820b6ba878919ffcc6947a53b3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112490
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-08-09 19:13:04 +00:00
Johnni Winther 19654f30d0 [cfe+vm+ddc] Return ClassHierarchy and CoreTypes together with Component
Users of the CFE often need the ClassHierarchy and may CoreTypes after
invoking the CFE. This CL extends the result of `kernelForProgram` and
`kernelForComponent` to a `CompilerResult` that includes these objects.

Change-Id: I08491198fe876b6514e49993ad794388d6662c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112259
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-09 13:02:12 +00:00
Johnni Winther 3312fe3d26 [cfe] Fully support expired flags in CFE
This ensures that we can prohibit the disabling of an enabled and
expired flag while still support the use of enum value in
implementation code.

Change-Id: Ib92c506365bb61853d6ff791461c5065acabcd4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99173
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-08-09 09:23:01 +00:00
Johnni Winther b614253cdb Test CFE constants in side-effects test
Change-Id: I720a4e1b574a19aebb93dfab17a372f987f2cb71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99153
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-08-09 07:11:52 +00:00
Stephen Adams f7a300fc69 [dart2js] new-rti: signatures for tear-offs with dependent types
Change-Id: I0fd4e1b081500fe9a44897b1489cdd2b6680f409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112440
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-08-08 23:08:42 +00:00
Stephen Adams 43eb2f74d5 [dart2js] new-rti: Add new-rti type in String.split lowering
Change-Id: I4f02fc023bdfcdf8bd27aed9024f2453f221ded7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112300
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-08-08 04:35:28 +00:00
Stephen Adams ccf56d67fe [dart2js] new-rti: store-forward types from instance allocations
Change-Id: I6996c2e8afeb83f36060396be4979c9343e009a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112148
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-08-08 04:29:28 +00:00
Stephen Adams 01a679ba73 [dart2js] new-rti: Fix generator header-body merge optimization
Change-Id: Id4f038415990f5379c1a01637b53c398f5325449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112270
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-08-07 23:14:35 +00:00
Aske Simon Christensen 5121a2e831 [cfe] Read product mode directly from environment in async transform.
When we perform constant evaluation in the CFE, the async transform
runs after constant evaluation. Thus, it can no longer use const
bool.fromEnvironment("dart.vm.product") to query whether the VM is
in product mode.

Instead, it can read the product mode define directly from the
environment defines given to the CFE and generate different code
depending on the value.

Change-Id: I2aabc4a84b50a940d35d5664ff4ebdf0680ed5c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111645
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-07 08:28:25 +00:00
Mayank Patke 78c3fc4595 [dart2js] Don't encode types as their own superinterfaces.
Change-Id: I0c478a1d09985394610b6f76224e40b6f12467fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112042
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2019-08-06 22:12:58 +00:00
Mayank Patke f715515531 [dart2js] Encode type variable as index in type rules when the target type declares the type variable.
Change-Id: Ie99ac30c04867336e03d32e9933c6b073d84ea8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112038
Reviewed-by: Stephen Adams <sra@google.com>
2019-08-06 22:12:58 +00:00
Stephen Adams f13978ca9d [dart2js] new-rti: Accelerator for some primitive types.
Change-Id: Icfd479633e6d3dac99ccddb04a6ac67e8859feb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111940
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-08-06 19:17:49 +00:00