Commit Graph

163 Commits

Author SHA1 Message Date
Johnni Winther 6931a7a288 Use [localFunctionNeedsSignature] to determine when to add JSignatureMethod
Closes #32078

Change-Id: Ib1c9c08b1fdf33e3d94c02595135cf430357fed6
Reviewed-on: https://dart-review.googlesource.com/43742
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-27 12:33:53 +00:00
Johnni Winther 7c2d96490d Support forwarding bounds in function type variables
Change-Id: Ifeab9ad06f512d9b6a5db02fc89d45250c25c054
Reviewed-on: https://dart-review.googlesource.com/40821
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-26 09:45:56 +00:00
Johnni Winther f2b8cafb44 Handle assert in initializers of constant constructors.
Change-Id: Ibb4053af00392b3c43177c60c8551cc6ffe937eb
Reviewed-on: https://dart-review.googlesource.com/38320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-13 14:00:01 +00:00
Johnni Winther d30aaaa4b8 Ensure no type parameters on constructors.
Change-Id: I6a40e2f74b8a89e5873d94d406a56f82db0d0b48
Reviewed-on: https://dart-review.googlesource.com/40526
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-02-13 11:11:05 +00:00
Emily Fortuna ef3c271542 Generate signature function in strong mode (previously was behind a flag).
Change-Id: Ia99623beb4f5cbba719833af2d710702d2caaa6d
Reviewed-on: https://dart-review.googlesource.com/38902
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-02-07 23:02:40 +00:00
Sigmund Cherem 5428a12b84 Ensure that env includes the actual mixin application fields and procedures.
From the docs of mixedInClass and mixin: the former is the direct thing that is
mixed in, but if it is a named mixin application it may not contain the actual
fields and procedures, instead the `.mixin` class does.

Change-Id: I049ced771925431d613b0b661154c1761fbe0a51
Reviewed-on: https://dart-review.googlesource.com/38161
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-02-02 07:10:30 +00:00
Sigmund Cherem 3b6d39cc2c Correctly defer typedef references
Change-Id: I61fb5ebb399dcfca5193b7ae870badc10add23e5
Reviewed-on: https://dart-review.googlesource.com/37880
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-01-31 21:10:29 +00:00
Johnni Winther ffd18a37ef Track type arguments of static and dynamic calls
- and use these to optimize for type argument need on instance
methods and closurized static methods.

Change-Id: Id41d8f8aa7639da15fbd24844e397a4524b6ed20
Reviewed-on: https://dart-review.googlesource.com/35261
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-19 22:31:37 +00:00
Sigmund Cherem e2ad2db805 Generate checks for library-is-loaded to fasta and dart2js.
Change-Id: Ibf453ca7390b81da7231dcb1be43e426c00d6eeb
Reviewed-on: https://dart-review.googlesource.com/35100
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-01-18 20:17:14 +00:00
Johnni Winther 73e35eb035 Update RTI optimization to handle type literal uses
... for generic methods and local function. Also update capture
conversion to recognize the new kinds of type variables.

Change-Id: I9b8771b0ebe6c9e926712fa31b0bdea966cc6a25
Reviewed-on: https://dart-review.googlesource.com/34600
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-01-17 15:12:55 +00:00
Emily Fortuna cbd05542cc Created a signature method on closures that returns the type of the closure function.
Some additional optimization work will need to be done at the end so
that we take out these functions when they are not needed (when we
don't have type variables).


Bug:
Change-Id: I28d59d04844ec18510b9befe45f26f4109d86ffa
Reviewed-on: https://dart-review.googlesource.com/32667
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-01-13 00:27:22 +00:00
Johnni Winther 8e8915f538 Support generic closures in rti analysis
Change-Id: I1d393cff5b83f8db69e7bddb8ecfcd4a5205854f
Reviewed-on: https://dart-review.googlesource.com/32700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 11:36:40 +00:00
Emily Fortuna cea3419584 Removed unnecessary Location parameter in closure conversion.
Bug:
Change-Id: I4460e8b54e104de1c8643f62f35176a2af537a6d
Reviewed-on: https://dart-review.googlesource.com/32722
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2018-01-06 00:34:08 +00:00
Johnni Winther e9243a4d16 Pass type arguments in static calls.
+ support generic type variable type literals
+ support generic type variable is test

Change-Id: I2473c39c33940c631070b919c7dcfe712fd1fe3d
Reviewed-on: https://dart-review.googlesource.com/31783
Reviewed-by: Stephen Adams <sra@google.com>
2018-01-03 07:57:58 +00:00
Johnni Winther 220a91122a Add --strong-mode flag to dart2js
+ move generic methods tests into a subfolder.

Change-Id: I00cde6a7dc7d6ff1677a8ca60f3a243f065e3765
Reviewed-on: https://dart-review.googlesource.com/31782
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-02 08:42:21 +00:00
Emily Fortuna fa9e576a40 Adjust importsTo so that you can get the import chain for entities other than memberEntities.
Also added some more tests to the deferred equivalence test.


Bug:
Change-Id: Ia5ca50728a96020ff76b7b519558cdb5847d598e
Reviewed-on: https://dart-review.googlesource.com/31600
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-28 19:31:13 +00:00
Johnni Winther 9fe7c0e806 Port unittests, part #5 of ?
Change-Id: I58c9deea426072907a5d02f61f23f138b1f50c1d
Reviewed-on: https://dart-review.googlesource.com/31101
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-22 12:11:47 +00:00
Johnni Winther b13a6015cc Support subtyping for function type variables.
Change-Id: I0e00330d76cc9b1f3d48bb1f0d87f6334976de54
Reviewed-on: https://dart-review.googlesource.com/29281
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 10:09:55 +00:00
Johnni Winther cd2afed97b Add typeArgumentCount to CallStructure
- to prepare for passing type parameters to generic methods.

Change-Id: I71fce9b2febdc69e650ec13569a70564b75ea3f1
Reviewed-on: https://dart-review.googlesource.com/26602
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-07 08:43:23 +00:00
Johnni Winther 08bd6919bf Introduce FunctionTypeVariable
+ rewrite subtype_test and friends to enable type tests from kernel
+ compute bounds on regular type variables

Change-Id: I8979d3e69bdfe7713146f546cc80c4d81f04778b
Reviewed-on: https://dart-review.googlesource.com/26200
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-06 14:46:44 +00:00
Emily Fortuna dc1b5525bf Create temporary Method type in kernel world for compatibility with Dart 1
Bug:
Change-Id: I9efa163ce1a9a76df405f32d35850743e7f090cc
Reviewed-on: https://dart-review.googlesource.com/25723
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-04 19:37:54 +00:00
Johnni Winther 03685a3c0b Remove _targetFunction and add asyncMarker to StackFrame
Change-Id: I6c1f92ec6759a67686ff40d26871f2e2a004a443
Reviewed-on: https://dart-review.googlesource.com/24860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-01 16:06:52 +00:00
Emily Fortuna b7ef9072f1 Set "type" for FutureOr to dynamic (temporarily).
Bug:
Change-Id: Ie4a376316c0fa444642c2535c0a97f3245c92fda
Reviewed-on: https://dart-review.googlesource.com/24621
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-11-30 18:18:04 +00:00
Emily Fortuna c7dadec876 Capture this and type variables in closures in checked mode when needed.
Bug:
Change-Id: I9e3bbc658590bcb6ec04cff4323cc2a97c20fc6b
Reviewed-on: https://dart-review.googlesource.com/21321
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-11-16 21:22:41 +00:00
Emily Fortuna bf94e73568 Fix up type inference to run in checked mode and enable checked mode tests running with kernel script.
Bug:
Change-Id: If720b6868fbdf010f4aac614ceea1ddea533c277
Reviewed-on: https://dart-review.googlesource.com/21222
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-15 22:34:51 +00:00
Johnni Winther 9ce12fc134 Skip abstract methods in KernelToElementMap.getSuperMember
Change-Id: Ic6d452cd3352fc557d59a54a37db4396c6a24d14
Reviewed-on: https://dart-review.googlesource.com/20100
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-13 09:33:34 +00:00
Johnni Winther 67d6c7095b Skip abstract methods in member lookup for inference.
Change-Id: Ic07e1f6f038ebf6a9767c65777c0d6898131b632
Reviewed-on: https://dart-review.googlesource.com/19000
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-09 08:15:09 +00:00
Sigmund Cherem 5799422d80 Support deferred loading in the kernel pipeline.
Change-Id: I8189a39db57e8cbac1e708a628dfcae70682ef3b
Reviewed-on: https://dart-review.googlesource.com/18685
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-07 23:00:50 +00:00
Johnni Winther 0cb8876756 Extract a NoSuchMethodData object from NoSuchMethodRegistry
Change-Id: Ie20797a25f61be4222278b26dcec9c31370c31b2
Reviewed-on: https://dart-review.googlesource.com/18821
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-07 09:03:38 +00:00
Stephen Adams 64656316ec dart2js kernel: make JClosureField implement PrivatelyNamedJSEntity for nicer names
This change reduces the number of diffs between AST and Kernel by a factor of 3.

I changed the order of adding closure fields - adding fields for
boxes, then 'this', then values and types.  This makes the order more
consistent with the old backend. We can undo this later.

Change-Id: I54d7c601cae89b6debce5166045dbb4d54add91f
Reviewed-on: https://dart-review.googlesource.com/18160
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-11-03 01:06:30 +00:00
Harry Terkelsen 9c78203f19 Add KTypedef to K element model
Change-Id: Iac058d920265381122886101d55e93ac10a865f4
Reviewed-on: https://dart-review.googlesource.com/18420
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-11-02 23:16:00 +00:00
Johnni Winther 395095b21d Make semantics of isExternal consistent between frontends
Change-Id: Ieda4b47442d9e4ec7e4fcdef159e72bcf28c99e6
Reviewed-on: https://dart-review.googlesource.com/16946
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-30 10:03:32 +00:00
Johnni Winther 4fdbf54473 Revert "Improve precision of instantiated types for redirecting constructor"
This reverts commit f41896052c.

Change-Id: Ice6eb30c46b77e6a10faee2d6025eb92af80f03a
Reviewed-on: https://dart-review.googlesource.com/16947
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-27 11:38:16 +00:00
Johnni Winther f41896052c Improve precision of instantiated types for redirecting constructor
This also eliminates some of the noise from the old frontend compared to the new frontend.

Change-Id: Ie943063ec59d3f0e1ee7662ca1b130733cf11b9e
Reviewed-on: https://dart-review.googlesource.com/16442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-27 07:49:30 +00:00
Stephen Adams 13aca35586 dart2js kernel: closure fields are not assignable
TBR=efortuna@google.com

Change-Id: I8644a627ad45da6f3cbc422e07f7b132e6861db6
Reviewed-on: https://dart-review.googlesource.com/16902
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-27 00:02:05 +00:00
Harry Terkelsen d62eb05435 Search for members in superclasses when searching for a class member
This changes 'hasConcreteMatch' to search the superclass chain in the
kernel implementation. This matches what the Element model does.

Change-Id: I6a0ab69bc7e6fe705139d6fa69fffc2346582702
Reviewed-on: https://dart-review.googlesource.com/12843
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-11 22:07:11 +00:00
Emily Fortuna a40fd8b507 Fixed up JS Interop, correct "native" detection, and made HN angular app run!
Bug:
Change-Id: Iea339d62d891661d6d1415424b12ac3f914b046e
Reviewed-on: https://dart-review.googlesource.com/12460
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-10 18:26:54 +00:00
Johnni Winther a39a5729b2 Handle optimizer hints in inferrer.
Change-Id: I2daac411c59a491a8860e6bfc1c85a653816d411
Reviewed-on: https://dart-review.googlesource.com/11920
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-06 20:05:38 +00:00
Johnni Winther 9f9b7bf520 Handle super get/set/invoke in inferrer
Change-Id: I4c3cd2ae4d99abb4de4edffc644e646f6eeca029
Reviewed-on: https://dart-review.googlesource.com/10460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 08:07:46 +00:00
Johnni Winther 8b96d1be59 Handle throw and enums
Change-Id: If7a957630f50a225422aaa233e3cb3ef2a005025
Reviewed-on: https://dart-review.googlesource.com/10400
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 07:52:42 +00:00
Harry Terkelsen 9e1bb63a2f Report invalid symbol constructor invocations
Change-Id: I03fe476639414969b831e93ed3461445cca89156
Reviewed-on: https://dart-review.googlesource.com/10801
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-10-03 23:43:02 +00:00
Harry Terkelsen dfb71004c7 Register seen classes as part of the impact.
This allows us to construct the class hierarchy from the impact results.

Change-Id: Id10a197eb80e60d5e25e093ffdadf8d0af092ecf
Reviewed-on: https://dart-review.googlesource.com/10208
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-03 21:36:33 +00:00
Johnni Winther 4b94004d4b Add tests for jsinterop errors
Change-Id: Icfa6b5a34ed56e43abb3a55eb8d48bc80eeac59f
Reviewed-on: https://dart-review.googlesource.com/9240
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-29 19:16:05 +00:00
Stephen Adams 56db0e80f5 Generate closure class names more like the AST version
Bug:
Change-Id: I95be2384fd67c17bc713732d902ec414e439d7af
Reviewed-on: https://dart-review.googlesource.com/9122
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-28 00:58:49 +00:00
Johnni Winther c0c63bf16e Fix handling of function type parameters
Closes #30826

Change-Id: I804bff2a204aa210ba59f691c5d680d8a53aadeb
Reviewed-on: https://dart-review.googlesource.com/7553
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-26 08:23:34 +00:00
Johnni Winther 772a0aff33 Handle and report erroneous compile time constants
Change-Id: I2ee86dbd714227e8e0894539ca64258fd11badfc
Reviewed-on: https://dart-review.googlesource.com/7820
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-09-22 18:57:37 +00:00
Johnni Winther 639ddd3067 Pass rti info for local functions to the closure converter
Change-Id: I593ad134a16ee10b43b50213db9774e7c2671f22
Reviewed-on: https://dart-review.googlesource.com/6600
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-19 12:00:03 +00:00
Emily Fortuna 942963fa2e Add TypeVariable analysis in closure conversion.
Bug:
Change-Id: I4155ceb042295934cc3c9125d275dc5f034675dd
Reviewed-on: https://dart-review.googlesource.com/6025
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-09-18 20:26:33 +00:00
Johnni Winther 5c057e7ca4 Refactor handling of type variable access.
Change-Id: I41a796346979fb060f717ab38f7ca1a47f6b2d80
Reviewed-on: https://dart-review.googlesource.com/5740
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-09-15 08:27:26 +00:00
Johnni Winther 2acf735159 Remove Local.memberContext and Local.executableContext
Change-Id: Icd1ff9ac06fb218731c618c5fc87e4d69bb47e77
Reviewed-on: https://dart-review.googlesource.com/5240
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-09-14 08:14:15 +00:00