- make Dart2 the default option for the command line VM
- add option --no-preview-dart-2 as a fallback option to run dart1
- change test scripts to use the executable dart for testing dart2 mode instead of
pkg/vm/tool/dart2
- adjust numerous build and test configurations
Change-Id: Id813fa5b71a89c7ec9335d3f6e83cfc9f35f86e7
Reviewed-on: https://dart-review.googlesource.com/58240
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
When the slow path code of StackOverflowInstr is calling out to runtime
and the runtime causes a lazy-deopt, the lazy deopt stub will treat the value in the
return-value-register as GC-safe and the value will be visited during GCs.
This CL changes the call-to-runtime-stub to always put 0 into the
return-value-register.
This should fix the flaky vm-linux-debug-x64-reload-be builder.
Change-Id: Ibea3630b8b9fa5de2b96134725df0017c09282bd
Reviewed-on: https://dart-review.googlesource.com/60661
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Rationale:
With limited integers, signed/unsigned 64-bit int typed
data is just a bit pattern, no need to sign/zero extend
these into bigger ints on load. This enables more
intrinsification of indexed stores/loads.
Note:
Still TBD, inline these indexed operations too.
Performance:
About 10x improvement on micro benchmarks.
https://github.com/dart-lang/sdk/issues/33205
Change-Id: I640c324a7d91e57fb4edc025e0dd456ad34fe906
Reviewed-on: https://dart-review.googlesource.com/60403
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
The stub code for calling into the runtime is now responsible for saving any
live registers. Since it doesn't know which registers are live (it's shared
across many safepoints), it saves all the registers. The stackmaps and
environments for safepoints which call this stub are extended to cover the stack
slots in the stub's frame which correspond to registers which are actually live
at the safepoint.
Currently this is only supported in precompiled X64 for the `CheckNull`
slow-path. By creating a separate stub for the CheckNull slow path we are able
to eliminate the size overhead of preparing arguments for the runtime call stub,
and reduce the slow-path size on X64 to 1 instruction.
# Test Plan
The stackmap for a safepoint in the `CheckNull` slowpath is only used when
handling the exception causes a GC, which is extremely unlikely. To induce this,
we add a flag to force this behavior in debug-mode and a test which exercises
this. The rest of the changes inherit existing coverage.
Change-Id: I3d8f2a7c3560c432599344d7420d42ddbee7a89d
Reviewed-on: https://dart-review.googlesource.com/59660
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
We previously used liblaunchpad.so, which will be removed from the
Fuchsia SDK.
Change-Id: I5992d195dc53549c449ae21b3b201bc1dade519a
Reviewed-on: https://dart-review.googlesource.com/60147
Reviewed-by: Zach Anderson <zra@google.com>
The old zx_task_suspend is being replaced with zx_task_suspend_token
which eliminates the possibility that suspends can get leaked due to
crashes.
Change-Id: Ib7df2494a013b899c98d03d9ceeb0cc9de2ea6b4
Reviewed-on: https://dart-review.googlesource.com/60204
Reviewed-by: Zach Anderson <zra@google.com>
Rationale:
Rather than forced inlining of clamped convertors
(the "saturated" method _toClampedUint8() from
dart:typed_data), exposing the fact that it always
returns smi values (since they check fail on null inputs)
yields much better Uint8ClampedListView performance
(it avoids re-compilation due to a speculative CheckSmi).
Note:
In the long run, we may still want them inlined
and improve range analysis to deal with clamping.
Performance:
About 2.8x faster than previous optimized version,
about 4.5x faster than original.
https://github.com/dart-lang/sdk/issues/33205
Change-Id: I86a06525d2f2ea0476effd3c3d856ff8d9ab1d87
Reviewed-on: https://dart-review.googlesource.com/60201
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
For example, by default 64-bit architectures now grow as 2, 4, 8, 16 instead of 2, 8, 32.
This change is to reduce memory usage and maximum minor GC time for Flutter and Fuchsia.
It would negatively impact batch applications, which prefer throughput,
so the new defaults are overriden by the command-line Dart VM in
runtime/bin/main.cc
Change-Id: Ie56a7599d4011a629c8c57bd88fec3ee8f277a9f
Reviewed-on: https://dart-review.googlesource.com/54305
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Rationale:
Handles remaining polymorphic reason for typed_data
setters and getters (internal vs. external) during inlining.
Also introduces high level flow graph utilities that
can be reused throughout the compiler to reduce
future code duplication. Disables type speculation
for 64-bit AOT Dart2 to make all work.
Performance:
About 4x speedup on micro benchmarks (AOT64).
https://github.com/dart-lang/sdk/issues/33205
Change-Id: I678426719e49cd8aa1e5051523da12178120b3ba
Reviewed-on: https://dart-review.googlesource.com/59000
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
The new version of zx_cprng_draw either succeeds in reading the
requested amount of data or fails entirely. A future CL will rename
zx_cprng_draw_new to zx_cprng_draw once zx_cprng_draw has this new
behavior.
Change-Id: I08acad6a3443cb295f7855afdd63010dcf872820
Reviewed-on: https://dart-review.googlesource.com/59861
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Adam Barth <abarth@google.com>
To reduce size, PC descriptors corresponding to deoptimization points
were omitted if FLAG_optimization_counter_threshold < 0.
However, even if generation of optimized code is disabled with
'--optimization-counter-threshold=-1' option, we could still load optimized
code from snapshot. The loaded code can trigger deoptimization and
PC descriptors corresponding to deoptimization points could be needed.
This change removes this incorrect optimization of PC descriptors size when
optimizing compiler is disabled.
Fixes https://github.com/dart-lang/sdk/issues/33389
Change-Id: I74b0fab34ca1a46672e5a8d5c45ea9b506eab9b1
Reviewed-on: https://dart-review.googlesource.com/59481
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The `@pragma` annotation on `vmservice_io.main` is modified to only mark it as a
root on non-product builds. Since the annotation is evaluated in the constant
transformation, we need to thread a flag through `gen_kernel.dart` indicating
whether the Kernel produced should target a product precompiler.
# Test Plan
Tested locally on Flutter. Unfortunately it's not possible to test the scenario where
`vmservice_io` is not included, since we don't have any "product" bots. Soon the
flag will be introduced into Flutter, and we will have some coverage from there.
Change-Id: I39f12343038fa221aafe5a55241bff4b8d14ec19
Reviewed-on: https://dart-review.googlesource.com/57501
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Simplifies evaluating the policy on each page growth and external allocation. Does not change the growth policy for synchronous GC.
Update the policy for idle GC to use capacity instead of used for consistency.
Change-Id: I3340399f7b97626e6b33bd8086ad408a9ff20ed4
Reviewed-on: https://dart-review.googlesource.com/58640
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
So far the frontend (parser, flow graph builder, ssa construction) were
aware of the actual frame layout.
This CL makes the indices we assign to [LocalVariable]s logical
indices, assigning:
* M parameters the indices 1 ... M
* N local variables the indices 0 -1 ... -(N-1)
The scope building, flow graph builder and ssa construction operate on
those logical indices.
When emitting actual code, the backend will translate those indices into
actual FP relative indices. This allows us to be more flexible in the
backend which frame layout we choose.
Issue https://github.com/dart-lang/sdk/issues/33274
Change-Id: I9a504bf97821c257aafd2b3430df9f4c9da4b442
Reviewed-on: https://dart-review.googlesource.com/57321
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>