Commit Graph

1837 Commits

Author SHA1 Message Date
Todd Turnidge 996f012707 2nd attempt at adding streamListen/streamCancel to the service protocol.
This time I am committing the protocol changes first and saving the
Observatory changes for a second cl.

------

We currently support 5 streams: Isolate, Debug, GC, _Echo, and _Graph.

Only generate events when at least one client is listening to the
corresponding event stream.

Only send events to the clients that actually request them.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1166433008
2015-06-04 09:57:22 -07:00
John McCutchan 864f9a3c9b Cap the number of pending accepts on Windows
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1151753008
2015-06-01 06:38:22 -07:00
Florian Schneider 7759c171ed VM: Fix nosnapshot build
This makes --check-function-fingerprints work again.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org//1161473003
2015-05-28 15:12:20 +02:00
Ivan Posva 0358f722ba - Include original, loaded URI in error message.
- Update error string comparison in pub.

BUG=

Review URL: https://codereview.chromium.org//1156983003
2015-05-28 00:14:39 -07:00
Ivan Posva 42257ab482 - Avoid trying to write to final fields.
BUG=

Review URL: https://codereview.chromium.org//1154213006
2015-05-27 17:44:41 -07:00
Srdjan Mitrovic fc3cd69c05 Load deferred classes eagerly when generating script snapshots
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1155183003
2015-05-27 17:11:35 -07:00
Ivan Posva 2abc21a1bf - Avoid using a streamed receive port for single messages.
- Only open a single receive port for a set of load requests.
- Store information about load requests in a map, which will be able to hold
  other relevant information about the request.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1154173006
2015-05-27 16:59:43 -07:00
Todd Turnidge 8d24372339 Revert "Add the streamListen and streamCancel rpcs to the vm service."
This reverts commit 0967b63073.

Conflicts:
	runtime/observatory/tests/service/graph_test.dart
	runtime/vm/service.cc

BUG=

Review URL: https://codereview.chromium.org//1152283005
2015-05-26 15:22:39 -07:00
Todd Turnidge 0967b63073 Add the streamListen and streamCancel rpcs to the vm service.
We currently support 5 streams: Isolate, Debug, GC, _Echo, and _Graph.

    Only generate events when at least one client is listening to the
    corresponding event stream.

    Only send events to the clients that actually request them.

    Implement this all as Dart streams in the service lib.

    Update tests.  Fix a race in async_generator_..._test that was biting me.

Review URL: https://codereview.chromium.org//1143783003
2015-05-26 13:52:35 -07:00
John McCutchan d7450e43fb Update GN build files for Mojo roll
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1142293007
2015-05-22 11:32:14 -07:00
John McCutchan 3442cad286 Decrease Dart binary size by 1.7MB
- Add flag to enable zlib compression of resources to create_resource.py
- Enable flag for Observatory resources
- Use 'dart:io' ZlibCodec to decompress resources when first loaded into service isolate.
- Dart executable (debug, macos) goes from 15,460b to 13,752b

R=asiva@google.com

Review URL: https://codereview.chromium.org//1151743002
2015-05-21 13:35:11 -07:00
Søren Gjesse 75afdeedf4 Fix Android compilation
Add include missing in previous commit.

TBR=whesse@google.com
BUG=

Review URL: https://codereview.chromium.org//1148063002
2015-05-20 15:47:41 +02:00
Søren Gjesse e03ab17437 Make Platform.executable return the fully qualified path of the executable
BUG=http://dartbug.com/16994
R=kustermann@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//1145053002
2015-05-20 13:14:51 +02:00
John McCutchan 51d8bae199 Revert "Hide Isolate pointer from embedder"
This reverts commit 014e694ba7.

Revert "Fix fall out from hide isolate pointer change"

This reverts commit 966aafbc81.

Revert "Fix build"

This reverts commit d7b03ba7b0.

BUG=

Review URL: https://codereview.chromium.org//1140263005
2015-05-19 11:41:42 -07:00
John McCutchan 014e694ba7 Hide Isolate pointer from embedder
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1130753006
2015-05-18 14:06:10 -07:00
asiva@google.com 02e2c353d3 Add dart:io and dart:_builtin to the dartium snapshot so that vmservices can work, the previous approach of trying to load dart:io and dart:_builtin from the sources does not work in a dart-sdk distribution as the sources are not copied out.
R=johnmccutchan@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org//1143573003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45830 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 23:15:19 +00:00
asiva@google.com 35cbf31ca1 Instead of aborting in Builtin::LoadAndCheckLibrary let the caller handle the error condition accordingly.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1126233009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45804 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 23:27:58 +00:00
asiva@google.com 05d7eb5dfa Move symbol table from per isolate snapshot to vm isolate snapshot, this reduces the per isolate initial heap size
from New space (0k of 1024k) Old space (1274k of 1536k)
to New space (0k of 1024k) Old space (756k of 1280k)

R=hausner@google.com

Review URL: https://codereview.chromium.org//1123813002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45795 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 20:14:37 +00:00
asiva@google.com 6f2330f004 Use regular sources to load dart:io and builtin library instead of linking in the standalone dart snapshot for accessing these. This ensures that we can use the regular dartium snapshot to create the vmservice isolate.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1127173004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45788 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 17:40:09 +00:00
iposva@google.com d0763f97f3 - Add --trace-loading to trace resolution and loading.
- Remove unused --print-script option.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1138083003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45720 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 22:58:32 +00:00
asiva@google.com 8f9eee3f22 - Use conditional code inclusion for the dart_no_snapshot and dart executables using the MACRO DART_NO_SNAPSHOT
- Do some minor modifications to the intrinsifier code to not do redundant fingerprint checks and avoid code duplication.

These changes result in a text segment size savings of about 110k.

Old Sizes:
   text    data     bss     dec     hex filename
3801418    7696   19261 3828375  3a6a97 (TOTALS)

New sizes:
   text    data     bss     dec     hex filename
3690342    7696   19261 3717299  38b8b3 (TOTALS)

Review URL: https://codereview.chromium.org//1134623004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45704 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 18:31:55 +00:00
iposva@google.com f469f59b60 Reland r45669:
- Refactor builtin.dart before any further work in this file.

Change to original submission is to not doubly sanitize the
Windows path when setting the working directory.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1127343004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45703 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 18:23:20 +00:00
iposva@google.com 16a29667dd - Revert r45669 to address Windows issues.
R=vegorov@google.com

Review URL: https://codereview.chromium.org//1130003004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45672 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-09 00:59:00 +00:00
iposva@google.com 7f5cdff385 - Refactor builtin.dart before any further work in this file.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1137853002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45669 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-08 23:58:01 +00:00
johnmccutchan@google.com 95064c2d0d Fix Observatory rebuild
BUG=

Review URL: https://codereview.chromium.org//1133603002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45589 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-07 12:45:33 +00:00
johnmccutchan@google.com 37feb0c855 Add embedded_dart_io source_set for Sky
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1124193004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45576 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-06 21:36:15 +00:00
srdjan@google.com dbeedf6d26 Add --noopt flag that sets all kind of flags to make unoptimzied code as fast as possible (and not running optimized code at all).
Add flag --always_megamorphic_calls, causes instance calls to use megamorphic instead of ICdata calls.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1119013003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45475 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 20:55:24 +00:00
johnmccutchan@google.com e23be8563a Fixes to enable building dart:io implementation cleanly in mojo tree
+ make Observatory respect script line offsets (which Sky uses).

R=iposva@google.com

Review URL: https://codereview.chromium.org//1101083003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45427 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-27 14:46:32 +00:00
johnmccutchan@google.com 405d097ac8 Fix importing builtin libraries in gen_snapshot
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1107733003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45418 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 22:08:44 +00:00
turnidge@google.com d9f65329c3 Do not JSON encode the 'result' of a service rpc.
Before a response looked like this...

{ result:<string> id:* }

...where result was always a json encoded string.  This meant that
users of the service protocol had to json decode both the outer
message and the result, which was silly.

Now a response looks like this:

{ result:<map> id:* }

This means that users of the service protocol only need to decode once.

We have changed event formats as well.  Previously, an event looked like this:

{ result:<string> }

(Essentially a result without an id.)  The result was json encoded,
requiring the user to double-decode.

Now an event looks like this:

{ event:<map> }

This allows us to distinguish events from rpc results and avoids
double-decoding.  It also avoids having an id-less rpc result mistaken
for an event.

------------

Some details and associated changes:

- Unify GCEvent and ServiceEvent in the VM.

- Move sequence number handling out of dart code and into JSONStream
  in the VM.  Plumbing.  I needed to do this to avoid double-encoding.
  Some of the dart code gets a bit simpler.

- Update C++ tests to have a sequence number.

- Change format of method/params used in Error responses to be more json-y.

- Strip out double decoding in the service lib.

- Improvements to tests.  I was running into some races and other issues.

- Fail fast when we run into a message decoding problem.  Instead of
  returning a service exception, we now disconnect from the vm.

- VMDisconnected => ConnectionClosed.

- Add some support for a reason string when disconnecting from the vm
  in the service library.

Review URL: https://codereview.chromium.org//1093043004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45378 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 17:55:08 +00:00
ajohnsen@google.com ab6f8cc118 Make all of stdout/stderr/stdin pipes close-on-exec when spawing child processes.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1076093004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45370 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 07:37:53 +00:00
asiva@google.com ec55c135c5 Fix check for return of error before calling SyncDirectoryListing.
R=iposva@google.com

Review URL: https://codereview.chromium.org//1096803002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45292 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 17:23:10 +00:00
johnmccutchan@google.com 6f40403682 Remove embedder-package scheme
- Soon mojo embedder private packages will be imported with a 'dart:_' prefixes.
- Add an explicit test of transitive private library access. This ensures that imports of 'dart:embedder_private_packages' cannot access anything imported within it.

R=zra@google.com

Review URL: https://codereview.chromium.org//1066613004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45169 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 15:49:50 +00:00
turnidge@google.com 0edd5aae1e Some cleanups in the code that posts results to service clients.
- Remove the notion of event families and masks.  This wasn't really used.

- Change "response" to "result" in our response map to be more json-rpc-like.

- Pass events to the service isolate as Strings.

- Add more type declarations around raw data (Uint8List) responses.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1077823003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45034 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 21:08:38 +00:00
johnmccutchan@google.com 198120555f Allow for 'embedder-package' URI scheme in builtin.dart
- Will be used by Mojo embedder.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1074893003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45031 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-09 20:23:39 +00:00
iposva@google.com 320b0e5541 - Remove JSCRE from the runtime.
R=vegorov@google.com

Review URL: https://codereview.chromium.org//1071713003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44987 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-08 23:59:23 +00:00
sgjesse@google.com 5973b2c422 Make the construction of a ProcessResult public
There was really no need for it to be a private implementation.

BUG=http://dartbug.com/23070
R=lrn@google.com

Review URL: https://codereview.chromium.org//1068803002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44935 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-07 13:05:45 +00:00
koda@google.com 909b3f5cb5 Fix Dartium build: Add missing Dart_ExitIsolate before call to Dart_CreateIsolate.
The API specifies that there must be no current isolate when creating a new one.
Add the corresponding check.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1052053003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44848 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-01 22:32:22 +00:00
asiva@google.com f752505e8d Fix windows compilation error "cannot allocate an array of constant size 0".
Review URL: https://codereview.chromium.org//1045253003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44817 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-31 19:32:23 +00:00
asiva@google.com 0dde7915cf Adjust vmservice_dartium.cc to account for new isolate snapshot buffer name.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1042563002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44815 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-31 18:46:48 +00:00
asiva@google.com 87c8a6ee76 First step towards splitting a full snapshot into a vm isolate snapshot and a
regular isolate snapsot.
- change gen_snapshot to split a full snapshot into a vm isolate snapshot
  and an isolate snapshot
- change the build process and scripts to account for splitting the full
  snapshot

R=hausner@google.com

Review URL: https://codereview.chromium.org//1023753006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44814 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-31 18:46:19 +00:00
asiva@google.com 354b4f3228 Move definition of trace_debug_protocol to dbg_connection.cc as this file is also linked into libvmservice_io
R=hausner@google.com

Review URL: https://codereview.chromium.org//1040543003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44778 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-30 15:40:51 +00:00
johnmccutchan@google.com 14afbd7fc2 Fix compile all for service isolate
BUG=

Review URL: https://codereview.chromium.org//1046483002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44768 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-28 00:00:42 +00:00
johnmccutchan@google.com bc0b241b0e Enable strict flags for all service tests
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1043513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44765 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 23:32:07 +00:00
turnidge@google.com 4b43e9759d Clean up observatory testing processes when we are done with them.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1035943005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44742 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 16:09:12 +00:00
kasperl@google.com 4c94a04529 Fix assert syntax in VM service code.
R=iposva@google.com, johnmccutchan@google.com
BUG=

Review URL: https://codereview.chromium.org//1041613002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44727 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 07:38:04 +00:00
johnmccutchan@google.com d2f5d87c96 Shutdown the service isolate when shutting down the VM
- Add a service control message to initiate service isolate shutdown.
- Provide a callback for the embedder to do any service isolate cleanup.
- Dart_Cleanup will now block until the service isolate shuts down.

R=zra@google.com

Review URL: https://codereview.chromium.org//1030013002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44685 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-25 15:50:19 +00:00
rmacnak@google.com fbc6b005a4 Support percent encoded data URIs in the standalone embedder.
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1028453002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44609 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 20:11:53 +00:00
sgjesse@google.com a27b06c0f2 Make sure File_WriteFrom write all data unless an error occour
Signals can interrupt write before all requested data is written.

R=ajohnsen@google.com
BUG=

Review URL: https://codereview.chromium.org//1015763002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44570 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-19 10:13:28 +00:00
paulberry@google.com 8edfda7956 Avoid race in _FileSystemWatcher if subscription closed while event queued.
BUG=dartbug.com/22769
R=ajohnsen@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//1006683002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44459 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-13 12:53:07 +00:00