Commit Graph

108 Commits

Author SHA1 Message Date
Alexander Aprelev b0a11c9d25 [vm] Fix kernel list loader so that files are relative to the list.
Fixes https://github.com/dart-lang/sdk/issues/33952.

Change-Id: I95325217601dd6a25a058e36d359014eab7e61bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103901
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-05-28 19:42:45 +00:00
Sam Rawlins b22cd05c51 Reland fix for #28233: add hint for missing returns to function expressions
The bulk of this change is actually correcting missing returns in the Dart SDK.

Bug: https://github.com/dart-lang/sdk/issues/28233
Change-Id: I52bcbc6c6f4a129d3fc22003f4448a7c3d4487ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100301
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-22 18:12:30 +00:00
Sigurd Meldgaard 4934f766d7 [vm] protobuf aware treeshaker, Support freezing messages
This also bumps the protobuf version.

Change-Id: I3e2d4f8fddcac5f7ac213fbad5a36804d917e34c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101296
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2019-05-07 07:12:33 +00:00
Alexander Markov 8924c18003 [vm/tests] Revert changes in pkg/vm unit tests after constant-update-2018 was disabled
Pkg/vm tests were adjusted after constant evaluation was enabled in the front-end.
As constant evaluation was reverted (4b7d256a06),
we also need to revert corresponding changes in pkg/vm unit tests.

Revert "[vm/bytecode] Update expectations for bytecode generator unit test"

This reverts commit 734c50cbf2.

Revert "[vm/aot/tfa] Update TFA tests after front-end starts evaluating constants"

This reverts commit 25cb45c02f.

Change-Id: I2fcc30571bec2dd904925724ddb7105567c7ecda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99782
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-19 18:12:21 +00:00
Alexander Markov 25cb45c02f [vm/aot/tfa] Update TFA tests after front-end starts evaluating constants
Usually TFA takes kernel AST with all constants evaluated.
However, in order to avoid calling constant evaluator pass in TFA unit tests
there is a special implementation of pragma annotation parser (for testing)
which accepts annotations which are not ConstantExpressions.

After CFE starts evaluating all constants (constant-update-2018 was enabled in
e9ca6a5335), TFA unit tests need be
switched to use ConstantPragmaAnnotationParser.

Also, empty environment defines are passed to CFE to avoid unevaluated constants
and unit test expectations are updated.

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

Change-Id: I2e7b0647e065cca129449b4531c6278c1d98061d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99269
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-04-12 19:33:35 +00:00
Jens Johansen 51433e65cc Compile flutter tests via the sdk
This CL includes:
* A dart script that - given a flutter checkout - finds and compiles
  tests to ensure we actually can.
* A shell script that checks out flutter, compiles the platform
  (to cope with any changes to the kernel format) and runs the above
  script.

Change-Id: I02806a375943361c3c111d9aa12a76d745391ca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98140
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-04-11 08:38:53 +00:00
Alexander Markov 75a529f115 [vm/tests] Improve usability of pkg/vm tests
Fixes https://github.com/dart-lang/sdk/issues/36468

Change-Id: I7deecb1a4ef5cb337056049cdcf4781020a07a5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98946
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-10 15:24:36 +00:00
Ben Konyi 15b11b0183 [ VM / Service / Observatory ] The VM service now requires an authentication code by default.
Previously, a valid web socket connection would use the following URI:

`ws://127.0.0.1/ws`

Now, by default, the VM service requires a connection to be made with a
URI similar to the following:

`ws://127.0.0.1:8181/Ug_U0QVsqFs=/ws`

where `Ug_U0QVsqFs` is an authentication code generated and shared by the
service.

This behavior can be disabled with the `--disable-service-auth-codes`
flag.

Change-Id: I288aac58e3ba9d35dca8071f3f7e7a073896c271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98433
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-04-09 22:57:29 +00:00
Alexander Markov e88363cffd [vm] Fix formatting and analyzer hints in pkg/vm
The following analyzer hints are fixed:

  hint • This function has a return type of 'String', but doesn't end with a return statement at pkg/vm/bin/compare_sizes.dart:140:3 • missing_return
  hint • This function has a return type of 'String', but doesn't end with a return statement at pkg/vm/bin/compare_sizes.dart:198:3 • missing_return

Change-Id: Ia34006eb023c0b3f9b60f8f38dc248cfa1c87a30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98983
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-09 22:38:27 +00:00
Jens Johansen ef168de000 [vm/kernel] Index all source and line starts before using them (2nd try)
By indexing all sources in a concatenated dill file and then using that
index to find the sources and line starts we can fix missing information
(leading to crashes when collecting coverage) in for instance circular
instances.

This reverts commit 57321c1590 and adds a
fix.

Change-Id: I7a91801fb318cad0218cf3101d6a15f1ec929175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98006
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-28 08:36:51 +00:00
Keerti Parthasarathy 57321c1590 Revert "[vm/kernel] Index all source and line starts before using them"
This reverts commit a7ab99dd84.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm/kernel] Index all source and line starts before using them
> 
> By indexing all sources in a concatenated dill file and then using that
> index to find the sources and line starts we can fix missing information
> (leading to crashes when collecting coverage) in for instance circular
> instances.
> 
> Change-Id: I454cff57f84f21de72f6486e1cecf15d1389a498
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96901
> Commit-Queue: Jens Johansen <jensj@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,jensj@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Iea75c9dd56e74fa0e98c90ea6841ed66b39d40cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97941
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-03-26 22:13:10 +00:00
Alexander Markov 61f0f5bc43 [vm/bytecode] Declare members in bytecode
This change replaces kernel AST declarations of fields and functions
with bytecode declarations.

Size of dilp files is reduced by 11-12%.

Startup latency:
Time to the first full frame: 1.945s -> 1.687s
FinalizeClass: 554ms -> 277ms
FinishClassLoading: 296ms -> 156ms

There are following regressions in bytecode mode, which will be fixed
in future:

* dart:mirrors are not supported yet (implementation of mirrors relies
  on reading kernel AST in certain cases).

  As the result, lib_2/mirrors/* tests fail.

* native extensions are not supported yet (annotations on libraries
  and classes in AST are cleaned up as they could reference members
  which are now removed from AST).

  As the result, standalone_2/entrypoints_verification_test test fails.

* language_2/spread_collections/const_error_test/* tests fail
  due to https://github.com/dart-lang/sdk/issues/36286.

Change-Id: I5130f401fd7b84038b136136e7ccc1a6e51b6cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97561
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-26 21:40:10 +00:00
Jens Johansen a7ab99dd84 [vm/kernel] Index all source and line starts before using them
By indexing all sources in a concatenated dill file and then using that
index to find the sources and line starts we can fix missing information
(leading to crashes when collecting coverage) in for instance circular
instances.

Change-Id: I454cff57f84f21de72f6486e1cecf15d1389a498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96901
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-21 12:05:15 +00:00
Jens Johansen 1f10174891 [vm/service] Test collecting coverage for a concatenated dill file
This CL adds a test where:
* Two libraries depend on each other and both have mixins where
  the body comes from the other file.
* The two-library component is then split into two one-library
  components and loaded by the VM via the "multiple kernels"
  functionality (basically as a concatenated dill file).
  (Notice, that each individual component has a reference
  (but no line starts or source), to the other library in its
  uriToSource table. This currently causes the VM to let (at least)
  one script have an empty source and and an empty line starts table.)
* The test then checks that it via the service protocol can find
  a) a non-null, non-empty "tokenPosTable" for each script,
  b) a translation between token positions and line-column via the
     tokenPosTable for each token position the VM specifies as a
     hit, a miss etc.
  Said another way, it basically checks if we can collect coverage.

The test is currently skipped because it fails and we can't -
to my knowledge - mark it as such.

Change-Id: I76a049bffdd554755372a19235bf0c270bad3764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96103
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-21 12:04:01 +00:00
Jens Johansen eb344e2072 Keep live libraries and uri to source in sync
This CL removes the sources from uriToSource for libraries
the incremental compiler doesn't keep around.

This includes:
* Explicitly invalidated libraries, also if in a package.
* Transitively invalidated libraries, also if in a package.
* Libraries that are now no longer referenced in the resulting whole
  program, unless it's in a package.
* Libraries from packages that are implicitly invalidated by an
  updated .packages file (e.g. if the .packages file no longer
  reference it or reference a new version of it).

This does *NOT* include:
* Libraries from packages that are not invalidated and that are still
  mentioned in .packages, even if the actual libraries are no longer
  referenced in the resulting whole program. The reason is that these
  libraries are kept around in the incremental compiler.

Bug: 36197
Change-Id: I0ed41567ab54828585326ffd4dcb3722980bf874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97201
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-03-21 10:08:30 +00:00
Sigurd Meldgaard 9d3988eb67 [vm] First stab at a protobuf aware treeshaker
Relies on https://dart-review.googlesource.com/c/sdk/+/96782
Change-Id: I820e884f96923f9eb9a856faef6442f6ed645fe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96162
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-03-18 13:07:44 +00:00
Alexander Aprelev 35fb67158b [vm/frontend] Change frontend server interface so compile response contains delta of sources files that were used by the compiler.
This is needed so that for incremental compilation client knows which files need to be tracked for changes, need to be reported as invalidated for next recompilation cycle(see https://github.com/flutter/flutter/pull/29004)

Change-Id: I8c9e7800b55335497a4cbecfd35cec7390528eb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95920
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-03-14 21:53:08 +00:00
Alexander Aprelev 6587483d33 [frontend] Dont re-report compile-expression errors.
Fixes dartbug.com/36091

Change-Id: I122359ad2377499511118c943dc8c27347fb2007
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96406
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-03-13 15:31:52 +00:00
Alexander Aprelev 11b9481403 [vm/frontend] Fix frontend_server_test on Windows.
Assumption is that invalidated files are identified by uri.
Allow `file:`-uri so uri can be used for compilation/recompilation requests.

Fixes https://github.com/dart-lang/sdk/issues/35946

Change-Id: Ia976486841ddd5e5e78923467f8b2ca58396f994
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95683
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-03-11 19:20:44 +00:00
Alexander Aprelev a681a6297a [vm/incremental compiler] Add reject/compile_expresson test for incremental compiler.
Change-Id: I79fd20e89ad3b9b5372725d60ba3c2b2d7213944
Reviewed-on: https://dart-review.googlesource.com/c/94366
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Alexander Aprelev <aam@google.com>
2019-03-01 17:15:00 +00:00
Alexander Markov 046928d502 [vm/kernel] Ignore package URIs when converting main script to package URI
If main script is specified as a 'package:' URI, kernel compiler
should not try to convert it to 'package:' URI using --packages file.

Bug: FL-186
Change-Id: I65e8825470ca08b5dd1ae5bd30cf4f5699d6d03c
Reviewed-on: https://dart-review.googlesource.com/c/93365
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-02-15 20:48:51 +00:00
Samir Jindel ae7bf9e999 [vm] Support closurization of methods through @pragma entry-points.
Fixes dartbug.com/35720.

Also enable native extensions in AOT.
Increases Flutter Gallery snapshot size by 0.19%.

Change-Id: I1b24c3b9a49a13fd48452e9a89595516a7f01780
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/92283
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-02-14 17:47:28 +00:00
Alexander Markov 336969538c [vm/bytecode] Revise representation of types, constants and calls in bytecode
* Type arguments are moved to global object table (and de-duplicated).
* Finalize non-recursive generic types at bytecode generation time.
* Constants are moved to global object table (and de-duplicated).
* ICData creation is avoided for direct calls.
* Interface calls reference target member instead of selector name.

Size of a dilp files: 17868K => 15896K (-11%).

Change-Id: I0c9bf338137a0fae6ed90ab6b125ed2b24a1a8ad
Reviewed-on: https://dart-review.googlesource.com/c/91108
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-02-05 20:13:45 +00:00
Peter von der Ahé 8e5ad9b3bd Prepare the VM for removing TypeEnvironment.hierarchy
Validating the class hierarchy requires subtype tests. Previously,
Fasta has worked around this by computing the hierarchy twice, as
well as visiting the hierarchy several times. In order to improve
performance of modular compilation, we're working on changing this.

To enable creating a TypeEnvironment without a hierarchy, we're
removing the field from the API.

Change-Id: I7c9f88d5c6495aaa8223eaeff7d2dfd5669e9e95
Reviewed-on: https://dart-review.googlesource.com/c/88823
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-10 05:21:24 +00:00
Samir Jindel b58e8d7307 [vm] Use TFA to remove explicit type-checks (including keyword-covariant parameters).
- Also allow using the unchecked entry-point for invocations of generic functions where
  there are no bounds or the bounds don't require dynamic checks.

Change-Id: I6ca1ebec777ecf2989c4fb77425d65d542d5adf2
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/87181
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-08 08:36:58 +00:00
Alexander Markov 6d8d57c967 [vm/kernel] Cleanup use of legacyMode in pkg/vm/test
When default mode of TypeEnvironment was flipped in
https://dart.googlesource.com/sdk/+/e45e33454874d5751fadc0ea15d8141165e24587,
the test was updated to use legacy mode explicitly.

However, the test needs a default mode of TypeEnvironment (whatever it is)
and not legacy mode, so reverting it back to use default.

Change-Id: Iec0c42588cf6a2083d395a8bdc95982aab2b0da1
Reviewed-on: https://dart-review.googlesource.com/c/87900
Commit-Queue: Alexander Aprelev <aam@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-12-20 20:16:45 +00:00
Peter von der Ahé e45e334548 Rename strong mode to legacy mode in package:kernel
Change-Id: Ia4a8a9cac7817a8db5771ec82541b556c705f7c8
Reviewed-on: https://dart-review.googlesource.com/c/86353
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-20 18:06:34 +00:00
Alexander Markov 2fc5a23dd5 [vm/kernel] Enable sync-async in pkg/vm tests
Change-Id: I7fc4a9ad503cb47a0c1b8b37ffdcdb754e2e7200
Reviewed-on: https://dart-review.googlesource.com/c/87608
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2018-12-18 22:34:11 +00:00
Alexander Markov 80412dcf6a [vm/kernel] Accept URIs in --packages option if multi-root filesystem is used
Change-Id: I0558a8feed81f895e75f2d9f73a5f737d8b4f085
Reviewed-on: https://dart-review.googlesource.com/c/86460
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-12-17 20:06:44 +00:00
Kevin Millikin a8493e1b50 Flip the default value of the Kernel syncAsync flag
In Kernel's TargetFlags, this flag still defaulted to false.  Flip the
default to true and update all client code in the SDK.  The
expectation is that many of the places that now pass false explicitly
really just want the default, but that will be verified separately and
then the flag will be removed.

Change-Id: I2a38eb53f280f21f59bb1d2e88c42516f827fd39
Reviewed-on: https://dart-review.googlesource.com/c/85448
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-12-12 14:23:54 +00:00
Alexander Markov 9f49b47823 [vm/bytecode] Revise representation of objects and strings in bytecode
This is a major revamp of bytecode metadata format. Now bytecode has
its own serialization mechanisms.

This CL adds 'bytecode component' metadata, which contains bytecode
object table and string table. All references from bytecode (constant
pools) to libraries, classes, members, types and strings now have a new
format. References to frequently used objects are represented as indices
in object table, while rarely used objects are written inline.
This allows VM to cache frequently used objects while reading bytecode.

Representation of strings is aligned with VM - string characters are
stored in separate pools of one-byte and two-byte strings. This allows
VM to avoid UTF-8 decoding and extra copying.

Closure declarations are now explicit. Type parameters no longer require
enslosing scopes when reading/writing them.

Benchmarks:
GenKernelKernelReadAllBytecode (Intel Core i5) +29.84%
GenKernelKernelReadAllBytecode (Intel Xeon) +28.74%
Change-Id: I4b80009733a8f8c038264af74f97c4e094b9e311
Reviewed-on: https://dart-review.googlesource.com/c/85469
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-12-03 19:08:42 +00:00
Alexander Markov 8f7a0f400b [vm/bytecode] Emit source positions for bytecode instructions
Change-Id: I83963771db301089317823f6bf14eb4a2728dbfb
Reviewed-on: https://dart-review.googlesource.com/c/81740
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-11-14 00:27:45 +00:00
Samir Jindel e23acaaf90 [vm/aot] Fix obfuscation.
Test Plan:

Make vm-kernel-precomp-obfuscate-linux-release-x64-try green, ensuring status file changes
reflect design gaps and not bugs.

Tested locally that obfuscated Flutter Gallery runs.

Change-Id: Ifcdc334de58f43c310e15b58dbcf6fe1597206f2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-obfuscate-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/81009
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-26 13:00:33 +00:00
Alexander Aprelev 27b3f0ba6b [vm/frontend] Allow 'package:'-scheme uris as sources for frontend_server compilation.
'package:'-scheme uris are important with compiler enforcing unique identification of files present in packages(that can be referenced either via 'package:'-uri or via 'file:'-uri).

Change-Id: Ib3006dadbdd1dfc5fe1df800cae3f95bcbb37063
Reviewed-on: https://dart-review.googlesource.com/c/80361
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-10-17 16:53:36 +00:00
Samir Jindel 3e7ce992cf [vm/tfa] Implementation of type arguments tracking in TFA.
Change-Id: I9398186e27ae7a040e249df010ae16fb6ab6da89
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/74962
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-11 19:09:42 +00:00
Alexander Markov 5deb1c6e81 [vm] Remove strong mode and sync-async flags from pkg/vm
Change-Id: Icd2920274ca4c402b38e5774bb408d6b5e529169
Reviewed-on: https://dart-review.googlesource.com/c/79082
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-10-10 20:11:35 +00:00
Peter von der Ahé 8c872e0e3a Remove TargetFlags.strongMode
Change-Id: Ibf8661e5444d16666c54f1d81c626893b000521a
Reviewed-on: https://dart-review.googlesource.com/c/78986
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-10 12:11:41 +00:00
Peter von der Ahé ee97806084 Replace strongMode with legacyMode in CompilerOptions
Also, remove --strong and --strong-mode flags (use --legacy-mode
flag to enable legacy mode).

Change-Id: I577ab5f755a2bee88f0f4d63915a6e852e792f06
Reviewed-on: https://dart-review.googlesource.com/c/79000
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-10 12:04:26 +00:00
Jens Johansen 7007567685 Fix issue with --unsafe-package-serialization
--unsafe-package-serialization saves the frontend_server from having to
re-serialize everything all the time.

Before this CL, though, things could go wrong:

If you had a situation where you had previously compiled a file that
depend on a package A, and where (some of) package A depends on
package B this would happen:
- All of package A was serialized together.
- All of package B was serialized together.

When later, you compile something that depend less on package A - namely
on only on parts that does not depend on package B, but is included in
the previously serialized package A, the following would happen:
- The new (non-package) libraries would be serialized.
- Package A serialization would be reused.

This is basically fine: Running the app would be fine, everything it
actually depend on is there.

However, if the VM is forced to compile everything it now also compiles
stuff that was included - but really unused - from package A - namely
also the libraries that depend on package B --- which is not included.

This CL changes the last part by also including package B.

The result is that even more unused libraries are included, but that
the VM can survive a forceful compile.

Note that the --unsafe-package-serialization is only used for tests,
so the "including even more unused" part is probably not a big deal,
and all in all there's still a big speed advantage to doing this.

Change-Id: Iac06ba6f40c2caaacce641c5853e9491496dce53
Reviewed-on: https://dart-review.googlesource.com/c/78541
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-10-10 06:35:49 +00:00
Peter von der Ahé 44c6312df8 Consolidate VM dependencies on front_end
Also, convert package:vm to use onDiagnostic.

We're consolidating all dependencies on package:front_end in one file per tool.

The idea is, if you want to depend on something in the package:front_end, you modify pkg/front_end/lib/src/api_unstable/vm.dart and consult with the front-end team.

These consolidated files will help us when designing a public API in the future.

Change-Id: I66bafdd0ae29605fd12f8d6c589dbc761e5c7a97
Reviewed-on: https://dart-review.googlesource.com/c/77581
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-03 05:41:30 +00:00
Alexander Markov 19e2040f35 [vm] Cleanup the ability to specify entry points via JSON and text files
Entry points files (both JSON and text) are replaced with
@pragma("vm:entry-point") annotations.

This change removes obsolete:
* --embedder_entry_points_manifest option in gen_snapshot;
* --entry-points option in gen_kernel and frontend_server;
* --print_precompiler_entry_points VM option;
* 'entry_points' argument in Dart_Precompile() API.

Change-Id: I503f50f51df27e8e9635388c013058686b3b6ff1
Reviewed-on: https://dart-review.googlesource.com/75793
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-21 16:51:48 +00:00
Alexander Aprelev 51d530475a [frontend] Honor embedSourceText option in incremental compiler.
Change-Id: Ia7d3058a800e0e17dc9321ec75dcf8efb826a154
Reviewed-on: https://dart-review.googlesource.com/75100
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-09-20 14:47:56 +00:00
Alexander Markov d44ffba254 [vm/tfa] Stop accepting non-empty entry points json files
Entry points JSON files are deprecated (replaced with pragmas).
So TFA should not require them. As a sanity check, it will complain
if an entry points JSON file is not empty.

Change-Id: Ie64121ab4cdd0c330f81a8cb71a671e1df82f136
Reviewed-on: https://dart-review.googlesource.com/75423
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-19 01:41:30 +00:00
Samir Jindel cdb9336fc0 [vm/tfa] Use concrete types for list and map literals and constants.
Change-Id: Ieaeb64501c78e31a38c1aa350a7f112f51bcc7f0
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/74881
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-18 08:58:11 +00:00
Samir Jindel 7c5b3dc485 [vm/tfa] Pass receiver type into field initializer summaries.
This is required for tracking type arguments, since field initializers can
reference type variables from the enclosing class.

Also a few drive-by spelling fixes.

Change-Id: I91e33f7d8c61e288ccb2d8e18b33f4e67ac22a1b
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/74666
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-13 19:17:26 +00:00
Samir Jindel cbd17b535f Re-land "[vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior."
We need to block interrupts while evaluating pragmas to prevert reentrant class finalization.
Original revision is in patchset 0.

Change-Id: I872cec4eaf4ca85567c9657c458ed39c8b2e30de
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/73160
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-11 18:14:51 +00:00
Alexander Aprelev aec5abc95a [vm] Tweak path/uri so test passes on Windows.
This is follow-up to https://dart-review.googlesource.com/c/sdk/+/72540.

Change-Id: Ibcef2c8571dbf4ee9761a3c43686e395a65ae8e9
Reviewed-on: https://dart-review.googlesource.com/73282
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-09-05 20:30:32 +00:00
Alexander Aprelev e07af58238 When compiled delta is rejected, reset incremental compiler back to last known good state(last accepted state).
This is needed so that compileExpression requests are serviced from that accepted state.

Bug: https://github.com/dart-lang/sdk/issues/34025
Change-Id: I592d2af50e59a721e1feb1699c6d56bcd568465f
Reviewed-on: https://dart-review.googlesource.com/72540
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-09-05 18:58:29 +00:00
Samir Jindel f8575698af Revert "[vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior."
This reverts commit ade6742ee9.

Reason for revert: Some service tests are broken.

Original change's description:
> [vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior.
> 
> Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
> Change-Id: I6eeafeea734efb2e876c5e03f12092b5229ad2bc
> Reviewed-on: https://dart-review.googlesource.com/70284
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

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

Change-Id: If95f68704737b1da7553c68eb4e22a4c554d3a4b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/72200
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-08-30 19:02:45 +00:00
Samir Jindel ade6742ee9 [vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior.
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I6eeafeea734efb2e876c5e03f12092b5229ad2bc
Reviewed-on: https://dart-review.googlesource.com/70284
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-08-30 15:30:40 +00:00