Commit Graph

88 Commits

Author SHA1 Message Date
Johnni Winther b58cc36ddc Extract KClosedWorld from ClosedWorld.
Change-Id: I2db59cea5081fde2f0b35c6518d6b618df617ac1
Reviewed-on: https://dart-review.googlesource.com/57827
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-04 09:22:41 +00:00
Johnni Winther 89514bd8cf Cleanup library_loader.
Change-Id: I0255580cd9292bcd3a5997c7d97d83b25d888372
Reviewed-on: https://dart-review.googlesource.com/55960
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-24 09:52:50 +00:00
Johnni Winther 78f348b3d5 Don't export types/masks.dart from types/types.dart
To make uses of TypeMask explicit in the imports.

Change-Id: I7c0c2377b65720394dcda217e5e68a4e3f9a4e9c
Reviewed-on: https://dart-review.googlesource.com/55421
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-17 08:05:42 +00:00
Johnni Winther 506c8819ae Delete CompilerResolution, ResolutionFrontEndStrategy at al.
Change-Id: I13698f02d5c9af878750290ad1aef8d32777684f
Reviewed-on: https://dart-review.googlesource.com/54403
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14:07 +00:00
Johnni Winther b347839ee6 Remove impact_test
A replacement is in progress in another CL.

Change-Id: Ib1eda85caa10c5e5a00f4c9e1b5c1605a2a56da6
Reviewed-on: https://dart-review.googlesource.com/54227
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-09 07:55:08 +00:00
Johnni Winther d0112f4431 Remove old frontend equivalence tests
Change-Id: I18b4b9979aea44b4dec64a5f1a32e67118b54a97
Reviewed-on: https://dart-review.googlesource.com/54222
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-09 07:55:08 +00:00
Johnni Winther 7afa0812ee Implement strong mode open world strategy.
Implements a new strategy for closed world computation that takes
the static type of the receiver into account when processing dynamic
calls.

For this to work, the J-model needs to only contain live members,
meaning queries can no longer assume that a J-model member exists for
instance for JSString.split because it might not be live.

This is the initial implementation which only uses
ir.MethodInvocation.invocationTarget. Later we will use the static
type of the expression on ir.MethodInvocation, ir.PropertyGet, and
ir.PropertySet.



Change-Id: I2dcc5a9148f27127d4e89c414a7d24f90f9cf2a4
Reviewed-on: https://dart-review.googlesource.com/48480
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-23 07:58:12 +00:00
Johnni Winther c5f69dff2d Include call on Closure in inference
Closes #32835

Change-Id: Ief2096544e01f74e6cc52abd6131a24a10ffe75f
Reviewed-on: https://dart-review.googlesource.com/50680
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-13 08:46:26 +00:00
Johnni Winther 826928e2ab Use _trust to test inference of --omit-implicit-checks
+ update the comment in ParameterTypeInformation.potentiallyNarrowType to
match the current expectations.

Change-Id: Ic98025f8314e8ac9eee6225c8c77e407a9fdabb9
Reviewed-on: https://dart-review.googlesource.com/50481
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-13 08:42:56 +00:00
Johnni Winther f555ae505a Trust type annotations in strong mode
Change-Id: I59019ec56e432a71c52637307fa4dd346fa27c1f
Reviewed-on: https://dart-review.googlesource.com/50240
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-10 09:16:46 +00:00
Johnni Winther 4d7327b7b7 Run inference test in strong mode
Change-Id: Iacfe794fe3303fd94574f6761389cce5f34e82da
Reviewed-on: https://dart-review.googlesource.com/49483
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-05 11:07:21 +00:00
Johnni Winther 7ed7e57aaa Assert that inference isn't expected on abstract methods.
This fixes the root cause of the bad inference on NativeTypedArrayOfDouble.[] in strong mode.

Change-Id: I6436ef1d49780cd0f931ab38120fbcba90380e7c
Reviewed-on: https://dart-review.googlesource.com/49420
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-04-05 09:32:25 +00:00
Sigmund Cherem e01fbecdf5 Fix type in NativeTypedArrayOfDouble
Change-Id: Ifeb5d1bdaa9dce941449217127b7324e3744d6df
Reviewed-on: https://dart-review.googlesource.com/49082
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-03 00:15:55 +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
Johnni Winther 94fc11388a Port inference tests, #5 of 5
Change-Id: I384056289dfa99991aa42fbe0baadedc6c208b6f
Reviewed-on: https://dart-review.googlesource.com/34586
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-17 10:19:53 +00:00
Johnni Winther 7568a4e4ce Don't register closure call methods
- closed world is incomplete anyway; we're missing the call methods from static and instance tear-off.

Change-Id: Ibd3fc9d80220bef3ee651bf529a487b617de7a6b
Reviewed-on: https://dart-review.googlesource.com/34144
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-12 11:47:18 +00:00
Johnni Winther e6363dd1bb Add tests showing the bad inference on .call
Change-Id: I939de4485a81d5a21f89088e91e6ae8eed648646
Reviewed-on: https://dart-review.googlesource.com/33941
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-12 11:29:43 +00:00
Johnni Winther 966986947b Port inference tests, part #4 of 5
Change-Id: Id4686f1e9673a5c7af3747584c9a59463b770e0f
Reviewed-on: https://dart-review.googlesource.com/32760
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 08:35:56 +00:00
Johnni Winther 00b083bafc Port inference tests, part #3 of ?
Change-Id: Ib4b9650c94b2302f68272d18601c97cd4685e03e
Reviewed-on: https://dart-review.googlesource.com/32543
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 08:28:38 +00:00
Johnni Winther de3f4f5e95 Port inference tests, part #2 of ?
Change-Id: Ia9012f278824ae2a7b069ecdcabc50c7dfbde40d
Reviewed-on: https://dart-review.googlesource.com/32340
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-08 08:09:44 +00:00
Johnni Winther 47d4534700 Port inference tests, part #1 of ?
- to the equivalence framework.

Change-Id: Ieddcb60c5e5367e2554bfa715562264f1dca5a9e
Reviewed-on: https://dart-review.googlesource.com/31941
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-03 08:57:37 +00:00
Stephen Adams f937039bd6 Remove unused JS_BUILTIN
Became unused at:
https://github.com/dart-lang/sdk/commit/1ae1ec7df4b22238fd61e9e529ad62a498b3199e
Change-Id: I92c167dc2a071a45b2635b9b1d907015043d60ab
Reviewed-on: https://dart-review.googlesource.com/31560
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2017-12-28 01:16:02 +00:00
Sam Rawlins 3bc3ab979e Fix IMPORT_INTERNAL_LIBRARY error location
Fixes #31682

Bug: https://github.com/dart-lang/sdk/issues/31682
Change-Id: Id4f52006aa7ca3e5fb0ecce61c0393310f18764f
Reviewed-on: https://dart-review.googlesource.com/30260
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-18 18:22:46 +00:00
Johnni Winther d29cd4f183 Add toText to SideEffects and TypeMask for testing
- and make toString more structured.

Change-Id: If62cfb8e7ee110db6dfb713236e119e7e2f0e244
Reviewed-on: https://dart-review.googlesource.com/22401
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-27 09:12:42 +00:00
Johnni Winther b5a4844f35 Add regression tests for [ClosureCallSiteTypeInformation] in loops.
Change-Id: I2c73bfa8ee59bfbc39abb618bd17fe09db28814b
Reviewed-on: https://dart-review.googlesource.com/21740
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Harry Terkelsen <het@google.com>
2017-11-20 10:45:37 +00:00
Johnni Winther de6dab1a09 Handle loadLibrary in inferrer
Change-Id: I4822a016fc5f74e37c1905de2d529b09dc44531c
Reviewed-on: https://dart-review.googlesource.com/20420
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-13 11:58:54 +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 f3d7a95343 Correctly refine calls to locals in old inferrer.
Closes #31333

Change-Id: I9336639a5d4774c9bbf444246d0458621b5f2a79
Reviewed-on: https://dart-review.googlesource.com/20000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-13 08:52:54 +00:00
Johnni Winther 041f98ca8c Add test for calls on calls on local variables.
Change-Id: I88e67860cc2a6e69f8364a75b175088a4c920ec7
Reviewed-on: https://dart-review.googlesource.com/19566
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-10 18:08:41 +00:00
Johnni Winther 0b1e2e0ab1 Handle .call on closures in the old inferrer
Closes #31316

Change-Id: I7fd2e6df9cfb7f2fa785ba7a68525208eebb248e
Reviewed-on: https://dart-review.googlesource.com/19562
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-10 10:27:17 +00:00
Johnni Winther 2bbecf843f Handle .call on closures.
Change-Id: I19b8fdcf00f222bdc7a4272eff3dffcdd19f5b57
Reviewed-on: https://dart-review.googlesource.com/19189
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-09 08:29:01 +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
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
Johnni Winther 29f3cc0db1 Various fixes for erroneous cases
Change-Id: I1c370dd220ff5e27196dcc8294d3c8eeda80462c
Reviewed-on: https://dart-review.googlesource.com/18483
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-06 08:42:46 +00:00
Johnni Winther b7e53e4966 Detect non-nullness of postfix results in the old inferrer
Change-Id: I51b0607371bfac4bead70bfc2852060aa3b1ed96
Reviewed-on: https://dart-review.googlesource.com/18280
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-03 10:29:59 +00:00
Johnni Winther 665694db89 Add test for postfix results.
Change-Id: I24b860c31eb82e44ae7e3fd0b55536c076fddd9a
Reviewed-on: https://dart-review.googlesource.com/18260
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-11-03 09:41:52 +00:00
Johnni Winther d3f3846207 Remove .getClosureInfoForMember
- and use ScopeInfo.forEachBoxedVariable instead of ClosureRepresentationInfo.forEachBoxedVariable.

Change-Id: I9d0c67eb06b7633a27d48745dc81d03d30f7e7ae
Reviewed-on: https://dart-review.googlesource.com/18186
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-11-02 14:06:38 +00:00
Johnni Winther 0373526d82 Fix refinements order on updates.
Change-Id: I2677792bb23d90ce5c63f159156c27653ed69f5f
Reviewed-on: https://dart-review.googlesource.com/17800
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-02 13:03:47 +00:00
Johnni Winther 74022b9902 Refine receiver before arguments in method invocation
Change-Id: I6c32ade4d2342489299b010c841fb5c928f96b9a
Reviewed-on: https://dart-review.googlesource.com/17783
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-11-02 11:50:29 +00:00
Johnni Winther dc366e2c71 Test index access on this
Change-Id: I9ce9e901ba7fed257c9035d40b9119bab1bbdc6e
Reviewed-on: https://dart-review.googlesource.com/17785
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-02 08:35:57 +00:00
Johnni Winther 5017e573e3 Add test for index postfix/prefix
Reviewed in https://dart-review.googlesource.com/c/sdk/+/17440

Change-Id: Ibf6399ca4c3ccf41ce8307833e5a300368c02299
Reviewed-on: https://dart-review.googlesource.com/17781
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-01 09:22:40 +00:00
Johnni Winther 1852cbab70 Use the right receiver mask in expose this computation
Change-Id: I298eeb12fca7b1e78b904b63e64ceb6414d0996a
Reviewed-on: https://dart-review.googlesource.com/17440
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-01 09:14:59 +00:00
Samir Jindel 031a7ffe41 [kernel] Improve Enum representation.
Dart2JS and the VM prefer for Enum names to be stored inline in the Enum
object to avoid having the static array of all Enum values. A base class
for Enums is provided to avoid repeating the common fields and accessors
between Enum definitions.

Bug:
Change-Id: I783f863015b45f13317fda06e627d14844fe2ddf
Reviewed-on: https://dart-review.googlesource.com/16526
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-27 12:10:53 +00:00
Johnni Winther 855388b629 Treat getter access as non-constant.
Change-Id: I2d4a07629be5984f25f6a58d2c540d8d8bb7aa6b
Reviewed-on: https://dart-review.googlesource.com/16800
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-27 08:08:36 +00:00
Johnni Winther ec6fc3f553 Handle assignment operators in inferrer
Change-Id: Ice10ba98ebf2f9a6c2e25a898b01ad5d95be768e
Reviewed-on: https://dart-review.googlesource.com/16240
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-27 07:38:34 +00:00
Johnni Winther e8aa3697e3 Test index-set in inferrer
Change-Id: If56ab799f102f392774be518f967ac072cafddb8
Reviewed-on: https://dart-review.googlesource.com/15888
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-24 08:43:28 +00:00
Johnni Winther 9bf7fc9130 Add test of index operations
Change-Id: I34e5cf8ba7bdd38a2b4094c71bc0e71c4a68c613
Reviewed-on: https://dart-review.googlesource.com/13802
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-23 08:26:43 +00:00
Johnni Winther b2e7058747 Specialize list constructors in inferrer
+ handle native methods and js-interop constructors

Change-Id: I901301bf6d4926e6ecb1e427e3d16e512d888aab
Reviewed-on: https://dart-review.googlesource.com/13722
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-23 07:29:51 +00:00
Konstantin Shcheglov 462542b734 Report UNUSED_ELEMENT for top-level variables.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/25323
Change-Id: I751ee82742ff622a9b28b3cb05886b5ee775f9ed
Reviewed-on: https://dart-review.googlesource.com/13929
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-16 17:44:06 +00:00
Johnni Winther f80860ddbd Track exposure of this in inferrer
Change-Id: I07d899ed59fd28ffe258c518743c66aa20fa0540
Reviewed-on: https://dart-review.googlesource.com/13480
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-13 07:50:35 +00:00