Commit Graph

629 Commits

Author SHA1 Message Date
johnmccutchan@google.com 66aa470fc6 * Create vm-service isolate at Dart_Initialize time.
* Remove Service create callback.
* Simplify creation of service isolate.
* Creation is done on thread pool.
* Use vm-service isolate for loading in standalone embedder.
* Remove import of dart:io from builtin library.

performance changes:

no service isolate:

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | -    0]

always start service isolate (as a thread pool task):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:45 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:44 | 100% | +12363 | -    0]

service does I/O (calls to Dart_LoadScript block until service is running):

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | -    0]

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43202 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 19:45:48 +00:00
koda@google.com 60831f3e26 Fix leak from new/free mismatch in main.
Found using AddressSanitizer.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42563 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-23 18:06:31 +00:00
ajohnsen@google.com 0491f4e887 Per isolate package root.
BUG=
R=iposva@google.com, ricow@google.com, sgjesse@google.com, turnidge@google.com

Committed: https://code.google.com/p/dart/source/detail?r=40534

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40581 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-23 05:46:14 +00:00
ajohnsen@google.com 38619425c2 Revert "Per isolate package root."
Revert "Fix test in checked mode."

The Dartium branch is locked atm, making it impossible to land this and have green Dartium bots.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40540 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 11:13:28 +00:00
ajohnsen@google.com a058d07806 Per isolate package root.
BUG=
R=iposva@google.com, sgjesse@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40534 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 08:07:06 +00:00
johnmccutchan@google.com 435c6ad7ac Reduce service isolate startup time from ~80ms to ~30ms
- Get access to dart:io internal signal listening function using API instead of mirrors.

- Service isolate can start with service deactivated.
- Load Observatory front end resources only when service activated.
- Do not execute Dart Service code until service is activated.
- Register live isolates when service is activated.

- Startup refactored to allow for future use of script snapshots.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40124 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 22:38:33 +00:00
zra@google.com 0f6c47ab78 Delays creating a snapshot file until after the snapshot is created.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39998 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 20:52:25 +00:00
ajohnsen@google.com 8c633a390e Cleanup resource loading of the VM.
There is not only one path for loading resources, and it's async.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39847 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 06:42:01 +00:00
turnidge@google.com 2d4250d852 Defer execution of the main isolate's entry point until the message loop.
This allows us to know more accurately the stack limit while running main.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39558 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 17:21:20 +00:00
turnidge@google.com c48496b873 Refactor isolate startup code in preparation for making isolate spawning more truly non-blocking.
Instead of passing a startup message to the new isolate, pass all
necessary information in to _startIsolate directly.  The new isolate
sends its control port and capabilities back to the parent.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39423 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 19:57:09 +00:00
iposva@google.com e57e60c300 Fix Windows Dartium build:
- Cannot access dart::bin::* from Dartium build.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39238 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 05:00:37 +00:00
ajohnsen@google.com f560436366 Fix two other issues, with my previous commit.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38619 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 13:12:22 +00:00
ajohnsen@google.com d56b11bf59 Compute absolute script path at isolate startup.
BUG=https://code.google.com/p/dart/issues/detail?id=20119
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38616 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 12:31:29 +00:00
ajohnsen@google.com d481c8b61c Start accepting incoming sockets earlier on Windows, to associate a at AcceptEx error to 'ServerSocket.bind'.
Note that I have not been able to reproduce the error, thus no test is added for this case.

BUG=http://code.google.com/p/dart/issues/detail?id=19815
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38606 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-28 11:36:35 +00:00
asiva@google.com 857304304f Do not add '-p' and 'c' options to VM options, the VM flag processing
functionality only accepts flags with the '--' prefix. It silently
ignores all following options if an invalid option is specified.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37517 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-19 21:00:50 +00:00
johnmccutchan@google.com 164a3500ef SIGQUIT toggles VM service HTTP server
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37396 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-17 14:26:38 +00:00
srdjan@google.com f4a625f895 Do not write protect code when running standalone. Improves startup performance.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37032 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-05 16:56:46 +00:00
johnmccutchan@google.com 2acd1f8c5b Fix error message with --observe flag
BUG=
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36649 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 07:40:17 +00:00
johnmccutchan@google.com c57e2b0d40 Add --observe flag alias
BUG=
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36648 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 07:26:05 +00:00
srdjan@google.com 5f4b13607e Do not Dart_RunLoop if --load_async=false. This allows the program to run to the end with --pause-isolates-on-exit --load-async=false.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36595 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-23 22:37:57 +00:00
hausner@google.com c6101ca4b5 First step towards asynchronous loading of sources. With this change, sources are read asynchronously in dart code (builtin.dart) and when the i/o future completes, a callback in the VM loads and compiles the script or library code.
In a next step, the i/o will be moved to the service isolate so that not all isolates have to import dart:io.

Fallout from this change:
1) Loading has become a tad slower. Will have to investigate why.

2) Errors that happen during loading (file not found, compilation error in an imported library)  are no longer reported at the offending import clause. This can be fixed later if necessary by passing the import clause source location to the library tag handler.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36575 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-23 17:43:14 +00:00
srdjan@google.com 6e6ead2faf Fix crash when no package root argument is specified. (Issue 18935).
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36438 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 16:46:19 +00:00
ajohnsen@google.com 198b11bd9b Add IO service object handler, with initial implementation for HTTP server.
This is tempoary disabling the Socket service handler.

BUG=
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36417 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 11:12:49 +00:00
turnidge@google.com 78f3f14635 Add pause/resume for isolates in vmservice/observatory.
Improve the isolate view and isolate summary.

Details:

- Rig DbgMsgQueueList so it can run even when the debugger hasn't started.

- Add <action-link> element for pause/resume actions.

- Introduce new flex-percentile css classes.

- Add <isolate-run-state>, <isolate-location>, <isolate-shared-summary>, and <isolate-counter-chart> elements.  Counters are now displayed as a pie chart instead of as text.

- Reorg <isolate-view> and <isolate-summary> substantially.

- Add shared style sheet to <script-view>.

- Combine pause-on-start/pause-on-exit with other debugger pause events and present a consistent representation for these in the vm service.  Reorg how pause events are shown in <isolate-run-state>.

- Give the user a nicer message when an isolate is still loading.

- Move the /resume command to /debug/resume.  Implement this with a bool in the Isolate class which is used to smuggle resume requests from the vm service to the dart embedding api.

- Add the /debug/pause command to the vm service

- Break the DebuggerEvent struct out into its own top-level class.  Add JSON printing.

etc.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36366 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-20 17:09:08 +00:00
kustermann@google.com ebd8317290 Extract common code, add host IP to --debug and --enable-vm-service options
R=hausner@google.com, johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35312 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 13:09:10 +00:00
johnmccutchan@google.com c3a88f02c0 Register existing isolates when service isolate is started
BUG=
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35227 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-21 22:16:34 +00:00
sgjesse@google.com 1e3e88769f Socket I/O statistics for Observatory
This is the first part of adding I/O statistics to the observatory.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33366 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 11:12:08 +00:00
ajohnsen@google.com 0f52be7f63 Make std* blocking file-descriptors.
This will most likely be a performance regression when piping, that
we'll have to look into in the future (copying data through
    message-passing).

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32715 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-17 10:06:35 +00:00
johnmccutchan@google.com c76b6eb1c2 Split service into VM and embedder specific bits.
Move most service sources into the VM.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31809 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-14 22:34:43 +00:00
johnmccutchan@google.com a80d328371 Call exit instead of returning from main
BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30672 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-26 18:13:51 +00:00
iposva@google.com 070d3dedf7 - Add a per-isolate pseudo random number generator to the
VM internals. This PRNG is not used to generate random
  numbers in Dart code.
- Use the PRNG to generate JIT cookies for large constants
  if needed during assembly.
- Add the possibility to set an external entropy source
  for the PRNG through the C API.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29950 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-06 00:59:46 +00:00
srdjan@google.com 2b9fad92c7 In preparation of inlining remainder and modulo binary Smi operations:
- Add REM token
- Fix checking of function fingerprints.
- Remove unused intrinsic for remainder (the function gets inlined and intrinsic is not generated)

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29929 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 19:27:46 +00:00
ajohnsen@google.com b71e57617e Always mark stdout and stderr as blocking on exit.
This is required by some shell systems, such as Emacs.

BUG=https://code.google.com/p/dart/issues/detail?id=14301
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29895 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 11:57:52 +00:00
iposva@google.com 3dced243b3 Fix http://dartbug.com/14763
- Find main in the exported names of the root library.
- Unify how the main function is called from spawnUri
  and the initial isolate.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29865 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-05 00:55:41 +00:00
sgjesse@google.com 36a67fa046 Implement fromEnvironment on bool, int and String
This implements const constructor fromEnvironment on bool, int and
String.

The VM have the added -Dname=value option to define the value for the
properties. All values are provided by using the -D - nothing is read
from the environment.

If the resulting value is null or - in the case of int.fromEnvironment
- not a number an ArgumentError is thrown.

This CL does not have any implementation for dart2js.

This is a continuation of the change
https://chromiumcodereview.appspot.com/24975002 by iposva@
BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29642 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 05:46:57 +00:00
whesse@google.com 462d0363fe Remove dart:io Options class.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29570 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 17:46:30 +00:00
turnidge@google.com 229e75a251 Add an option to trace the debug protocol to the dart binary:
--trace_debug_protocol

------------------------
Sample output:

[>>>] Sending message to debug fd 10:
{ "event": "isolate", "params": { "reason": "created", "id": 7114 }}
[>>>] Sending message to debug fd 10:
{ "event": "paused", "params": { "reason": "breakpoint", "isolateId": 7114,"location": { "url":"file:\/\/\/Users\/turnidge\/dart\/DebuggingExample\/bin\/debuggingexample.dart","libraryId":14,"tokenOffset":193}}}
[<<<] Receiving message from debug fd 10:
{"id":1,"command":"getStackTrace","params":{"isolateId":7114}}
[>>>] Sending message to debug fd 10:
{ "id": 1, "result": {"callFrames" : [ {"functionName":"main","location": { "url":"file:\/\/\/Users\/turnidge\/dart\/DebuggingExample\/bin\/debuggingexample.dart","libraryId":14,"tokenOffset":193},"locals":[]}]}}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29477 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 18:53:15 +00:00
johnmccutchan@google.com 8745ab62b8 Update VM service to new isolate API
R=floitsch@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29415 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 06:12:18 +00:00
floitsch@google.com 6a72655d1b Very simple version of Isolates.
R=ajohnsen@google.com, iposva@google.com, kasperl@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29271 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 19:23:00 +00:00
asiva@google.com a294e0a82f Fix for issue 14236:
Retain script path of parent isolate when spawnFunction is called so that
it works when using script snapshots.

The test case issue14236_test.dart is a script snapshot whose original source
file path is issue14236_source.dart

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29178 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 16:41:22 +00:00
iposva@google.com 736d03406e - Add the ability to pass the command line options as an argument to main.
R=asiva@google.com, floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28829 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-17 21:59:46 +00:00
johnmccutchan@google.com 2786add1ea Initial GUI for VM service
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28462 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-10 16:36:03 +00:00
johnmccutchan@google.com 7fec0190f5 Revert 28422
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28426 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 22:24:21 +00:00
johnmccutchan@google.com 209d858d4d Initial GUI for VM service
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28422 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 21:57:33 +00:00
asiva@google.com 1cd2ad79ec Fix for 12312 (Dartium crash when reloading after running tests).
Add framework for Dart_Cleanup which will cleanup stuff on exit.
Ideally the VM isolate should be shutdown in Dart_Terminate but we don't
seem to have a clean thread pool shutdown as a result of which there are
racing isolates.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28248 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 22:17:48 +00:00
regis@google.com 61ddf78204 Fix VM exit code in some cases.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27926 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-26 01:10:48 +00:00
iposva@google.com 35a8e25648 Fix http://dartbug.com/13297
- Error out early if the current working directory cannot be determined.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27486 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-13 16:40:36 +00:00
ajohnsen@google.com 3dfe7c97e2 Always initialize the EventHandler in the standalone.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26517 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-22 12:03:59 +00:00
whesse@google.com 9de122a462 Add Platform.packageRoot and Platform.executableArguments to dart:io.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26432 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 15:21:55 +00:00
johnmccutchan@google.com 33d528a787 Remove race(s) in vmservice tests.
BUG=https://code.google.com/p/dart/issues/detail?id=12294
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25927 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 15:44:21 +00:00