Commit Graph

2317 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen 973a1a0219 Remove uses of upper-case constants in remaining SDK code.
This includes Fasta, tools and observatory, so the checked-in SDK must
have the lower-case constants.

Change-Id: I8380ad041ad058f7d02ae19caccfecd434d13d75
Reviewed-on: https://dart-review.googlesource.com/50201
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-16 16:11:57 +00:00
Johnni Winther b1bc4ed2b5 Handle as in nested const constructors
Change-Id: I8ee105594022b7c64a3f1dd0228501b06f48cebe
Reviewed-on: https://dart-review.googlesource.com/51126
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-13 22:02:35 +00:00
Leaf Petersen c2b338f1b7 Remove fuzzy arrow support from analyzer
Fixes #31637

Change-Id: I87767b92814455187ea71cc4caca786043dbbe3d
Reviewed-on: https://dart-review.googlesource.com/51100
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-04-13 16:47:16 +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
Jenny Messerly 782cfe04d1 fix #32756, DDC dynamic calls to generics will work with emit-metadata
Also fixes DDK to disable metadata by default.

Change-Id: Ic5fd637c1048cb5ccfd035b8e0dd07b0985c1364
Reviewed-on: https://dart-review.googlesource.com/51040
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-04-13 03:01:06 +00:00
Jenny Messerly 8613938e33 fix DDK to track mock setters correctly.
Also fix nosuchmethod_forwarding_arguments_test to work in dart4web compilers

Change-Id: If19bf74561c716845e24862c2400e0ab5cfc135c
Reviewed-on: https://dart-review.googlesource.com/48891
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-13 00:27:26 +00:00
Sigmund Cherem ff24a5ee6b fasta: make strong-mode inference aware of the type of LoadLibrary and CheckLibraryIsLoaded
Closes https://github.com/dart-lang/sdk/issues/32841

Change-Id: I270b11b33460b66cd400fa8145ce5e968096a2bf
Reviewed-on: https://dart-review.googlesource.com/50622
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-12 19:44:51 +00:00
Johnni Winther b7cc1e7ce7 Fix stack overflow in RTI computation
Closes #32853

Change-Id: Ic759780799830dde655fafc7839c7d5387eb75d6
Reviewed-on: https://dart-review.googlesource.com/50943
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-12 17:45:39 +00:00
Jenny Messerly 2ddc5495f8 Reduce DDC signature overhead
- changes top-level/static method tearoffs to work similar to instance
  method tearoffs (attach typeinfo at the tearoff location).
- changes getters/setter signatures to a more compact representation.
- fixes incorrect reification of tearoffs in DDC Kernel backend,
  causing a couple of tests to pass after the changes.
- module startup should also be faster, because we avoid using
  `defineLazyProperty` for signatures.

Change-Id: I9d1705adcd5101a99f0599120cb927396eae778a
Reviewed-on: https://dart-review.googlesource.com/48455
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-12 02:22:09 +00:00
Jenny Messerly 8df4042b2d fix #32088, DDC calls nSM for signature mismatch
also fixes #32653, DDC should call nSM for unexpected named arguments

Change-Id: Id1848cd5af87ac615fd96fbf2784a72f9286801d
Reviewed-on: https://dart-review.googlesource.com/48940
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-12 00:29:59 +00:00
Johnni Winther b00ae2ec5d Fix dynamic call arguments computation
Closes #32828

Change-Id: Ic6307746d4d3c48b312cab74b383705d5892b408
Reviewed-on: https://dart-review.googlesource.com/50480
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-11 07:54:01 +00:00
Stephen Adams f3cec061eb Capture type variables in global NSM stubs
- Add a type argument count to JSInvocationMirror.
- Change stubs to pass the argument count.

Change-Id: I448dbee9a2aa0be17c24ae79eae0c89e7574fa7c
Reviewed-on: https://dart-review.googlesource.com/49820
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-10 21:32:11 +00:00
Alexander Thomas 3851591642 [infra] Keep comments intact when updating status files.
* Preserve empty lines in the file header.
* Add empty entry to the tool's newly created sections.
* Remove extra empty line at the end of the file.

Change-Id: I271583774d5f5497025a9d85bcadf8b0b9e39e81
Reviewed-on: https://dart-review.googlesource.com/37600
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-04-10 19:03:21 +00:00
Lasse R.H. Nielsen 5ea271bb01 Clean up documentation of implicit new/const insertions tests.
Add Expect.allIdentical to complement Expect.allDistinct.

Change-Id: I65e4e0005f141434bd8fb47d9c60153f32b293aa
Reviewed-on: https://dart-review.googlesource.com/50421
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-04-10 14:49:41 +00:00
Aske Simon Christensen bd39320b3b Recover from error on undefined continue label.
Closes https://github.com/dart-lang/sdk/issues/32800

Change-Id: Idbd11f1c17affc1e9a6dd7f4c6999464bac8982e
Reviewed-on: https://dart-review.googlesource.com/50220
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-10 14:33:11 +00:00
Lasse R.H. Nielsen 5d89a1ac32 Add tests for mixin application constructor forwarding.
Forwarding should work for constructors with optional parameters,
and for const constructors as long as the mixin doesn't declare any
instance variables.

Add tests for forwarding of constructors in mixin applications.

Bug: http://dartbug.com/31543, http://dartbug.com/32223
Change-Id: Iaf950f48703e14391050338f7ae2d80854ec8286
Reviewed-on: https://dart-review.googlesource.com/50460
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-04-10 14:27:30 +00:00
Aske Simon Christensen 290cc58e71 Use actual receiver when error-wrapping a null-aware property get.
Fixes the crash on conditional_property_access_test_{05,06}.dart
from https://github.com/dart-lang/sdk/issues/32800

Change-Id: Ic3928b345c235472d6632e8bc443f28d59b81f6b
Reviewed-on: https://dart-review.googlesource.com/49920
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-04-10 13:24:29 +00:00
Johnni Winther 91bbc798fa Skip abstract forwarding stubs
Change-Id: If0c0967e55038d330fef48d97bc96a92b0f4b506
Reviewed-on: https://dart-review.googlesource.com/49860
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-10 07:48:39 +00:00
Sigmund Cherem f71d204185 Fix expected type in substByContext
Note: the crash in language_2.status was added as a result of
https://dart-review.googlesource.com/c/sdk/+/49835.
Change-Id: I0dbd69a7cf80c6c432938f9bfd9df60703d5b367
Reviewed-on: https://dart-review.googlesource.com/50361
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-10 00:05:01 +00:00
Stephen Adams 899dbe4dae Forward type arguments in one-shot interceptors.
The status change is unrelated.

TBR=sigmund@google.com

Change-Id: Ic611ec7e9fa6b8e5dae9de7fc106fd839dd35bb6
Reviewed-on: https://dart-review.googlesource.com/50322
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-09 22:29:15 +00:00
Sigmund Cherem b430570364 dart2js: handle constant casts with type variable substitutions
Closes https://github.com/dart-lang/sdk/issues/32811

Change-Id: Ibf108405a3a36092a42902e5be806310a34c067c
Reviewed-on: https://dart-review.googlesource.com/49835
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-09 18:31:46 +00:00
Brian Wilkerson 3575b810b3 Only add const in a constant context (issue 32819)
Change-Id: Ia149d812d2540fa98d76765ffb8b54fe32ecf010
Reviewed-on: https://dart-review.googlesource.com/50120
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-09 18:11:36 +00:00
Sigmund Cherem 09f7d2aee5 dart2js: naive support for instantiations in constants - ignore the actual
instantiation

Change-Id: Ic214ac3688fe7639ce98daf0eb1ab7ba4705b81c
Reviewed-on: https://dart-review.googlesource.com/50023
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-09 18:09:16 +00:00
Martin Kustermann ef926f98f5 Update status file after 0fedb9b9d
Change-Id: I9045c9a3cabd5db0e1c88b731e036a1422d30333
Reviewed-on: https://dart-review.googlesource.com/50181
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-04-09 11:13:21 +00:00
Stephen Adams 6656233fcc Strong-mode fixes in js_runtime
Fixes errors in RegExp and String.fromCharCodes.

TBR=sigmund@google.com

Change-Id: I7f84d2b9ee2dfead6d0cf634e36c06b9071bf991
Reviewed-on: https://dart-review.googlesource.com/49981
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-06 21:44:32 +00:00
Dmitry Stefantsov 0fedb9b9d8 [fasta] Disable upwards new/const completion
Change-Id: If2c14bf402bbcbacbf4cf2da351eb7234e1e0944
Reviewed-on: https://dart-review.googlesource.com/49900
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-04-06 19:31:22 +00:00
Peter von der Ahé 60af3baf4d Implement type arguments to implicit creation
Fixes https://github.com/dart-lang/sdk/issues/30922

Change-Id: If9806d0ec5e1cfcc3ae3bd008f3ad3aa1f518a34
Reviewed-on: https://dart-review.googlesource.com/41261
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-04-06 11:00:22 +00:00
Sigmund Cherem 52896af2bb Fix analyzer bot: missing status line for new test in !$strong
TBR

Change-Id: Ie6088dac55ea56a052fbaaf012c625c3c1ea6614
Reviewed-on: https://dart-review.googlesource.com/49829
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-06 04:10:10 +00:00
Sigmund Cherem 0284fdab6b dart2js: allow as expressions in constants
The CFE doesn't allow them explicitly yet, but implicit casts do show up by the
time we see them in dart2js.

Closes https://github.com/dart-lang/sdk/issues/32773

Change-Id: Idb566625ce7c8edc74a4eea0109491bd72357051
Reviewed-on: https://dart-review.googlesource.com/49801
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-06 00:46:30 +00:00
Jenny Messerly 1eddbffe2e fix #32754, improve correctness/perf of operator []= with return
Change-Id: I80f5c7aec5606a415d8cba8c001b2aca24d04a8e
Reviewed-on: https://dart-review.googlesource.com/49581
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-04-05 19:08:07 +00:00
Erik Ernst fdc787efc8 Adjusted issue numbers of a test
This is a "small" CL: Only comments in status files are changed.

Issue 31359 was split into a meta-bug 32782 and several other tool
specific issues, because 31359 was reported for dart2js-with-kernel,
but the problem affects several tools.

Change-Id: Ib47032aa622e232f24348bb55bc17d39a971cc2f
Reviewed-on: https://dart-review.googlesource.com/49701
Reviewed-by: Erik Ernst <eernst@google.com>
2018-04-05 14:35:55 +00:00
Régis Crelier bd6e66c538 [VM runtime] Ignore 'implements Function' in strong mode type tests (fixes #32154).
Change-Id: I7d53594e6ffaef616b3384e073e2240a8ca7017c
Reviewed-on: https://dart-review.googlesource.com/49080
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-04-04 17:52:55 +00:00
Stephen Adams c5caf7e294 dart2js: Pass through type arguments in parameter defaulting stubs
This fixes a problem where a defaulted optional argument
would cause the passed type parameters to be replace with dynamic.

Change-Id: I32cf327b3a4b6176f199164c840a1114fc302205
Reviewed-on: https://dart-review.googlesource.com/49081
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-04 00:20:41 +00:00
Erik Ernst c98df5b065 Check that type alias equality relies on the underlying type, not the typedefed name.
Note that this is a multi-test, which is helpful in order to make it visible which situations are covered and which ones are not, but when it all works it would make sense to just run everything in one step, in order to get better performance.

Change-Id: Ifab94f7ad369a7c76bab3337eabf2ddd22821b04
Reviewed-on: https://dart-review.googlesource.com/47882
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-04-03 12:34:40 +00:00
asiva a0470fefb6 Remove implicit_creation/implicit_new_or_const_composite_test from the status file under darkp as the test now passes.
Change-Id: I672127172ffcfcdc603d90671bb7e51c2d0b4dda
Reviewed-on: https://dart-review.googlesource.com/48960
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-03-31 01:53:31 +00:00
Stephen Adams 9858ea1f8d Explicitly store isIntercepted in full emitter tearoffs
The trick of detecting isIntercepted from the number of arguments does
not work with function type arguments. We fixed this in other places,
now fix it in the full emitter.

Change-Id: I35fcda11db1df0e7442b66317c9ea20674514722
Reviewed-on: https://dart-review.googlesource.com/48922
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2018-03-31 00:02:11 +00:00
asiva 996a66d247 Fix build bot failure in dartkp mode (language_2/implicit_creation/implicit_new_or_const_test now passes)
Change-Id: Ic079d4012cee62fe4c42321dbe2c5a795e90b890
Reviewed-on: https://dart-review.googlesource.com/48921
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-03-30 22:38:43 +00:00
Jenny Messerly cdc696f9a7 fix status of VM precomp tests to match its callable function support
(The status entries match the standard Dart 2 VM behavior.)

Change-Id: I6c939ca04c892959479b00621ad8dc27767a5f0a
Reviewed-on: https://dart-review.googlesource.com/48890
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-03-30 20:11:10 +00:00
Dmitry Stefantsov 59d859645e [fasta] Do new/const insertion in simple cases
Bug: http://dartbug.com/32553
Change-Id: I58e201ffd5019a5a65c0ac188aaab363225b5296
Reviewed-on: https://dart-review.googlesource.com/48481
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-30 18:35:05 +00:00
Jenny Messerly bed5debbeb Callable object support in Analyzer and DDC.
Fixes #32156
Fixes #32157
Fixes #32426

This also fixes `implements Function` so it has no effect in Dart 2
(it is ignored for the purposes of subtyping.)

Change-Id: Ibec9c77cd516b8b97fef68a579998598d0acf8c6
Reviewed-on: https://dart-review.googlesource.com/45141
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-03-30 18:14:55 +00:00
Jenny Messerly d46dd1bd68 fix error message for dcalls on null
Change-Id: I0f3ab303ce8844c9b147a21f3233ef04ec0acb66
Reviewed-on: https://dart-review.googlesource.com/45920
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-03-30 00:34:29 +00:00
Sigmund Cherem 8d689fcca7 step 4 of ??: add omit-implicit-checks and preview-dart-2 flags, strong-mode
defaults to include implicit checks.

Closes https://github.com/dart-lang/sdk/issues/32332

Change-Id: Iad5311234dec50a3f8dbd6557264b3feeb92afc8
Reviewed-on: https://dart-review.googlesource.com/48459
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-03-29 22:13:09 +00:00
Paul Berry 506ac7f953 Rework linker type inference using ExprBuilder.
This CL changes the way linker type inference works.  Instead of
walking the operations in an UnlinkedExpr in order and inferring types
directly, it first builds an AST for the expression using ExprBuilder,
then uses ResolverVisitor to resolve the AST and perform type
inference.

This helps ensure that summary type inference and ordinary AST-based
type inference produce the same result, since they now use the same
core algorithm.  In particular, this means that summary type inference
now does downwards inference properly.

Since the ResolverVisitor makes greater use of the element model than
the rest of the linker, this required implementing additional methods
in the linker's element model.

This CL includes some minor fixes to ExprBuilder that were uncovered
during testing.  It also contains some minor changes to
ResolverVisitor to make it work during linking.

Fixes #32525.
Fixes #32394.

Change-Id: I5ec9b2bf5565ad30b8cc856475334323dc118da8
Reviewed-on: https://dart-review.googlesource.com/48741
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-29 17:16:39 +00:00
Régis Crelier 7d90df42f1 [Kernel, VM runtime] Hook up bool checks in strong mode (fixes #32336).
Update kernel status file.

Change-Id: I08b153d431c15870e0251e7dd760213c795579c9
Reviewed-on: https://dart-review.googlesource.com/48707
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-03-29 16:10:52 +00:00
Ben Konyi 42581e4fa6 [VM] Added '--enable-asserts' to the top-level help message.
Change-Id: I91b22cc1563b7c5217f21032109d948a5bb78b57
Reviewed-on: https://dart-review.googlesource.com/48456
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-03-28 18:54:00 +00:00
Régis Crelier 85b4c604c5 [VM runtime] Improve type error messages in Dart 2 (fixes #32564).
Hide private class _Future and map it to core lib class Future.
In Dart 2, show dynamic as type argument(s) of raw generic types.

Change-Id: I70b0e1707bc767d04838ac12d16b3ad15623f51f
Reviewed-on: https://dart-review.googlesource.com/48502
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-03-28 17:12:04 +00:00
Alexander Markov c60199cf86 [vm/kernel/aot] Tree shaking based on results of TFA, take 2.
This is a re-landing of

https://github.com/dart-lang/sdk/commit/06ebf884db61b97a60b1578560678329cd51bf61

after the fix was submitted separately at

https://github.com/dart-lang/sdk/commit/e3b9c2860e46f9d673ffc3129ede2a11c6125d06

Original review: https://dart-review.googlesource.com/c/sdk/+/46942

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I2d3a10acb9b5af0184b3d1504acb2f4ebebfff8a
Reviewed-on: https://dart-review.googlesource.com/48440
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-03-27 23:39:24 +00:00
Samir Jindel eeba621943 [kernel/vm] Build NSM forwarders for getters and setters.
They are necessary for performing type-checks.

Change-Id: Ie30f0617488730d920c00229fb2ec358cc8d6c4b
Reviewed-on: https://dart-review.googlesource.com/48421
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-03-27 14:40:04 +00:00
Jenny Messerly 192b4621ba Fix DDC shadowing bug with named arguments and async functions.
Change-Id: I4c01ab03bc02d0e533b6d27d43e824aad5d32fea
Reviewed-on: https://dart-review.googlesource.com/48458
Reviewed-by: Vijay Menon <vsm@google.com>
2018-03-27 00:34:46 +00:00
Jenny Messerly a914cac65e fix #32481, DDK signatures for mock members induced by nSM
This bug prevented various DDK features from working correctly at
runtime, such as tearoffs, dynamic call checking, generic methods, and
parameter type checks.

This was fixed for DDC in https://dart.googlesource.com/sdk/+/40738b8884e584f8b6fce26b71e9692c0067db18

Change-Id: I91fd12b3c167341c692d8d3e7ad2217dd78d2950
Reviewed-on: https://dart-review.googlesource.com/45964
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-03-27 00:25:32 +00:00