Commit Graph

13143 Commits

Author SHA1 Message Date
Filip Filmar 63d4797fbe Sets the loading path for tzdata
Fuchsia has a fixed path in which tzdata is offered to
running programs.  This change sets the env variables
that point to the data.

Fixes #39861

Change-Id: Idf669fa72bda3278bfbdae2a95b0381769f6e698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129301
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-10 21:53:02 +00:00
Ryan Macnak 4f1270655c [vm, gc] Sweep non-executable large pages concurrently.
In some workloads, the heap is mostly large pages.

Move large executable pages from the large list to the executable list. They do not require special treatment because they are large during sweeping because we never truncate an Instructions object. They still require being swept immediately because they are executable so that code protections can be flipped before resuming Dart execution.

Fix off-by-one errors in SnapshotGraph.objects and SnapshotClass.instances discovered as a result of the large page list changing from prepending to appending.

Bug: https://github.com/flutter/flutter/issues/48360
Change-Id: If6d9137fd36c9b18205493166d586b9a7cee4b1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130823
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-10 21:12:51 +00:00
Artem Serov 3cc3bc00e4 [runtime/vm] ARM64: Use shared stubs for BoxInt64Instr.
Use a shared allocation stub for _Mint class for BoxInt64Instr,
avoid SlowPath emission.

This change improves Flutter Gallery code size by:

Instr: -2.4%.
Total: -1.4%.

Change-Id: I033340b8548fe3822a57829579142d33bc1ef37f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126720
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Victor Agnez Lima <victoragnez@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-10 19:30:01 +00:00
Artem Serov 966d795f4e [vm/compiler] Fix Mint allocation stub runtime entry and test.
* Fix .dart test which didn't exersize the shared stub going into
   runtime.
 * Fix AllocateMint runtime entry int constant choice so it
   doesn't fit a Smi on all targets, not only 32-bit ones.
 * Make MintAllocation stubs go to runtime when
   FLAG_shared_slow_path_triggers_gc is set for testing purposes.

Change-Id: I699f36c70d055af7bd17a16f81b92b9e9d87580c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129703
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-10 19:30:01 +00:00
Artem Serov 735f128889 [vm/compiler] ARM64: Improve compare and branch with zero.
Use tbz/tbnz/cbz/cbnz instructions where possible.

This change improves Flutter Gallery code size by:

Instr: -0.25%.
Total: -0.16%.

Change-Id: Ie4e28f2facb9bfbc150a297fdc030d911d40925c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129441
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-10 19:18:51 +00:00
Teagan Strickland 26c88bbb74 [vm/compiler] Clean up ELF creation code.
Instead of making the ELF object handle stripping and keep track of two
possible output stream, just revert ELF objects to only output to a
single stream. Now, layers that use ELF, like the ImageWriters, handle
the stripping by deciding whether or not to add certain sections or
static symbols to the generated ELF, and we create separate DWARF
objects for each unstripped ELF object.

We also avoid duplication of writing segment and section table entries
by just creating special Sections that correspond to reserved entries,
the program table header entries for itself, etc, and then move the
section and segment entry writing into Section itself. We also lift
a lot of the same calculations used in subclass construction to the
Section level, and replace the old fields with four different kind
of object members:

* Fields that are known at construction time and thus now const
  (e.g., section_type)

* Fields that are not known at construction time that have reasonable
  defaults for most instances and so need not be changed from their
  default value (e.g., section_link)

* Fields that are not known at construction time which must be set once
  (and only once) before use. These are now accessed via getters/setters
  that check whether or not the field has been set (e.g., section_name)

* Fields that are calculated from the contents of the particular
  subclass, which are now just methods (e.g., FileSize())

We also change the snapshot profile writer test to test the size of
internally stripped ELF output on all platforms without running it
through an external stripping utility (previously untested), and test
assembled or externally stripped output on more platforms where we
support those. Instead of depending on pkg/vm/tool/precompiler2 for
assembling (which always uses gcc), I've added assembleSnapshot and
stripSnapshot to use_flag_test_helper.dart, which mimics the way the
test_runner determines the executable and flags to use.

Change-Id: I4ade45c5caffb443abb3f5c567343504c8085f89
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129083
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-10 11:51:57 +00:00
Jens Johansen d5b01a1960 [VM] Ignore dart scheme scripts in isolate reload
After cl/128585 landed a app-jit failure started throwing an error:
>testee>err> kernel-service: Error: Unhandled exception:
>testee>err> Bad state: No element
>testee>err> #0      Iterable.first (dart:core/iterable.dart:520:7)
>testee>err> #1      MappedIterable.first (dart:_internal/iterable.dart:374:31)
>testee>err> #2      lookupOrBuildNewIncrementalCompiler (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:400:45)
>testee>err> #3      _processLoadRequest (file:///b/s/w/ir/cache/builder/sdk/pkg/vm/bin/kernel_service.dart:679:22)
>testee>err> #4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
>testee>err>

This is caused by the change ultimately adding scripts for the used
mixed in files in "LoadedScripts".
In this case "dart:collection/map.dart" (as I recall) was added to it.
When reloading the source, it runs through all libraries that
"isn't dart scheme", and for all of those libraries through all scripts
reported by LoadedScripts for that library (now including something from
the platform), and checking if it has been modified. Checking if it is
modified only works for file:/// uris through, which platform files aren't,
so it just reports true (i.e. the file is modified).
This is then passed to the kernel service which - based on the list of
one file modified - somehow concludes that it has a compiler already
(which it doesn't) and then crashes.

This CL fixes this specific issue by also skipping scripts that are
"dart scheme".

There's still an underlying issue that has nothing to do with cl/128585
though. I'll comment on that in the bug
(https://github.com/dart-lang/sdk/issues/39869).

Bug: 39869
Change-Id: I1a3f2de888ec53c40f4b6b46a369595abae5bb44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130374
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-09 07:55:27 +00:00
Alexander Markov f4e61eacfd [vm/compiler] Remove PushArgument instructions from IL up to AllocateRegisters
PushArgument instructions are removed from IL while it is constructed and
optimized. Before allocating registers, PushArgument instructions are
inserted immediately before call instructions. On ARM/ARM64 subsequent
PushArgument instructions are generated using store multiple (STM) / store
pair (STP) instructions which reduces size.

Flutter gallery in release mode after this CL and https://dart-review.googlesource.com/c/sdk/+/129324:
arm: instructions size -1.4%, total size -0.83%
arm64: instructions size -1.43%, total size -0.83%

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

Change-Id: I61493c72306c3ade4d9850e0dfc17e7e943a14c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128481
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-09 01:37:27 +00:00
Alexander Markov 9b555ca6d3 [vm/compiler] Remove PushArguments from AllocateObjectInstr
Issue: https://github.com/dart-lang/sdk/issues/39788
Change-Id: Ideda280bce1e8a4b463f47d950c1a32b48e7b204
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129324
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-09 01:37:27 +00:00
Ryan Macnak 361f4abfe0 [vm, gc] Add missing check to begin concurrent marking during large page allocation.
Bug: https://github.com/flutter/flutter/issues/48360
Change-Id: Iaa869bc5c1d4f85481e3ff89d6af16eba893f756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130737
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-09 01:02:48 +00:00
Régis Crelier e2e290b4cf [VM/nnbd] Simplify NNBDMode enum class.
NNBDMode does not reflect the semantics (legacy or nnbd) of type tests anymore.
Instead, the semantics are derived from the value of the strong mode flag.
This required one function to be specialized, namely the implementation of
'null is Type' in weak mode in an opted-in library, which still requires
nnbd semantics although run in weak mode.
Relevant changes are in object.h and object.cc:
- methods NNBD_NullIsInstanceOf and NNBD_IsTopType are new.
- methods IsNullType, IsTopType, and IsNeverType are modified.

Change-Id: I36cd43d93d2cfabd110cbcc6b26487a583bb089d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130444
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-08 19:35:00 +00:00
asiva ac4b43f0a8 [VM/runtime] - Remove DART_NO_SNAPSHOT
- Remove the define DART_NO_SNAPSHOT in all the build configs
- Remove all conditional code under DART_NO_SNAPSHOT

Change-Id: Ia01d09de7c4b1813a5e172a630950e637e476713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130566
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-08 18:56:21 +00:00
Teagan Strickland 3dd8a3b2f3 [vm] Populate VM isolate group source data and instruction pointers.
Change-Id: I1fcdf4a58c4a9b6bd24b4b90fa7048031ec3af12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130702
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2020-01-08 15:15:08 +00:00
Ryan Macnak 5b8c4e8024 [vm, service] Speed up generation and transmission of heap snapshots.
- Remove server-side transmission bottleneck in WebSocket compression.
 - Remove client-side transmission bottleneck in response inflation.
 - Remove generation bottleneck and memory overhead of WeakTables by using a finger table.

On dart2js self compile, 1.5GB heap, 400MB heap snapshot
Time to generate and transmit:    46 -> 5s
Auxiliary memory for WeakTables: 537 -> 1.5MB

Change-Id: Ia58e2ffb942e5d29536e175d9caedd2bf835981a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130621
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-08 03:22:59 +00:00
Samir Jindel 8a39cb8f66 [vm] Enable multiple entry-points on IA32.
Issue https://github.com/dart-lang/sdk/issues/34162

Change-Id: If3ca8448012dd1e3dc6e5f638e24202f53ccaf60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129716
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-07 17:05:44 +00:00
Régis Crelier 482ae8cb5b [VM/nnbd] Implement weak and strong mode type checking in runtime.
This does not yet include checking of required named parameters.
Also, inlined type testing code, type testing stubs, and type propagation are
not yet updated.

Change-Id: If6d8996635474e349d28b7fd207d724838d08881
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129922
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-06 22:32:19 +00:00
Alexander Aprelev 85e396a1de [vm/fieldtable] Move current field values out of Field object into separate table.
This is to support sharing of Field objects between isolate group's isolates.

Each isolate will have it's own field table with static instances/values.
field_table is stored on isolate, copied over to thread for easier access.

This also removes the write barrier from static field assignments; the field table is a GC root.

Bug: https://github.com/dart-lang/sdk/issues/37835
Bug: https://github.com/dart-lang/sdk/issues/36097
Change-Id: I232a86f059ac4cacc3e9f54bcc31d1d0524f9496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127582
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-06 18:58:11 +00:00
Martin Kustermann 16697697d4 [vm] Read causal-async-stacks/lazy-async-stacks from snapshot (instead of requiring AOT runtime to pass same flags as in compiler)
We already do this for "use-bare-instructions" and "dwarf-stack-traces". This
CL does the same for "causal-async-stacks" and "lazy-async-stacks".

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

Change-Id: I44136299858b3b72e8a3a176234f5051d6b61c1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130364
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-01-06 12:15:59 +00:00
Alexander Markov 0380d3a90e [vm/compiler] Do not use specualtive unboxing for Phi instructions in AOT
When inserting Unbox instructions in SelectRepresentations pass, their
speculative mode depends on the instruction which uses corresponding
value. Phi instructions were using default kGuardInputs mode, which may
cause insertion of speculative Unbox instructions in AOT mode.
Such Unbox instructions may need deoptimization if type of an argument
changes during optimizations. Generating code for such Unbox
instructions causes assertion failure (in debug mode), or crash in
release mode.

The fix is to change speculative mode of Phi instructions in AOT, so
they won't cause speculative Unbox instructions.

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

Change-Id: Ic9c9957875fd775fe1c02f3666829f26dad64937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130063
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-01-03 21:15:19 +00:00
Alexander Markov ff43a04d77 [vm/compiler] Fix crash in StringInterpolateInstr::Canonicalize
If OSR happens while calculating an argument of string interpolation,
array of arguments may be Phi and not CreateArray instruction.
In this case, canonicalization of StringInterpolate should gracefully
return instead of crashing. Such OSR may happen due to control flow
collections.

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

Change-Id: Ibf35a0f0ebb20d5a44102f7ddfd4e91925d7c6ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129900
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-03 18:26:19 +00:00
Martin Kustermann addd5eea00 [vm/compiler] Consistently use pc-offsets of pointing to instruction after call in static calls table, to ensure unique offsets
The pc-relative calls were recorded with pc-offsets pointing to the start of the
call instruction, where as code-based calls were recorded with
pc-offsets pointing to the next instruction (i.e. return address).

This is inconsistent and caused us to hit an assert in
`Code::set_static_calls_target_table`. The assert was benign, but it is
good to maintain the uniqueness guarantee in the static calls table, so
we'll unify the encoding to use offsets to the instruction after the
call in both cases.

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

Change-Id: Id0305befd78f09ed0b0e100f39641bca9e764442
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129717
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-01-03 17:17:59 +00:00
Samir Jindel 445ae73b32 [vm/tfa] Use pragma to pass type arguments to exact return types.
Change-Id: Ie2a1de07653c53e8b9506c54a0a66a5fe6503b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129160
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-03 14:08:19 +00:00
Ryan Macnak 5804537b83 [vm, timeline] Following switch from Duration events to Begin-End event pairs, avoid separate native call transitions to query the monotonic and thread clocks.
Bug: https://github.com/dart-lang/sdk/issues/39727
Change-Id: Ie38947c63845f13d660cb4a367681fed31796473
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128564
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-02 23:13:06 +00:00
Ryan Macnak f6677c3862 [vm, service] Account for image pages in the capacity reported by heap snapshots.
The VM does not include image pages in its usual accounting of heap usage and capacity because they are immortal and don't contribute to marking or sweeping work. The heap snapshot does include objects on these pages, so it should include the pages in its notion of usage and capacity, otherwise the heap-snapshot can effectively claim it has more usage than capacity.

Fixes negative fragmentation reported by the heap snapshot page.

Change-Id: Ib9f3c395ee5a6e51ee9b4c9a834843851426910d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128565
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-01-02 21:26:59 +00:00
Alexander Markov ad12931304 [vm/compiler] Remove PushArguments from ThrowInstr, ReThrowInstr
Issue: https://github.com/dart-lang/sdk/issues/39788
Change-Id: Ic47d3b57a35182162848df61495f8963afd55fc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129321
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-02 19:41:46 +00:00
Alexander Markov 2477378537 [vm/compiler] Refactor PolymorphicInstanceCallInstr
This change hides InstanceCallInstr inside PolymorphicInstanceCallInstr
and makes sure that PolymorphicInstanceCallInstr owns its arguments
(which would become critical once call arguments become instruction
inputs).

Also, PolymorphicInstanceCallInstr now extends TemplateDartCall which
makes it possible to avoid duplication of methods related to all calls.

Issue: https://github.com/dart-lang/sdk/issues/39788
Change-Id: Ie3d4ff46a8e99a0988ba88a88ca9a60be8503ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129307
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-02 19:09:36 +00:00
Daco Harkes b8a679ab88 [vm] Fix IntConverter canonicalization
The check of not removing 64-bit->32-bit truncating conversions was in the wrong place.

Fixes: https://github.com/dart-lang/sdk/issues/39885
Fixes: https://github.com/flutter/flutter/issues/47454

Change-Id: Ic32a13cbf7ec622692cdca86b3237dae1c0f1cef
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129284
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-02 12:43:36 +00:00
asiva b52d264f5b [VM/runtime] Address code review comments.
Change-Id: I6d33b5d522e32f29ffefc7282b2fbe09b1db6a7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129811
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-12-27 21:27:35 +00:00
Ben Konyi c2734309f0 [ VM / dart:typed_data ] Fixed more cases where null was a valid parameter for typed data functions in AOT
Fixes https://github.com/dart-lang/sdk/issues/39812

Change-Id: I66d5808d16b203b8e50e77631203eca6f4452c07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129743
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-27 20:04:35 +00:00
asiva 8e4421a95e [VM/runtime] Conditionally include kernel/service isolate code
- Do not include the kernel isolate code in the precompiled runtime
- Do not include the service isolate code in PRODUCT mode

Change-Id: I6c49a9d4b3523205d1d70d1c6e5743b809ef3212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129807
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-27 19:46:15 +00:00
asiva b1c6d89fb0 [VM/runtime] Remove support for loading URLs through service isolate
- Removes the load port functionality from the service isolate, this was
  used to load sources in Dart 1 and is pretty much dead code in Dart 2
- Moves resolution of URIs and Package URI (based on package map) to the
  individual isolates instead of sending a request to the service isolate
- Setups the package map lazily as it is needed only if resolveURI is
  called in Dart code, it is not needed for loading/compiling sources
  (this is now done in the front end).
- Removed Dart_ServiceWaitForLoadPort() methods from the Dart C API as
  it is not used anywhere.

Change-Id: I6c3704bc431bdcd49bf074eb58bee1ed492ccccb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129742
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-27 17:30:05 +00:00
Ben Konyi 93c9ebabd6 [ VM / dart:io / Service ] Add service extension RPCs to dart:io to allow for HttpClient.enableTimelineLogging to be set remotely.
It isn't possible to do this with evaluate since we are unable to access
classes from private libraries exposed through dart:io like dart:_http.

Change-Id: I3d4168d919dbcf5008da60b14165fd9b89f22cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129322
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-12-26 23:23:34 +00:00
Ben Konyi 017ea8b54a [ VM / dart:io ] Added lastReadTime, lastWriteTime to socket profiling
Change-Id: I8dc7c271b44bdecf5fcc081c1324ce809ca9c140
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129562
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-12-26 16:22:34 +00:00
yuanhuihui 006f611a2b support more sync event when use systrace to record timeline event
sync event is not included in the systrace, such as Timeline.startSync.
more detail, see https://github.com/dart-lang/sdk/issues/39727

Signed-off-by: yuanhuihui <gityuan@gmail.com>
Bug: issues/39727
Change-Id: I21de32d517c9cbc7c00a12d69bdcb77df572f8db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127921
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-12-20 23:37:07 +00:00
Martin Kustermann 72f4a831aa Revert "[SDK] Switch to is_sync to identify sync/async running."
This reverts commit 886615d0f9.

Reason for revert:

There was an unexpected slowdown in some async benchmarks, e.g. Calls.AwaitAsyncCall.

Will revert for now and investigate next year.


Original change's description:
> [SDK] Switch to is_sync to identify sync/async running.
> 
> This should address the regression introduced by https://dart-review.googlesource.com/c/sdk/+/124988
> 
> Bug: https://github.com/dart-lang/sdk/issues/39525
> Change-Id: Id163b649bdd0363297c186559fa84ff87f908e4b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129062
> Reviewed-by: Clement Skau <cskau@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>

TBR=kustermann@google.com,cskau@google.com

Change-Id: I5cda795cbccc01f22e0f8192473c171a4e9fca4b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/39525
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129285
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-12-20 19:06:54 +00:00
Alexander Markov 1b71c00414 [vm/compiler] Refactoring: introduce Instruction::ArgumentValueAt()
ArgumentValueAt(...) replaces repeated expressions
PushArgumentAt(...)->value() and hides many uses of PushArgumentAt().

Issue: https://github.com/dart-lang/sdk/issues/39788
Change-Id: I38637cf7cd5151e7a4fbfed9b324707fd70d6dae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129220
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-12-20 17:36:30 +00:00
Teagan Strickland 7f74ed5e4c [gardening] Only check these asserts if we're producing ELF.
Change-Id: Iec753baaef453d8d5bee80aad6314e5490a6c5ce
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129282
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-12-20 13:38:30 +00:00
Samir Jindel c486154ae0 [vm/aot] Inline == in AOT against nullable receiver.
Fixes https://github.com/dart-lang/sdk/issues/39809

Flutter Gallery ARM32: -0.51% instr, -0.43% total
Flutter Gallery ARM64: -0.44% instr, -0.37% total

Change-Id: Idd29f67eaf588bb5895c356555882efae50494cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128584
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-20 12:33:50 +00:00
Clement Skau 886615d0f9 [SDK] Switch to is_sync to identify sync/async running.
This should address the regression introduced by https://dart-review.googlesource.com/c/sdk/+/124988

Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: Id163b649bdd0363297c186559fa84ff87f908e4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129062
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-12-20 11:07:10 +00:00
Teagan Strickland 4774141425 [vm/compiler] Generate debugging info during single snapshot pass.
Previously when --save-debugging-info=<...> was used when not
compiling to ELF, we generated the requested snapshot format
and the separate debugging information as two separate snapshot
generation passes. However, we want to avoid this, to remove the
assumption that instruction snapshot serialization must be
deterministic.

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

Also allows --strip to be used with --snapshot-kind=app-aot-assembly,
so that DWARF sections are not output in the generated assembly code.

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

Change-Id: Ibdf1f5c771bae21870af252b38e64250fde53603
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128735
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-20 10:14:10 +00:00
Régis Crelier b92fefdfe9 [VM/nnbd] Pass nnbd mode from compiler via generated code or bytecode to runtime functions performing type checks or type reification.
This continues the work started in https://dart-review.googlesource.com/c/sdk/+/124105
The nnbd mode is now part of the type arguments instantiation cache,
since the resulting vector depends on the mode.

Change-Id: I803c07fa9473024557db8585e87286f16681169a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128307
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2019-12-20 03:26:29 +00:00
Alexander Markov fbc57b8b13 [vm/compiler/arm] Fix assertion !stub.InVMIsolateHeap() at il_arm.cc:4650
After dab60b485c we decide to use shared
slow path for BoxInt64Instr based on FLAG_use_bare_instructions.
However, even in --use_bare_instructions mode we might be compiling
something before VM isolate stubs are replaced with isolate-specific
stubs. In such case we shouldn't use shared slow path as
BoxInt64Instr::EmitNativeCode generates PC-relative call to the stub.

This change fixes the assertion

../../runtime/vm/compiler/backend/il_arm.cc: 4650: error: expected: !stub.InVMIsolateHeap()
 version=2.8.0-edge.dab60b485ca4544d58970d9be299d5aaf78cf9e5 (Thu Dec 19 17:29:12 2019 +0000) on "linux_simarm"
 thread=28698, isolate=isolate(0x5640171cd800)
   pc 0x000056401446060c fp 0x00007ffec2747190 dart::Profiler::DumpStackTrace(void*)
   pc 0x00005640141d23b2 fp 0x00007ffec2747270 dart::Assert::Fail(char const*, ...)
   pc 0x00005640145fa85d fp 0x00007ffec2747300 out/DebugSIMARM_X64/gen_snapshot+0xa1285d
   pc 0x00005640145b35b6 fp 0x00007ffec2747470 dart::FlowGraphCompiler::VisitBlocks()
   pc 0x00005640145bfd94 fp 0x00007ffec27474a0 dart::FlowGraphCompiler::CompileGraph()
   pc 0x000056401454aa07 fp 0x00007ffec2747af0 dart::PrecompileParsedFunctionHelper::Compile(dart::CompilationPipeline*)
   pc 0x000056401454cf3f fp 0x00007ffec2747d00 out/DebugSIMARM_X64/gen_snapshot+0x964f3f
   pc 0x000056401454765e fp 0x00007ffec2747da0 dart::Precompiler::CompileFunction(dart::Precompiler*, dart::Thread*, dart::Zone*, dart::Function const&)
   pc 0x0000564014470016 fp 0x00007ffec2747de0 out/DebugSIMARM_X64/gen_snapshot+0x888016
   pc 0x000056401446d72c fp 0x00007ffec2747e70 dart::ProgramVisitor::VisitClasses(dart::Visitor<dart::Class>*)
   pc 0x000056401446d9f3 fp 0x00007ffec2747f00 dart::ProgramVisitor::VisitFunctions(dart::Visitor<dart::Function>*)
   pc 0x000056401453e474 fp 0x00007ffec27480c0 dart::Precompiler::DoCompileAll()
   pc 0x000056401453e245 fp 0x00007ffec27484b0 dart::Precompiler::CompileAll()
   pc 0x00005640149c60eb fp 0x00007ffec2748570 Dart_Precompile
   pc 0x00005640141a7a5f fp 0x00007ffec27486f0 dart::bin::main(int, char**)
 -- End of DumpStackTrace

in debug mode.

Change-Id: I5095e8def7b3d8067423455f32bce5aea1e0c381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129141
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-12-19 21:14:42 +00:00
Alexander Markov dab60b485c [vm/compiler/arm] Fix crashes related to BoxInt64 with --no-use-bare-instructions
BoxInt64Instr::MakeLocationSummary pretended that it is using shared
slow path, but it was not actually used in --no-use-bare-instructions mode.
As a result, BoxInt64Instr slow path pushed only live registers, but
stack map was generated for all registers. This caused various crashes,
mostly in GC.

The fix is to correctly create LocationSummary with kCallOnSlowPath
instead of kCallOnSharedSlowPath if we're not going to use shared
slow path (if --no-use-bare-instructions is specified).

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

Change-Id: Iaba7cd7d88143f2621a007c8559b932bb171de4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129004
Reviewed-by: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-12-19 17:29:12 +00:00
Liam Appelbe 730191fcbd [vm] Implement nullability check in type equality intrinsic
I'm not able to write a test for this yet, but I manually verified that
it's doing the kLegacy -> kNonNullable mapping correctly, on all 4
architectures.

Bug: https://github.com/dart-lang/sdk/issues/39755
Change-Id: I8d1b014c4d4d067fd55e96166b19015d50c9cc6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128982
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-12-19 16:55:23 +00:00
Samir Jindel f134164332 [vm] Enable multiple entry-points on ARM64.
Adresses https://github.com/dart-lang/sdk/issues/34162

Change-Id: I7126f8c9b470041aaa260255293327f67d64d1bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128063
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-19 16:41:24 +00:00
Victor Lima 302184f840 [vm/precomp] Enable unbox_numeric_fields flag for AOT
This change stops seting unbox_numeric_fields flag to false in AOT.

It also sets the speculative mode to be non speculative for store
unboxed fields instructions in AOT, since unboxing is done based on TFA.

Change-Id: Ic7a6391f8569e22eea13128251d83d109b06083c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127884
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-12-19 15:12:52 +00:00
Victor Lima 7a1c91bda9 [vm/precomp] Inline SIMD operations
This CL is responsible for inlining Float32x4 and Float64x2 arithmetic
operations in order to reduce their run-time cost.

Null-checks were required in order to allow the unbox instructions to
be non-speculative.

CheckNullInstr was modified to throw ArgumentError when checking
arguments for those operations.

Change-Id: I18b36d96a36011647480f301eb6dc6bb478f59a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128589
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-12-19 15:09:32 +00:00
Jens Johansen 8d11c1dce6 [kernel][vm] Add uris only from mixins to libraries sourceReferences
index to fix VMs coverage issue

This CL fixes the VM not always reporting coverage for mixin usages
properly.

* When asking the VM for coverage you can do it in one of two ways
  * Ask the VM for coverage for everything; or
  * Ask the VM for coverage for a specific script
* Asking the VM for coverage for everything works perfectly fine.
  The VM goes through everything and reports coverage correctly.
* Asking the VM for coverage for a specific script (which is, at least
  now, what the flutter tools does) doesn't work in the simple mixin
  case described at http://dartbug.com/39779: The VM goes through the
  libraries, asking for the list of scripts they "know about",
  and checks for matches against what you asked for.
  In this case, when asking for 'master.dart', the library for
  'lib.dart' says no when it shouldn't --- because of the way the mixin
  transformation works the content is actually in lib.dart.

This CL updates the content of the field 'sourceReferences' on Library
to fix the issue.


Fixes #39779

Change-Id: I0c38a323c81d1784ade704837b67ece549fc95d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128585
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-12-19 06:59:28 +00:00
Samir Jindel f8200991d7 [vm] Remove redundant type-tests from min/max.
MinLib: 4% improvement
MaxLib: 10% improvement

Change-Id: I26459d5cefdbeaa8af3d9e226b401e12eace9ca2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128883
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-12-18 22:33:21 +00:00
Alexander Markov 7ddf3532de [vm/bytecode] Cleanup support for old versions of bytecode format
This change removes support for all bytecode format versions up to the
current version (27) from the VM.

Version 27 landed Nov 15 2019 in 329d0913ca.

Change-Id: I6af2851543fbb7119bd4b22759f9f05e8c2517dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128940
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-12-18 19:40:16 +00:00