Commit Graph

629 Commits

Author SHA1 Message Date
Vyacheslav Egorov 23fd1a184b VM: Support bootstrapping core libraries from Kernel binaries instead of source.
BUG=http://dartbug.com/27590
R=asiva@google.com

Review URL: https://codereview.chromium.org/2485993002 .
2016-11-16 13:56:20 +01:00
Ryan Macnak 987165f022 Reload native extensions when starting from a snapshot.
Fixes #21180
Fixes #27574

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2475523002 .
2016-11-07 16:17:47 -08:00
John McCutchan 14297ee480 Add an environment variable toggle to control new service protocol auth token
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2486443002 .
2016-11-07 14:45:52 -08:00
Zachary Anderson 479a97b129 clang-format runtime/bin
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2480793002 .
2016-11-04 12:30:56 -07:00
Ryan Macnak 4d65db8a95 Don't use IsolateData for the exit hook as multiple embedders share the dart/bin while using different isolate data structures.
Issue flutter/flutter#6506

R=asiva@google.com

Review URL: https://codereview.chromium.org/2463923002 .
2016-10-31 15:56:25 -07:00
Siva Annamalai 9c737d6055 Adjust help message.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2441553002 .
2016-10-20 13:54:35 -07:00
Siva Annamalai 941b0c8c39 Fix build.
BUG=

Review URL: https://codereview.chromium.org/2426383003 .
2016-10-19 18:01:41 -07:00
Siva Annamalai 36a237c88d Fix build.
Review URL: https://codereview.chromium.org/2431253004 .
2016-10-19 17:48:01 -07:00
Siva Annamalai af4d246ef1 Cleanup options for use of application snapshots
- unified kAppAfterRun and kAppJITAfterRun to kAppJIT
 - adjusted the test configuration to make dart2app and dart2appjit to mean
   the same
 - delete GenerateFullSnapshot function as it is not used anymore

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2429023002 .
2016-10-19 17:42:01 -07:00
Ryan Macnak c9c33d9db3 Implement File::Map on Windows.
R=zra@google.com

Review URL: https://codereview.chromium.org/2430473002 .
2016-10-19 16:36:01 -07:00
Ryan Macnak 5ee94eb837 Generate an app snapshot even if the training run does a hard exit.
(As the analyzer and pub do.)

R=asiva@google.com

Review URL: https://codereview.chromium.org/2426843002 .
2016-10-19 09:37:47 -07:00
Ryan Macnak 3d00ecdc8f Reapply "Use a single file for app snapshots."
- Don't read script to check for an app snapshot if it is a pipe. Fixes loading source from a pipe.
 - Fix windows and fushsia builds.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2416973003 .
2016-10-14 09:57:54 -07:00
Ryan Macnak 6839a23240 Revert "Use a single file for app snapshots."
This reverts commit 4f8b16df3b.

Review URL: https://codereview.chromium.org/2410303008 .
2016-10-13 15:29:23 -07:00
Ryan Macnak 4f8b16df3b Use a single file for app snapshots.
For blobs, put all four pieces into a single file with a header describing their offsets.
For dynamic libraries, move the vm isolate and isolate pieces into the dynamic library as additional read-only sections.

Automatically detect if the script argument is an app snapshot and initialize the VM appropriately, similar to automatic detection of script snapshots.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2405393002 .
2016-10-13 14:33:56 -07:00
Siva Annamalai aae051e4c3 Fix for issue 27567 (inconsistent handling of invalid -D options
BUG=#27567
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2409263004 .
2016-10-12 18:42:30 -07:00
Florian Schneider ecb818a991 AOT: Add missing native entry points for secure sockets.
These are only accessed from native code on MacOS/iOS.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2419653002 .
2016-10-12 13:04:22 -07:00
Ryan Macnak ad32e93c05 Include optimized code in JIT app snapshots.
R=asiva@google.com

Review URL: https://codereview.chromium.org/2397853003 .
2016-10-07 10:34:57 -07:00
Siva Annamalai 12f86594ec Add --parse-all option in order to benchmark and measure the scanner/parser performance.
R=hausner@google.com

Review URL: https://codereview.chromium.org/2327693002 .
2016-09-23 15:20:39 -07:00
Ryan Macnak fb127ddf4a Standalone: Add missing tree-shaker root.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2356953002 .
2016-09-20 14:44:05 -07:00
Zachary Anderson 139db22be5 Use OS-provided trusted root certs on Linux
First, the look for trusted root certificates
in standard locations on the file system
(/etc/pki/tls/certs/ca-bundle.crt followed by
/etc/ssl/certs), and only if these do not exist
will we fall back on the compiled-in trusted root
certificates. This behavior can be overridden
with the new flags --root-certs-file and
--root-certs-cache.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2346683003 .
2016-09-16 09:08:51 -07:00
Florian Schneider 021ebb2033 Correct and GC unrecognized flags from our tests.
Fix some misspelled flags.

Remove some non-existent flags.

Fix --short_socket_read and --short_socket_write flags used in IO tests.

Running with --ignore-unrecognized-flags is still on because some flags are only visible
in DEBUG mode.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2247733005 .
2016-08-15 18:28:11 -07:00
Adam Barth fac99f35b3 Switch Dart_Initialize to use a struct
The number of NULL parameters was getting out of hand.

R=zra@google.com

Review URL: https://codereview.chromium.org/2223463003
2016-08-09 12:25:39 -07:00
Adam Barth bd41127c7f Revert "Switch Dart_Initialize to use a struct"
I landed the wrong version of my patch.

This reverts commit bdc25d5695.
2016-08-09 12:24:13 -07:00
Adam Barth bdc25d5695 Switch Dart_Initialize to use a struct
The number of NULL parameters was getting out of hand.

R=zra@google.com

Review URL: https://codereview.chromium.org/2223463003 .
2016-08-09 12:20:16 -07:00
Zachary Anderson 82cb63e70f Fixes leak of duplicate command line environment strings
R=asiva@google.com

Review URL: https://codereview.chromium.org/2222013002 .
2016-08-08 12:53:26 -07:00
John McCutchan 9c83d24622 Add --hot-reload-rollback test mode
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2200683002 .
2016-08-01 10:57:22 -07:00
Ryan Macnak acf93a6b19 Fail cleanly if we cannot open a file to write a snapshot.
R=regis@google.com

Review URL: https://codereview.chromium.org/2193293002 .
2016-07-29 13:52:09 -07:00
Todd Turnidge 1166f83bf6 Only reload libraries when they may have been modified.
We now check all of the scripts which make up a library.  If any
script is modified, then we consider that library to be modified.  We
also consider any library which imports a modified library to be
modified.  To propagate this info efficiently, we build and discard
the imported-by graph when beginning a reload.

The embedder must provide a FileModifiedCallback in order to support
the detection of modified scripts.

In order to detect changes to package: libraries, we have modified the
embedder interface to provide the resolved url when possible, so that
we don't need to re-resolve package uris when checking for reload.
This change is incompatible and all embedders will need to be updated.

We now support a "force" flag when reloading sources.  This causes all
libraries to be reloaded regardless of whether the underlying scripts
have been updated.

Closes #26919

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2186423002 .
2016-07-29 11:23:18 -07:00
John McCutchan d0ebc78d68 Peturb the reload points on the reload bot
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2183533002 .
2016-07-25 13:34:04 -07:00
Zachary Anderson b0503ad81c Fix build
Review URL: https://codereview.chromium.org/2173223002 .
2016-07-22 14:07:07 -07:00
Zachary Anderson 53374c3b99 Fuchsia: Build standalone VM. Make it run "Hello, World!".
This CL adds targets to the GN build that build the standalone Dart VM
without the observatory, and with dart:io enabled but with most of the
functionality stubbed out as UNIMPLEMENTED(). It also adds a simple
eventhandler for Fuchsia for implementing Timers.

R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2168193002 .
2016-07-22 14:00:31 -07:00
Ryan Macnak 35f56623d4 Speculative fix for timeouts (hangs) in
language/disassmble_test
  utils/recursive_import_test
  utils/dummy_compiler_test

Also fix an ASAN warning about mismatched new/delete.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2164383002 .
2016-07-21 11:25:05 -07:00
Florian Schneider 63e3f4dc8b Make loader lock new-allocated to avoid shutdown crash.
Process::Exit does not do the normal shutdown procedure - this CL avoids
a crash in the static destructor of the loader info lock by making it
new-allocated.

Also remove --shutdown flag since the clean shutdown procedure is on by
default since a while now.

BUG=#26846
R=asiva@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2147833002 .
2016-07-13 09:41:06 -07:00
John McCutchan 24a0988df6 Hot reload fixes for isolate tests
- [x] Bump maximum number of vm arguments (fixes a bunch of reload crashes....)
- [x] Only check that an isolate has reload if it was ever runnable.
- [x] Skip some isolate tests that use deferred libraries or are checking for closure identity.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2141763002 .
2016-07-11 13:58:26 -07:00
John McCutchan ef71bc1834 Improve hot reload test mode
- [x] Start reloading even earlier.
- [x] Keep the value of FLAG_reload_every per-isolate (so spawned isolates reload eagerly too).
- [x] Adjust the reload every back off curve to be linear in the beginning.
- [x] Cap the reload every threshold at 1,000,000
- [x] Test status file updates.
- [x] Stop disabling the background compiler / OSR when running tests.
- [x] Skip multi tests with compilation errors when reloading.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2133823002 .
2016-07-11 12:29:13 -07:00
John McCutchan dc1b2bf580 Small tweaks to hot reload testing
- [x] Start reloading 5x sooner in test mode.
- [x] Skip mirrors tests for now.
- [x] Skip reloading tests that expect compile time errors.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2128923003 .
2016-07-08 06:51:21 -07:00
John McCutchan af85432e28 Ban cross origin WebSocket connections to the service protocol.
- Explicitly allow connections from localhost/127.0.0.1 and the server's ip address and host name.

- This has the negative effect of breaking our Dartium work flow, so, I've added the "--disable-service-origin-check" flag to the standalone embedder which disables the security check.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2125343002 .
2016-07-07 12:14:54 -07:00
John McCutchan 621ce4e2fd Add --hot-reload-test-mode flag to embedder and wire it up to test.py
- [x] Add --hot-reload-test-mode to standalone embedder.
- [x] Have test.py pass `--hot-reload-test-mode` instead of specific flags.
- [x] Add --reload_every_back_off flag to control exponential backof off reloads.
- [x] Add --check_reloaded flag to ensure that an isolate has reloaded at least once before exiting.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2118923002 .
2016-07-01 14:26:25 -07:00
Siva Annamalai 9bb73c8906 Remove dead code _resolveUri in builtin.dart is not used anymore.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2111763002 .
2016-06-30 09:05:53 -07:00
Matthias Hausner a71a6fc689 Better command line error messages
BUG=20263
R=regis@google.com

Review URL: https://codereview.chromium.org/2084553003 .
2016-06-20 15:41:54 -07:00
Todd Turnidge 055231cee0 Allow embedder service request handlers to return JSON-RPC errors.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2041293003 .
2016-06-07 15:47:37 -07:00
John McCutchan bf4b3b3733 Activate the service isolate for all precompiled tests.
- [x] We always need the load port now.
- [x] Fix a minor locking issue in Loader::~Loader

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2041113003 .
2016-06-07 12:47:44 -07:00
John McCutchan c5dd06f7c7 Attempt to fix entrypoints list in main.cc
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2043953002 .
2016-06-06 16:21:46 -07:00
John McCutchan 6fd8fd7987 Rework standalone to use a synchronous loader that does not invoke Dart code
- [x] The first caller of the tag handler blocks, recursive callers queue work and exit.
- [x] Use a NativeMessageHandler to receive I/O results from the service isolate.
- [x] Preserve load error message format.
- [x] Move packages map into service isolate.
- [x] Wire up Todd's native URI code.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1998963003 .
2016-06-06 14:15:01 -07:00
Ryan Macnak ef8baa8760 Add test harness option for app snapshots with unoptimized code.
./tools/test.py -m all -c dart2appjit -r dart_app --use-blobs

Rename 'dart_product' runtime to 'dart_app'.

Rename Dart_PrecompiledJITSnapshotBlob to Dart_CreateAppJITSnapshot and add documentation.

Remove out-of-date scripts in tools/precompilation.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1992703005 .
2016-05-26 10:37:47 -07:00
Todd Turnidge a02995c3c3 Leave wiggle room in --observe documentation.
BUG=

Review URL: https://codereview.chromium.org/1975273002 .
2016-05-13 11:07:15 -07:00
Todd Turnidge bd3cdf4009 Improve the help message for --observe to be more explicit.
Closes #26340

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1981453002 .
2016-05-13 10:51:51 -07:00
Ryan Macnak 7546ef1709 Simplify command line options for creating snapshots.
Also makes codeless app snapshots work in debug and release modes.

dart --snapshot=file.snap [--snapshot-kind=script] script.dart
dart file.snap

dart_bootstrap --snapshot=dir --snapshot-kind=app-after-run script.dart
dart --run-app-snapshot=dir script.dart

dart_bootstrap --snapshot=dir --snapshot-kind=app-jit-after-run script.dart
dart --run-app-snapshot=dir script.dart

dart_bootstrap --snapshot=dir --snapshot-kind=app-aot script.dart
dart_precompiled_runtime --run-app-snapshot=dir script.dart

R=asiva@google.com

Review URL: https://codereview.chromium.org/1947783003 .
2016-05-06 12:40:04 -07:00
Ryan Macnak 257b3a82b8 JIT precompilated snapshots.
(Precompiled snapshots with unoptimized code.)

+ ./out/ReleaseX64/dart --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m3.299s
user	0m3.197s
sys	0m0.831s

+ ./out/ProductX64/dart_bootstrap --full-snapshot-after-run=/usr/local/google/home/rmacnak/dart3/sdk/app --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js
+ ./out/ProductX64/dart --run-full-snapshot=/usr/local/google/home/rmacnak/dart3/sdk/app --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
vm-service: Isolate creation error: (null)
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m1.979s
user	0m1.806s
sys	0m0.581s

+ ./out/ReleaseX64/dart_bootstrap --use_blobs --gen-precompiled-jit-snapshot=/usr/local/google/home/rmacnak/dart3/sdk --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js
VMIsolate(CodeSize): 2699304
Isolate(CodeSize): 5930097
Instructions(CodeSize): 9440176
Total(CodeSize): 18069577
+ ./out/ReleaseX64/dart --use_blobs --run-precompiled-jit-snapshot=/usr/local/google/home/rmacnak/dart3/sdk --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m0.994s
user	0m1.259s
sys	0m0.229s

R=asiva@google.com, fschneider@google.com

Review URL: https://codereview.chromium.org/1938653002 .
2016-05-04 18:47:36 -07:00
Ryan Macnak 3ae8c18359 Fix gcc 4.9 build errors.
(-Werror=clobbered and -Wconversion-null)

BUG=http://dartbug.com/26309
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1932253002 .
2016-04-29 10:34:03 -07:00