Commit Graph

1162 Commits

Author SHA1 Message Date
Florian Loitsch 3b8e4d41a7 Reapply "Run async functions immediately."
Which was reverted in commit 032be73dbe.
Originally commited in commit 67bac0bce6.
Original review URL: https://dart-review.googlesource.com/5263

Change-Id: Ic7333c29e502a3924dc6aade8ffa46fc8aa5b04a
Reviewed-on: https://dart-review.googlesource.com/38120
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-02-02 15:50:16 +00:00
Vyacheslav Egorov d117760ba6 [vm/kernel/aot] Skip unnecessary type checks on parameters of instance methods.
This relands 75a9579ea0.

The approach works as follows:

Step 1: Kernel transform. Under the closed world assumption compute the
set of selectors dispatched dynamically, then mark all procedures that don't
match any of those selectors as 'not-dispatched-dynamically'.

Step 2: VM backend. When building IR for a function if this function was
marked as not-dispatched-dynamically then omit type checks for any parameter
that is not marked as generic-covariant-impl, as such arguments are guaranteed
to be checked on the caller side (by front-end).


+------------------------+------------+----------+-----------+--------------+
|       benchmark        |  baseline  |  current |  with opt |  improved by |
+------------------------+------------+----------+-----------+--------------+
| stock_layout_iteration |  2366.3786 |   2724.3 |   2562.75 |  -5.93%      |
| stock_build_iteration  |     3824.3 |   4914.8 |      4681 |  -4.76%      |
+------------------------+------------+----------+-----------+--------------+

* Flutter gallery Instructions size is reduced by 11% (8748720 bytes to 7846368 bytes).
Baseline is at 6196496 bytes.


Alternatively to annotating individual procedures, I considered annotating Program node
with a set of dynamically dispatched selectors. Decoding and passing this information
around proved to be quite cumbersome in the "streaming" world, so I opted for a simpler
approach where all individual procedures are annotated.

Bug: https://github.com/dart-lang/sdk/issues/3179
Change-Id: I2f32a609e3872c74d5ae7bbd97555453aaedf15f
Reviewed-on: https://dart-review.googlesource.com/38125
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-02-02 11:43:55 +00:00
Vyacheslav Egorov 7078f6be58 Revert "[vm/kernel/aot] Skip unnecessary type checks on parameters of instance methods."
This reverts commit 75a9579ea0.

Reason for revert: function_subtype_bound_closure7_test fails in darkp

Original change's description:
> [vm/kernel/aot] Skip unnecessary type checks on parameters of instance methods.
> 
> The approach works as follows:
> 
> Step 1: Kernel transform. Under the closed world assumption compute the
> set of selectors dispatched dynamically, then mark all procedures that don't
> match any of those selectors as 'not-dispatched-dynamically'.
> 
> Step 2: VM backend. When building IR for a function if this function was
> marked as not-dispatched-dynamically then omit type checks for any parameter
> that is not marked as generic-covariant-impl, as such arguments are guaranteed
> to be checked on the caller side (by front-end).
> 
> # Performance Impact
> 
> +------------------------+------------+----------+-----------+--------------+
> |       benchmark        |  baseline  |  current |  with opt |  improved by |
> +------------------------+------------+----------+-----------+--------------+
> | stock_layout_iteration |  2366.3786 |   2724.3 |   2562.75 |  -5.93%      |
> | stock_build_iteration  |     3824.3 |   4914.8 |      4681 |  -4.76%      |
> +------------------------+------------+----------+-----------+--------------+
> 
> * Flutter gallery Instructions size is reduced by 11% (8748720 bytes to 7846368 bytes).
> Baseline is at 6196496 bytes.
> 
> # Alternative Implementations
> 
> Alternatively to annotating individual procedures, I considered annotating Program node
> with a set of dynamically dispatched selectors. Decoding and passing this information
> around proved to be quite cumbersome in the "streaming" world, so I opted for a simpler
> approach where all individual procedures are annotated.
> 
> Change-Id: I363db6d5dd1138fe25917646313c16d0b213c3b4
> Reviewed-on: https://dart-review.googlesource.com/37822
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,sjindel@google.com

Change-Id: I0fd6bf3e6edfc3e605da2b996f9a0da6c409d01c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/37802
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-01 20:41:19 +00:00
Vyacheslav Egorov 75a9579ea0 [vm/kernel/aot] Skip unnecessary type checks on parameters of instance methods.
The approach works as follows:

Step 1: Kernel transform. Under the closed world assumption compute the
set of selectors dispatched dynamically, then mark all procedures that don't
match any of those selectors as 'not-dispatched-dynamically'.

Step 2: VM backend. When building IR for a function if this function was
marked as not-dispatched-dynamically then omit type checks for any parameter
that is not marked as generic-covariant-impl, as such arguments are guaranteed
to be checked on the caller side (by front-end).

# Performance Impact

+------------------------+------------+----------+-----------+--------------+
|       benchmark        |  baseline  |  current |  with opt |  improved by |
+------------------------+------------+----------+-----------+--------------+
| stock_layout_iteration |  2366.3786 |   2724.3 |   2562.75 |  -5.93%      |
| stock_build_iteration  |     3824.3 |   4914.8 |      4681 |  -4.76%      |
+------------------------+------------+----------+-----------+--------------+

* Flutter gallery Instructions size is reduced by 11% (8748720 bytes to 7846368 bytes).
Baseline is at 6196496 bytes.

# Alternative Implementations

Alternatively to annotating individual procedures, I considered annotating Program node
with a set of dynamically dispatched selectors. Decoding and passing this information
around proved to be quite cumbersome in the "streaming" world, so I opted for a simpler
approach where all individual procedures are annotated.

Change-Id: I363db6d5dd1138fe25917646313c16d0b213c3b4
Reviewed-on: https://dart-review.googlesource.com/37822
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-02-01 18:07:38 +00:00
Siva Chandra 71dba8a0e5 Link the platform kernel with the command line dart executable.
Change-Id: Ib376a259e2e9ff9b487820c041d6795f8f7192d1
Reviewed-on: https://dart-review.googlesource.com/37420
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
2018-02-01 15:11:29 +00:00
Florian Loitsch 032be73dbe Revert "Run async functions immediately."
This reverts commit 67bac0bce6.

Reason for revert: broke the bot.

Original change's description:
> Run async functions immediately.
> 
> Migrated from https://codereview.chromium.org/2478703003/
> 
> Change-Id: I1d678c01ba5876490b12c676c500171328361d31
> Reviewed-on: https://dart-review.googlesource.com/5263
> Commit-Queue: Florian Loitsch <floitsch@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vijay Menon <vsm@google.com>
> Reviewed-by: William Hesse <whesse@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=whesse@google.com,rnystrom@google.com,vegorov@google.com,kustermann@google.com,zra@google.com,floitsch@google.com,jmesserly@google.com,vsm@google.com,regis@google.com,sigmund@google.com

Change-Id: I20c948057423c3fa5aa8c72843f8f2a17e086ad5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/37981
Reviewed-by: Florian Loitsch <floitsch@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-02-01 15:01:21 +00:00
Florian Loitsch 67bac0bce6 Run async functions immediately.
Migrated from https://codereview.chromium.org/2478703003/

Change-Id: I1d678c01ba5876490b12c676c500171328361d31
Reviewed-on: https://dart-review.googlesource.com/5263
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-02-01 14:08:57 +00:00
Alexander Aprelev 4e677e9606 Revert "Introduce incremental compiler that can support accept/reject vm flow."
This reverts commit 2912e95451 as it introduced a flaky test.

Change-Id: I09c5d64eb2fe75ed67b6af5aa60b91de88f4bbda
Reviewed-on: https://dart-review.googlesource.com/37865
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-01-31 19:17:39 +00:00
Alexander Markov d69ac00676 [vm/kernel/tfa] Remove unused static type approximations
This CL removes .staticType from all Types and most Statements as they
are not currently used.

Change-Id: Ia29bac49327356b26395c4851d84941daf61614d
Reviewed-on: https://dart-review.googlesource.com/37124
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-01-31 19:15:15 +00:00
Alexander Markov 2b8e149999 [vm/kernel/tfa] Improve efficiency of type flow analysis
* _ReceiverTypeBuilder class is introduced to create receiver type more
  efficiently (without using union operations and creating intermediate
  types).

* Certain tracing prints are hidden behind kPrintTrace flag to avoid
  expensive string interpolations.

* Also, added debugging flag for dumping class hierarchy.

This CL reduces analysis time of Flutter gallery by ~2x.

Change-Id: Ia918b88a4d902895e77aac306dc6a5cf9cecad14
Reviewed-on: https://dart-review.googlesource.com/37644
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-01-31 17:43:25 +00:00
Alexander Aprelev 2912e95451 Introduce incremental compiler that can support accept/reject vm flow.
This is to be used in Flutter tools: https://github.com/flutter/engine/pull/4601

Bug: https://github.com/dart-lang/sdk/issues/31919
Change-Id: Ib94562e797b3455c047ce5a9dae959375f957e5f
Reviewed-on: https://dart-review.googlesource.com/37360
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-01-31 17:06:06 +00:00
Alexander Aprelev 0a79c54cee Remove trailing space only if string is not empty
Bug: dartbug.com/32003
Change-Id: Ia4160e438ac7f98ae607098761618623f6fd0501
Reviewed-on: https://dart-review.googlesource.com/37841
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-01-31 16:06:06 +00:00
Alexander Markov 30a12f927b [vm/kernel/tfa] Fix invalidation of invocations during processing
This CL fixes the case when an invocation is invalidated in the
middle of processing. In such case, its result should not be retained
and it should be re-processed again.

Also:

* _WorkList.pending Set is replaced with LinkedList (reduces analysis time).

* ClassHierarchy is configured to ignore ambiguous supertypes.

* _AssertionError._throwNew entry point is added (as it is implicitly
  inserted by flow graph builder).

Change-Id: Ie2d5d29352a5463fbe602910f9ae7f6f77a917d7
Reviewed-on: https://dart-review.googlesource.com/37126
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-01-30 17:32:19 +00:00
Alexander Markov be767fc855 [vm/kernel] Support noSuchMethod in type flow analysis
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I65bc3af0745107a401d473f267789de4b27bf191
Reviewed-on: https://dart-review.googlesource.com/36361
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-01-29 17:47:03 +00:00
Ryan Macnak a369b88497 Teach package:kernel and patch_sdk.dart about dart_runner.
Change-Id: Ie39e278031b8d484086f3b4ad0c2eb323a152fc3
Reviewed-on: https://dart-review.googlesource.com/36489
Reviewed-by: Zach Anderson <zra@google.com>
2018-01-26 00:05:08 +00:00
Alexander Markov f9503cda50 [vm/kernel] Improvements and fixes in type flow analysis
* Invocation handlers and InvocationAnalyzer are revised to reduce
  complexity of the code, improve precision and efficiency of analysis.

* Invocation now has 2 subclasses: DirectInvocation and
  DispatchableInvocation; processing of invocations is moved to these
  subclasses and simplified.
  DirectInvocation is responsible for processing particular
  methods and fields, while DispatchableInvocation processes polymorphic
  calls by collecting targets and accurate receiver types for each target,
  and delegating to DirectInvocations for processing of each target.

* Dynamic tear-offs and dynamic calls via getter/field are
  supported.

* Invalidation of field initializers is implemented.

* Implicit 'return null' at the end of a function is correctly
  detected.

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I3d2ea69fbc95e3eb9aee244ee909016dfcf79bee
Reviewed-on: https://dart-review.googlesource.com/34507
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-19 17:39:35 +00:00
Jens Johansen 6fe7b74e47 [kernel] Mark synthetic constructors as such
Fixes #31143

Change-Id: I2c844e48c955234de1b03de08c12729f72db4f3a
Reviewed-on: https://dart-review.googlesource.com/35921
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-19 12:29:56 +00:00
Jens Johansen c1160d8cfa [kernel] Change ast to text output to use synthetic instead of default
Change-Id: Ied8777df13aa0411daf89f3ad3ec6bdda7bb4898
Reviewed-on: https://dart-review.googlesource.com/35862
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-19 09:58:46 +00:00
Alexander Markov bcdb32bc1a [vm/kernel] Unit tests for type flow analysis
Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: If6cf8c7dfb59703b00f5432ce803f81e1bf90232
Reviewed-on: https://dart-review.googlesource.com/34301
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-19 00:55:34 +00:00
Alexander Markov e3de763163 [vm/kernel] Use types inferred by type flow analysis for results of calls
* Type flow analysis writes inferred types (which include
  non-nullability and concrete classes) for the results of calls.

* VM uses new metadata to compute CompileTypes.

Issue: https://github.com/dart-lang/sdk/issues/30480

Change-Id: Ib0b7446af071f9cca5d8f1edd2d1d5f83b5714ba
Reviewed-on: https://dart-review.googlesource.com/33140
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-18 21:19:14 +00:00
Peter von der Ahé 4d1adf42d3 Deprecate IncrementalClassHierarchy
See https://github.com/dart-lang/sdk/issues/31842

Change-Id: I019909831a91a4e06138dc3a6bf32f766bca1ae6
Reviewed-on: https://dart-review.googlesource.com/34880
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-17 13:30:17 +00:00
Peter von der Ahé 2cc21f515e Remove original and minimal IKG
Change-Id: Id845a025ae9823fd3e53aaac7b5a95aa9e2ad767
Reviewed-on: https://dart-review.googlesource.com/34380
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-15 15:02:20 +00:00
Siva Chandra 4b73d12082 Link kernel service dill with the command line dart executable.
This linked in kernel service dill file will be used to load the kernel
isolate if the attempt to lookup the kernel service snapshot fails. The
kernel service snapshot is looked up in the following order.

1. If the "--dfe" option is specified, the file specified is used.
2. If the kernel service snapshot is found next to the executable,
then it is used.
3. If the kernel service snapshot is found in the "snapshots" directory
next to the executable, then it is used.

Change-Id: I5a0e757eb27b26a274b22b4bc36350fee59a100f
Reviewed-on: https://dart-review.googlesource.com/32446
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
2018-01-12 20:40:41 +00:00
Alexander Markov 8fc7050f4f [vm/kernel] Global type flow analysis
Global type flow analysis is a whole-program type inference on
strong-mode kernel AST which is aimed at inferring various properties
useful for optimizations, such as non-nullability, exact types and
monomorphic call targets.

Issue: https://github.com/dart-lang/sdk/issues/30480

Change-Id: Ie2e6e642dfacdb562a3341f8d2bbaf69ca829319
Reviewed-on: https://dart-review.googlesource.com/30903
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-11 21:33:08 +00:00
Aske Simon Christensen 9bdcc40f69 Rename PhysicalFileSystem to StandardFileSystem.
Preparation for data URI support. For clarity, this is just a rename.

Change-Id: Ibbd8da05d1a7106b5ec7c0ea9c1e13a95a89d1bd
Reviewed-on: https://dart-review.googlesource.com/33460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-11 11:23:25 +00:00
Alexander Aprelev c352b2203b Add dart2.bat to accommodate running dart2 tests on Windows
Bug: https://github.com/dart-lang/sdk/issues/31707#issuecomment-356708044
Change-Id: I7e7f7515fec393b1403cf5f8da2d740771ff10b7
Reviewed-on: https://dart-review.googlesource.com/34025
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-01-11 01:35:17 +00:00
Alexander Markov c67be1b896 [vm/kernel/aot] Devirtualize Object methods if receiver is non-nullable
Change-Id: Ib860d7218162fc384e6a4e3f100f4179cb20fde5
Reviewed-on: https://dart-review.googlesource.com/32668
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-10 22:40:29 +00:00
Aske Simon Christensen 0c03458717 Reland "Treat most warnings as errors in strong mode."
Reland of https://dart-review.googlesource.com/c/sdk/+/29160

Adds a 'severity' field to diagnostic messages and replaces all
addWarning and addNit functions by a generic addProblem, which uses
the intrinsic severity of the message. Eventually, errors should
also be reported this way.

A special severity value maps into either warning or error for Dart 1
and Dart 2, respectively. Most Dart 1 warnings are in this category.

Fixes some 320 failures of DDK test expecting a compile-time error.
These were previously masked by a workaround in the DDC error handler
which has now been removed.

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

Change-Id: Id3b3b7f1fc6a101639fc908c90f3ec7d304a7b4b
Reviewed-on: https://dart-review.googlesource.com/32580
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-08 09:20:02 +00:00
Alexander Markov c051a0b905 [VM, Tests] Turn Dart 2.0 fixed-size integers ON by default, v2
Dart 2.0 fixed-size integers are enabled in Dart VM in all modes.
Status of legacy tests is updated.

This CL includes ff9fc413a7 with fixes.

Change-Id: I632d8177e9d07cd82ecea75ab6c325681b3a25c9
Reviewed-on: https://dart-review.googlesource.com/32443
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-05 01:44:56 +00:00
Aske Simon Christensen 5402f02cbc Revert "Treat most warnings as errors in strong mode."
This reverts commit 3303df8102.

Reason for revert: Tests failing

TBR=ahe@google.com,askesc@google.com

Change-Id: Ifc8c9def6d134ab1b0c5f094a02a4f57a3581f19
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/32360
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-01-04 15:35:17 +00:00
Aske Simon Christensen 3303df8102 Treat most warnings as errors in strong mode.
Adds a 'severity' field to diagnostic messages and replaces all
addWarning and addNit functions by a generic addProblem, which uses
the intrinsic severity of the message. Eventually, errors should
also be reported this way.

A special severity value maps into either warning or error for Dart 1
and Dart 2, respectively. Most Dart 1 warnings are in this category.

Fixes some 320 failures of DDK test expecting a compile-time error.
These were previously masked by a workaround in the DDC error handler
which has now been removed.

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

Change-Id: I6acea31b8cba7dec8b318e081d28f4eb4ebbf75c
Reviewed-on: https://dart-review.googlesource.com/29160
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-04 14:56:46 +00:00
Kevin Millikin f2dc0fa4d2 Respect --suppress-fe-warnings in the front-end isolate
Closes issue #31552.

Bug: https://github.com/dart-lang/sdk/issues/31552
Change-Id: I6e6c8b1aadadf096966bff6def81127e4186f82a
Reviewed-on: https://dart-review.googlesource.com/32240
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-01-04 09:15:05 +00:00
Alexander Markov c812f6ab33 [vm, kernel] Tool for dumping kernel files with VM-specific metadata
Change-Id: I7f7b3cd797e30283821741583983dbe939e5132e
Reviewed-on: https://dart-review.googlesource.com/30960
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-01-03 17:40:04 +00:00
Ben Konyi c8ae685d0c Added flag --suppress_cfe_warnings to suppress warnings generated by the common front end. Fixes issue #31552.
Bug:
Change-Id: Ia025fa2feaec20cbada1596fb022b70e69501ede
Reviewed-on: https://dart-review.googlesource.com/30385
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-12-20 19:01:02 +00:00
Alexander Markov 12086506f8 [vm/kernel] Refactor devirtualization to allow other implementations
This is a pure refactoring which extracts the base class for
Devirtualization transformation. It is needed to add a new implementation
of devirtualization later, in addition to the current CHA-based
implementation.

Change-Id: Ifbc6160150a842f5322cf5aea13a7c2180507c96
Reviewed-on: https://dart-review.googlesource.com/30620
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-20 18:43:12 +00:00
Alexander Markov 4ace8d42c0 [vm/kernel] Run global transformations only if there are no errors
Change-Id: Ia3b059e75f36488f1ec4ee8ef49037d66f22612c
Reviewed-on: https://dart-review.googlesource.com/30469
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-12-20 18:36:52 +00:00
Alexander Markov b6276eb3d5 [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v3.
* Enable --limit-ints-to-64-bits for CFE when it is used to generate
  kernel for VM as CFE relies on int.parse being able to parse correct
  literals and reject incorrect.

* Pass --limit-ints-to-64-bits to gen_kernel via environment
  variable to support batch mode compilation.

Issue: https://github.com/dart-lang/sdk/issues/31339

Re-landing https://dart-review.googlesource.com/29941 with the fix:

* Use checked-in SDK to avoid timeouts on SIMARM bots.
  Checked-in SDK was updated and now includes necessary fixes.

Change-Id: I4a5a99455b60204572f3d619d7eb374035b03e40
Reviewed-on: https://dart-review.googlesource.com/30640
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-20 18:04:42 +00:00
Peter von der Ahé 51d4803855 Add onProblem to provide more flexible error handling
Change-Id: Iafd73e0a065a357170ec8836360644ecfef944b5
Reviewed-on: https://dart-review.googlesource.com/30443
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-19 12:06:44 +00:00
Vyacheslav Egorov 0dc324a68d Revert "[VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v2."
This reverts commit 2a3f00a179.

Reason for revert: SIMARM bots are timing out.

Original change's description:
> [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v2.
> 
> * Enable --limit-ints-to-64-bits for CFE when it is used to generate
>   kernel for VM as CFE relies on int.parse being able to parse correct
>   literals and reject incorrect.
> 
> * Pass --limit-ints-to-64-bits to gen_kernel via environment
>   variable to support batch mode compilation.
> 
> * Use current Dart SDK instead of checked-in Dart SDK to run CFE
>   in gen_kernel as checked-in Dart SDK is old and it doesn't have
>   int.parse fix yet.
> 
> Issue: https://github.com/dart-lang/sdk/issues/31339
> Change-Id: Iaba2a7945a3faa9427f9aab1e9f2b907fa2246a3
> Reviewed-on: https://dart-review.googlesource.com/29941
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=vegorov@google.com,kustermann@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com

Change-Id: Iecf26953bc6ae95c3bf0d1142bb89fb51cb0aaee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/31339
Reviewed-on: https://dart-review.googlesource.com/30440
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-12-19 08:52:25 +00:00
Alexander Markov 2a3f00a179 [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v2.
* Enable --limit-ints-to-64-bits for CFE when it is used to generate
  kernel for VM as CFE relies on int.parse being able to parse correct
  literals and reject incorrect.

* Pass --limit-ints-to-64-bits to gen_kernel via environment
  variable to support batch mode compilation.

* Use current Dart SDK instead of checked-in Dart SDK to run CFE
  in gen_kernel as checked-in Dart SDK is old and it doesn't have
  int.parse fix yet.

Issue: https://github.com/dart-lang/sdk/issues/31339
Change-Id: Iaba2a7945a3faa9427f9aab1e9f2b907fa2246a3
Reviewed-on: https://dart-review.googlesource.com/29941
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-18 21:43:06 +00:00
Vyacheslav Egorov 5ed9895488 [vm/kernel] gen_kernel should not report all errors twice
Bug:
Change-Id: Ib389e053571fa4fe235448fb33f15e5f3b659cdc
Reviewed-on: https://dart-review.googlesource.com/29594
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-18 16:49:31 +00:00
Alexander Markov ab8629af65 Revert "[VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler"
This reverts commit 752dd8921a.

Reason: buildbot failures. Batch compiler which is used on certain
buildbots doesn't have --limit-ints-to-64-bits enabled yet.

Issue: https://github.com/dart-lang/sdk/issues/31339
Change-Id: I75a3940f981f47cb83425b99842c15c7d81b3c2d
Reviewed-on: https://dart-review.googlesource.com/29701
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-12-14 22:04:16 +00:00
Alexander Markov 752dd8921a [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler
* Also enable --limit-ints-to-64-bits for CFE when it is used to generate
  kernel for VM as CFE relies on int.parse being able to parse correct
  literals and reject incorrect.

Issue: https://github.com/dart-lang/sdk/issues/31339

Change-Id: I4d12057457869e86945a4d3cf83326be7c93c17f
Reviewed-on: https://dart-review.googlesource.com/29546
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-14 21:03:42 +00:00
Martin Kustermann a11d7a1643 Add support for running simdbc64 in batch mode
This makes isolate tests fail, since we no longer run from "source" (or
rather use the kernel-isolate to to "source -> dill" for us).

The special vm/cc suite will continue to be run via the kerne-isolate, so we
have the coverage for these (which probably include reload tests).

Issue https://github.com/dart-lang/sdk/issues/31585

Change-Id: I51bd2f9345d650b4ff2a98aa1c8365c765e0d013
Reviewed-on: https://dart-review.googlesource.com/28722
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-12 15:26:41 +00:00
Martin Kustermann d1ed915244 Use batch mode compilation for normal -cdartkp
Issue https://github.com/dart-lang/sdk/issues/31585

Change-Id: I70790a33cfbfbc7c2c48c6e77074f955d6de7e01
Reviewed-on: https://dart-review.googlesource.com/28280
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-12 13:47:11 +00:00
Vyacheslav Egorov efca9c69ab [vm/testing] Make --strong -c dartk configuration a Dart 2.0 configuration.
Switch it to use pkg/vm/tool/dart2 which is the source of truth for what
Dart 2 VM configuration means. Don't pass any additional flags from
tools/test.py itself.

Align pkg/vm/tool/dart2 with what tools/test.py was passing to VM on _2 suites.

Make default invocation `tools/test.py -c dartk --strong -m release,debug`
green by updating status files and skipping suites that are not Dart 2.0
compliant. I have filed issues #31588 for isolate suite and #31587 for
service suite.

Reland of https://dart-review.googlesource.com/27820

Change-Id: I49400fae716f75425e70bf1e561b3375ba39157e
Reviewed-on: https://dart-review.googlesource.com/28565
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-12 12:19:10 +00:00
Martin Kustermann 317c55fa2c Reland "Use batch mode compilation for -cdartkp --strong"
Preliminary testing shows, this increases performance by around 20%. The
main benefit is by re-using a warmed-up VM and not start one from
scratch for every compilation.

Going forward we can do more optimizations, e.g. reading the platform
dill file only once into memory (instead of repeatedly) ...

  => This requires us using the new state-full IKG compiler.

Issue https://github.com/dart-lang/sdk/issues/31585

Change-Id: I2d3448783fc118611baf4671187a897227a65a6c
Reviewed-on: https://dart-review.googlesource.com/28400
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-12 10:14:20 +00:00
Vyacheslav Egorov e84fa65696 Revert "[vm/testing] Make --strong -c dartk configuration a Dart 2.0 configuration."
This reverts commit 50865e9387.

CQ on Mac is broken.

TBR=kustermann@google.com

Bug:
Change-Id: I41a7cab59c076dba4f25f5904725cca5bb4619c9
Reviewed-on: https://dart-review.googlesource.com/28420
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 21:07:43 +00:00
Alexander Markov 0352170a8f [VM] Avoid depending on --kernel-binaries if .dill file is specified
If a .dill file is specified on the VM command line (dart/dart_bootstrap),
and --kernel-binaries is not specified, then this dill file is used as
the source of platform libraries.

It supports the case of AOT-compiling a self-contained .dill file.

Change-Id: I42956a20b98958b9a2440f156fbbef17bfc359f8
Reviewed-on: https://dart-review.googlesource.com/24341
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 20:53:46 +00:00
Alan Knight af0b27480a Revert "Use batch mode compilation for -cdartkp --strong"
This reverts commit 8c38a415de.

Bug:
Change-Id: I1b159f2d2d10b51ee843a2ba9a61feb339152338
Reviewed-on: https://dart-review.googlesource.com/28362
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-11 18:22:49 +00:00