Commit graph

68232 commits

Author SHA1 Message Date
Samir Jindel 6a8aae0095 [vm] Enable Dart VM to run in QEMU user-mode emulation for ARM.
Normally we consult /proc to determine the host architecture. However, this
reports the actual host architecture, not the QEMU-simulated one.

Also, GDB cannot debug position-independent executables in QEMU, so we disable
PIE when compiling for execution in QEMU.

Pass '--use-qemu' to 'gn.py' to build for QEMU.

Change-Id: Ib125127ceb0582b66754cfc0da22e09d224ee1e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125267
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-18 16:58:53 +00:00
Brian Wilkerson 1ae6f1b031 Support for creating and displaying edits in the preview tool
Change-Id: I2284ceeb0229d7111022eb3759e39752264f1bc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125492
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 16:14:43 +00:00
Konstantin Shcheglov 8fbb053092 Issue 39021. Guard against invalid generic type alias, without function type.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/39021
Change-Id: I0259ef04f95e1935ca273b5540aafb069c7ad455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125526
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 16:06:53 +00:00
Konstantin Shcheglov fe3fadbdba Issue 39025. ForEachPartsWithIdentifier does not define anything, don't pretend that it is a LocalVariableElement.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/39025
Change-Id: Ieda56c73a1928434a29aa947c44fc29b66a79464
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125525
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-18 15:44:13 +00:00
Konstantin Shcheglov 3a17bebf9c Issue 39028. Guard against mixin constructor in FieldFormalParameter completion.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/39028
Change-Id: I78e4df6baa8424231aeb2c8044d9cb5c685dcdbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-18 15:36:48 +00:00
Konstantin Shcheglov 2a5d00bcd2 Issue 38992. Build annotation elements for type parameter elements on their creation.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38992
Change-Id: I98f7690914ce2acb7074a8333b9a482605bb9afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125527
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-18 15:36:08 +00:00
Konstantin Shcheglov aa0cf44b05 Issue 38506. Don't attempt to use LibraryElement.metadata for not the first LibraryDirective.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38506
Change-Id: Ib76b1e81554f061622ec98fae21b4dd9a1280c24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-18 15:28:45 +00:00
Konstantin Shcheglov 6df2491743 Issue 38551. Fix for reading references to PropertyAccessorElement(s) defined in extensions.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38551
Change-Id: Id93714a2db97ff1ab448fe408f4e86df9988a147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-18 15:28:03 +00:00
Johnni Winther 7c1f58f9fe [cfe] Demote inferred type variables when used as type arguments
Closes #39346

Change-Id: I997347d04e7a3c3cb9786f31cd6c24513307de92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125502
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-18 14:57:43 +00:00
Samir Jindel 16af4b7355 [vm] Set all entrypoints when reading JIT snapshots.
Fixes https://github.com/dart-lang/sdk/issues/39397

Change-Id: I328f6707e9f316decb5207cc11872886431fe5f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125410
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-18 14:47:53 +00:00
Clement Skau 369fdb7cb2 [SDK] Fixes FORCE_INCLUDE_DISASSEMBLER build in PRODUCT.
CodeObservers is not available in PRODUCT, but FORCE_INCLUDE_DISASSEMBLER will
enable code that uses (but doesn't strictly need) it.

This is related to https://dart-review.googlesource.com/c/sdk/+/125404.

Tested:
  ./tools/build.py --arch x64 --mode product dart_precompiled_runtime gen_snapshot
Change-Id: I5f0c0765a608b50704045c918b41c71398b89390
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125263
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-11-18 14:38:03 +00:00
Jens Johansen 043885676c [CFE] Mark initializer as inferred and don't redo work
No reason to do the same work twice.

Change-Id: I8cea469f91dc7087b31bb80352723f0158dcaa6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125402
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-18 13:50:43 +00:00
Jens Johansen 06e6554d2e [CFE] getFormal via Identifier (name and offset) and not just String (name)
Change-Id: I78059e627edaf8876eee74f878b36cfce990b78f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125265
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-18 13:48:53 +00:00
Jens Johansen edbff4eae7 [CFE] Encapsulate 'Stack' and create DebugStack as an option
Change-Id: Ib3dd188e3b2c65d6e6824487ae7794fe9214bfbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125264
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-11-18 12:44:13 +00:00
Martin Kustermann aceeba7567 [vm/async] Encode the yield index -> token position in PcDescriptors.
Right now `Script::yield_positions()` is an array mapping function start
token positions to arrays. Those arrays contain token positions and are
indexed by yield index.
  => This `Script::yield_positions()` is not available in AOT mode.

The fast async stack implementation will need to be able to find out
where an async closure was suspended. It does so by looking at the
":await_jump_var", which contains the yield index. It then needs to
associate the yield index to token position of the yield.

This CL adds an entry into the PcDescriptors for every yield in a
async/async* function and removes `Script::yield_positions()`.
The entry will associate the yield index with the token position.

Flutter gallery total size impact for flutter-release:

  - armv7: +0.016%
  - armv8: +0.045%

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

Change-Id: I0b2ce41e85d8f5d590201bf2fb091578d7379890
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125408
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-18 11:50:13 +00:00
Johnni Winther 129565a71d [kernel] Handle property invocation in MethodInvocation.getStaticType
Change-Id: I4a1ecdb9842f4f189be67e5f5d1b99ddb40d41da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125202
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-18 10:15:08 +00:00
Clement Skau 706c54f763 [SDK] Adds disasm. flags for FORCE_INCLUDE_DISASSEMBLER.
This CL enables passing --disassemble to e.g. a product mode gen_snapshot
which used to not have the flag even when the disasm. was forcefully
included.

This CL also:
- Fixes numerous typos: marco -> macro.
- Reorders the _four_ types of flags in order of strictness.

Change-Id: I8e3ef75ea0a748a6af5fa48cf289a57beeb51148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125404
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-18 10:11:38 +00:00
Karl Klose 696069c9a2 [infra] test.dart: Download build results while running the tests
Change-Id: Ieb92069e08d9a1df8e0692b27086616b4d71e66e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124329
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-11-18 10:07:03 +00:00
Johnni Winther 9e03a639ea [cfe] Split inferMethodInvocation into invocation variants
Change-Id: I4ca0cb419652b4d822d8eb945a77b7243012ed1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125411
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-11-18 10:03:33 +00:00
Johnni Winther 764926f37d [cfe] Use BinaryExpression in compounds
Change-Id: I82c420bbc2e6d85eef0d602c3993487b78e91f19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125409
Reviewed-by: Jens Johansen <jensj@google.com>
2019-11-18 10:03:33 +00:00
Jens Johansen 29f127d055 [CFE] Clear initializers unconditionally in prepareInitializers
There doesn't appear to be any reason to guard the clearing,
and in a future CL it makes sense for it to always be cleared.

Change-Id: Id75a0ceb51dff474f20ac5aa5a05e56e49c00698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125401
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-11-18 08:46:13 +00:00
Stephen Adams ed6dd5b79b [dart2js] Address new UNUSED_ELEMENT warnings
Change-Id: I391b32a5d0753215773b1849c3a953258d3c435e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125490
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-11-16 20:59:52 +00:00
Lasse Reichstein Holst Nielsen 7b67303318 Make json.fuse(utf8) work correctly.
Change-Id: Ie4d5164759c1d4a8c19e216bfac50b116271f1a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125342
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-11-16 13:45:59 +00:00
Johnni Winther 4b5589e0cb Reland "[cfe] Use StaticTypeContext for getStaticType" and more"
This relands commits
 "[cfe] Use StaticTypeContext for getStaticType"
 45033c6ad9

 "[cfe] Move caching of thisType to CoreTypes"
 fab25cbe0c

 "[vm/bytecode] Notify static type context when entering/leaving library"
 c9f88ae253

Change-Id: I407d6b0e3b3df503cedc9fcb2c834d835cf083f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125343
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-16 05:50:58 +00:00
Brian Wilkerson c96fe4e006 Add more explaination to existing examples
Change-Id: I2f89ef54eb4467d23f7507c1217385a1df2d4a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124594
Commit-Queue: Kathy Walrath <kathyw@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2019-11-16 02:52:18 +00:00
Régis Crelier 8617da2bf0 [VM/nnbd] Pass NNBD mode to runtime functions whose semantics depend on it.
Runtime functions do not yet implement the NNBD semantics.
In a next change, generated code will pass NNBD mode to the runtime.
Declare one new VM flags: --strong-non-nullable-type-checks

Change-Id: I050a468e4a6b665ce46c345bafba04a947cf7cb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124105
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-11-16 02:49:48 +00:00
Ryan Macnak d6b0a27665 [test] Explicitly mark streamed_conversion_json_utf8_decode_test as slow in reload test modes.
Change-Id: I60777b0fd3a20b340b12225a24529474eb75b2af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125483
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-11-16 01:14:28 +00:00
Ben Konyi 1c12878d05 [ dart:io ] Added timeline events for HttpClient connections and requests
Setting the `enableTimelineLogging` property of `HttpClient` to true results in
timeline events being created for HTTP connections and HTTP requests.
Timeline events contain general connection information, including:
  - Request type
  - Status code
  - Request / response headers
  - Cookies
  - Non-sensitive proxy information
  - Relevent error messages for failed connections

Change-Id: Ibe16a312ab5398c9ae886ea07bea5ca70b63e440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-11-16 00:46:46 +00:00
Ryan Macnak 545b10389d [vm, service] Compute allocation stats on demand, instead of during allocation and GC.
Removes support for accumulators, which now repeat the current live values.
Decreases performance difference between release and product modes.
Fixes inaccuracy when counters are queried before the first full GC.

Golem geomean   x64 4.687%
Golem geomean arm64 5.770%

Bug: https://github.com/dart-lang/sdk/issues/37678
Change-Id: I12b26a9834b0f0f911ddcc6e8e5ff4573272607d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116885
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-11-16 00:22:56 +00:00
Nicholas Shahan 6239777983 [dart2js] Fix a few missing and one unneeded covariants
Change-Id: Ic5fe4ec2230b233301c628fee8436471a0dbfdb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125445
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-11-16 00:08:06 +00:00
Kallen Tu a2fe9d450e [analyzer] Report invalid variance positions in methods of a class.
Change-Id: I425f81e7e64a02b29e094dab53f37318a09a3c62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125228
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-15 23:55:19 +00:00
Liam Appelbe 329d0913ca [vm] Late modifier for non-final local variables.
I also added a test for top level late variables (they already worked).

Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I6720e6476a067c7f8b21a34b87b23ab14fc866a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125224
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-11-15 23:03:16 +00:00
Ryan Macnak a8b3773054 [vm, reload] Guard against field loads that no longer conform to the field's static type.
Fix incorrect type arguments when noSuchMethod forwarders allocate Invocation's typeArguments.

Change-Id: I0fd2782bc96f500f31dbbdd2aa896c8caf1f0045
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123692
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-11-15 22:55:26 +00:00
Paul Berry 33c95a8508 Migration: account for definite assignment.
Fixes #38344.

Change-Id: I64d17fe1e571fc708632c0e48b6556e2094a91e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125443
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-15 22:38:36 +00:00
Jaime Wren f3ee4d0fe5 Add a failing test case for http://dartbug.com/39401 -- quick fix improvement around angular generated files
Change-Id: I784baefaa41db4e45c183335b73e7bb33991070a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125464
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-11-15 22:30:16 +00:00
Sam Rawlins 15e5c23167 nnbd preview tool: Better text when inserting 'required'
Helps with #39247

Change-Id: I3bb7b25c73d58fc49260d6e3019b58b2f3f6b80a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125440
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-15 22:20:16 +00:00
Kallen Tu 6ec813e07a [analyzer] Modified type inference constraints wrt variance.
Change-Id: I0502bad1c57af358453c78d27fe738880beb7b4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125021
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-15 22:02:36 +00:00
Paul Berry 249a9172f7 Migration: don't mark fields as nullable due to factory and redirecting constructors.
Change-Id: I4b60a2bea125089d86e2368b3e674adf5ef402aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125460
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-15 21:08:06 +00:00
Fizaa Luthra ea6c7f29fa [fuzzer] Added void functions to the API table
Change-Id: I048607903ba15f604a9d0784b75061ac0d0d397c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125305
Commit-Queue: Fizaa Luthra <fizaaluthra@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-11-15 19:07:54 +00:00
Mike Fairhurst a6635d006b [nnbd_migration] Show "exact nullability" in output directory.
Change-Id: I29545fe358282aa05dee10ed7ff5e86ea899581e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125222
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-15 18:27:24 +00:00
Sigmund Cherem 557ed605de Temporarily do not enable nnbd when building packages for ddc tests
This will make the nnbd-ddc bot green again. To properly support compiling these
packages in the future, we need to either migrate them or add to the CFE the
machanism to select whether a package is opt-out.

Change-Id: Ia8c5fa1a8000e233af20c87e877e2c666cb4354e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125420
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-11-15 17:49:43 +00:00
Kallen Tu 89dc1a791e Updated analyzer error messages in variance_multi_subclass_error_test.
Change-Id: If3e85c8cc6a92cdafe146769628ea5c11a5bfcab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125362
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2019-11-15 17:16:25 +00:00
Erik Ernst d290f1cec2 Add nonfunction-type-aliases experimental flag
Change-Id: I203af5227ecfee8c9e6b0f4985f68e38a18553c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125203
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-15 17:04:15 +00:00
Brian Wilkerson faa4eb7808 Partial support for an incremental workflow
Change-Id: Ibc18be75d5b4aada7c27cdfae559bd829bd50215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125421
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-15 17:01:45 +00:00
Martin Kustermann c5b87f2a01 [vm] Disable entire test (apparently status files can no longer disable individual multitests)
Change-Id: I9f7be990c28a76e124b8a54b7bcc0df76d64b9fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125406
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-15 16:58:48 +00:00
Erik Ernst fdb9d19826 Added aliases and nonfunction to kernel spell check lists
Change-Id: I1d1affaba8b9ac473ecf645d2dc21fe9ffd16ae1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125405
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-15 16:21:22 +00:00
Alexander Markov 03c3eff5dd [vm] Support JIT exception handling in DART_PRECOMPILER mode
DART_PRECOMPILER define is used when building gen_snapshot and
run_vm_tests. Both gen_snapshot and run_vm_tests support AOT and
JIT modes, selected by FLAG_precompiled_mode.

Before this change, DART_PRECOMPILER always used AOT exception
handling (catch_entry_moves_maps). This works fine even if code is
generated in JIT mode, but it is not compatible with JIT exception
handling. run_vm_tests uses kernel service which comes from app-jit
snapshot (on x64), which is generated in JIT mode with JIT exception
handling. This causes crash if there is a Dart exception in kernel
service.

This change adjusts exception handling in DART_PRECOMPILER mode to
support both AOT and JIT implementations and select one using
FLAG_precompiled_mode.

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

Change-Id: I6c9ce05552a98bd4eeaea18c082a98e9bdbe9460
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125302
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-11-15 16:14:15 +00:00
Martin Kustermann 5f18b77d39 [vm/reload] Disable vm/dart/isolates/spawn_function_test/0 until full IG reloading is implemented
The test explicitly passes --enable-isolate-groups (off by-default in JIT).
It will be enabled once full hot-reload with multiple isolates in one IG is implemented.

Change-Id: I8c71a948406f6911c450161a3b5b0b0c0519b0d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125403
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-11-15 15:54:55 +00:00
Martin Kustermann 20962e656b [vm/concurrency] Split up IsolateReloadContext into IsolateReloadContext/IsolateGroupReloadContext
Similar to the split of ClassTable into ClassTable/SharedClassTable,
this CL splits up the IsolateReloadContext into:

  * IsolateGroupReloadContext: Consists of reload-related information across all
    isolates. The [Reload()] method is split up in phases that are
    performed on all isolates before the next phase is started.

    => This allows each isolate to add reasons for rolling back, if no
       reasons are found the reload will be accepted atomically.

  * IsolateReloadContext: Constists of reload-related information for a
    particular isolate (e.g. mappings of old to new classes)

The assumption is that all isolates have the same source (and therefore
the same libraries). For certain things, e.g. discovering which libraries
changed, it is necessary to examine the object store. We use the first
isolate in a group (but could use any of them) to do so, since the
isolate group does not have this information atm.

This is a preparation CL for supporting hot-reloading multiple isolates
within one isolate group. Though the support in this CL stays at having
only a single isolate in a group.

  => This CL turns off FLAG_enable_isolate_groups in JIT mode.

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

Change-Id: I7f4d536d4f5ab4a2a73fb0c7618ba967c9b77234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123254
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-11-15 14:08:45 +00:00
Jens Johansen c37ca05357 [CFE] Plug memory leak in incremental compiler
This CL adds a non-test, "incremental_dart2js_tester.dart" that via the
incremental compiler compiles dart2js, and then invalidates every file
one by one.

This caused a lot of memory usage and leaks was found and plugged.

Memory usage before:

  3.5e+07 +----------------------------------------------------------------+
          |      +      +       +      +      +      +       +      +      |
          |                                          *   **  **VS********* |
    3e+07 |-+                                       **  *** ******** *** *-|
          |                                     *  *** ** *** *** *      * |
          |                                 ** ***** ***   *             * |
  2.5e+07 |-+                               *******   **                 *-|
          |                             ** ****  *                       * |
          |                          * *****                             * |
    2e+07 |-+                     * **** **                              *-|
          |                    ****** *                                  * |
  1.5e+07 |-+               ****** *                                     *-|
          |               ***** *                                        * |
          |             *****                                            * |
    1e+07 |-+        *****                                               *-|
          |       *****                                                  * |
          |    *****                                                     * |
    5e+06 |-+****                                                        *-|
          | ***                                                          * |
          |**    +      +       +      +      +      +       +      +    * |
        0 +----------------------------------------------------------------+
          0     100    200     300    400    500    600     700    800    900

(i.e. it peeks at about 30 GB of ram usage)

Memory usage now:


  1.6e+06 +----------------------------------------------------------------+
          |      +     +      +     +      +     +      +     +  *   +     |
  1.5e+06 |-+                        *        *      *    *    VS* *******-|
          |                    *  *  ** **    *      *    *      *         |
          |                *** *  *  ** **    *      *    *      *         |
  1.4e+06 |-+*  * * *  *   *** *  *  *****    *      *    *      *       +-|
          |  *  * * *  *   *** *  ** *****    *  ************************  |
  1.3e+06 |-**  *** ** *  **** ***** *************************************-|
          | ******* ** *  ********** **** ******************************** |
          |****************************** **********                       |
  1.2e+06 |*********************                                         +-|
          |*****************                                               |
  1.1e+06 |**** *                                                        +-|
          |**                                                              |
          |*                                                               |
    1e+06 |*+                                                            +-|
          |*                                                               |
   900000 |-+                                                            +-|
          |                                                                |
          |      +     +      +     +      +     +      +     +      +     |
   800000 +----------------------------------------------------------------+
          0     100   200    300   400    500   600    700   800    900   1000

(i.e. it peeks at about 1.4 GB of ram usage)

Change-Id: I22f8d9e935dec1e50baa2cbd7ac5724880d6c886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125344
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-11-15 13:52:35 +00:00