Commit Graph

4698 Commits

Author SHA1 Message Date
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
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
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
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
Johnni Winther 9ddb267c41 Use [StackFrame] class to hold data local to the current member in KernelSsaGraphBuilder
Change-Id: I6f80ef33f7da3a3b332dea6a44bd435d16bbd06b
Reviewed-on: https://dart-review.googlesource.com/24461
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-30 09:32:11 +00:00
Johnni Winther c5034c6532 Remove enterInlinedMember and leaveInlinedMember from KernelToLocalsMap
Change-Id: I9a33e7ba4b499785c50916c09496a35eaf99c301
Reviewed-on: https://dart-review.googlesource.com/24422
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-30 08:46:11 +00:00
Johnni Winther 5a238b215a More source information
+ on super calls
+ null tests
+ logical and

Change-Id: I136500544d14afa5cbaf431ec12dfb1516c38d29
Reviewed-on: https://dart-review.googlesource.com/24480
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-30 08:45:39 +00:00
Stephen Adams e81ff9cb60 Avoid using Set as worklist
It can be slow: https://github.com/dart-lang/sdk/issues/31470

Bug:
Change-Id: Id8dd5b0d158d04ad6387f868a774d047d2b99760
Reviewed-on: https://dart-review.googlesource.com/24504
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-29 23:58:10 +00:00
Johnni Winther 87b2e063cf Make source information a required argument on several H-nodes
Change-Id: I35218dc46602c28a2d8c38b3bb36bddaa896475b
Reviewed-on: https://dart-review.googlesource.com/23780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 11:43:49 +00:00
Johnni Winther 93d03da1db Add source information to yield* and async*
Change-Id: I4e3f09f60527c0ea501b266abca6b70dc01d1a64
Reviewed-on: https://dart-review.googlesource.com/23668
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 10:16:54 +00:00
Johnni Winther 9bfef29e21 Add source information to throw/try/await in async and yield in sync*
Change-Id: I8559aaf40c3cb12892113b7373608dc0eed3cb45
Reviewed-on: https://dart-review.googlesource.com/23680
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 09:56:09 +00:00
Johnni Winther 03aab05eea Add source information on try, is and as
Change-Id: I83eaad5913eead816d28286d31e370cafeb7f52b
Reviewed-on: https://dart-review.googlesource.com/23520
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 09:43:20 +00:00
Johnni Winther bc32fb7e42 Add sourcemapping to (simple) async methods.
Change-Id: Ia1dbf85d75b2dd2c3c0308aa8ff4c65605c62481
Reviewed-on: https://dart-review.googlesource.com/23380
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 09:22:10 +00:00
Johnni Winther 758306af54 Provide source info on switch, boxing and capture
Change-Id: I6d8deaa5d523a1f9346c773295f3d1152636f01a
Reviewed-on: https://dart-review.googlesource.com/23665
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 09:06:41 +00:00
Emily Fortuna 6557792b5b Add information about what types are instantiated when dealing with
factories and reified generics.

Bug:
Change-Id: Ia34b08859f1e54e7dc8fc3f8d51a1e78a1fa0e41
Reviewed-on: https://dart-review.googlesource.com/24022
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-11-28 01:00:53 +00:00
Stephen Adams 321dbe92b4 Make use of type parameter on JS pseudofunction
Change-Id: I52d0190cd1aad42a3b35d7327a65fd680524c698
Reviewed-on: https://dart-review.googlesource.com/23724
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-28 00:57:33 +00:00
Johnni Winther 69106c6c8c Support simple static inlining from kernel.
Change-Id: Ie9a062b2d825c9fb0ed7bd5933eb7cf841509409
Reviewed-on: https://dart-review.googlesource.com/23660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-27 10:19:41 +00:00
Johnni Winther da9d21c49e Add inlining test
Change-Id: I17663d41d0f4e2b6f3bb7f44bed694cfff7fac38
Reviewed-on: https://dart-review.googlesource.com/23481
Reviewed-by: Stephen Adams <sra@google.com>
2017-11-27 09:22:57 +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
Emily Fortuna d3eef66367 Add function parameter type checks in checked mode with constructors and loop variables.
Bug:
Change-Id: Ib3245eb59c9f23b31e4a0b1c65a25f1c2ad3188f
Reviewed-on: https://dart-review.googlesource.com/23143
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-11-22 19:57:04 +00:00
Stephen Adams 3f9f7bb61d load elimination: do not create phis for for-in length check
Refinement of previous CL avoids the handful of regressions generated
by the previous CL.

R=johnniwinther@google.com

Change-Id: Ifea90d48a339aa94dee0f73485f8ec24f10d9e53
Reviewed-on: https://dart-review.googlesource.com/22320
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-22 00:34:17 +00:00
Johnni Winther 3ee0a42842 Update source_mapping_test* to take arbitrary file input
+ add the missing source information to HStringify found by through testing swarm with it.

Change-Id: Iaba9d8cc5c1ff2bee6a94988eb1916ac4abc66a2
Reviewed-on: https://dart-review.googlesource.com/22140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 10:38:03 +00:00
Johnni Winther 9578eac4e2 Add source information to loops.
Change-Id: I0d0ce8f39cba888741d8adffd7d07826dc82f93e
Reviewed-on: https://dart-review.googlesource.com/22120
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-11-21 10:23:17 +00:00
Peter von der Ahé a689397a36 Revert "Implement support for generic comment syntax in Fasta."
This reverts commit f1959d6cd4.

Reason for revert: insufficient approval.

Original change's description:
> Implement support for generic comment syntax in Fasta.
> 
> Change-Id: I4c15a4adf2dbb50efd799b801dcb75a538bbe7d6
> Reviewed-on: https://dart-review.googlesource.com/21223
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Dan Rubel <danrubel@google.com>

TBR=paulberry@google.com,danrubel@google.com,sigmund@google.com

Change-Id: I047e4e87913002c6bd77e455599189349c123146
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/22460
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-11-21 10:08:39 +00:00