Commit Graph

4835 Commits

Author SHA1 Message Date
Johnni Winther 66398a511a Store CallStructure in StaticUse
- in preparation for tracking unused optional arguments of static methods

Change-Id: I8a9b1d0d9acd57256d383f880b9c602d91804486
Reviewed-on: https://dart-review.googlesource.com/29801
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-19 10:21:08 +00:00
Emily Fortuna 4cd0593574 Tiny fix to fix type errors in our compiler while running host-checked
and deferred loaded code.

Bug:
Change-Id: I57b51a287fd7ffad59a1a59eae34e739b5e5603b
Reviewed-on: https://dart-review.googlesource.com/29745
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-12-15 18:42:33 +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 5f06d51d1a Enable inlining by default
Change-Id: I4810959da23193d8a1b572b4feea329a2f4b2f31
Reviewed-on: https://dart-review.googlesource.com/29320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 10:02:54 +00:00
Johnni Winther b759f8fb15 Use sorted named parameters on inlining.
Change-Id: I066383b86b55e1d76633c281f30ebbc3fa5d46e3
Reviewed-on: https://dart-review.googlesource.com/29280
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 09:21:44 +00:00
Johnni Winther 5c0f33934b Register inlined constructor types
Change-Id: I097394c868a0fabe0e83814a65ec7884b64741af
Reviewed-on: https://dart-review.googlesource.com/29121
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 09:07:03 +00:00
Johnni Winther 0edef589d4 Ensure type variables for inlined constructors and mixin fields
Change-Id: I348acffb7842ff1c9f28ebf73c507e282c6a045e
Reviewed-on: https://dart-review.googlesource.com/29080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 08:53:21 +00:00
Sigmund Cherem 08bd966708 Count return/throw and their children in inlining heuristic.
I discovered this because a deferred method was being inlined accidentally: we
thought it was empty and inlined it when we shouldn't have.

Change-Id: I9795b62f4ffb81222100afedd3b42cb8828900bd
Reviewed-on: https://dart-review.googlesource.com/27925
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-13 23:26:54 +00:00
Dan Rubel 3ab29148f4 Add fasta parser cascade recovery
Change-Id: I1cf32604acf2124a9d61621fbb4cfb9343d98d33
Reviewed-on: https://dart-review.googlesource.com/28840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-13 18:30:25 +00:00
Erik Ernst f95a3cc1e6 dart2js no longer warns that function type variables are not reified
Change-Id: I69746c92912fcbbc35e1f6c37e310352f92708f6
Reviewed-on: https://dart-review.googlesource.com/28641
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-12-13 14:01:16 +00:00
Johnni Winther 5599c80edd Don't create HParameterValue nodes for type arguments when inlining
Change-Id: If44fc4cbb39336f7ac01b906702f5aaa2ed1cd90
Reviewed-on: https://dart-review.googlesource.com/28721
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 10:10:23 +00:00
Johnni Winther a1f5474f80 Allow inlining of platform library functions
Change-Id: I2803d66f54d2e1052ca8af5fb719bded8f400171
Reviewed-on: https://dart-review.googlesource.com/28563
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 09:35:59 +00:00
Johnni Winther 9df549a2d0 Avoid inlining of external functions
Change-Id: I43aed9e484c55d40a9fa7d5db029e0d11a698b3e
Reviewed-on: https://dart-review.googlesource.com/28562
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 09:28:09 +00:00
Harry Terkelsen 1e0a657961 dart2js kernel: Add types seen in the superclass chain to the hierarchy
Change-Id: I5c0f6b76042e7a3cf8f54326963d56eb6a78f568
Reviewed-on: https://dart-review.googlesource.com/27020
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-13 00:19:03 +00:00
Bob Nystrom 650c9dcc8e Support extractTypeArguments() in 1.0 mode on the VM and dart2js.
Without strong mode, a "good enough" implementation is to simply call
the generic method with "dynamic" for the type arguments, which is what
this does. That should be enough to unblock our internal users.

We also need to not report a compile error when
dart_internal/extract_type_arguments.dart imports the hidden
"dart:_internal" library.

This patch does both of those for the VM and dart2js (using its old
front end).

Note that the test still fails because the test is more particular than
most actual user code would be -- it validates that the instantiated
type arguments are *exactly* correct, and not that the returned object
is merely subtype compatible.

Bug:
Change-Id: I0343beace4991861b29712b3fd7067ec8dc8f8ba
Reviewed-on: https://dart-review.googlesource.com/28020
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-12 19:04:18 +00:00
Johnni Winther 59106e8f55 Fix crashes caused by inlining
Change-Id: I7fef190a4b5248f1508f0122c5dcb5ee7fdc4c40
Reviewed-on: https://dart-review.googlesource.com/27940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-12 08:07:29 +00:00
Emily Fortuna 1dab6ab88c Add List/Map factory type checks.
Bug:
Change-Id: I27b4cd1e4b528606e2ea2028eab3cdea1d47abc4
Reviewed-on: https://dart-review.googlesource.com/27882
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-08 23:11:20 +00:00
Sigmund Cherem 5fde58ceb0 Map closure entities so they get emitted in the correct output unit
Change-Id: I7edcf1715adcff3caba5bbe7ebfc18ecaeca6801
Reviewed-on: https://dart-review.googlesource.com/27920
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-12-08 22:40:40 +00:00
Stephen Adams d7516551ca measure computeWorldImpact in Kernel pipeline
Change-Id: I23d80a1272413350f3bf846d6e55e4bc533ddc59
Reviewed-on: https://dart-review.googlesource.com/25724
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-08 21:01:51 +00:00
Johnni Winther 2fe5db885d Fix inlining 'too difficult' test
- include reason for 'too difficult' in the expectations
- fix inlining of dynamic call with optional argument

Change-Id: I02e4885ff3eb4a991501bb3f5d8432d35165491e
Reviewed-on: https://dart-review.googlesource.com/27220
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-08 16:05:42 +00:00
Johnni Winther 12a94d7035 Initial kernel based inlining heuristics
- currently for number of calls outside loops.

Change-Id: Iedafe54ab70f65969bf89db3bfd98d45be493893
Reviewed-on: https://dart-review.googlesource.com/26300
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-08 15:55:10 +00:00
Johnni Winther dbc907a6a0 Include inlined instance type for constructors and factories
Change-Id: Ia9be24f02f07e0d3329125b2ffed28e16bf34be3
Reviewed-on: https://dart-review.googlesource.com/26280
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-08 15:17:00 +00:00
Emily Fortuna 8ba52663d6 Update status script with the new canonical way of specifying test statuses.
Bug:
Change-Id: Id8ccd310a7f81a021788059ebea8590c3d20c203
Reviewed-on: https://dart-review.googlesource.com/27402
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-07 20:37:07 +00:00
Johnni Winther b6f1bd02e8 Inline constructor bodies.
Change-Id: Iaf7d206ff92aa07ddfd3934340888dcd617fc47c
Reviewed-on: https://dart-review.googlesource.com/25900
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-07 09:13:23 +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
Sigmund Cherem 1ad04b5935 Ignore metadata in the deferred-loading kernel implementation.
Since the kernel implementation doesn't support dart:mirrors, we don't need to
track these symbols. We should consider doing the same in the old
pipeline as well.

This address a deeper bug where we were adding to the K-element-map more
entities after we had closed the world and we had created the J-element-map.

The added regression test was failing because we tried to convert the K
annotation to its J conterpart, but we couldn't find it in the conversion maps
because it was added too late. If we add support for mirrors in the future, we
just need to ensure that such K elements are discovered before the deferred
loading phase.

Change-Id: I029062067cb21bdc06c30d09c77031775f381c20
Reviewed-on: https://dart-review.googlesource.com/26520
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Harry Terkelsen <het@google.com>
2017-12-06 22:19:31 +00:00
Emily Fortuna fe178582ef Add constraint checks for constructors (factory and generative).
Bug:
Change-Id: I68a3420276cd49c33ca4697262117aa8d4a3ff0f
Reviewed-on: https://dart-review.googlesource.com/26740
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-06 21:51:30 +00:00
Stephen Adams cbe72e4ff0 Refine choice of when to allow a phi for array.length
A few more simple for-in loops on arrays can eliminate the concurrent
modification error check.

Change-Id: I66bb7c324627233aafc5bbc62ffc77c7f6234c79
Reviewed-on: https://dart-review.googlesource.com/24380
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-06 19:45:25 +00:00
Stephen Adams 5971a27674 Cache additionalExports as Set
Cache additionalExports as a Set to speed up kernel version of deferred loading

Bug: https://github.com/dart-lang/sdk/issues/31520
Change-Id: I0c67c2c0255bbbd3a4c844bae3a3b8ecf2233e13
Reviewed-on: https://dart-review.googlesource.com/25740
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-06 19:24:26 +00:00
Harry Terkelsen 9f973c6599 Disable importing dart:mirrors in kernel mode
Change-Id: I9a4b7d32a67cc109b9a9d3a33b5996176988a97c
Reviewed-on: https://dart-review.googlesource.com/26404
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-12-06 18:44:15 +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
Johnni Winther c1f148ec42 Handle inlining of dynamic invocations.
Change-Id: I1982938b1af5b234f1eade14077778f87c455cac
Reviewed-on: https://dart-review.googlesource.com/25840
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-06 08:34:34 +00:00
Jens Johansen 078f25acf9 [CFE/dart2js] Create dart2js-specific CFE entry point
This CL creates the initial dart2js-specific CFE entry point.
It is currently mostly a matter of copying the dart2js code for running the
front-end into the front-end, although it also applies a workaround for
making batch-mode faster.

Running the same dart2js with kernel tests as on the bots locally I get
this:

* Before: [09:11 | 100% | +10507 | -    0]
* Now [04:46 | 100% | +10507 | -    0]

Change-Id: I68f147fd7aadb0281807b4688b9f6fdc5aa24c28
Reviewed-on: https://dart-review.googlesource.com/25300
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-06 08:24:28 +00:00
Emily Fortuna 5c932019ff Reapply "Fix order of runtime type checks of optional function parameters." It wasn't working with inlining previously.
This reverts commit 301c501924.

Bug:
Change-Id: I26059705b8410ad4e8b5b580ff85dd324727f755
Reviewed-on: https://dart-review.googlesource.com/26460
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-12-05 23:44:36 +00:00
Emily Fortuna 301c501924 Revert "Fix order of runtime type checks of optional function parameters."
This reverts commit 964332fc79.

Bug:
Change-Id: Ib2715d82a296f030fb32855c29c77997692e79ef
Reviewed-on: https://dart-review.googlesource.com/26441
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-12-05 21:43:18 +00:00
Emily Fortuna 964332fc79 Fix order of runtime type checks of optional function parameters.
Bug:
Change-Id: Ic5b69030c9854502b70f1fa2030f974e99f10ad3
Reviewed-on: https://dart-review.googlesource.com/26400
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-05 20:11:24 +00:00
Johnni Winther dbadf204aa Add source information to break, continue, == and constructor body calls
Change-Id: I3ca3dc1e1ed55b636808685bff5d017d422678e7
Reviewed-on: https://dart-review.googlesource.com/24923
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-05 11:40:41 +00:00
Emily Fortuna 31cb880614 Add parameter type checks in constructor body methods.
Bug:
Change-Id: Ic62886aa9db8dbe1f16f85ea528faffdeb299dac
Reviewed-on: https://dart-review.googlesource.com/26044
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-12-05 00:28:04 +00:00
Paul Berry b53e4e4302 Fix update_from_log.dart when the next section is preceded by a commented-out line.
Change-Id: I9b88279e73de783323bba6617ad00dbc24e81d45
Reviewed-on: https://dart-review.googlesource.com/26042
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-04 20:59:34 +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
Dan Rubel 2a883a9c33 More fasta parser expression recovery
Change-Id: Ie3a71d4febcb9e0c277ddd6038eb1cc40c6fdf26
Reviewed-on: https://dart-review.googlesource.com/24240
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-04 16:22:04 +00:00
Peter von der Ahé e14726a3f4 Use absolute URIs instead of relative paths
We change the type of FileUriNode.fileUri from String to Uri, which in principle
doesn't change the binary format. However, we did notice that LibraryParts
weren't serialized as specified in binary.md, so we also fixed that.

Since fileUris are stored as strings in a separate table, Uri.parse is only called
once per unique URI.

Fasta only uses relativizeUri when printing diagnostics, and URIs stored in
expectation files (golden files) are relativized using String.replaceAll.

Change-Id: Ib2dc1b80c03a0cdaf84e48b8b3ba73b16bdf8a40
Reviewed-on: https://dart-review.googlesource.com/25421
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-04 11:34:24 +00:00
Samir Jindel bf797e6507 [kernel] Re-land assert initializers.
This change updates Dart2js and DDC.
Thanks to johnniwinther@ for the Dart2js updates.

The original revision is in patchset 2.

Change-Id: I26db33312f003f88ccccb67b27998ef21a1f667f
Reviewed-on: https://dart-review.googlesource.com/25820
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2017-12-04 11:22:34 +00:00
Peter von der Ahé d4cfecb106 Revert "Apply resolution to AdjacentStrings."
This reverts commit 1699831282.

Reason for revert: I didn't say LGTM to this, and I'm not convinced this change is necessary.

Original change's description:
> Apply resolution to AdjacentStrings.
> 
> R=​brianwilkerson@google.com, paulberry@google.com
> 
> Bug:
> Change-Id: Iae09b39be41f1ddcd05a5a5ded554a1b7f9c09f3
> Reviewed-on: https://dart-review.googlesource.com/25800
> Reviewed-by: Paul Berry <paulberry@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

Change-Id: I11a947708e8e2de6a4591396fb2a32cb8833dc6d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/25541
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-12-04 09:09:36 +00:00
Konstantin Shcheglov 1699831282 Apply resolution to AdjacentStrings.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Iae09b39be41f1ddcd05a5a5ded554a1b7f9c09f3
Reviewed-on: https://dart-review.googlesource.com/25800
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-04 05:30:03 +00:00
Stephen Adams df1490ba39 measure ssa builder from kernel
TBR=sigmund@google.com

Change-Id: I60aa2c52dde5c77f3205f500d29e465aaf3abc60
Reviewed-on: https://dart-review.googlesource.com/25721
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2017-12-02 01:42:22 +00:00
Stephen Adams 8d4667fa05 Generate sourcemap info for 'as'.
Bug: https://github.com/dart-lang/sdk/issues/31499
Change-Id: Ib311c2c4ed59fe6515a23175f43d7772b7efd0e6
Reviewed-on: https://dart-review.googlesource.com/25200
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-01 19:18:07 +00:00
Johnni Winther 8df5357378 Implement too difficult computation for kernel.
Change-Id: Ib167b356fcf7e869ecb91b3e268021e2747760c4
Reviewed-on: https://dart-review.googlesource.com/24901
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-01 16:13:26 +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
Jens Johansen 22d0696d91 [CFE] Move front-end API under src/
This CL deprecates the front-end API and moves it into src/api_prototype.

For now all usages have been updated to point to the new location,
but they should be updated to use custom-client invocations instead (e.g.
one specific way for DDC, another for dart2js etc.)

Bug:
Change-Id: I9b4f41f6ebf55d42510fd35240d942d1dc7292d6
Reviewed-on: https://dart-review.googlesource.com/24822
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-01 08:42:16 +00:00