* Adds non-static final field printing for `Instance`s
* Adds specialized printing for `Closure`s (tearoffs).
* Instances of `Mint` and `Type` can also appear in constant
pools, so handle both in ObjectToSExp.
* DartValueToSExp is a wrapper method for ObjectToSExp that
also checks to see if the value is defined in the constant
pool. If it is, the object is serialized as a reference to
that definition.
* Reworks the `tmp_*_` fields used for non-reentrant cases
to be per function to make it easier to understand how they
interact. (Only cross-function tmp field that remains is
`tmp_string_`, since its contents are always immediately
converted to a C string and then no longer needed.)
Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: Ibad4bc2497dd1f580d1daa536c4a267818981c14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111425
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Previously, KernelIsolate::CompileExpressionToKernel was called
with is_static == false and klass == nullptr, which doesn't make sense:
this call requested to compile expression inside instance method context but
without enclosing class. This results in a malformed kernel AST and crash
in bytecode generator.
Fixes vm/cc/LinkedHashMap and vm/cc/Service_* tests in bytecode mode.
Change-Id: I121b0cb0e149d378d6b12e9861ef941513e1e199
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112024
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Given the uri of a make_a_fuzz run, this script will first
extract the links pointng to each of the individual shards
and then parse the output generated by that shard for
divergences reported by the dartfuzz_test.dart program.
Change-Id: Ieb328737f940bf736c803ec58ac88e54e30e59b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111666
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
- Add `.style.yapf` with configuration to use Google style.
- Run `yapf` on all `.py` files in this repo.
- Manually fix one trailing space in a doc string.
- Run `git cl format runtime` to satisfy presubmit.
Change-Id: I7e6bd11e91f07926b9188362599af398551eed79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111600
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Remove DebugCheck on Jump opcode.
Emit explicit DebugCheck bytecode instructions for VariableSet (see CL 111221).
Emit explicit DebugCheck bytecode instructions for VariableDeclaration.
Emit explicit DebugCheck bytecode instructions in _generateNonLocalControlTransfer before context is unwound.
Refactor prologue of async op functions, so that the same DebugCheck opcode is
encountered on every reentry.
Allow extra single steps when debugging bytecode in service tests.
Support context level calculation of compiled frames.
Adjust filter of synthetic variables in debugger.
Fix logic to skip single steps in bytecode prologue.
Change-Id: I1d6236c37af1aded0eebca1c3e3bb1978f7369dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111867
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
After landing d3f3b46, which adds support for vm-service to the run_vm_tests binary,
random vm/cc tests started to time out. The VM shutdown procedure waits
for the service isolate to shut down, which it doesn't do.
Since we haven't been running the vm-service isolate before, this
might've been an existing issue which is just surfaced now. This CL
disabled starting vm-service (like it was before) except for the
particular test which needs it.
Issue https://github.com/dart-lang/sdk/issues/37741
Change-Id: I914cccf0cf640602a6a7e31b1aa456301837be79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111737
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
This way, users of S-expression deserialization will not also pull in
the rest of the upcoming IL deserialization functionality (and
anything extra needed by that).
Also changes SExpParser::ReportError to just print the error
information to stderr and abort, instead of using the Dart VM
exception machinery.
Change-Id: Id01b2a6fdca1a6204d502f398df139c2faa12d07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111644
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
This reverts commit d6e9e15cf1.
Reason for revert: The recognized kind was likely intentionally
carried over to the DIF, since the inliner doesn't distinguish
between dynamic and non-dynamic call sites for these recognized
method replacements. In addition, the replacements are speculative
and can't handle arbitrary inputs, so deoptimization should end up
re-executing the original DIF call and thus cause an appropriate
type error to be emitted via the DIF.
Original change's description:
> [vm] Clear recognized method info on dynamic invocation forwarders.
>
> Similar change to b68e5c4338, where this information gets copied
> over into the new dynamic invocation forwarder from the original
> function.
>
> Change-Id: I728fa459837a8bb2e831c5314d12f6a00f7f32b6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110722
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Teagan Strickland <sstrickl@google.com>
TBR=kustermann@google.com,sstrickl@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Iffd34142647440f0bdb0ab60d1ec41ca638d4c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111732
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
This is the beginning of allowing us to - wherever we process kernel
data - make decisions based on the kernel version. Said another way,
we can actually start to change the kernel format without breaking
backwards compatibility in the VM.
Change-Id: Ied7b3d9fe72976c4f3c0895d02b6ab70e0f5dba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111642
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
AST-based flow graph builder has a heuristic logic on when to generate
DebugStepCheck when assigning value to a variable. This logic depends on
right-hand side expression. In order to replicate the same behavior
with bytecode, bytecode generator would also implement this logic and
generate explicit DebugCheck instructions instead of stopping on every
StoreLocal/PopLocal/StoreContextVar.
Change-Id: Ic10180673a324db9216e34459d9c0afaca6a11e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111221
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Enter a safepoint when waiting for child isolate spawns to complete, since the child isolate now requires its parent (along with all other members of the isolate group) to participate in safepoints.
Adjust shutdown of ThreadPool isolates to re-enter the isolate before waiting for outstanding spawns.
Bug: https://github.com/dart-lang/sdk/issues/37679
Change-Id: I760c0f75b77a3884ac3f4757f0c6920a417f3453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111524
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Specifies that the 'isolate' mentioned in the error message is always the
service isolate.
Also adds a specific error message for when the service isolate port isn't
found, which can indicate the service isn't there (yet?).
Change-Id: I1f29b7c4ccf4df2c3dbefafe05f410e4725488e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111426
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
* Add a new `SExpDouble` atom and change `SExpNumber` to `SExpInteger`.
* Allow for negative integers in deserialization.
* Add support for `LocalVariable`s and related instructions.
* Function objects are now represented by actual S-expressions generated
with the new `FunctionToSExp` method. Previously, they were only represented
by a symbol containing their canonical name.
* The top-level tag for a serialized flow graph is now `FlowGraph`, not
`function`. This avoids confusion between serialized flow graphs and
serialized function references. Similarly, the old `FunctionToSExp`
method is now called `FlowGraphToSExp`.
* Made all SExpression* returning functions that take Object (or subclass)
instances return nullptr if the passed in instance is the null object,
except for ObjectToSExp, which returns the symbol `null`.
* Factored out creating tags for the different kind of block/function
entry and also created an `Entries` section to the top-level `FlowGraph`
form that contains function entry points similar to the `Constants` one
instead of inlining entries as separate elements in the `FlowGraph` form.
* Additional extra information in verbose mode for some elements.
Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: Iede3865ec64f81955a87fd57b10e74d49ee8414c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110917
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Allows for VM service clients to determine information about the system
the service is running on. Needed for some DevTools functionality.
Change-Id: I530984816e6cc1e4ca378454882219085e2d9de8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111361
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Enter a safepoint when waiting for child isolate spawns to complete, since the child isolate now requires its parent (along with all other members of the isolate group) to participate in safepoints.
Change-Id: Ia75f76a08a59bb73d116301ec5e1a3c0fd1db99c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111313
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>