Commit Graph

3601 Commits

Author SHA1 Message Date
Søren Gjesse 753521a1d2 Improve the reporting of the number of CPUs on Mac OS
BUG=https://github.com/dart-lang/sdk/issues/23620
R=ahe@google.com

Review URL: https://codereview.chromium.org//1181333004.
2015-06-17 19:19:14 +02:00
Zachary Anderson fcd4c59430 Fixes crashes in VM isolate shutdown.
If null is not initialized before the VM Isolate's ObjectStore, the
ObjectStore's fields are initialized to kHeapObjectTag, which causes
a crash in VM Isolate shutdown.

There is also a crash when the VM Isolate is signaled with the
shutdown event, so this CL removes adding a Debugger to the
VM Isolate, so that there is no need to shut it down, and send
the signal.

NB: This change does *not* actually enable shutdown. It just fixes
crashes that would happen if it were enabled.

BUG=
R=iposva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1168933002.
2015-06-17 10:14:18 -07:00
John McCutchan 075ac55eb3 Introduce dart_tools_api.h
- Move contents of dart_debugger_api.h into dart_tools_api.h
- Make dart_debugger_api.h forward to dart_tools_api.h
- Move some (service, timeline) bits of dart_api.h into dart_tools_api.h.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1185983005.
2015-06-17 09:45:35 -07:00
John McCutchan c7187924a9 Initial Timeline Events
- Each isolate has its own TimelineEventBuffer
- Each isolate has TimelineEventStreams for API, Compiler, Embedder, Isolate, and GC
- Compiler, Isolate, Embedder, and GC are being inserted into the stream
- Basic unit tests
- Dart API for injecting timeline events
- Arbitrary number of native and Dart arguments can be attached to each event
- JSON printing
- Output can be loaded by about://tracing
- Add --timeline-trace-dir flag

Short term follow up CLS:
- Service protocol requests to enable / disable tracing and retrieve a trace
- UI for Observatory
- Dart code EventStreams and Events

R=asiva@google.com

Review URL: https://codereview.chromium.org//1170503004.
2015-06-16 10:10:14 -07:00
Anders Johnsen 9a01a22e96 Revert "Clean up process spawning."
This reverts commits
- bbdc57ebf6
- bd25e641f2
- 5cc8fca131
- ed72caa3cd

BUG=

Review URL: https://codereview.chromium.org//1182423003.
2015-06-15 15:26:56 +02:00
Søren Gjesse c05c8c6606 Revert change to Platform.excutable and add Platform.resolvedExecutable
The change to Platform.excutable in
e03ab17437 was a breaking change and it
has been reverted.

A new getter Platform.resolvedExecutable has been added to provide the
the fully qualified path of the executable.

BUG=https://github.com/dart-lang/sdk/issues/16994
R=lrn@google.com, kustermann@google.com, len@google.com

Review URL: https://codereview.chromium.org//1180623006.
2015-06-15 10:13:21 +02:00
Ivan Posva 7158d5fc26 Landing https://codereview.chromium.org/1171223003/ for Chinmay.
BUG=

Review URL: https://codereview.chromium.org//1174343006.
2015-06-13 06:36:24 -07:00
Soren Gjesse 82535a6e91 Resolve the executable path on Mac OS when sym-linked
Don't try to test sym-linked files on Windows as Junctions only support
directories.

This helps to locate the Dart SDK (if any) from the path of the dart
executable. On Linux the use of /proc/self/exe already takes care of this.

R=kustermann@google.com
BUG=

Review URL: https://codereview.chromium.org//1178643007.
2015-06-12 09:26:47 +02:00
Siva Annamalai 298a2f467f Add an assertion to ensure that the return type and types of parameters are canonical or a TypeParameter.
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1182673002.
2015-06-11 18:09:41 -07:00
Anders Johnsen ed72caa3cd Revert and fix more of the mac change.
BUG=

Review URL: https://codereview.chromium.org//1175603003.
2015-06-10 12:31:31 +02:00
Anders Johnsen bd25e641f2 Revert execvpe on Mac and fix usage of strerror_r.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1174903002.
2015-06-10 11:13:29 +02:00
Anders Johnsen bbdc57ebf6 Clean up process spawning.
Pass environment as argument to execvpe and use _exit instead of exit
(so fork/vfork can be used interchangeable).

BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1156313004.
2015-06-10 10:42:54 +02:00
Søren Gjesse d5a34bd6d2 Resolve the executable path on Mac OS when sym-linked
Also resolve its directory if symlinked.

This helps to locate the Dart SDK (if any) from the path of the dart
executable. On Linux the use of /proc/self/exe already takes care of this.

R=kustermann@google.com
BUG=

Review URL: https://codereview.chromium.org//1160793004
2015-06-09 16:13:00 +02:00
Ivan Posva f5e3f94019 Fix http://dartbug.com/23578:
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
  extra flags argument.
- Make sure to clear IC data array when clearing code.

BUG=23578

Review URL: https://codereview.chromium.org//1162033005
2015-06-07 17:57:34 +02:00
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