Commit Graph

548 Commits

Author SHA1 Message Date
Kevin Millikin b700223542 [cfe] Do not reset the VM async name generator
In the VM-specific async transformation, an index is used to generate
fresh temporary names for values that are live across an await.
Before it was always 0 when translating a statement because there are
no live values on entry or exit to a statement.

When translating statements nested inside block expressions there can
be live values, so the index should not be reset.

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

Change-Id: I6103d75c25f312ab1538a7c0f8fee0fea9f01b27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98664
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-04-05 09:00:24 +00:00
Alexander Markov 38dbddc90d [vm/bytecode] Add AllocateClosure bytecode
AllocateClosure bytecode is used to convey information about closure
function into an instance allocation site. This allows VM inliner to see
closure function very early at the optimization pipeline and enables
inlining of closure calls.

DeltaBlueClosures in JIT/bytecode mode (--use-bytecode-compiler):
Before: DeltaBlueClosures(RunTime): 1746.5404424083767 us.
After: DeltaBlueClosures(RunTime): 1291.4649496449324 us.

Issue: https://github.com/dart-lang/sdk/issues/36342
Issue: https://github.com/dart-lang/sdk/issues/36429
Issue: https://github.com/dart-lang/sdk/issues/36428
Change-Id: I6e94cdc2eb30110b0651a86bd2bdc40dcdd63207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98439
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-05 00:00:13 +00:00
Daco Harkes 395e5f6037 [cfe/vm] make dart:ffi compatible with constant-update-2018
I added TODOs for removing the old code after the constants update has landed.

Change-Id: Icde8d68e4e7c4b51e9536f09ce4e514e3b00336d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98661
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-04 11:09:51 +00:00
Alexander Markov 7c9d02b313 [vm/bytecode] Generate empty list literals more efficiently
Issue: https://github.com/dart-lang/sdk/issues/36429
Change-Id: I47e189bff4e9998123c06afa2e5b0d1c79d74566
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98608
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2019-04-03 23:43:21 +00:00
Alexander Markov bf293ea34c [vm/bytecode] Remove support for old version of bytecode format (v1)
Bytecode format version 2 was introduced Feb 05 2019 in
https://dart-review.googlesource.com/c/sdk/+/91108

This change cleans up code related to old constant pool entries which
were removed in v2.

Change-Id: Ic9cccd2fdec26758f377691bf4edc26d1309a524
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98610
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-03 22:44:21 +00:00
Alexander Markov dfdd974390 [vm/kernel] Pass environment defines through CompilerOptions for front-end const evaluator
Front-end constant evaluator doesn't fully evaluate constants if
CompilerOptions.environmentDefines is not set. Unevaluated constants
are not handled in bytecode generator or AOT tranformations.

As we're moving towards constant evaluation in the front-end, all
VM-specific kernel compilers such as gen_kernel and front-end server
should set CompilerOptions.environmentDefines.

Change-Id: I0c3021f87e4afdcb289822c57c2a19195b0dc467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98435
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-04-03 17:43:56 +00:00
Alexander Markov 8fb77ec84d [vm/bytecode] Preliminary support for new language features in bytecode
Issue: https://github.com/dart-lang/sdk/issues/36214
Issue: https://github.com/dart-lang/sdk/issues/36218

Change-Id: I39149b82cb93c1cb87c64cf9c41c56b753bba13a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98400
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2019-04-02 19:11:09 +00:00
Samir Jindel 154c324786 [vm/ffi] Lock out structs on 32-bit platforms.
Addresses https://github.com/dart-lang/sdk/issues/36334

Change-Id: I880812941748207ea93a789db2f2d4d2938d3f37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97961
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2019-04-01 10:30:58 +00:00
Aske Simon Christensen 0b57b67ecb [CFE] Move const set desugaring to constant evaluator.
To properly recognize control-flow constructs in sets, the constant
evaluator needs to get un-desugared set literals. This commit skips the
desugaring of const set literals if the constant evaluator is enabled
and adds a similar desugaring in the constant evaluator.

Doing the desugaring in the constant evaluator (which can be called
independently of Fasta) necessitates that dart:collection is indexed
in CoreTypes. We can remove this indexing again when the VM gains
native support for set constants.

Change-Id: Ibddafdcb182e4471012801745b51b529805b7b9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98008
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +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
Alexander Markov 0d93a85916 [vm/bytecode] Clean component metadata except bytecode when dropping AST
Change-Id: If0a7894406458b0cb6f4e1c5e4d60a6377b2459b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98044
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-27 21:07:50 +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
Liam Appelbe 93e4ae4fdf [vm] Add flags to gen_kernel script to support old ABIs
Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: If6343223c03dc7f53d597294ef7a32c204236da6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97566
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-03-25 19:17: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
Aske Simon Christensen 1ea717f1c9 [CFE] Use Fasta diagnostics in constant evaluator.
The constant evaluator now generates all errors as Fasta diagnostic
messages. The ErrorReporter is simplified to just accept a diagnostic
message, or a notification that the constant evaluator encountered an
invalid expression (presumably put there due to an earlier error).

Also, the flow of control between the error reporter and the internal
abort exceptions is reversed, so the error reporter is now called as a
result of an abort exception being caught by the evaluate method.

Reland of https://dart-review.googlesource.com/c/sdk/+/96300

Change-Id: I7d32b6e98962b6ee781a6c96b593b00ee7fd8a89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97225
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 15:42:05 +00:00
Aske Simon Christensen c10ee9971f [CFE] Move constant evaluator to Fasta.
Reland of https://dart-review.googlesource.com/c/sdk/+/96081

Change-Id: Ie9e6a0d26703469396fa6ea4803f49ce387f495b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97224
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 15:42:05 +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
William Hesse 3b2e368376 Revert 5 changes with failures
TBR=askesc@google.com

Revert "[CFE] Move constant evaluator to Fasta."

This reverts commit 845b5b2df1.

Revert "[CFE] Always call the constant evaluator by the evaluate method."

This reverts commit 91bc4ec2b9.

Revert "[CFE] Use Fasta diagnostics in the constant evaluator."

This reverts commit c7b572aa29.

Revert "[CFE] Check for null in constant evaluation"

This reverts commit e6d2751e9c.

Revert "Rename import after moving file."

This reverts commit a6e2c5eb4c.

Change-Id: Iadfe087c0110f6f331b82d990213f95d3ef4541b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97223
Reviewed-by: William Hesse <whesse@google.com>
2019-03-18 12:25:32 +00:00
Aske Simon Christensen c7b572aa29 [CFE] Use Fasta diagnostics in the constant evaluator.
The constant evaluator now generates all errors as Fasta diagnostic
messages. The ErrorReporter is simplified to just accept a diagnostic
message, or a notification that the constant evaluator encountered an
invalid expression (presumably put there due to an earlier error).

Also, the flow of control between the error reporter and the internal
abort exceptions is reversed, so the error reporter is now called as a
result of an abort exception being caught by the evaluate method.

Change-Id: I66f148cc4e202e328f895ae0b770f9b68c9f3c8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96300
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 10:42:14 +00:00
Aske Simon Christensen 845b5b2df1 [CFE] Move constant evaluator to Fasta.
This is in preparation for recognizing Fasta-specific nodes in the
constant evaluator, and for using the Fasta diagnostics framework.

Change-Id: I8535fbb68e622f1814a1d577c348d87e573b6b34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96081
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-18 10:42:14 +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
Aart Bik e6f56a8adf [vm/compiler] first vm implementation of block expression
Rationale:
Implementation of control-flow collections is
done through the notion of block expressions.
This is a first implementation to get this
working. It takes a few shortcuts (like disabling
OSR inside block expressions for now) that may be
refined later.

https://github.com/dart-lang/language/issues/78
https://github.com/dart-lang/language/issues/47

Change-Id: I966bf10942075052fcfd9bac00298a179efc551b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94441
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-03-08 20:48:31 +00:00
Anthony Bullard 995b1c9adc FE Server shouldn't try to invalidate other file schemes
When trying to invalidate files when using a multi-
root file system, if a .dill file that is being
used to initialize an incremental compiler contains
both files with a custom marker scheme, as well as
an internal one like `org-dartlang-sdk`, it will
throw when it encounters the internal scheme.

This commit remedies the issue, but this is my
first CL to the SDK, I'm not sure if this is
the best approach.

Other approaches may be:

- Ignore dartlang internal file schemes only
- Catch errors from entity.exists instead of filtering

And I'm sure there are many others.

Change-Id: Idc7aba4b41eb5cf7f66db492f0ea6e26252779c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94680
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-03-06 21:14:40 +00:00
Sigurd Meldgaard ca24e7aa10 [vm] Allow no main method when doing type flow analysis
Change-Id: I97fce485ad1792766d34ad365b359b44c8aacb61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95385
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2019-03-05 10:38:38 +00:00
Jens Johansen 2695cdfbb1 Change incremental compiler to take entry points (plural)
Change-Id: I03203cdeb11ab7bc6116779642909ebc7220c619
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95122
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-03-05 07:39:31 +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
Jens Johansen 2087d6db46 initializeFromComponent has to include platform
For initializeFromComponent to work correctly the platform has to be
provided (as the other libraries provided are linked to some platform,
and loading another one is thus no good).
This CL changes it so we don't load another one, and checks that the
component we're trying to initialize from actually contains dart:core.

Change-Id: I88d30436c101c589b0555ff70ae21297ed665d7b
Reviewed-on: https://dart-review.googlesource.com/c/93435
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-02-22 13:08:45 +00:00
Jens Johansen e4d1b28698 Incremental compiler should respect omitPlatform setting
Change-Id: Id842db646ba95945c8fadce0626cb8cbee2812ad
Reviewed-on: https://dart-review.googlesource.com/c/93433
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-02-22 11:44:45 +00:00
Daco Harkes 9b10476092 [kernel/ffi] fix library paths
Follow up of: https://dart-review.googlesource.com/c/sdk/+/93081

Change-Id: Ie4a71d0aa723fc8f9b9ed0d244a921445a81b394
Reviewed-on: https://dart-review.googlesource.com/c/93543
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-02-20 12:54:21 +00:00
Daco Harkes 620743fb6b [vm/ffi] void functions
Change-Id: I1544e0985d934dfa354143764dee61feb08b2592
Reviewed-on: https://dart-review.googlesource.com/c/93422
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-02-18 13:15:21 +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
Daco Harkes 20c3cd62fc Revert adding dart:ffi to core_types and fasta kernel_target
Change-Id: I0c8a05cf8715962ab6ebe787dafd14fe611a8a0e
Reviewed-on: https://dart-review.googlesource.com/c/93172
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-02-15 10:14:00 +00:00
Samir Jindel 3b2144fa93 [vm] Respect entry-point annotation on constructors during obfuscation.
Change-Id: Ia61d582fb6dd647b8fcab051b57ff08682076d9d
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, vm-kernel-precomp-obfuscate-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/93225
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-02-14 20:18:19 +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
Daco Harkes 6a5c9597c6 Revert adding enclosingLibrary to ast.dart
Change-Id: Iacc24b512d1ff40bd54e37ba0ad0611fa46234b7
Reviewed-on: https://dart-review.googlesource.com/c/93169
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-02-14 15:49:08 +00:00
Ryan Macnak 5d71308b78 [vm/tools] Don't duplicate "problems" metadata into split package files.
Add utility for enumerating libraries in a kernel binary.

Bug: MI4-1794
Change-Id: Iad65f236ef9d0d184323ffd2af92d311a97e525c
Reviewed-on: https://dart-review.googlesource.com/c/92865
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-02-13 19:16:36 +00:00
Samir Jindel c8a2a7b719 [vm/ffi] Move FFI transformations from pkg/kernel to pkg/vm.
Change-Id: I8bc0c60ceb98ad88aca31934b6eaaf1e55128a10
Reviewed-on: https://dart-review.googlesource.com/c/93081
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-02-13 15:53:35 +00:00
Samir Jindel 809d8123d3 [vm] Add FFI library to more targets and Flutter file libraries.json (in patch).
Change-Id: I65421efbc708b5192f871a0dae5f739352c5c3d9
Reviewed-on: https://dart-review.googlesource.com/c/93080
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-02-13 15:01:23 +00:00
Daco Harkes 7d46d4b5cb [vm / library] Foreign function interface prototype
Prototype for `dart:ffi` on Linux/MacOS x64 in JIT mode.
`dart:ffi` is experimental and its API is likely to change in the future.
Progress and design decisions are tracked in https://github.com/dart-lang/sdk/projects/13


issue: https://github.com/dart-lang/sdk/issues/34452
Change-Id: Ifa4566388e42c8757f154741d11e303465ef305d
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, vm-kernel-mac-debug-x64-try, vm-kernel-asan-linux-release-x64
Reviewed-on: https://dart-review.googlesource.com/c/80124
Reviewed-by: Samir Jindel <sjindel@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2019-02-13 12:42:47 +00:00
Aske Simon Christensen 250f9665fb [CFE] Get constants backend from backend target.
Change-Id: I04286cd38eb45ca38f8335d896c503becad16566
Reviewed-on: https://dart-review.googlesource.com/c/92136
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-02-12 09:56:57 +00:00
Aske Simon Christensen b7afb22323 [CFE] Eliminate redundant coreTypes parameter.
Change-Id: Ie76a70454ef6dd7e60b916e2820c1d4e78b3e88d
Reviewed-on: https://dart-review.googlesource.com/c/92134
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-02-12 09:56:57 +00:00
Aart Bik dbf4900c99 [vm/tools] Fix issues with snapshot size reporting
Rationale:
This fixes the following three issues to get byte-exact
snapshot size difference reporting, which makes optimizing
for code size a lot easier.

Issues:
(1) reports the slightly more accurate raw size
(2) accumulates dups in the json
    (before we only did bookkeeping for one)
(3) avoid non-deterministic parts in names
    (this resulted in reporting baffling method size
     differences against the same layout, even though
     the aggregate difference added up to 0).

https://github.com/dart-lang/sdk/issues/35323

Change-Id: Ia6abe50ab8694fe54906e28a3b3375ed99ace9df
Reviewed-on: https://dart-review.googlesource.com/c/92320
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-02-07 19:42:26 +00:00
Aske Simon Christensen ac95355fdb Compiler option for environment defines
Change-Id: I50f0085ebbc2c9a3af26769a0004bfb8361d85f2
Reviewed-on: https://dart-review.googlesource.com/c/91340
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-02-07 16:15:52 +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
Aske Simon Christensen 8a45b5eb57 Move environment handling into the front-end constant evaluator.
Change-Id: Id01bad9d9dbb7d5f6104a0f633d8303fecfa29db
Reviewed-on: https://dart-review.googlesource.com/c/91227
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-02-04 13:31:30 +00:00