Commit Graph

122 Commits

Author SHA1 Message Date
Ivan Posva ba6c0ace3e - Add getters for the current packageRoot or packageMap to the Isolate class.
- Simplify loading in builtin.dart.

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

Review URL: https://codereview.chromium.org//1334353002 .
2015-10-03 06:53:13 -07:00
Lasse R.H. Nielsen 232a9d687e Add "environment" parameter to spawnUri for String.fromEnvironment support.
This completes the parameters corresponding to official command line parameters
for the VM/dart2js.

R=floitsch@google.com, iposva@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org//1350053002 .
2015-09-22 12:29:40 +02:00
Todd Turnidge b0ca0789be Fix a variety of service protocol bugs.
Add documentation for breakpoint.

Fix Instance.pattern documentation.

Fix Instance.bytes documentation.

Add class field for null instances.

Fix documentation of Context and closureContext.

Make getObject return Collected for deleted breakpoints.

Closes #24247
Closes #24249
Closes #24309
Closes #24325
Closes #24326
Closes #24327

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1341473002 .
2015-09-11 12:29:21 -07:00
Lasse R.H. Nielsen ff65079c47 Add packages parameter to Isolate.spawnUri.
No implementation supplied, marked as "not implemented everywhere".

BUG= http://dartbug.com/23951
R=iposva@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org//1323373002 .
2015-09-11 13:07:54 +02:00
Ivan Posva b07a9ddbca - Implement .packages specification.
Limitation: Currently only works for file: based .package files. If a script is loaded from http: then the VM currently assumes a co-located packages/ directory.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1232593003 .
2015-07-29 11:30:33 -07:00
Ivan Posva fe03640e85 - Implement VM parts of https://codereview.chromium.org/1240743003/
- Pass additional state in the IsolateSpawnState to set
  error and exit handlers, as well as fatal errors on isolate start.

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1244733002 .
2015-07-20 16:46:54 +02:00
Lasse R.H. Nielsen e4881c55d0 Add errorsAreFatal, onExit and onError parameters to the spawn functions.
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1240743003.
2015-07-16 16:52:43 +02:00
Lasse R.H. Nielsen 5a843ebbf3 Add "checked" parameter to Isolate.spawnUri.
R=iposva@google.com

Review URL: https://codereview.chromium.org//1154673004
2015-06-03 12:32:52 +02:00
lrn@google.com e96a973492 Reduce timer stack overhead by getting immediate callback and run it, instead of calling through function.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45097 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 12:35:40 +00:00
lrn@google.com 1b208bd6e6 Update Isolate API.
Remove AS_EVENT as priority of ping/kill. It wasn't very usable or predictable.
Make priority consistently named and a named parameter.
Add response object to ping/addExitListener so it doesn't have to send null.
This is useful for cases where you want to use the same receive port for
multiple purposes.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45092 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 10:29:54 +00:00
iposva@google.com 91e105d8c6 - Implement some more missing pieces of the Isolate API.
Added:
    * addOnExitListener, removeOnExitListener
    * setErrorsFatal
    * addOnErrorListener, removeOnErrorListener

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44307 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-07 01:04:19 +00:00
iposva@google.com b4088d10c9 Adjust handling of timers:
- Every zero timer is enqueued individually in the event queue
  and handled in sequence with other events.
- Non-zero timers and zero timers expire in order. Therefor a
  due zero timer will also fire all preceding non-zero timers
  to ensure this order.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44095 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-27 16:45:23 +00:00
iposva@google.com ad008bf8ba - Move timer implementation closer to the rest of message handling.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43225 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 00:39:35 +00:00
asiva@google.com ca1c3241c4 Fix for issue 21398.
Accept only 'literal-like' objects when sending messages to isolates
spawned using spawnURI. Allow all objects for isolates spawned using
spawnFunction.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42793 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-12 23:14:30 +00:00
iposva@google.com 2104fd6165 Fix http://dartbug.com/21834
- Ensure that microtasks fire after every timer event, instead
  of being bunched together once all pending timers fired.
- Do not wait for timer message to be delivered. Trigger timers
  as soon as they are ready from within the message handling
  loop.
- Notify timers in the order of wakeup time regardless of
  specified timeout value. (AKA Do not allow Timer.run to
  overtake new Timer() scheduled operations.)

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42673 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 22:21:59 +00:00
iposva@google.com fd69128004 - Allow an isolate to be started in paused state.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42576 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-30 23:52:37 +00:00
lrn@google.com cf724d70a9 Add Isolate.current getter, returning the current isolate as an Isolate object.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42499 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 07:04:29 +00:00
iposva@google.com 577242dbd4 - Implement Isolate.kill.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42355 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-13 00:39:16 +00:00
iposva@google.com 602aad28a1 - Implement Isolate.ping.
- Allow isolate library messages to be enqueued at the beginning
  of the message queue.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42193 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 22:45:10 +00:00
iposva@google.com 320ffa23a1 - Implement hashCode and == for Capability.
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42102 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-04 12:17:48 +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
lrn@google.com 0acdec95ff Specify packageRoot parameter to Isolate.spawnUri.
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39903 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 09:11:54 +00:00
ricow@google.com 69bed3d030 Revert revision 39617 "Create isolates in a separate thread."
This is breaking dartium with:
BrowserOutput.stderr:
  ../../dart/runtime/vm/dart_api_impl.cc:1614: error: Dart_EnterScope expects there to be a current isolate. Did you forget to call Dart_CreateIsolate or Dart_EnterIsolate?

R=vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39638 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 09:52:59 +00:00
turnidge@google.com 3cd24f8ebf Create isolates in a separate thread.
Previously the parent isolate waited for the child isolate to fully
load, which was not ideal.  This change fixes that.

If you run on mac, you may need to raise your open file limit to make mandel_isolate_test pass:

ulimit -n 1024

Default open file limit on the mac is low.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39617 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 19:47:06 +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 5686b6a793 - Implement Isolate.pause and Isolate.resume.
- Implement a minimum Capability functionality.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37982 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-03 12:56:02 +00:00
lrn@google.com 01897bf44d Revert "Ensure that failure to start an isolate all end up in the future."
Review URL: https://codereview.chromium.org//312123002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36986 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 09:40:29 +00:00
lrn@google.com c2aa45f121 Ensure that failure to start an isolate all end up in the future.
Isolate.spawnUri can fail in many ways.
Any problem that prevents calling "main" on a loaded isolate
should end up as IsolateSpawnException in the future returned by
Isolate.spawnUri.

This CL ensures that failure to look up main is handled correctly,
and adds more tests.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36982 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-04 08:42:39 +00:00
lrn@google.com 8e82e840e0 Make methods on isolate external.
R=iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36642 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 06:14:13 +00:00
iposva@google.com 16e405af4c - Fix for unsuccessful hoisting of CheckSmi in _HashMap.[]=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35511 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-28 23:43:19 +00:00
iposva@google.com fd8565b071 - Add a minimal implementation of Capability.
- Make RawReceivePort and SendPort VM internal objects.
- Rationalize the creation of ports and their handling within the VM.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35325 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 19:44:03 +00:00
iposva@google.com 0977a3bf2b - First step in refactoring ports with the goal of moving
them closer into the VM implementation.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34438 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 17:30:39 +00:00
lrn@google.com fd4b12a479 Fix file still using old Isolate constructor.
Review URL: https://codereview.chromium.org//187793002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33329 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-05 14:25:15 +00:00
lrn@google.com b23f5d0327 Add 'startPaused' option to Isolate.spawn*.
Initial implementation of startPaused in dart2js.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32722 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-17 13:06:06 +00:00
lrn@google.com 29dd07f51a Add Capability class.
Currently throws UnimplementedError in constructor patches. All implementation is still missing.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32274 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-04 09:23:38 +00:00
iposva@google.com 1e8061f060 - Remove the reply_port from the VM internal message object.
- Adjust all the uses of this API.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31205 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-17 21:11:18 +00:00
floitsch@google.com 0c8ac24661 Isolate.spawn{Uri} only reports errors asynchronously.
It is generally considered bad style to throw synchronous and asynchronous errors. This CL catches all synchronous errors and reports them in the asynchronous future that is returned.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31131 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-13 13:05:28 +00:00
floitsch@google.com 4b316431fa Implement scheduleImmediate for the VM.
BUG= http://dartbug.com/9001
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30797 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-02 16:27:07 +00:00
lrn@google.com a43c644f63 Make SendPortImpl_internalSend not take a reply port as argument.
The reply port is still there in the internal Message structure,
where it is used by control messages.

BUG= http://dartbug.com/14731
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30302 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-15 11:28:23 +00:00
lrn@google.com 207f0e6a3f Update and fix isolate documentation.
Review URL: https://codereview.chromium.org//66303012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30221 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-13 09:34:58 +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
floitsch@google.com ecb4291d96 Remove deprecated second argument to SendPort.send().
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29836 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 19:01:11 +00:00
floitsch@google.com 7886e0ac13 Update TODO with bug number.
R=nweiz@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29769 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 20:54:45 +00:00
iposva@google.com 2ed438e40c Reland https://code.google.com/p/dart/source/detail?r=29315:
- Make sure to keep the main/control port opened until the
  isolate is finished.
- Account for the number of opened control ports to be able
  to determine whether there are live ports.
- Ensure that the spawned isolated is kept alive until the
  initial startup message can be handled.
- Add more isolate tracing output.
- Use the control port for the debugger id.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29323 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-27 14:34:23 +00:00
iposva@google.com eb95d787c3 - Revert parts of r29315 while attempting to reproduce
unexplained buildbot failures locally.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29317 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-26 21:50:38 +00:00
iposva@google.com b3f3d8bfbd - Make sure to keep the main/control port opened until the
isolate is finished.
- Account for the number of opened control ports to be able
  to determine whether there are live ports.
- Fix imports in snapshotted test.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29315 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-26 20:50:20 +00:00
whesse@google.com 980c1a1150 Fix Isolate.spawnUri on Windows.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29277 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 19:56:34 +00:00