Commit Graph

15625 Commits

Author SHA1 Message Date
Samir Jindel e59a4a2b42 [vm/ffi] Call natives through stubs if write-protection is enabled without dual-mapping.
Addresses the Dart -> Native half of dartbug.com/37629

Change-Id: I242b7f3a14dd105334a8b6e5c089b173c398491e
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111280
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-07 11:37:20 +00:00
Dmitry Stefantsov f3139f57b4 [cfe][nnbd] (De)Serialize nullability modifiers in .dill files
Closes #37688.

Bug: http://dartbug.com/37688
Change-Id: Ie3aa8fe09d859cd65bbb58da3f56297483b7b725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112085
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-08-07 10:06:40 +00:00
Teagan Strickland 48f18231ba [vm/compiler] More serialization support for closures and instances.
* 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>
2019-08-07 08:28:18 +00:00
Ben Konyi c262cbd414 Revert "[vm/ffi] Enable creating an ExternalTypedData from a Pointer."
This reverts commit ddd83d256f.

Reason for revert: Causing build failures in the Flutter engine, blocking the SDK roll. Build error:

org-dartlang-sdk:///third_party/dart/runtime/lib/ffi_patch.dart:76:3: Error: Type 'TypedData' not found.
  TypedData asExternalTypedData({int count: 1}) =>
  ^^^^^^^^^



Original change's description:
> [vm/ffi] Enable creating an ExternalTypedData from a Pointer.
> 
> Fixes dartbug.com/37738
> 
> Change-Id: I65c6741978d36cd1c255039a4dd8a06190ea4366
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111736
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Daco Harkes <dacoharkes@google.com>

TBR=vegorov@google.com,sjindel@google.com,dacoharkes@google.com

Change-Id: I90a9cb5e2894c0bc064e620cef0a0f51505ac05d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112047
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-08-06 19:52:11 +00:00
Aart Bik 193985777d [vm/compiler] Propagate call type to load indexed
Rationale:
AOT's TFA sometimes knows a bit more about the result
type of a call that is later recognized as an indexed
load. This CL preserves that type for later use, improving
decision on operations that consume this load.

https://github.com/dart-lang/sdk/issues/37719

Change-Id: I5f88e03b68b4f7aec6e39a8ca94f243c2796730d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112028
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-06 19:28:29 +00:00
Alexander Markov 4a20be4816 [vm] Fix incorrect is_static argument passed to expression evaluation
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>
2019-08-06 17:10:50 +00:00
Alexander Markov 53fe0627ec [vm/bytecode] Recognize calls to _StringBase._interpolate in bytecode flow graph builder
ia32/TypedData.Int8ListBench(RunTime): 22.8us -> 14.9us

Issue: https://github.com/dart-lang/sdk/issues/36429
Change-Id: Ib9e68df107c9bbc97c3d75fb13728efb77615c6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112029
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-06 15:49:57 +00:00
Samir Jindel ddd83d256f [vm/ffi] Enable creating an ExternalTypedData from a Pointer.
Fixes dartbug.com/37738

Change-Id: I65c6741978d36cd1c255039a4dd8a06190ea4366
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111736
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-08-06 15:38:27 +00:00
Felicitas Hetzelt b6df9fb9d1 [dart/vm] Only re-run if exit code outside |255|
Rationale:
A test should only be reported if the exit code indicates an error
outside of the Dart VM. Which is most likely the case for exit Code
values outside of the interval [-255,255]

https://github.com/dart-lang/sdk/issues/37632

Change-Id: I35e3352e85e1af5f5a06753d8f43e6606902c80d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111989
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-08-05 22:50:22 +00:00
Felicitas Hetzelt ddc09607c6 [dart/vm] Webscraper for make_a_fuzz cluster runs
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>
2019-08-05 22:46:09 +00:00
Nate Bosch 55f81f2210 Mass format python with yapf
- 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>
2019-08-05 20:34:31 +00:00
Régis Crelier c923007f37 [vm/bytecode] Fixes and improvements in bytecode debugger.
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>
2019-08-05 17:54:17 +00:00
Alexander Markov 8cd01287b4 [vm/aot/tfa] Infer types from generic return types of native methods
Issue: https://github.com/dart-lang/sdk/issues/37719
Change-Id: I35a8cd7a5e20e13d705f005e17ebc80fb8e8f80e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111900
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-05 16:43:47 +00:00
Martin Kustermann 271445d207 [vm] Prevent service-isolate from starting in run_vm_tests, except if test needs it
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>
2019-08-05 15:26:42 +00:00
Teagan Strickland 5574669966 [vm] Add TODO about recognized kinds on DIFs.
Bug: https://github.com/dart-lang/sdk/issues/37737
Change-Id: Ibe760ee0783c2853a52a19fa187fd152ade21661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111733
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-08-05 13:59:29 +00:00
Teagan Strickland c271c599af [vm/compiler] Move S-exp deserialization into sexpression.{cc,h}.
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>
2019-08-05 13:59:22 +00:00
Clement Skau 844626c4e6 [VM] Copies Dart_CodeObserver in Init to prevent use-after-free.
Dart_CodeObserver is a struct (in dart_api.h) with two pointers:
  void* data;
  void (*Dart_OnNewCodeCallback)(...) on_new_code;

Change-Id: I556b73e0e3488a10f9fd162af24e36ad4f240fa1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111723
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-08-05 10:46:29 +00:00
Martin Kustermann d3f3b46b87 [VM] Add test for Dart_InvokeVMServiceMethod
This CL adds CC a test for Dart_InvokeVMServiceMethod. This requires also
adding support for starting the service-isolate in run_vm_tests, which in
return requires adding the vm_platform.dill (as well as a few other things).

Furthermore this CL also adds a Service::WaitForLoadPortInternal, which does
not require a current thread and makes Dart_InvokeVMServiceMethod use it.

Original CL (not landed): https://dart-review.googlesource.com/c/sdk/+/67761


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

Change-Id: Ife98b56043c26eb477825b05f8aaedaec508eeb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111726
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-08-05 10:07:39 +00:00
Jens Johansen fd7baa4fd9 [CFE] Serialize language version
Change-Id: I6ea448df722a7e1e51c31f06d42bfbe743855a45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111725
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-05 09:14:09 +00:00
Teagan Strickland 4969bc6d23 Revert "[vm] Clear recognized method info on dynamic invocation forwarders."
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>
2019-08-05 08:55:44 +00:00
Jens Johansen 39a007678e [VM] Save kernel binary version in KernelProgramInfo
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>
2019-08-05 06:51:24 +00:00
Alexander Markov ac45ee7e63 [vm/bytecode] Support exactness tracking in bytecode
MicroClosureCreateTearoffClassSecondTime(RunTime) 3922 us -> 2030 us.

Issue: https://github.com/dart-lang/sdk/issues/36429
Change-Id: I3a6f93950a469969d82243fd1744d5a4f7fb1e78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111868
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-03 17:36:31 +00:00
Alexander Markov aa650e53f5 [vm/bytecode] Emit explicit DebugCheck bytecode instructions for VariableSet
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>
2019-08-03 01:34:45 +00:00
Ryan Macnak 6653611ae4 [vm, gc] Check if we should start concurrent marking after external allocations and background code finalization.
Bug: https://github.com/flutter/flutter/issues/36808
Change-Id: I2577ffa22e4dec5d659198948d490b4e17aae8db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111664
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-02 22:08:59 +00:00
Aart Bik 19085e3819 [dart/vm] Check SSA def-use dominance only
Rationale:
PushArguments violate some def-use dominance relations
after inlining. Fixing this seems not worth the engineering
effort. Rather we wait until we remove PushArguments
altogether (the optimizing compiler has no need for them).

https://github.com/dart-lang/sdk/issues/36899

Change-Id: I9265420ae8ec4981fe7170b9a1869dd56ae323cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111880
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-08-02 20:29:39 +00:00
Martin Kustermann fac682c5ef [vm/gc] Hold lock before accessing PageSpace::large_pages_
Change-Id: I08c4d125e929f0c1824204b813920ac8a7cf1f59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111721
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-08-02 15:26:01 +00:00
Ryan Macnak d08c203e30 Add various missing argument checks to dart:io natives.
Avoid reflective access to mirrors creating invalid reflectees.

Change type checks in embedding API functions to return UnhandledExceptionErrors instead of APIErrors so they are catchable by Dart.

Fixes invocation_fuzz_test.

Bug: https://github.com/dart-lang/sdk/issues/15274
Bug: https://github.com/dart-lang/sdk/issues/23869
Bug: https://github.com/dart-lang/sdk/issues/37680
Change-Id: Ife3e3cb894c59620b0318e4e08947a3d1d45bab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110620
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-08-01 23:32:40 +00:00
Johnni Winther 972d4e9a75 [cfe] Move relativize code from dart2js to cfe
Change-Id: I2e07dcf91adf65965583189972b0c27cc0aee526
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111427
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-01 21:07:50 +00:00
Ryan Macnak b66cd42372 [vm] Fix deadlock in isolate shutdown, take 2.
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>
2019-08-01 19:04:11 +00:00
Ryan Macnak ebc4a59b61 Use Dart_PrepareToAbort in segfault handlers for consistency.
Change-Id: Ie4c838c8f8b68b16a0bda2e8a59005bee6c1bf30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111523
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-01 16:41:43 +00:00
Aart Bik 150e8f89d5 [dart/vm] Fix dominance violation
Rationale:
The flow graph checker still had a few ugly exceptions
due to dominance violation after inlining. This CL fixes
the violation, removes the exceptions from the flow graph
checker, and also adds a new utility that can be used in
some other places.

https://github.com/dart-lang/sdk/issues/36899

Change-Id: I42766af22a3696fe050b0e5c4a2dfe930933fc40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111502
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-08-01 15:54:33 +00:00
Samir Jindel 0ea0409401 [vm/ios] Don't use __clear_cache on iOS, it's not always available.
Change-Id: Ia80b543587b3dc265c4a4d97befff73d915ad2be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110560
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-01 14:14:39 +00:00
Martin Kustermann 91dadded66 [vm/compiler] Recognize _asyncStackTraceHelper and build special graph if !FLAG_causal_async_stacks
This is a follow-up to [0] necessary due to mixed bytecode compiled code mode.

[0] https://dart-review.googlesource.com/c/sdk/+/110919


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

Change-Id: If3ac86224644bf02160722ff23eac0c30dbd4697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111641
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-08-01 10:47:59 +00:00
Felicitas Hetzelt 52ce6273f3 [dart/vm] Rerun test on return code divergence
Rationale:
Some of the reported divergences could not be reproduced locally.
This patch adds the option to re-run tests on empty divergences
in order to triage such bugs.
Further, it adds an option to specify an existing dart program instead
of generating one randomly for testing purposes.

https://github.com/dart-lang/sdk/issues/37632
https://github.com/dart-lang/sdk/issues/37646

Change-Id: I85760dc52bfb4f3f9fa45931f94df8fa4c3c2a89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111240
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-07-31 21:04:01 +00:00
Martin Kustermann 130c654dcd [vm/compiler] Avoid runtime call for _asyncStackTraceHelper if !FLAG_causal_async_stacks
Even though the FLAG_causal_async_stacks can be used to disable causal
async stack traces, the generated code would still call to the runtime,
which would simply return `null`.

To avoid this runtime call we recognize the method in the 2 flow graph builders.

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

Change-Id: I896807060db911714d47a462c34696a0a3def62f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110919
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-07-31 19:49:51 +00:00
Alexander Aprelev bd049f5b53 [llvm] Fix bit target definition on Windows - it needs .exe extension
Change-Id: I4fc94797f0c957dc5bb1d6bf94e7de8c1d2399b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111501
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-07-31 17:33:09 +00:00
Martin Kustermann cdf56d7892 [vm] Ensure we wait for the service-isolate to boot-up before communicating with it
Change-Id: Iaa099faa7cb560e25c90a045d518c6c07a4c54cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111428
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-07-31 13:30:34 +00:00
lambdabaa d3fbbf8b5a Fix the dart-sdk-linux task by not building analysis server on 32 bit ARM architecture
Dart FFI which is now an analysis server dependency does not yet support 32 bit ARM. I also went ahead and updated dart_api_impl.h to address the TODO about removing the architectures enabled in https://github.com/dart-lang/sdk/issues/35773 from the blocklist.

Change-Id: Id2535520df1069e21eb4fa5818484ae6d92b2efd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111314
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-07-31 12:54:52 +00:00
Clement Skau 8cce940579 [API] Makes Dart_InvokeVMServiceMethod errors more specific.
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>
2019-07-31 12:21:24 +00:00
Teagan Strickland 2e197ae4de [vm/compiler] Tweaks and additions to IL serializer/S-expressions.
* 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>
2019-07-31 11:52:44 +00:00
Samir Jindel 0a85a8878d [vm/llvm] Use relative paths in LLVM build rules.
This fixes the Flutter build.

Change-Id: I2f1e6e48e054e1c2368bed4bc8b47a7bf37dcb56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111420
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2019-07-31 08:44:32 +00:00
Alexander Markov 40e6954a30 [vm/bytecode] Update error messages for dart:mirrors and dart:ffi
This is a follow-up for https://dart.googlesource.com/sdk/+/821efa642c648ffe4c3c871b79ba618517bed774.
Error messages are aligned between bytecode reader and default kernel loader.

Change-Id: I2d4d3712f041cbbc0feb865d7f25d5df2ddbdf34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111380
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-31 01:39:18 +00:00
Ben Konyi 1e80e917b6 [ VM / Service ] Update package:vm_service to support service protocol 3.25
Change-Id: I81e7e658985a2cb90a2a38676cf59022c5457398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111364
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
2019-07-31 00:14:21 +00:00
Ben Konyi 5f32027e1d [ VM / Service ] Add getInboundReferences, getRetainingPath RPCs and InboundReferences, InboundReference, RetainingPath, RetainingObject objects.
Change-Id: I26211d13d49688037114d76f648e500b98ec3295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108560
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-07-30 23:26:28 +00:00
Ryan Macnak e91e3b816b Revert "[vm] Fix deadlock in isolate shutdown."
This reverts commit d8160e0cb1.

Reason for revert: crashes in lib_2/isolate/spawn_uri_nested_vm_test

Original change's description:
> [vm] Fix deadlock in isolate shutdown.
> 
> 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>

TBR=kustermann@google.com,aam@google.com,rmacnak@google.com

Change-Id: I32d8e291b85754461d919ca258ecb479e54f072d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111317
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-07-30 22:50:50 +00:00
Ben Konyi 18e4e7830d [ VM / Service ] Bump VM service version to 3.24
Change-Id: I8b5d39ce77eae950773afbc08826e80b5656fdcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111363
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-07-30 22:34:39 +00:00
Ben Konyi 8591778065 [ VM / Service ] Added 'operatingSystem' property to VM object
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>
2019-07-30 22:31:26 +00:00
Ryan Macnak d8160e0cb1 [vm] Fix deadlock in isolate shutdown.
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>
2019-07-30 21:05:22 +00:00
Aart Bik bb34cfeb25 [dart/fuzzer] Extend list of forbidden classes/methods
Rationale:
Avoid touching file system or exit codes just to avoid
possible false divergences.

https://github.com/dart-lang/sdk/issues/37632

Change-Id: I603ef19fa2919f0f26839c4f42bfc51a3fb96979
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111360
Reviewed-by: Felicitas Hetzelt <felih@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-07-30 20:49:56 +00:00
Aart Bik 361d27e20b [dart/vm] Fix bug in parallel move/register allocator
Rationale:
Another one bites the dust due to fuzzing! The attached
small reproducer assert failed in debug and crashed
in release due to "any" allocation in the parallel move.

https://github.com/dart-lang/sdk/issues/37633

Change-Id: Ie9044cb7fa86dfdb1ba312599f57db76bec47611
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110540
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-07-30 20:42:05 +00:00