Commit Graph

3601 Commits

Author SHA1 Message Date
Ben Konyi 729099cc5b [ VM ] Update embedding API to perform Platform initialization
Platform::Init (now Platform::InitOnce) was only being called directly
from the CL embedder and could not be invoked via any path in the embedding
API. Platform::InitOnce is now invoked in both dart::bin::BootstrapDartIo and
dart::embedder::InitOnce.

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

Change-Id: I594908895c19e3058f707f920e265e79ca4cecd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117591
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-09-20 18:26:19 +00:00
Tamir Duberstein 4c666569b5 Reland "[fuchsia] migrate from ioctls to FIDL"
This is a reland of 085f81224a

Original change's description:
> [fuchsia] migrate from ioctls to FIDL
>
> Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=6250
> Change-Id: If2756bca0b226bfe8e89b4c793933abac540801e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117620
> Commit-Queue: Zach Anderson <zra@google.com>
> Auto-Submit: Tamir Duberstein <tamird@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>
> Reviewed-by: Chinmay Garde <chinmaygarde@google.com>

Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=6250
Change-Id: Ifbaa12e920088c74a1946cc258533e0fb9d85840
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117960
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-09-19 22:58:54 +00:00
asiva 7c1821c4aa [NNBD/VM] Restructure VM patch files for the NNBD dart sdk split
- Move all VM patch files from the lib directory to
sdk/lib/_internal/vm/lib
- Move all VM patch files from the bin directory to
sdk/lib/_internal/vm/bin
- Fixed paths for above patch files in libraries.yaml file.
- Created copies of these patch files in sdk_nnbd directory
- Cleaned up *.gni files by removing the unused dart patch files lists.

Change-Id: I3109d22f3b729a073a6b40175a0d29162a455830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117685
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-09-19 03:57:30 +00:00
Ben Konyi 108fe9cbcf Revert "[fuchsia] migrate from ioctls to FIDL"
This reverts commit 085f81224a.

Reason for revert: Blocking Dart SDK -> Flutter engine roll

Build failure:

[9/132] CXX obj/third_party/dart/runtime/bin/dart_io_api.socket_base_fuchsia.o
FAILED: obj/third_party/dart/runtime/bin/dart_io_api.socket_base_fuchsia.o
/usr/local/google/home/bkonyi/goma/gomacc  ../../fuchsia/toolchain/linux/bin//clang++ -MD -MF obj/third_party/dart/runtime/bin/dart_io_api.socket_base_fuchsia.o.d --target=x86_64-fuchsia --sysroot ../../fuchsia/sdk/linux/arch/x64/sysroot  -DDART_IO_ROOT_CERTS_DISABLED -DUSE_OPENSSL=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -D_DEBUG -DTARGET_ARCH_X64 -DNDEBUG -DFUCHSIA_SDK -DTARGET_OS_FUCHSIA -I../../third_party/dart/runtime -I../../third_party -I../.. -Igen -I../../third_party/dart/runtime/include -I../../third_party/dart/runtime -I../../third_party/dart/runtime/include -I../../fuchsia/sdk/linux/pkg/fdio/include -I../../third_party/zlib -I../../third_party/boringssl/src/include -Igen/build/fuchsia/fidl -I../../fuchsia/sdk/linux/pkg/fidl_cpp/include -I../../fuchsia/sdk/linux/pkg/fidl_cpp_sync/include -I../../fuchsia/sdk/linux/pkg/fidl_cpp_base/include -I../../fuchsia/sdk/linux/pkg/fidl_base/include -I../../fuchsia/sdk/linux/pkg/fit/include -I../../fuchsia/sdk/linux/pkg/fidl-async/include -I../../fuchsia/sdk/linux/pkg/async/include -I../../fuchsia/sdk/linux/pkg/fidl/include -I../../fuchsia/sdk/linux/pkg/zx/include -I../../fuchsia/sdk/linux/pkg/async-default/include -Igen/build/fuchsia/fidl -Igen/build/fuchsia/fidl -Igen/build/fuchsia/fidl -Igen/build/fuchsia/fidl -Igen/build/fuchsia/fidl -fno-strict-aliasing -m64 -march=x86-64 -fcolor-diagnostics -Wall -Wextra -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wnewline-eof -Wthread-safety -Wno-implicit-int-float-conversion -O0 -g2 -Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-private-field -Wnon-virtual-dtor -Wvla -Wno-conversion-null -Woverloaded-virtual -Wno-comments -g3 -ggdb3 -fno-rtti -fno-exceptions -Wimplicit-fallthrough -O3 -fno-sanitize=safe-stack -fvisibility-inlines-hidden -std=c++17 -fno-rtti -fno-exceptions -c ../../third_party/dart/runtime/bin/socket_base_fuchsia.cc -o obj/third_party/dart/runtime/bin/dart_io_api.socket_base_fuchsia.o
../../third_party/dart/runtime/bin/socket_base_fuchsia.cc:13:10: fatal error: 'lib/sys/cpp/service_directory.h' file not found
#include <lib/sys/cpp/service_directory.h>


Original change's description:
> [fuchsia] migrate from ioctls to FIDL
>
> Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=6250
> Change-Id: If2756bca0b226bfe8e89b4c793933abac540801e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117620
> Commit-Queue: Zach Anderson <zra@google.com>
> Auto-Submit: Tamir Duberstein <tamird@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>
> Reviewed-by: Chinmay Garde <chinmaygarde@google.com>

TBR=zra@google.com,chinmaygarde@google.com,tamird@google.com,stijlist@google.com,tkilbourn@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=6250
Change-Id: I0adfdd3657e7c291afff7fad6b25f165d140f33f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117926
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-09-18 22:51:31 +00:00
Ryan Macnak 7305ae6c35 Revert "Update BoringSSL to 4dfd5af70191b068aebe567b8e29ce108cee85ce."
This reverts commit 93f1324449.

Reason for revert: asm build failure for ia32 mac (e.g., simarm)

Original change's description:
> Update BoringSSL to 4dfd5af70191b068aebe567b8e29ce108cee85ce.
> 
> Update usage of PKCS12_parse to PKCS12_get_key_and_certs, since the former changed behavior when the PKCS12 has no private key.
> 
> Change-Id: I040c1a17e2994ac66cf03ad1efa80e423136cdbd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116828
> Reviewed-by: Jonas Termansen <sortie@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=sortie@google.com,rmacnak@google.com,zra@google.com

Change-Id: I85e9c4e5bd457b72c7df4986a127c169329c178c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117921
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-18 21:38:18 +00:00
Ryan Macnak 93f1324449 Update BoringSSL to 4dfd5af70191b068aebe567b8e29ce108cee85ce.
Update usage of PKCS12_parse to PKCS12_get_key_and_certs, since the former changed behavior when the PKCS12 has no private key.

Change-Id: I040c1a17e2994ac66cf03ad1efa80e423136cdbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116828
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-18 20:02:10 +00:00
Samir Jindel 205b90f0de Take 3 for '[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).'
Fixes the changes to assembly snapshot writer in SIMARM_X64 mode. This unfortunately can't be tested until the ELF loader is available.

Take 2 is in patchset 1.

Change-Id: Ib8b067dd4f09dcba3b142705e9cb4dfbf4e3eb53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117726
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-18 14:56:27 +00:00
Tamir Duberstein 085f81224a [fuchsia] migrate from ioctls to FIDL
Bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=6250
Change-Id: If2756bca0b226bfe8e89b4c793933abac540801e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117620
Commit-Queue: Zach Anderson <zra@google.com>
Auto-Submit: Tamir Duberstein <tamird@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
2019-09-17 22:17:08 +00:00
Ben Konyi 0a5d6a5263 [ VM / Service ] Add --write-service-info=<filename> flag to allow for writing VM service connection information to a file
Fixes https://github.com/dart-lang/sdk/issues/38418

Change-Id: I6dfaa4c510d571a5b4efd7c4b6d1933fc1f46c81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117581
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-09-17 20:34:12 +00:00
Jens Johansen 9f0872847d [VM] Linux with symbolic link to dart: still find kernel-service snapshot
Prior to this change, on Linux, if one created a symbolic link to the
dart executable and ran that, the kernel-service snapshot would not be
found. This has the effect of compiling the input script on a
non-trained kernel service, meaning the startup is slower.

This is particularly bad as the debian install of dart creates a symbolic
link to dart as /usr/bin/dart with the target being /usr/lib/dart/bin/dart
meaning that for instance running a hello-world script like one normally
would, `dart hello.dart` would take something along the lines of 3-4 times
longer than if running `/usr/lib/dart/bin/dart hello.dart`.
On my Pixelbook (in crostini) this is ~755 ms vs ~210 ms.

This change does *NOT* fix it on other platforms.

Change-Id: I6c9105d49205f3e4b9ea64e8ddb95a1d36ae21a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117144
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-17 07:25:38 +00:00
Alexander Aprelev 0c481a196c Revert Reland '[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).' as it breaks flutter profile execution on ios 32-bit platform.
Fixes https://github.com/flutter/flutter/issues/40114

Change-Id: If8d71e9c19c2e794d29f7ecbacb87457890a2fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116883
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-12 00:10:09 +00:00
Clement Skau 46b58397f8 [Runtime] Adds appended blob runtime mode.
The Dart runtime will be able to load snapshot blobs appended at the end of
itself.
This is a step on the way to a self-contained native executable.

Tested:
  $ dart2aot hello_world.dart hello_world.aot
  $ <Some steps to hand-craft appended binary ..>
  $ dartaotruntime_plus_hello_world.bin
  Hello, world!

  python tools/test.py -n dartk-linux-debug-x64 vm/dart/run_appended_aot_snapshot_test

Change-Id: I79d5500c4e2668da31cf1d27145296d17470e04c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112382
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-11 10:56:57 +00:00
Ben Konyi 62f78a7abb [nit] Fixes two typos: build flag and error string.
Change-Id: I0e0b7a8aeb113dc82177a8e1c9acd4c3e0b715ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115706
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-09-10 11:31:46 +00:00
Alexander Aprelev 95db62d6a2 [vm/io] Return data right away if it's ready.
This fixes problem with directory watching on Windows where data might be accumulated before dart stream is setup.

Bug: https://github.com/dart-lang/sdk/issues/37909

Change-Id: I601842522e76e4a6a4e6a22d6b376a49af200e6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115801
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-09 23:16:52 +00:00
Ryan Macnak 84db16381d [vm] Remove dead --load_deferred_eagerly and dependent code tracking for library prefixes.
Since Dart 2, library prefixes are always loaded eagerly on the VM.

Also remove reload check for deferred prefixes. This check was added to avoid behavior of library prefixes giving spurious "not loaded" errors after a reload, but now this error can never occur. Resolves a difference in reload between AST and bytecode modes, since bytecode mode isn't surfacing the deferred property.

Change-Id: Ide5fb6cac2efc90ca1b108a35bc09d342cbd60de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116051
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-09-06 23:37:33 +00:00
Martin Kustermann a64b06ec83 [gardening] Migrate most files to be implicit-bool-conversion free
Issue https://dart-review.googlesource.com/c/sdk/+/115701

Change-Id: Ib579f0bbc8d694aec74afd837217316a10baf910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115707
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-09-05 21:41:42 +00:00
Samir Jindel c219a76652 Reland "[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs)."
The original change is in Patchset 1.
The dependency contains the fix for the non-bare-instructions bot.

Change-Id: Iab02ab0736a2ee9144b667d2777ca526341b2a36
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-bare-linux-release-x64-try,vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115241
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-05 20:19:22 +00:00
Zichang Guo 92ed74e5f1 Reland "[vm] support zoneID for http"
This is a reland of c3db2e3ee0

Original change's description:
> [vm] support zoneID for http
> 
> Coming from https://dart-review.googlesource.com/c/sdk/+/103544.
> 
> Fixes: https://github.com/dart-lang/sdk/issues/37570
> Change-Id: I0f81cb5d8009dc929fca24e03a343a7b0c1597bc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110121
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

Change-Id: I3692bf02fd29bc3bc8b9b54de1466075fecec1f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115605
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-09-05 14:54:48 +00:00
Zichang Guo 05b7c55e8f Revert "[vm] support zoneID for http"
This reverts commit c3db2e3ee0.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm] support zoneID for http
> 
> Coming from https://dart-review.googlesource.com/c/sdk/+/103544.
> 
> Fixes: https://github.com/dart-lang/sdk/issues/37570
> Change-Id: I0f81cb5d8009dc929fca24e03a343a7b0c1597bc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110121
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

TBR=lrn@google.com,zra@google.com,asiva@google.com,zichangguo@google.com

Change-Id: I41e52b905b112a0e6f2a6c2c8c135a9ec6ef6869
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115604
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-09-04 22:17:48 +00:00
Zichang Guo c3db2e3ee0 [vm] support zoneID for http
Coming from https://dart-review.googlesource.com/c/sdk/+/103544.

Fixes: https://github.com/dart-lang/sdk/issues/37570
Change-Id: I0f81cb5d8009dc929fca24e03a343a7b0c1597bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110121
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-09-04 15:42:01 +00:00
Samir Jindel 72e8bdc56b Revert "[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs)."
This reverts commit ecbea5a58e.

Reason for revert: broken with bare instructions and ABI bot

Original change's description:
> [vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).
> 
> To do this, we add writable data sections (currently uninitialzed) to ELF and Asm snapshots
> and allow Instructions to have patchable relocations against (the start of) these sections.
> 
> Issue https://github.com/dart-lang/sdk/issues/37295 (see also for design & discussion).
> 
> Change-Id: If20bfa55776f4044aaa6bb8ea2101d2ada41842c
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110221
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,sjindel@google.com

Change-Id: I9787da6d42575ca4f5ae0a698052a19ac4275afd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115240
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-09-03 12:31:15 +00:00
Samir Jindel ecbea5a58e [vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).
To do this, we add writable data sections (currently uninitialzed) to ELF and Asm snapshots
and allow Instructions to have patchable relocations against (the start of) these sections.

Issue https://github.com/dart-lang/sdk/issues/37295 (see also for design & discussion).

Change-Id: If20bfa55776f4044aaa6bb8ea2101d2ada41842c
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110221
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-03 12:02:02 +00:00
Felicitas Hetzelt 6c38345818 [vm/fuzzer] Add FFI calls to C library
Rationale:
Uses a simple C library to test FFI interface.
Bug: https://github.com/dart-lang/sdk/issues/38008
https://github.com/dart-lang/sdk/issues/37606
Change-Id: I0bb57db5a9977e2300dcace8fef85a2a92d50e41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114556
Commit-Queue: Felicitas Hetzelt <felih@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-08-29 22:45:33 +00:00
Martin Kustermann 68e805f9f6 [vm/cocurrency] Add simple spawn function test and test with/without isolate groups
This fixes also an issue when running without isolate groups.

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

Change-Id: I0fb64b3f2b755ccab4c36c6a0fafee7edff239cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114204
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-08-23 15:15:58 +00:00
Samir Jindel bc16959fc7 Reland "[vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable."
The original revision is in patchset 1.

Three bugs are fixed:

1. Fix SIMARM_X64 build: no need to generate trampolines for AOT or simulated JIT.
2. Hot-reload: Fix hot-reload: don't invalidate Code for force-optimized functions.
3. Windows: Provide shadow space to runtime routines.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-release-x64-try
Change-Id: I326009cfacb51a84e9de4ddf9ff2d6d415460f91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113829
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-21 13:33:37 +00:00
Daco Harkes 670d40d808 [vm/ffi] regression test for 37511
I tested this test manually by reverting 48d92b3176 to confirm that it makes the test segfault.

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

Change-Id: I62cb2b83775780a2fccfd9ee4ebff793de82090a
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109703
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-08-21 08:10:34 +00:00
Samir Jindel 663a8630e6 Revert "[vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable."
This reverts commit bab592fd28.

Reason for revert: Breaks SIMARM_X64 build and crashes in hot-reload.

Original change's description:
> [vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable.
> 
> Issue https://github.com/dart-lang/sdk/issues/37629
> 
> Change-Id: Ib61c32bde5a8b38d90b4da77e27e3874b8bfb7e2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111432
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,alexmarkov@google.com,sjindel@google.com

Change-Id: Id7dc3068a97debc7a8f757df31ef33fb68bdcb44
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113827
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-20 16:27:32 +00:00
Samir Jindel e8c82c6784 [vm/ffi] Suppress irrelevant lint failures in FFI sources.
Change-Id: I63893f54a43e7ea5deb8e5e62a0f91e7d0c44d70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113826
Commit-Queue: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-08-20 15:55:19 +00:00
Samir Jindel bab592fd28 [vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable.
Issue https://github.com/dart-lang/sdk/issues/37629

Change-Id: Ib61c32bde5a8b38d90b4da77e27e3874b8bfb7e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111432
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-20 15:54:50 +00:00
Alexander Markov 6728a9f515 [vm] Add more descriptive error messages to VM unit tests
New error messages simplify triaging problems related to kernel compilation
and loading of snapshot.

Change-Id: I46e8cb51fd2d209c5af97a3edb99f22bae2020f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113401
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 20:39:15 +00:00
Alexander Markov b4b1d5ddac [vm/bytecode] Avoid eagerly reading all bytecode in app-jit snapshots
Reading all bytecode results in significantly higher memory usage due to
more classes finalized and more Function, Field, OneByteString, ObjectPool
and Bytecode objects.

dart2js-compile/CompileHelloMemoryUse benchmark with bytecode:
heap.old.capacity.max 121.387 -> 112.016 MB

Change-Id: Ic702a1c61613e1fc0c2d1f0b3a972da238bab838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113140
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 19:31:40 +00:00
asiva 2023f09b56 [VM] For app-jit snapshot on MacOS 10.15 and higher mmap ANONYMOUS pages and
read the app-jit snapshot into this memory instead of directly mapping
the app-jit snapshot.

use MAP_JIT option only for executable pages and do not use it on iOS.

Change-Id: I8db6f29293677bbf36209473709077115b7b489e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113219
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-08-16 04:39:02 +00:00
Zichang Guo 306f8e04bb [vm] path containing spaces when creating process On Windows
path may contain spaces. When it is passed into CreatProcessW, it will interpret in several ways. Escape path for CreateProcessW to remove ambiguity. Make sure [path] won't be escaped again.

Bug:https://github.com/dart-lang/sdk/issues/37751
Change-Id: I70914c7c2e17aad660126662ab0e83eebe348892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112934
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-08-15 18:04:10 +00:00
Zichang Guo d83425be57 [vm] DirectoryWatch on windows stop immeidate issueRead after initialization
Once DirectoryWatcherHandle is created, it immediately send IssueRead() request to start monitoring the changes in the dicectory. But when changes are comming too fast, the following dart side stream has not been listened. The stream will hang forever.

Bug: https://github.com/dart-lang/sdk/issues/37233
Change-Id: I6100e62331009c2922d84c970d911867370eaeab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111342
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-08-13 19:58:01 +00:00
Zichang Guo 45f892df68 Revert "[vm] escape path when creating process on Windows"
This reverts commit 8a0ae573a1.

Reason for revert: Block 'flutter upgrade'. The manual escaped string should be escaped again.

Original change's description:
> [vm] escape path when creating process on Windows
> 
> path may contain spaces. When it is passed into CreatProcessW, it will interpret in several ways. Escape path for CreateProcessW to remove ambiguity.
> The api doc of CreateProcessW: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw#parameters
> 
> Bug: https://github.com/dart-lang/sdk/issues/37751
> Change-Id: Ia3486d9a8c6b38c526c651dd6a801e0b8dad8655
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112267
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

TBR=zra@google.com,asiva@google.com,zichangguo@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/37751
Change-Id: Ifae15d01b96d91ee88b24469e08ecb4ecc97a832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112921
Reviewed-by: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-08-13 16:38:00 +00:00
Zach Anderson b31df28d72 [dart:io] Retain the stack trace on some native socket errors
Currently, if a the write() system call fails on a socket, the
stack trace in Dart code of the synchronous call to write is
dropped. This CL retains the stack trace.

Change-Id: I926ca98073d795acc2eb9656dc1c6371ac5b009c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112650
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-08-12 18:35:05 +00:00
Chris Bracken 15a3bf82cb Add defined() guard for checkout_llvm build flag
Adds a guard before uses of the checkout_llvm flag, defaulting it to
false when unset. This prevents breakages when used in trees that hasn't
defined that gn flag.

Change-Id: I99c4c1a3db7fcc4823684ad2f358469abdf84780
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112501
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-08-09 19:00:24 +00:00
Daco Harkes 51f4574e50 Reland "[vm/ffi] Support structs on 32bit architectures"
Fixes alignment checks on GCC <= 7 and Clang <= 7.

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

Original CL is in patchset 1.

Tested GCC 7 and Clang 7 behavior of alignof and offsetof manually (our CQ uses newer tooling).

Change-Id: I828b00ad3d36be68a0d28b0a710fea938ca17784
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-ffi-android-product-arm-try,vm-dartkb-linux-release-x64-abi-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112254
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-08-09 14:14:32 +00:00
Zichang Guo 8a0ae573a1 [vm] escape path when creating process on Windows
path may contain spaces. When it is passed into CreatProcessW, it will interpret in several ways. Escape path for CreateProcessW to remove ambiguity.
The api doc of CreateProcessW: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw#parameters

Bug: https://github.com/dart-lang/sdk/issues/37751
Change-Id: Ia3486d9a8c6b38c526c651dd6a801e0b8dad8655
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112267
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-08-08 19:10:01 +00:00
Samir Jindel a05f5910fa [vm/ffi] Delete helper thread in ffi/function_gc_test
Fixes memory leak on ASAN bot.

Change-Id: Idbfd1e66b703e1203fec027a040147179dd0752d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112343
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-08 18:16:39 +00:00
Samir Jindel b12e2ce0b4 [vm] Make FFI code protection test wait for helper to terminate before continuing.
Addresses https://github.com/dart-lang/sdk/issues/37779

Change-Id: I3ee7ec890be9c859737e8676a00047e46643e050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112258
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-08 10:07:42 +00:00
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
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
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
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
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
Jake Ehrlich 773f8d53ed Reland "[llvm] Add initial scaffolding"
This is a reland of b71d2d9996

Original change's description:
> [llvm] Add initial scaffolding
>
> This change adds the gclient and GN changes needed to build
> an executable using LLVM in the Dart tree as well as a basic
> testing framework based on llvm-lit.
>
> Change-Id: I9009a98ff95043cc3754966f31697ba7f1712310
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106434
> Commit-Queue: Jake Ehrlich <jakehehrlich@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

Change-Id: I73cd24455c373bcc4d0f5675af6a3b1e0f947f67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110683
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-07-30 20:34:31 +00:00
Alexander Markov 575f5c8b90 Revert "[vm] Fix uri/path discrepancy preventing running snapshots via spawnUri"
This reverts commit c4b829ba2c.

Reason for revert: failures on several bots:

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8906839588400817728/+/steps/test_results/0/logs/unapproved_failing_tests__logs_/0

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8906839597885007504/+/steps/test_results/0/logs/unapproved_failing_tests__logs_/0

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8906839588760701184/+/steps/test_results/0/logs/unapproved_failing_tests__logs_/0

Original change's description:
> [vm] Fix uri/path discrepancy preventing running snapshots via spawnUri
> 
> Change-Id: I718d7012d074b73eacfb0d4922fc744b6d2bd77b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110547
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,asiva@google.com,mfairhurst@google.com

Change-Id: Id43441d2259a17dff538c95d455a3839b284cad3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110800
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-26 21:27:23 +00:00
Mike Fairhurst c4b829ba2c [vm] Fix uri/path discrepancy preventing running snapshots via spawnUri
Change-Id: I718d7012d074b73eacfb0d4922fc744b6d2bd77b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110547
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-07-26 20:27:11 +00:00
Clement Skau 32bb7441b4 [nit] style in run_vm_tests.cc: func args comments, NULL -> nullptr.
Change-Id: Id3155c9420f3b28170de7964991f2cd3be52fcf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110564
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-07-26 10:23:28 +00:00