Commit graph

67136 commits

Author SHA1 Message Date
Ben Konyi e87f3407c8 [ dart:developer ] Added optional parent parameter to TimelineTask constructors.
Specifying a parent will result in an argument being added to 'start'
events for that TimelineTask named 'parentId', which contains the task
ID of the parent. This is to be used by DevTools to show relationships
between asynchronous tasks that are not currently supported in the trace
event format used by Catapult.

Change-Id: Id0a030f018f5a6ac1e3b0ef2e89c1cd732790f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-03 16:33:38 +00:00
Alexander Markov 07a63a17a4 [vm,aot,bytecode] Handle procedure-attributes metadata when generating bytecode
Change-Id: I26e1a15d979ce13ca60298de28ced49b6882cf52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119765
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-10-03 16:27:33 +00:00
Konstantin Shcheglov 0cd0d9a744 Remove FunctionTypeImpl.forTypedef()
Change-Id: I4d54ef8046a8dd5b06b9f815e89d28e5a8a985d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-03 16:25:33 +00:00
Konstantin Shcheglov c1e6533c0e Remove TypeArgumentsComputer and lazy InterfaceType arguments.
Change-Id: I48ca04ca30eb737c832440ef3fe391b169fd323e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119825
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-03 14:32:47 +00:00
Konstantin Shcheglov bd30cbff30 Remove FunctionTypeImpl.fresh()
Change-Id: Ie57af4228e9e58ff09dc9ca568392e539997a82c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-03 14:32:37 +00:00
Konstantin Shcheglov a4e1b08e25 Stop using 'Element.type' in TypeSystem.
Change-Id: Ice12345ee8acc58f4f05311fb4b68ad24eadf33d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119769
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-03 14:24:42 +00:00
Konstantin Shcheglov 4b1cf2aa10 Stop using 'Element.type' in ElementFactory, AstTestFactory, _OverrideChecker.
Change-Id: I064ec8ae3ab207b686d450c6dcd5fa23b5caca62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-03 14:24:33 +00:00
Samir Jindel afac6a3714 Re-land "[vm] Use ELF loader in dart2native."
Fixes symbol resolution on Darwin.

The original commit is in patchset 1.

Change-Id: If71e9a72b8a2f45db2591bfa45ec4018745ee2c4
Cq-Include-Trybots:luci.dart.try:dart-sdk-mac-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119646
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-03 13:40:12 +00:00
Clement Skau 6e1b479285 [SDK] Adds text wrapping and tweaks to flags for dart2native.
Usage: dart2native <main-dart-file> [<options>]

Generates an executable or an AOT snapshot from <main-dart-file>.

-D, --define=<key=value>       Set values of environment variables. To specify
                               multiple variables, use multiple options or use
                               commas to separate key-value pairs.
                               E.g.: dart2native -Da=1,b=2 main.dart

    --enable-asserts           Enable assert statements.
-h, --help                     Display this help message.
-o, --output=<path>            Set the output filename. <path> can be relative
                               or absolute.
                               E.g.: dart2native main.dart -o ../bin/my_app.exe

-k, --output-kind=<aot|exe>
          [aot]                Generate an AOT snapshot.
          [exe] (default)      Generate a standalone executable.

-p, --packages=<path>          Get package locations from the specified file
                               instead of .packages. <path> can be relative or
                               absolute.
                               E.g.: dart2native --packages=/tmp/pkgs main.dart

-v, --verbose                  Show verbose output.


Change-Id: Id4d5542a946326fb8c009643f16fa1be99c9a97e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118994
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2019-10-03 12:06:02 +00:00
Johnni Winther 967673c005 [cfe] Introduce ClassMember
Use interface ClassMember instead of Builder in ClassHierarchyBuilder.
This avoids the coupling between DelayedMember and Builder and is a
precursor to removing Builder.target.

Change-Id: Ie2067512051618a60fcb94b5aae7e7f3d8c02b15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119644
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-03 09:49:01 +00:00
Johnni Winther 3e2d6f95ee [cfe] Use fileOffset in Forest instead of Token
Change-Id: I6904555d5e192b7f6a561ae41859288db808e771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119642
Reviewed-by: Jens Johansen <jensj@google.com>
2019-10-03 09:49:01 +00:00
Jens Johansen 2285741180 [analyzer] Update syntactic_errors.g
Change-Id: Id1339e7d1e200f6ba3d0a594a6c8b1c3f9f0ba9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119841
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-03 08:35:11 +00:00
Jens Johansen 396608e35d [CFE] Update parser test framework to work with extensions
Change-Id: I7e3fa005470a66e33da12ee71235020fb53e8767
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-03 08:29:51 +00:00
Chris Bracken 5c106e3098 [vm, fuchsia] Add timezone support in Fuchsia SDK builds
Previously Fuchsia did not expose a timezone API in their public API.
Support for the existing private APIs was added in:

https://fuchsia-review.googlesource.com/c/fuchsia/+/284531
https://fuchsia-review.googlesource.com/c/fuchsia/+/284654

as fuchsia::deprecatedtimezone. A replacement API has not yet been added
to the public SDK.

This resolves b/141224241.

Change-Id: I50d3cb61f869508a6cf90e918c5af001a27192f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119820
Auto-Submit: Chris Bracken <cbracken@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-10-03 04:33:59 +00:00
pq 512d763b9d diagnostic property types support
Adds support for:

* ints
* doubles
* enums
* Strings

Up next: Colors, Iterables, Transforms and a catch-all.

Also note the TODO to change how types are being written (will be needed for Iterables).

See: https://github.com/dart-lang/sdk/issues/38633

Change-Id: I9d545ce9e090059ae330f9ae5dadf8e7d4b373c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119725
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-03 02:12:39 +00:00
Konstantin Shcheglov 16944f0edb Stop using 'Element.type' in StaticTypeAnalyzer.
...other than the places where we should not set the type at all,
because these identifiers are not expressions. This is being done in
a separate CL, which will probably land as a breaking change.

Change-Id: I710488f0d1aa2475e51b59e383a1192b16162855
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119766
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-03 00:19:37 +00:00
Felicitas Hetzelt 375c4a9657 [vm/fuzzer] Disable CC for most types
Change-Id: I7ab01cd7ca2d5f9ec23f5be9dfbe7c4dfc7b46a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119768
Commit-Queue: Felicitas Hetzelt <felih@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-10-03 00:12:02 +00:00
Robert Nystrom e919e89d0b Add an "--nnbd" flag to build.py.
This treats whether or not to use the forked NNBD SDK as a build flag
similar to mode or architecture. When this flag is passed, it appends
"NNBD" to the main output directory, like xcodebuild/ReleaseX64NNBD.

It also defines a "use_nnbd" flag that is available inside BUILD.gn
files to determine whether or not to use the forked SDK. This flag
currently isn't used. Implementation teams will need to edit their
build steps to take that into account.

In order to use this mode on the bots, we'll need to tweak the bot
scripts to figure out whether the mode is enabled or not. There are a
couple of TODOs in the Python scripts for that. I'm not sure how that
should be specified in dart_sdk.py.

This CL does not remove my previous change to allow building the NNBD
fork next to dart-sdk in the same root output directory. I'll revert
those changes in a different CL once this one lands.

Change-Id: I3bd28f273106ee90caf9474b2fadad120b2c2d0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119602
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2019-10-03 00:11:32 +00:00
Ryan Macnak d65a60db00 [vm, bytecode] Populate bytecode cache when initializing an incremental compiler from a kernel file.
AST
"without_change_elapsed_time_ms": 2863,
"implementation_change_elapsed_time_ms": 6009,
"interface_change_elapsed_time_ms": 5888,
"with_coverage_time_ms": 2884

BYTECODE BEFORE
"without_change_elapsed_time_ms": 5216,
"implementation_change_elapsed_time_ms": 8517,
"interface_change_elapsed_time_ms": 8895,
"with_coverage_time_ms": 5462

BYTECODE AFTER
"without_change_elapsed_time_ms": 3384,
"implementation_change_elapsed_time_ms": 8139,
"interface_change_elapsed_time_ms": 8073,
"with_coverage_time_ms": 3473

Change-Id: Ic8e1c183070cb6019ea48f16c04ea5363df41a97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119620
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-02 23:53:42 +00:00
Felicitas Hetzelt 22479a17ff [vm/fuzzer] Sort generated tables.
Change-Id: I5f8cac14ffeb05f12889a42706de02a40b72cd75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119727
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-10-02 23:27:41 +00:00
Felicitas Hetzelt 9050e28bf0 [vm/fuzzer] Avoid STRING *= large number in loops
Change-Id: I2048b1c888a9656107bcee6a966f4658c9bab4a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119740
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-10-02 23:25:01 +00:00
Alexander Markov 1ed707703d [vm/bytecode] Mark try blocks generated for try/finally as synthetic
This matches behavior of AST-based flow graph builder. Debugger ignores
synthetic (is_generated) try blocks when it figures out if thrown
exception is unhandled, so in order to ignore all try/finally blocks
they should be marked as synthetic.

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

Change-Id: I06840362a255b500e1e9317af90a61bbdea2a310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119726
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-02 23:15:11 +00:00
Brian Wilkerson f2816eeb0d Add a test, a TODO, and a minor display enhancement
Change-Id: Iee53c429839b36426677916f13878b1a3313bef3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119767
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-02 22:23:41 +00:00
Sigmund Cherem 33494de2f9 (ddk modular test) exclude sources from dill files.
This fixes the issue we had with shared/diamond depedencies.  This also matches
more closely how DDK is invoked internally and externally.

While the change to use `--dart-sdk-summary` is not necessary, this brings the
API closer to how it is used elsewhere. It should be cleaned up in the future to
reuse the `--input-summary` flag instead.

Change-Id: Iec3695b5541ffaf7f5762a3d77f071a596237da1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119723
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-10-02 22:22:11 +00:00
Konstantin Shcheglov 70af20bda5 Stop using 'Element.type' in ElementResolver.
R=brianwilkerson@google.com

Change-Id: I9b4eec9e0c846d0c7c9bf17177746ca71eaa4e88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119764
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-02 22:08:21 +00:00
Alexander Markov 97bb624cfe [vm] Rebuild type testing stubs if their fast path starts failing
When type testing stub is generated it captures whatever subclasses are
present at this moment. As program continues running, new classes could be
loaded and finalized. This is especially true in bytecode mode with
its more lazy class loading. So type testing stubs could get outdated and
will fall back to slow path. This could cause performance regressions as
slow path is (1) slower :) and (2) it populates and uses SubtypeTestCache,
which has a limited capcity (controlled by max_subtype_cache_entries flag).
Once SubtypeTestCache overflows type checks are not longer cached which
makes type checks at particular location significantly slower.

The solution is to rebuild specialized type testing stub in TypeCheck
runtime entry after fast path failed but check succeeded.

Change-Id: Ied166e19be2870acef7a066b83bb73931bd1073d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119184
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-02 21:09:33 +00:00
Felicitas Hetzelt f46e5ee44e [vm/fuzzer] Make num type non instantiable
Change-Id: I7ea37b58f1a3464ff4565219268f1a8bf3b04672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119720
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-10-02 21:04:04 +00:00
Aart Bik 7e99f49629 [vm/compiler] general rbit utilities
Rationale:
Useful to implement the simulator, but also useful
in the future when compiler wants to constant fold
operations related to bit reversal.

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

Change-Id: I2f09ba6b1897202b5c07a2cff771afd7bbc99495
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119703
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-02 20:37:10 +00:00
Samir Jindel 9e738b94b4 [vm] Remove #include from elf_loader.h so it can be used imported in Flutter.
Change-Id: I72ff785709ee1f5f5fbbd57d2433ca96e9866470
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118986
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-10-02 20:11:20 +00:00
Brian Wilkerson bb342ec83f Fix a test breaking the windows bot
Change-Id: I8192597a93ceb043585da0dc51f194e99bc2422c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119701
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-02 20:01:40 +00:00
Nicholas Shahan 2e99a418a0 [dartdevc] Only generate temporary id for a library when it is needed
Cleanup missed in https://dart-review.googlesource.com/c/sdk/+/119460

Change-Id: I34a48c3767938c9930baf4fb4ada5c3f18649de0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119501
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-02 19:43:00 +00:00
Stephen Adams f27d4f2f7a [dart2js] Create list constants with implementation type
This is now consistent with Set and Map constants.

Change-Id: I4a65f372eeeaaba5d6b7c229c452ba4dc7870708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119582
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-10-02 19:30:30 +00:00
Brian Wilkerson 4b0ba9cf84 Fix bug when operating on a tearoff from an extension override (issue 38653)
Change-Id: I809f57d6558f59f1563e9efa7582c69d0c14ea48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-02 18:16:00 +00:00
pq 5a174aa2df getter support for fixing missing diagnostic property references
Change-Id: Iac5523b90f3f753107cf5dc22c3cd211a21ae040
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119681
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-02 18:11:20 +00:00
Aart Bik 2c3f0fc359 [vm/assembler] Add rbit to ARM32
Rationale:
We are adding library support for bit operations:
  lowZeroBitCount/highZeroBitCount/nonZeroBitCount
The rbit on AM32 will enable very efficient direct
native implementations of these operations in the
DartVM codegen.

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

Change-Id: Icedf4af301b5c8011922fccb1530a9c28e5c0964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-02 17:34:10 +00:00
Brian Wilkerson 33cd343374 Clean up the stack when a constructor initializer is found (issue 38674)
Change-Id: I219586288a8588298cef94f80be8030581907556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-02 17:11:40 +00:00
Aart Bik eaf1c308ab [vm/assembler] Add rbit to ARM64
Rationale:
We are adding library support for bit operations:
  lowZeroBitCount/highZeroBitCount/nonZeroBitCount
The rbit on AM64 will enable very efficient direct
native implementations of these operations in the
DartVM codegen.

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

Change-Id: I4456a622d7bad1a2cfbf9383927c76983c1de9ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119586
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-02 16:44:59 +00:00
Brian Wilkerson fee4fe8241 Generate output files for files outside the migrated package
This allows navigation to work from migrated files, but some navigation
from unmiograted files doesn't work.

This also causes the content of the output directory to be deleted
before generation starts so that old files won't confuse the user.

Change-Id: I0007d811e56b82cb6b91582e3237c7383ae2d060
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-02 16:31:19 +00:00
Clement Skau 0f7a3cd611 [SDK] Adds dart2native to the test_matrix vm-kernel fileset.
Change-Id: Ic60bc7f908937226a56d7c4fa13c6733abecc1c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119641
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-10-02 15:54:50 +00:00
Alexander Markov 5a2a5204dd [kernel] Fix metadata_test in presence of control flow collections
Block nodes inside BlockExpression are not serialized separately in
kernel binary, so attached metadata is not preserved.

This change fixes Fixes pkg/kernel/test/metadata_test test failure
revealed by https://dart-review.googlesource.com/c/sdk/+/119520.

Change-Id: I38c2cde6311e001f16faf2641762aaf42dd6d2b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119527
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-02 15:53:04 +00:00
Samir Jindel d0b799f39c Revert "[vm] Use ELF loader in dart2native."
This reverts commit 98b286de21.

Reason for revert: Breaks on Mac

Original change's description:
> [vm] Use ELF loader in dart2native.
> 
> Change-Id: I58834e3626cb18830ad9f9b1b95bdfa9d1ebd040
> Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119150
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Clement Skau <cskau@google.com>

TBR=sjindel@google.com,cskau@google.com,dianamichesa@google.com

Change-Id: I61c5c36e4ccd09d91cdb58c7c87f679f02579f03
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119643
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-10-02 14:02:51 +00:00
Samir Jindel 98b286de21 [vm] Use ELF loader in dart2native.
Change-Id: I58834e3626cb18830ad9f9b1b95bdfa9d1ebd040
Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119150
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-10-02 13:42:39 +00:00
Teagan Strickland ff1a3f7e3a [vm/compiler] Add a snapshot-serialized function pool.
Like the constant pool, this pool is populated when the flag
`--populate-llvm-constant-pool` is used. This pool contains the `Function`
objects that were compiled, and each `FlowGraph` node in the serialized flow
graphs will contain extra information labeled by `llvm-index` which is the
index of its corresponding `Function` object in the pool.

Also fix up printing of the constant and function pools when the flag
`--print-llvm-constant-pool` is used so that the output is buffered to avoid
overlapping output from concurrently running isolates.

Bug: https://github.com/dart-lang/sdk/issues/38297
Change-Id: I67739500c665e509ed16becc2e6bca7fe4928eb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119543
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-02 11:52:39 +00:00
Dmitry Stefantsov bdf6b9505e [cfe] Ask for subtype checking mode explicitly
The interpretation of the subtype check result depends on the mode.  In partial
NNBD mode all type errors that wouldn't be errors in non-NNBD programs should
become warnings.  In full NNBD mode all such errors are errors.  This CL adds
the mode explicitly to the interface of the subtype check as a parameter.

Bug: http://dartbug.com/38673
Change-Id: I14bcdd260618530cfdd8189c01abba7469a16679
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119545
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-02 11:30:29 +00:00
Dmitry Stefantsov c1616157d1 [cfe] Use a class instead of the enum for subtype check results
Bug: http://dartbug.com/38673
Change-Id: I3f435c1c9b214ac822e6892849dddc9f6be8a462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119544
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-02 11:30:29 +00:00
Dmitry Stefantsov be43bce0b6 [cfe] Make interface of subtype checks aware of nullabilities.
Change-Id: Id4dbd2c903a36df511f7d638d24dc63f8a9344c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119541
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-02 11:30:29 +00:00
Teagan Strickland 0e24c2e6e5 [vm/compiler] Don't serialize precompiled constructors.
The code from these precompiled constructors is thrown away,
and if we are adding constants to the LLVM constant pool, then
we may add constants that will not actually appear in the final
program which may cause issues for tree shaking.

If these constructors are actually used, then they will be
recompiled normally.

In addition, we also do not add unreferenced constants to the
constant pool. That is, these constant definitions will not have
an `llvm_index` value in their serialized form when the LLVM
constant pool is populated.

Bug: https://github.com/dart-lang/sdk/issues/38661
Change-Id: I2a3702fd3f174504a5f01458064306cd687d7949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119339
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-02 10:07:29 +00:00
Ryan Macnak f0b2a46734 [vm, fuchsia, arm64] Restore the shadow call stack on exceptions.
Fuchsia is about to turn on ShadowCallStack for ARM64. Once this is enabled, we need to treat R18 like a preserved register. Generated Dart has not accessed this register because it is reserved on iOS, and in the absence of Dart exceptions this would be sufficient for us to be ShadowCallStack compatible. However, our exception handling mechanism jumps past all the C++ frames between the Dart exit frame and Exceptions::JumpToFrame, skipping code that would pop from R18.

Add save/restore of R18 in the invocation stubs, and restore of R18 in the jump stub. The latter prevents the ShadowCallStack from overflowing for code that has lots of exceptions without a native call.

Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=37449
Change-Id: I2ce6e46624c8d72507e7afa7a44839b1f0def556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119481
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-02 05:33:29 +00:00
Ryan Macnak 97f14cced1 [vm, bytecode] Also generate split bytecode for the first compile.
Change-Id: Iaaedab0b1bbd61f008021082435521752033f009
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119535
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-02 01:42:28 +00:00
Mike Fairhurst 2590d065f1 Update test_reflective_loader, use @SkippedTest
Change-Id: I17f8da88a4587a7ad51038ca796f138231021fe9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119583
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-02 00:02:21 +00:00