Commit Graph

3601 Commits

Author SHA1 Message Date
Adam Barth 6b52846b2c Update use of mx_handle_wait_one().
BUG=

patch from issue 2465123003 at patchset 20001 (http://crrev.com/2465123003#ps20001)
2016-11-01 13:42:31 -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
John McCutchan 63e4f69e5e Provide an API to dart:developer to control the web server hosting the Service Protocol
- [x] Add `ServiceProtocolnfo` class to dart:developer.
- [x] Add `Service` class to dart:developer.
- [x] Add `Service.getInfo` static method to dart:developer.
- [x] Add `Service.controlWebServer` static method to dart:developer.

API:

```dart

/// Information about the service protocol.
class ServiceProtocolInfo {
  /// The major version of the protocol.
  final int majorVersion;
  /// The minor version of the protocol.
  final int minorVersion;
  /// The Uri to access the service. If the web server is not running, this
  /// will be null.
  final Uri serverUri;
}

/// Access information about the service protocol and control the web server.
class Service {
  /// Get information about the service protocol.
  static Future<ServiceProtocolInfo> getInfo();

  /// Control the web server that the service protocol is accessed through.
  static Future<ServiceProtocolInfo> controlWebServer({bool enable: false});
}
```

... and add a randomly generated authentication token path prefix that must be passed in to access the service protocol.

Old base url:

Observatory listening on http://127.0.0.1:54804/

New base url:

Observatory listening on http://127.0.0.1:54804/<token>/

For example:

Observatory listening on http://127.0.0.1:54804/PTwjm8Ii8qg=/

Many tools will need to be updated.

Fixes #23320

BUG=
R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2438613002 .
2016-10-31 12:32:23 -07:00
Zachary Anderson be11752b14 Use 'mx_channel' instead of deprecated 'mx_msgpipe' naming
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2458703004 .
2016-10-31 11:10:06 -07:00
Zachary Anderson e29da6037b Small cleanups and linter fixes.
Review URL: https://codereview.chromium.org/2455983002 .
2016-10-27 05:02:20 -07:00
Vyacheslav Egorov eb8c24e133 Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451623006 .
2016-10-27 10:09:22 +02:00
Zachary Anderson 55094eadd7 Fuchsia: fix build
Review URL: https://codereview.chromium.org/2448323005 .
2016-10-26 09:50:05 -07:00
Zachary Anderson c1313a5ec7 Format GN files and add a presubmit check that GN is properly formatted
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2451613005 .
2016-10-26 08:50:54 -07:00
Zachary Anderson e3f1794ba3 GN: Fix dart_bootstrap build
Makes sure we are using the no_snapshot variants of the libraries,
that we get builtin.cc instead of builtin_nolib.cc, and that all of
the right library sources get built in.

fixes=27668

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2449223004 .
2016-10-26 08:24:23 -07:00
Vyacheslav Egorov 12968edb9c Revert "Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork.""
This reverts commit 4e7a31262e.

Windows bots are broken now.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451893004 .
2016-10-26 17:07:18 +02:00
Vyacheslav Egorov 4e7a31262e Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This relands commit 2fed1c3905 with fixes to ensure that analyzer summaries are correctly created and XARM build does not try to use target binaries on the host.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2453773002 .
2016-10-26 16:48:28 +02:00
Vyacheslav Egorov cf7ff42e60 Revert "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This reverts commit 2fed1c3905.

SDK builds are failing

TBR=zra@google.com

Review URL: https://codereview.chromium.org/2455593002 .
2016-10-26 13:06:27 +02:00
Vyacheslav Egorov 2fed1c3905 Merge more Kernel infrastructure from kernel_sdk SDK fork.
- bring patched SDK generation scripts and VM patch tweaks that allow VM patch files to be parsed by analyzer front-end;
  Patched SDK is an SDK with all VM patches spliced into it. Kernel compiler is based on the analyzer front-end which does
  not have any patch files support/model so for it to produce Kernel files that match VM we need to generate a such patched SDKs.

- bring test script modifications that allow to test Kernel pipeline

BUG=
R=asiva@google.com, kmillikin@google.com, whesse@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2434123003 .
2016-10-26 13:02:54 +02:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

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

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Zachary Anderson 624675349a Stub out Socket::LookAddress on Fuchsia
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2446343002 .
2016-10-25 13:07:23 -07:00
Ryan Macnak 7c14d5e7d7 Exit gen_snapshot and log an error if an output file path is invalid
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2440113003 .
2016-10-21 16:04:32 -07:00
Zach Anderson b6ea87c444 [windows] Make most file_win.cc functions use malloc for string conversions.
They have been using Dart_ScopeAllocate(), which makes them impossible
to use outside of a scope.

Also turn on inlining in the GN Debug windows build to match the gyp build
and speed things up a bit.

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

Review URL: https://codereview.chromium.org/2439173002 .
2016-10-21 14:55:37 -07:00
Zachary Anderson 2312ff7cf4 Fuchsia: Use mx_handle_wait_many in the eventhandler
This is to set up for more handles coming in from sockets, etc.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2438903002 .
2016-10-21 13:38:06 -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
Zachary Anderson 8200955ed0 Fuchsia: Add native symbol resolver. Small fixes.
R=asiva@google.com

Review URL: https://codereview.chromium.org/2438843002 .
2016-10-20 13:39:35 -07:00
Zachary Anderson 1baa650388 Fuchsia: Fix eventhandler for changed syscall return
Review URL: https://codereview.chromium.org/2433833005 .
2016-10-20 07:47:26 -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
Zachary Anderson 16db33b7a2 Propagate errors correctly in Socket.connect
socket.port can throw an exception. The error from the
exception, if there is one, has to go to the completer,
not be thrown up the stack, otherwise it may go to the
enclosing Zone rather than e.g. a try ... catch around
await Socket.connetc().

This is a possible fix for the issue below, but it is
tough to say because I don't have a reliable repro.

related #27440

R=asiva@google.com

Review URL: https://codereview.chromium.org/2426413006 .
2016-10-19 15:12:59 -07:00
Zachary Anderson 9d29251368 Remove dependency on Fuchsia's runtime library.
This library is no longer publicly exposed. The only functionality used
by it is the utility function for printing mx errors, which has now
moved into the vDSO and is available in <magenta/status.h>.

R=zra@google.com, zra@chromium.org

Review URL: https://codereview.chromium.org/2428373005 .
2016-10-19 15:09:32 -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
Zach Anderson df260e5fe7 Fix crashes on debug windows
Review URL: https://codereview.chromium.org/2426053002 .
2016-10-18 09:37:04 -07:00
Siva Annamalai bcea09162a Land https://codereview.chromium.org/2423893003/ for viettrungluu
TBR=zra

Review URL: https://codereview.chromium.org/2426833002 .
2016-10-17 16:57:02 -07:00
Vyacheslav Egorov f67ce21068 VM support for running Kernel binaries.
BUG=
R=asiva@google.com, fschneider@google.com

Review URL: https://codereview.chromium.org/2411823003 .
2016-10-15 22:48:46 +02: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
Zachary Anderson 7ace8dc4f7 [fuchsia] fix uninitialized field in the event handler
R=asiva@google.com

Review URL: https://codereview.chromium.org/2399283003 .
2016-10-07 11:16:57 -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 42c58c5c2d - fix some cases where we are using uninitialized memory
- use attribute 'no msan' on NativeEntry::ReturnValueIsError function
  as msan doesn't seem to track the return slot being set by a native
  function
- vsnprintf seems to have issues with msan so unpoison the allocated
  memory buffer everytime vsnprintf is used to suppress the error.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2383293003 .
2016-10-05 16:54:18 -07:00
John McCutchan 8b37da82ef Support paths which are encoded with base64 in http put devfs server code
- [x] Add a new header 'dev_fs_path_b64' which is used over 'dev_fs_path' when present.
- [x] 'dev_fs_path_b64' expects the path encoded as UTF8 and then BASE64.
- [x] Add unit test case.

BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/2386123005 .
2016-10-04 15:31:09 -07:00
Zach Anderson 9a6797e6ba GN build on windows
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2385643004 .
2016-10-04 09:19:07 -07:00
Siva Annamalai d30d056951 disable use of tcmalloc if msan is enabled during the build.
R=zra@google.com

Review URL: https://codereview.chromium.org/2384903002 .
2016-10-03 11:28:52 -07:00
Zachary Anderson 7c784cea9f Linux create_sdk GN build for host
This CL enables GN builds of all targets from dart.gyp
on Linux for the host (i.e. ia32, x64).

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2379803002 .
2016-09-29 13:23:00 -07:00
Chinmay Garde cfbf1a511e CoreServices is not available on iOS. Don't add it as a dependency.
R=zra@google.com

Review URL: https://codereview.chromium.org/2378953003 .
2016-09-29 11:05:27 -07:00
Zachary Anderson 27784381b2 Add tcmalloc to GN build
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2367723004 .
2016-09-23 15:24:54 -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
Zachary Anderson a76aa4e70c Throw an ArgumentError if the port is out of range
fixes #27416

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2361373003 .
2016-09-23 11:12:54 -07:00
Zachary Anderson 7e1b7e54d7 Starting work on full GN build
This change:
- Sucks in gn binaries
- Sucks in a version of llvm that the GN build likes
- Adds tools/gn.py to invoke gn
- Adds a root BUILD.gn and .gn file
- Removes chrome boilerplate we don't need
- etc.

This lets us do a standalone build of the 'runtime'
target for x64, ia32, arm, arm64, mips, and the
simulators on Linux, and arm and arm64 on Android.

It does not include tcmalloc, and hasn't been tested
on Mac or Windows. That work and more cleanup of
chrome boilerplate will come in follow-up CLs.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2350583002 .
2016-09-23 07:47:36 -07:00
Zachary Anderson 94c96ac42c Added a target for a host version of the dart executable.
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2351743004 .
2016-09-21 19:05:06 -07:00
James Robinson 8a53ba91de Stop using deprecated (names of) magenta syscalls.
R=jamesr@chromium.org

Review URL: https://codereview.chromium.org/2355953004 .
2016-09-20 15:55:51 -07:00