Commit graph

67109 commits

Author SHA1 Message Date
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
Brian Wilkerson
a7b03453d1 Sort the instrumentation renderer.
There are no changes other than the sorting.

Change-Id: Ifcb6874324714cad954138a857416b6046bd276e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119585
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 22:19:40 +00:00
Konstantin Shcheglov
8c3065e947 Add fuzz tests for annotation resolution crashes.
Change-Id: I2748ae2bee93b621f864c11dc4d58ec9b1e4b9fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 21:50:20 +00:00
Ben Konyi
989289c36f [ package:vm_service ] Add 'tokenPosToLine' and 'tokenPosToColumn' to Script, improve test coverage
This change should also reduce the number of flaky failures and fix issue where `pub run -c test` would fail for certain tests.

Change-Id: I6010346b8a916958d46985e45600ef5a4dc760c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119500
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-10-01 21:42:13 +00:00
Konstantin Shcheglov
84383dff6d Fix elements resynthesizer tests on Windows.
R=brianwilkerson@google.com

Change-Id: I601d0c6ce7a02c22d839c89ba344ab59eaa92576
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 21:39:40 +00:00
pq
23aca57eda fix for adding boolean diagnostic property references
very constrained support for fixing `diagnostic_describe_all_properties` for the boolean field case.

still todo:

* tests for no debugFillProperties method
* tests for getters
* support for ColorProperty -- for Color
* support for EnumProperty -- for any enum class
* support for IntProperty -- int
* support for DoubleProperty -- double
* support for IterableProperty -- any iterable
* support for StringProperty -- string
* support for TransformProperty -- Matrix4
* support for DiagnosticsProperty for any T that doesn't match one of the other cases

(at least)

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




Change-Id: Ie6875f49914e54d3b4539fcb51a231da688bdf18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119536
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-01 21:34:00 +00:00
Brian Wilkerson
6ec36b786f Generate a file for each compilation unit rather than for each library
Change-Id: I9a1e812115ba616d0bea57ad6e813c993d1e65d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119539
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-01 21:31:29 +00:00
Konstantin Shcheglov
cb9a35ca53 Issue 38565. Revert incomplete annotation constructor invocation inference implementation.
This partially reverts https://dart-review.googlesource.com/c/sdk/+/118901

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38565
Change-Id: I4d259a380985ce6e0670fc644594054b820b9bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119534
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 20:44:26 +00:00
Brian Wilkerson
431176ea26 Add non-nnbd-specific navigation
Change-Id: I7b641a89ed935000c54b6f769f50aaf634cdcda8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119531
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 20:15:36 +00:00
Nate Bosch
cbf6a233fc Call out tests as a valid use case for Exception
Based on a discussion where the current wording made it seem necessary
to create a `TestException` class for the sole reason of avoiding
direct usage of `Exception`.

Also remove usage of unnecessary `new` in doc.

Change-Id: I7abe84e8719af056b3f82e1d7e08faa9a641591d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118369
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-10-01 19:22:00 +00:00
Brian Wilkerson
d77f1c8674 Display reasons that are edges; annotate reasons from tests
Change-Id: If2703437a4654b2828fbd16f7dfb81ee99f7b874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119532
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-01 18:48:56 +00:00
Nicholas Shahan
b49d08fb01 [dartdevc] Allow dart:_runtime imports in modular tests
The modular test framework relies on temp files and a multi-root
file system. The uri of a script from this kind of tests uses a
specific scheme we can use to identify it and allow the import in
tests.

Change-Id: I94f81bac3a920546f1d33186fb9d9ca555d6cf8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119301
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-01 18:23:16 +00:00
Liam Appelbe
26c49d5578 [vm] Wasm memory exports, and emscripten hello world
I got the hello world wasm file from the emscripten team and got it
running using a fake implementation of WASI's fd_write function. This
necessitated adding support for memory exports.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I139a4e868d437e2232bf4260e5cc26d8c598ac2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119061
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-01 18:19:56 +00:00
Aart Bik
1b911958a5 [vm/fuzzer] split analyzer import from nightly run
Rationale:
Table generation uses the analyzers, but bots don't.
Change-Id: I75cda624244493e7bb81657add9e7401480971ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119528
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Felicitas Hetzelt <felih@google.com>
2019-10-01 17:52:26 +00:00
Nicholas Shahan
036c404076 [dartdevc] Copy subtype test into modular framework
Create ddc only modular test suite. Serves as the base for upcoming diffs adding
NNBD tests.

Change-Id: I03364a63074173f203a1aee7ef7ae4d6f1be90eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119485
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-10-01 17:33:06 +00:00
Paul Berry
5fee952514 Re-introduce Driver.useSummary2 getter.
This is used by published versions of analyzer_plugin, so removing it
would be a breaking change.  We'll remove it in a future breaking
change release of the analyzer.

Change-Id: I18f27dd32556e6d570b2a3747570a0595fdfa5d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119482
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-01 16:45:26 +00:00
Ben Hagen
082e82ed5e Remove optional new keyword when extracting widget
Closes #38655
https://github.com/dart-lang/sdk/pull/38655

GitOrigin-RevId: 63cd3a9cb6ac0efaa3dee38f5ba6443c17f0f7ba
Change-Id: I97aed6ad2dc740d7c7650aec1234873cab2ceac3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-01 15:59:45 +00:00
Daco Harkes
1103600280 [vm/ffi] Fix --enable-ffi=false test and bytecode pipeline
Closes: https://github.com/dart-lang/sdk/issues/38591

Change-Id: Ice3d7bb2502ef275e7ff65e7ada369111632fdea
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119323
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-01 15:17:52 +00:00
pq
470c5eab8e bump to linter 0.1.99
Change-Id: I40f4be96d6fc953ae536203f86360dda6139467a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119523
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-10-01 14:31:57 +00:00
Konstantin Shcheglov
dfe05e3f79 Don't compare bounds of TypeParameterTypeImpl(s).
Change-Id: I59ad8caaa74ad8ffbab0a8853b8a255a0a402a57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 14:27:42 +00:00
Konstantin Shcheglov
8e8d1e4061 Remove unused parts of AstRewriteVisitor.
With summary1 out we don't need this method and the flag.

R=brianwilkerson@google.com

Change-Id: I1d8d8e78f5a457294d5dc3500172b130dbe320ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 14:23:52 +00:00
Konstantin Shcheglov
21c26ab6d9 Issue 38641. Fix scopes for metadata resolution.
I found an issue during todays google3 presubmit.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38641
Change-Id: Ibfa53271405188147e7888c7e4c13bb1fdb40c82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 14:09:12 +00:00
Jens Johansen
05c75c096d [CFE] Merge DDC and bazel incremental modular entrypoint code
Change-Id: Ia6ff627d50131fb55817e0d1adf2bc15240aeec1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119338
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-01 13:56:32 +00:00
Jens Johansen
998f1efbe9 [kernel] Add test for keeping sources when loading concatenated component
This CL adds a test for what was fixed in
79cc54e519, namely that when loading a
concatenated component, the uriToSource map shouldn't have its values
overwritten with objects with no source in them.

Change-Id: Ief899295d0b4ab97cbfe598a39bb47441d38c3ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119542
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-01 13:14:52 +00:00
Jens Johansen
84848b1467 [kernel] Add VM pragma prefer-inline to certain methods in kernel serialization
In my measurements this changes the time it takes to write the sdk by
-11.1274% +/- 0.624366% (via slightly modified
pkg/kernel/test/binary_bench.dart AstToBinary out/ReleaseX64/vm_platform_strong.dill)

Change-Id: I4c5cbe17f42b70ef361b2edda0b33c8fc1727b63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-10-01 12:03:42 +00:00
Alexander Thomas
c09c81123d [infra] Update checked in SDKs to 2.6.0-dev.4.0
Update the checked in SDKs to avoid the dartfmt crash in dart_style
1.3.0 (https://github.com/dart-lang/dart_style/issues/855).

TBR=whesse@google.com

Change-Id: If9ab4036fd5691a87174ff2e7121e5c6ec238e34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119337
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2019-10-01 11:29:32 +00:00
Daco Harkes
fb1c5a6404 [cfe/ffi] Cleanup after constant-update-2018
Change-Id: I1e49471b39b5e044e918455f0713a83cdb352324
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119336
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-10-01 11:24:22 +00:00
Teagan Strickland
a2bb7301c5 [vm/compiler] Lift PC offsets out of StackMaps.
Instead of storing the PC offset inside the StackMap object, store it instead
in the `Array` containing `StackMap`s in `Code` objects. That is, the `Array`
provided by `Code::stackmaps()` no longer contains just `StackMap` objects, but
instead contains `Smi`s and `StackMap` objects in alternating fashion.  Each
`Smi` is the PC offset for the `StackMap` object that follows.

This ends up changing very little code outside of `StackMap`,
`Code::GetStackMap`, and `StackMapTableBuilder`, as there are only two types of
`StackMap` users:

* Users that call `Code::GetStackMap` already have the PC offset.
* Users that call Code::stackmaps() can just fetch the PC offset from the
  returned `Array` instead.

On 64-bit architectures, we will use more space to represent the PC offset
as a Smi in the Array than the old uint32_t field. However, the drop in total
number of StackMap objects due to an increased ability to canonicalize
them should offset this. On 32-bit architectures, we can only represent
30 bit PC offsets, not 32 bit PC offsets, but that shouldn't be a problem
in practice except for pathological cases.

_Numbers from building the Flutter gallery in android_release mode_

Since PC offsets are no longer in the `StackMap` objects, this enables
a lot more canonicalization than before. Previously, we generated
49379 `StackMap`s, but now we only generate 16139 `StackMap`s, just under
a third of the original number. This is because there were a lot of
`StackMap`s that differed only in their PC offset, and now they can
be canonicalized into the same `StackMap` object.

When building the Flutter gallery with android_release, the app.so size
drops from 11276896 bytes to 10908256 bytes, a difference of 368640
bytes, or 3.27%.

Using the AOT snapshot profiling support, we see the following drops:

Heap snapshot size drops from 10.7 MB to 10.4 MB.

`Code`              | Before  | After   | Difference
---------------------------------------------------------
Shallow size        | 352363  | 352363  | 0
Retained size       | 9114801 | 8796064 | -318737
Percent of snapshot | 81.2%   | 80.7%   | -0.5%

`(RO)StackMap`      | Before  | After   | Difference
---------------------------------------------------------
Shallow size        | 49381   | 16141   | -33240
Retained size       | 893965  | 286613  | -607352
Percent of snapshot | 7.97%   | 2.63%   | -5.34%

`StackMap`          | Before  | After   | Difference
---------------------------------------------------------
Shallow size        | 844584  | 270472  | -574112
Retained size       | 844584  | 270472  | -574112
Percent of snapshot | 7.53%   | 2.48%   | -5.05%

As we'd expect from the `StackMap` numbers above, we end up using a little
under a third of the space for `StackMap`s. We actually use even less space
(32.0% of the original) than the drop in `StackMap` numbers (32.7%), because
each `RawStackMap` instance is 32 bits smaller due to dropping the `pc_offset_`
field. Note that even though these PC offsets now show up in the
`Code::stackmaps()` `Array`, we can see this is still a net drop in space used
by looking at the retained size of `Code` objects.

Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: I0910a43e7a5a7e2e721676209196be1884c5a71c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119147
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-01 09:12:22 +00:00