Commit Graph

3333 Commits

Author SHA1 Message Date
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
Harry Terkelsen 12baebc768 Set outer closure needs 'this' if inner needs 'this' for rti
Change-Id: I46850f2a28abb499fa64266480fc108b38ecbfb9
Reviewed-on: https://dart-review.googlesource.com/18904
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-07 00:17:21 +00:00
Sigmund Cherem 14843eb067 Create deferred-load-task from the front-end strategy.
This CL also moves code around a bit to prepare for the kernel implementation.
There are minimal changes, most of the code is the same. The refactor will make
the diff on the next CL much simpler

Change-Id: I4fff9c6511a5c19264c5573c4e2a0fffa2d61bfd
Reviewed-on: https://dart-review.googlesource.com/18681
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-11-06 23:34:00 +00:00
Brian Wilkerson 6553687296 Fix another path in type_checker_test
Change-Id: I2b17a4227490e4abab02fe38e65d7ad77c6fb0dc
Reviewed-on: https://dart-review.googlesource.com/18920
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-11-06 21:26:12 +00:00
Brian Wilkerson caf3f19bcf Fix unparser test
Change-Id: Ie70d4ff749c0e76df47ff76d5b9f888f00010b12
Reviewed-on: https://dart-review.googlesource.com/18862
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-11-06 19:50:00 +00:00
Sigmund Cherem 46c859152a Add output unit data: an intermediate representation of the resuls of deferred loading
Change-Id: I54fb3eb49338f137c127113fd884ce54a1187a64
Reviewed-on: https://dart-review.googlesource.com/18508
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-06 17:15:40 +00:00
Erik Ernst 40b6741778 Adds support for syntax error in tests to test.py.
This CL modifies the Dart source used from test.py such that it takes
`syntax error` into account as an expected outcome in test files (so
that we can have `//# 01: syntax error` with a similar meaning as
`//# 01: compile-time error`).

For all tools except the spec_parser, `syntax error` is the same
outcome as `compile-time error`; that is, nobody else will see the
difference.

For the spec_parser, `syntax error` is the outcome where parsing has
failed; `compile-time error` is taken to mean some other compile-time
error, i.e., the spec_parser is expected to _succeed_ when the
expected outcome is `compile-time error`.

Test files in language and language_2 have been adjusted to use the
outcome `syntax error` where appropriate.

The status files in language and language_2 for the spec_parser have
been adjusted such that they fit all the new `syntax error` outcomes
in test files.

Other status files have been adjusted in a few cases where tests were
corrected (because a compile-time error which was clearly not intended
to be a syntax error turned out to be caused by a typo, which means
that the actual compile-time error has never been tested).

The spec grammar Dart.g was adjusted in a few cases, when some bugs
were discovered. In particular, the treatment of Function has been
changed: It is now known by the parser that Function does not take
any type arguments. This makes no difference for developers, because
they cannot declare a type named Function anyway, but it means that
a number of tricky parsing issues were resolved.

Dart.g was also adjusted to allow `qualified` to contain three
identifiers, which is an old bug (preventing things like metadata on
the form `@p.C.myConst`).

Change-Id: Ie420887d45c882ef97c84143365219f8aa0d2933
Reviewed-on: https://dart-review.googlesource.com/18262
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-11-06 08:56:09 +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
Sigmund Cherem cfc1630f6e Mark jsinterop test slow
Runs fine when run in isolation, but often times out when running the entire
suite on my local machine.

Change-Id: Iedbaa0fac5fc7191de9f3975c642769aff77c950
Reviewed-on: https://dart-review.googlesource.com/18680
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-11-03 23:56:04 +00:00
Sigmund Cherem c53c2f948d Support caching impacts with the kernel frontend. This is needed by deferred
loading.

To make this possible, this CL explicitly models the impact cache and deleter.

Change-Id: I444625a7a14155d9c530a390854a42d277055aaa
Reviewed-on: https://dart-review.googlesource.com/18463
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-03 17:52:21 +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
Brian Wilkerson dd18ef841b Parser conversion, part 3
Change-Id: Ibe48da9bfa89887fb04a4b958b913fe7c0087cf1
Reviewed-on: https://dart-review.googlesource.com/17600
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-11-01 16:32:45 +00:00
Johnni Winther 42a6bfac51 Update infrastructure on inference_equivalence and equivalence-based tests.
Reviewed in https://dart-review.googlesource.com/c/sdk/+/17440

Change-Id: I35c054517e72185d99eee2b438d62a5f5c52fdee
Reviewed-on: https://dart-review.googlesource.com/17782
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-01 09:28:31 +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
Leaf Petersen 4270b99d75 Fix dynamic as bottom uses in front end and dart2js.
Re-enable the dynamic as bottom hint in analysis_options.yaml and fix
the code to be hint clean again.

Fixes #30589
Fixes #30590

Bug:
Change-Id: Idb7910b3ab1c6d931a3ead3eed885d8bd172e621
Reviewed-on: https://dart-review.googlesource.com/17062
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-30 19:54:26 +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
Stephen Adams b3a93f44eb Add dart2js noInline and tryInline annotations to package:meta
There will be a follow-up change to remove NoInline from package:expect.

Change-Id: I6dc33241ea6d8b6a8994da6a8ec5295dab30f4da
Reviewed-on: https://dart-review.googlesource.com/17043
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-27 21:21:13 +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 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 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 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
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
Sigmund Cherem a8d13565cd Add support for deferred loading in fasta
Change-Id: I2a5489b618210935b4b21c583aba9738a5e3f645
Reviewed-on: https://dart-review.googlesource.com/13441
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-26 23:22:48 +00:00
Harry Terkelsen 0c7fbd7f38 fix dart2js_native test status file
Change-Id: Id99e8403871542ab43e7a7762aca6975ffd2c3e0
Reviewed-on: https://dart-review.googlesource.com/16622
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-25 19:25:30 +00:00
Emily Fortuna 0b69394c49 Usage of type variables with mixins.
Bug:
Change-Id: I8c7fdf203e76e63164b3f28c23d9c0e2c9939cd8
Reviewed-on: https://dart-review.googlesource.com/15986
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-10-24 18:00:18 +00:00
Johnni Winther 313ded4e1c Revert "Handle synthesized multiple inheritance"
This reverts commit 898a1ae1aa.

Change-Id: Ifca20a405a017299da3dd585fbe2f7727638d8e5
Reviewed-on: https://dart-review.googlesource.com/16220
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-24 09:39:47 +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 898a1ae1aa Handle synthesized multiple inheritance
The reuse of mixin applications employed by kernel introduces unneeded
multiple inheritance (the same class implemented with different type arguments).
The type system in dart2js does not support multiple inheritance and flags such
cases as compile-time errors.

With this CL such synthesized cases are bypassed, while regular cases are still flagged.

Change-Id: Ieb07d2b6559e15a7b745baeddc80c07acff7a3d1
Reviewed-on: https://dart-review.googlesource.com/15886
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-10-23 18:04:22 +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 222af2dd08 Compute side effects during inference.
Change-Id: Iad5567cb76c8725b19446b6a802e6e704d42e99e
Reviewed-on: https://dart-review.googlesource.com/13800
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-23 07:37:18 +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
Peter von der Ahé b96ac4520a Update most clients to use computePlatformBinariesLocation.
Change-Id: I6e6960c471b2fab3f0cd8a672da05d7699217410
Reviewed-on: https://dart-review.googlesource.com/12291
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-17 10:48:40 +00:00
Stephen Adams 2c44adec91 dart2js kernel status updart for dart2js_native and dart2js_extra
Not sure why they changed, but it is useful for other work to have a
'correct' baseline.

TBR=sigmund@google.com

Change-Id: I6d22f731e74f093e39ad0203a668b2ea165946b5
Reviewed-on: https://dart-review.googlesource.com/14362
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-17 02:53:41 +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
Emily Fortuna e3d0a7093c Test TypeVariables in isTest correctly (and non-type variables) in Kernel.
Bug:
Change-Id: I624e7a111841bcab77d370163ac21d2c5cc3010a
Reviewed-on: https://dart-review.googlesource.com/13681
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-14 00:20:44 +00:00
Stephen Adams b80c0a1dde fix archaic syntax in dart2js_native test
TBR=efortuna@google.com

Bug:
Change-Id: I394985d25513fa213f7ba9270c92b4d357bff91c
Reviewed-on: https://dart-review.googlesource.com/13923
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2017-10-13 22:40:34 +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
William Hesse 6d1e43630f Update status for migrated tests
Bug:
Change-Id: I2ba85715f5fa375b12009df7e0094c4032f29071
R=mkroghj@google.com
Reviewed-on: https://dart-review.googlesource.com/13500
Reviewed-by: Morten Krogh-jespersen <mkroghj@google.com>
2017-10-12 11:22:13 +00:00
Johnni Winther 99af2fef35 Handle initializers in inferrer.
Change-Id: I0f21682448da8e427a73b849c8e6c8cc523c8201
Reviewed-on: https://dart-review.googlesource.com/12940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-12 08:08:03 +00:00
Johnni Winther 0daecdf552 Skip captured variables in refinement.
Change-Id: Iad54833db0dbdc683790fccec3dca4f5cf435657
Reviewed-on: https://dart-review.googlesource.com/12442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-12 07:59:13 +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
Brian Wilkerson e942115fcd Fix an infinite loop in the parser
Change-Id: I0946867082afecde10afb00abedc94bb0f18f6d3
Reviewed-on: https://dart-review.googlesource.com/12040
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-11 15:40:30 +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
Sigmund Cherem c0860d0499 one more fix
Change-Id: I47481d04e25137bc63b23d2366dbc5929c275e94
Reviewed-on: https://dart-review.googlesource.com/12440
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-09 23:18:27 +00:00