Commit Graph

3601 Commits

Author SHA1 Message Date
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
Zachary Anderson 64e9017629 Fuchsia: Platform specific calls needed to Initialize and Cleanup VM.
fuchsia_test now succeeds.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2148533002 .
2016-07-13 09:12:28 -07:00
John McCutchan e6e61332d6 Relax service protocol origin check to allow connections from localhost on any port.
This is necessary because adb port forwarding will give us a different port than the port bound on the actual device.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2146613002 .
2016-07-12 13:27:01 -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 96b9625bc5 Fix the Dartium build
BUG=

Review URL: https://codereview.chromium.org/2131603003 .
2016-07-07 12:22:06 -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 2a2c3c9b33 Fix Windows dev_fs_test failure
BUG=

Review URL: https://codereview.chromium.org/2111673009 .
2016-07-01 15:54:26 -07:00
Todd Turnidge f7242f2137 Reimplement devfs in dart. Implementation now writes to disk.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2120473004 .
2016-07-01 14:57:32 -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
Zachary Anderson a503570e3a Fuchsia: Initial check-in.
Instructions to build and run are in README.fuchsia.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2117593002 .
2016-07-01 12:42:05 -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
Siva Annamalai d41d5dc414 Do not use Dart_DefaultCanonicalizeUrl for resolving a script uri in the current working directory as that code has not been written to handle paths on windows.
Review URL: https://codereview.chromium.org/2081853004 .
2016-06-20 19:59:53 -07:00
Siva Annamalai aca3d3eedf Fix canonicalization of relative paths, Dart_DefaultCanonicalizeUrl expects the base)url to end with a '/' when a directory is passed in otherwise it assumes a file path is passed in.
Review URL: https://codereview.chromium.org/2087723002 .
2016-06-20 17:55:41 -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
Siva Annamalai 11682cd4c7 Use the new loader mechanism to resolve URIs and load script files in gen_snapshot. This should allow the package config resolution to work in gen_snapshot for flutter and dartium snapshot generation cases.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2073173002 .
2016-06-20 13:56:06 -07:00
Siva Annamalai 72f7d1456c Change Dart_DefaultCanonicalizeUrl to accept the library url string instead of a library, this is useful to allow us to use this to generically resolve a Uri relative to another string.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2068833002 .
2016-06-14 17:15:51 -07:00
Lasse R.H. Nielsen 191ab42d64 Make VM resolvePackageUri fail on package:foo and package:/foo.
R=asiva@google.com, floitsch@google.com

Committed: https://github.com/dart-lang/sdk/commit/eb49613cbfaca2167b124ab01064a2412ff844a5

Review URL: https://codereview.chromium.org/1998603002 .
2016-06-14 12:22:15 +02:00
Lasse R.H. Nielsen a5aebce4b7 Revert "Make VM resolvePackageUri fail on package:foo and package:/foo."
There were some tests of the changed behavior.

R=whesse@google.com

Review URL: https://codereview.chromium.org/2068633002 .
2016-06-14 10:53:08 +02:00
Lasse R.H. Nielsen eb49613cbf Make VM resolvePackageUri fail on package:foo and package:/foo.
R=asiva@google.com, floitsch@google.com

Review URL: https://codereview.chromium.org/1998603002.
2016-06-14 09:38:51 +02:00
Zachary Anderson 678cb048ed Adds blocking file locks.
Fixes #26665

R=sgjesse@google.com

Review URL: https://codereview.chromium.org/2050413002 .
2016-06-13 07:58:09 -07:00
John McCutchan 8b4ac265c7 Fix Windows bots
BUG=

Review URL: https://codereview.chromium.org/2045243003 .
2016-06-08 07:20:42 -07:00
John McCutchan 3b2e14ab56 Fix deferred load errors
R=hausner@google.com

Review URL: https://codereview.chromium.org/2045023003 .
2016-06-08 07:12:52 -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
Siva Annamalai 53c20930d1 Add --packages option to gen_snapshot in order to accept package map files (see https://github.com/dart-lang/sdk/issues/26362)
BUG=26362
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2044673002 .
2016-06-06 17:12:20 -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 154a659b5e Fix Dart2js, analyzer bots
- Re-add support for loading from a script snapshot

BUG=

Review URL: https://codereview.chromium.org/2041173002 .
2016-06-06 15:30:33 -07:00
John McCutchan 1020392647 Add missing locking around loaders list
BUG=

Review URL: https://codereview.chromium.org/2039383002 .
2016-06-06 14:51:24 -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
Lasse R.H. Nielsen c7e601c90d Revert "Add package-config tests where test is running in Isolate.spawn-isolates."
This reverts commit f3f6d1e00d.

Running a new process doesn't correctly pass empty command line parameters on Windows.

Committed: https://github.com/dart-lang/sdk/commit/151d1b67961d3be2a7dc8f5f76948ccbfe045fcb

R=floitsch@google.com

Committed: https://github.com/dart-lang/sdk/commit/2d8e63e9859a388cd1a3847ef5d20a32ace52c6c

Review URL: https://codereview.chromium.org/2038033002.
2016-06-06 08:46:58 +02:00
John McCutchan d47866964c Fix canonicalization of --url_mapping URIs in gen_snapshot
When gen_snapshot encounters a url that has been remapped with the --url_mapping command line argument it rewrites the library's url to be the mapped url before canonicalization. The new C++ API only does canonicalization with respect to the library's url (as returned by Dart_LibraryUrl) which is insufficient for gen_snapshot. The correct long-term fix is to alter the new C++ API to allow for the base url to be passed in directly rather than indirectly via Dart_LibraryUrl.

This CL just restores some deleted code and has gen_snapshot work like it did before. The standalone embedder still uses the C++ API during loading.

Review URL: https://codereview.chromium.org/2031103002 .
2016-06-02 14:52:42 -07:00
Todd Turnidge a7d46eb5a6 Canonicalize uris in C++ instead of Dart for the standalone embedder.
Adds Dart_DefaultCanonicalizeUrl() to the dart embedding api.

Motivation:

As we try to get source reloading working for the standalone embedder, things get simpler if an isolate doesn't run Dart code while it is loading Dart code.  We intend to solve this by moving the embedder tag handler calls to the service isolate.  But making a blocking rpc into the service isolate whenever a url needs to be canonicalized during parsing seems like it would slow things down and make things complicated.  By moving canonicalization into C++, we avoid this.

R=ahe@google.com, fschneider@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2011543002 .
2016-06-02 12:29:57 -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
John McCutchan 78c82d5a0c Separate the list of dart:io entry point functions so it can easily be consumed by other embedders
BUG=

Review URL: https://codereview.chromium.org/2005293002 .
2016-05-24 09:47:38 -07:00
Todd Turnidge b3a1066c8e Simplify the canonicalization of dart-ext uris.
We used to stuff the path of the canonicalizing library into the uri
so that we could retrieve it later.  That isn't necessary, as the
library is still available when we import later.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2004933002 .
2016-05-23 10:25:25 -07:00
Zach Anderson 18ec8dddd9 Add back join of windows eventhandler threads
These threads are polluting the exit code despite using the better
ExitProcess call. Instead of adding back Thread::Join, I've instead
inlined the call into the eventhandler to make it easier to be sure
the open handles are closed.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1989463003 .
2016-05-17 14:53:54 -07:00
Zach Anderson 5f59a954f8 Uses an open thread handle as the ThreadJoinId on Windows.
Also:
- Reaps exited threads in the thread pool before putting
a thread on the idle list so that a new arriving task
isn't blocked on a supposedly idle thread in the middle
of a join.
- Stops trying to join eventhandler threads on
Windows. Now that we're using the correct exit() call,
we probably don't have to worry about exit code pollution,
so joining the threads is unnecessary.

related #26400

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

Review URL: https://codereview.chromium.org/1978153002 .
2016-05-17 13:18:13 -07:00
Florian Loitsch 26250e0322 Remove output from gen-snapshot.
R=johnmccutchan@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1986723003 .
2016-05-17 17:59:10 +02:00
Harry Terkelsen 1745ba77f5 fix all instances of "the the"
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1980573003 .
2016-05-13 12:38:25 -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
Florian Loitsch e3c3f099ea Fix strong mode errors in dart:io.
Still a lot of strong mode warnings left.

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

Committed: https://github.com/dart-lang/sdk/commit/5216f1d67d09d289f7c7ceab56a64ce0dcb7d563

Reverted: https://github.com/dart-lang/sdk/commit/7503ecc8fdb32747b2b05b529219ce83da8f0b6c

Review URL: https://codereview.chromium.org/1904553006 .
2016-05-12 13:17:31 +02:00
Florian Loitsch 7503ecc8fd Revert "Fix strong mode errors in dart:io."
This reverts commit 5216f1d67d.

BUG=

Review URL: https://codereview.chromium.org/1966373002 .
2016-05-11 21:44:09 +02:00
Florian Loitsch 5216f1d67d Fix strong mode errors in dart:io.
Still a lot of strong mode warnings left.

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

Review URL: https://codereview.chromium.org/1904553006 .
2016-05-11 14:30:32 +02:00
Zachary Anderson 57fea4f10b Adds a gn argument for boringssl path
Fixes Flutter build. There should be no need for Flutter to set the
flag. Mojo will need to set the flag.

R=jsimmons@google.com

Review URL: https://codereview.chromium.org/1955163002 .
2016-05-06 15:05:10 -07:00
Jason Simmons 7eb43c2134 Return a null Platform.executable and resolvedExecutable on Android
See https://github.com/flutter/flutter/issues/3648

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1953333002 .
2016-05-06 14:29:53 -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
Zachary Anderson d55b87d622 Fixes GN boringssl deps path
The Mojo tree already DEPSes in boringssl into its //third_party. To
avoid DEPSing in two boringssl's, we need to look for the one there.
(The GN 'check' routine requires the sources to be found even if
noone depends on them.) Flutter will need to move its boringssl
DEPS from //dart/third_party/boringssl to //third_party/boringssl
to match.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1952383002 .
2016-05-05 16:07:11 -07:00