johnmccutchan@google.com
919dc2d6eb
* Introduce ThreadInterrupter which calls a TLS set callback when thread is interrupted.
...
* Threads can only register and unregister themselves with ThreadInterrupter.
* Profiler is no longer involved in interrupting threads. It's just a callback and the buffer.
* Profiler operates lock free using an atomic operation to reserve sample in sample buffer.
* Linux, Mac, and Windows done.
R=asiva@google.com
Review URL: https://codereview.chromium.org//109803002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31170 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-16 18:52:15 +00:00
sgjesse@google.com
72d2ca28c9
Cleanup the getting and setting of the socket file descriptor
...
R=ajohnsen@google.com
Review URL: https://codereview.chromium.org//81013002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30524 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 15:22:35 +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
sgjesse@google.com
264611807f
Get rid of some downcasts
...
R=whesse@google.com
BUG=
Review URL: https://codereview.chromium.org//23540002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26697 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 09:13:21 +00:00
sgjesse@google.com
a4e6a23195
Remove bogus Dart_ExitScope calls
...
When the Dart_EnterScope/Dart_ExitScope calls where removed some
Dart_ExitScope calls in error returns where not removed.
R=whesse@google.com
BUG=
Review URL: https://codereview.chromium.org//22890003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26108 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 08:07:29 +00:00
sgjesse@google.com
959456533f
Add Process.runSync for running processes synchronously
...
BUG=http://dartbug.com/1707
R=whesse@google.com
Review URL: https://codereview.chromium.org//21816002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26052 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-13 14:12:31 +00:00
asiva@google.com
b4d9e0d620
Auto create ApiLocalScope before calling native functions, this ensures that
...
native functions do not have to call Dart_EnterScope/Dart_ExitScope
when they callback into the VM.
Remove Dart_EnterScope/Dart_ExitScope calls around native functions in 'bin'
directory.
R=regis@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//22303002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25827 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 19:27:48 +00:00
ajohnsen@google.com
900dba8e03
Remove static mutexes/monitors from dart:io.
...
BUG=
R=whesse@google.com
Review URL: https://codereview.chromium.org//18080010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24576 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 08:44:15 +00:00
smok@google.com
ebbc2020a2
Put everything in runtime/bin into '::dart::bin' namespace.
...
Review URL: https://codereview.chromium.org//14341015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +00:00
sgjesse@google.com
cf64f0ad79
Add access to process id for both current process and processes started
...
BUG=https://code.google.com/p/dart/issues/detail?id=9129
R=ajohnsen@google.com
Review URL: https://codereview.chromium.org//14322011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21611 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-17 10:15:29 +00:00
sgjesse@google.com
e10bc2d3e0
Reapply "Add a sleep function to dart:io"
...
This reapplies r20952, r20953, r20954 together with hiding sleep from
dart:io in a number of tests.
R=ager@google.com
Review URL: https://codereview.chromium.org//13704003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20964 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 13:04:26 +00:00
sgjesse@google.com
22a06ceeea
Revert r20952, r20953, r20954
...
Too many failures due to conflicting top level sleep methods.
TBR=ager@google.com
BUG=
Review URL: https://codereview.chromium.org//13565005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20955 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 10:06:56 +00:00
sgjesse@google.com
b81606254e
Add a sleep function to dart:io
...
The sleep function is a top-level function.
R=ager@google.com
BUG=https://code.google.com/p/dart/issues/detail?id=9254
Review URL: https://codereview.chromium.org//13641005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20952 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 09:35:37 +00:00
sgjesse@google.com
488b016a2f
Merge IO v2 branch to bleeding edge
...
R=ager@google.com , ajohnsen@google.com , whesse@google.com
BUG=
Review URL: https://codereview.chromium.org//12316036
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18820 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 11:58:11 +00:00
ager@google.com
6d0f985432
Add exitCode setter to set the exit code returned by the Dart VM
...
standalone binary on normal termination.
This is needed to be able to set the exit code without cutting
off pending asynchronous operations.
R=sgjesse@google.com ,rnystrom@google.com
BUG=
Review URL: https://codereview.chromium.org//11665004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16435 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-21 10:36:52 +00:00
ager@google.com
8a14c1c319
Use FormatMessageW for Windows error messages to handle internationalized messages correctly.
...
R=sgjesse@google.com
BUG=dartbug.com/6986
Review URL: https://codereview.chromium.org//11558012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16041 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-12 14:39:21 +00:00
ager@google.com
c44170ebd5
Reapply change to use system code page on Windows to fix Pub.
...
This time with correct null termination of the char* that
we convert.
R=sgjesse@google.com
BUG=dartbug.com/7180
Review URL: https://codereview.chromium.org//11472032
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15860 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 20:14:37 +00:00
rnystrom@google.com
cf5ab6030e
Revert "By default use current code page on Windows for decoding string"
...
This reverts commit c247cd299958d0ee713dcfef8aaf44d230a3a7e0.
Revert "Fix memory leaks in system string patch"
This reverts commit 5e533a0c383518fc1851fbdc01a796f7d6b077f8.
Review URL: https://codereview.chromium.org//11446067
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15854 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 18:49:52 +00:00
ager@google.com
2d5c3b2101
Fix memory leaks in system string patch
...
R=sgjesse@google.com
BUG=
Review URL: https://codereview.chromium.org//11470017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15846 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 13:30:17 +00:00
ager@google.com
66f08dcabf
By default use current code page on Windows for decoding string
...
data from processes.
R=sgjesse@google.com
BUG=dartbug.com/7180
Review URL: https://codereview.chromium.org//11475026
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15844 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-07 12:51:49 +00:00
ager@google.com
6236cd51a5
Use native fields for process pid and fix bug that allowed killing
...
a process before it was started.
We should make the change to make Process.start return a future that
does not complete unless the process is actually started. That would
have avoided this issue as well.
R=sgjesse@google.com
BUG=dartbug.com/5301
Review URL: https://codereview.chromium.org//10963024
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12691 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 11:07:36 +00:00
ager@google.com
c6aea6b1eb
Use native wrapper fields to store socket ids.
...
This relies on landing the change to fix implicit super constructors
for subclasses of something that has native fields.
R=sgjesse@google.com
BUG=dartbug.com/5301
Review URL: https://codereview.chromium.org//10962012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12684 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 08:19:01 +00:00
ager@google.com
0d14ec42be
Guard against integer overflow in process constructor.
...
I have set an arbitrary limit of around one million arguments. I
see no reasonable use of the Process API where that would be a
problem.
R=whesse@google.com ,turnidge@google.com
BUG=dartbug.com/1751
TEST=None, can't happen right now but might in the future.
Review URL: https://chromiumcodereview.appspot.com//10690160
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9583 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-12 08:35:10 +00:00
ajohnsen@google.com
c54800f942
Give Process.kill an optional argument to specify which signal to send.
...
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10545134
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8541 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 12:00:50 +00:00
ager@google.com
501a0dd907
Add test that passes invalid arguments to socket methods and fix
...
issues encountered.
The fuzzing is not as systematic as for some of the other
APIs. However, a lot of checking is going on in the Dart code so
forcing issues required a bit of work making objects act like lists
and integers.
Additionally, fix a memory leak in process implementation.
R=sgjesse@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10441078
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8088 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-30 08:17:25 +00:00
ager@google.com
493a76dd40
Support passing an environment variable map to child processes.
...
Fix minor type warning in test.
Reapplication after MacOS bug fix.
R=sgjesse@google.com
BUG=dartbug.com/2193
TEST=
Review URL: https://chromiumcodereview.appspot.com//10166029
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6827 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-23 07:54:10 +00:00
ager@google.com
c5d347fcbc
Revert "Support passing an environment variable map to child processes."
...
Apparently the code or the test is broken on Mac.
R=sgjesse@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10163004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6795 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-20 12:53:19 +00:00
ager@google.com
ee81b6f0a1
Support passing an environment variable map to child processes.
...
Fix minor type warning in test.
R=sgjesse@google.com
BUG=dartbug.com/2193
TEST=
Review URL: https://chromiumcodereview.appspot.com//10127008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6794 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-20 12:38:57 +00:00
turnidge@google.com
48de07fb60
Start using Dart_PropagateError in the runtime/bin directory.
...
Review URL: https://chromiumcodereview.appspot.com//9657001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5197 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 23:06:44 +00:00
turnidge@google.com
c143d26700
Start using Dart_SetField and Dart_GetField in the vm.
...
Review URL: https://chromiumcodereview.appspot.com//9642003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5185 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-08 18:36:56 +00:00
ager@google.com
37499dce81
Rework Windows process handling.
...
- Use only one thread to wait for multiple process objects.
- Fix issue where reading from a closed pipe would print an
error message on stderr.
- Remove the need to go to dart before removing a processinfo
object from the list. Sometimes you never get there so we
have to remove the process info object always.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9310053
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3844 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 13:47:42 +00:00
ager@google.com
7031be2291
Revert "Changes to the process implementation."
...
There is a race-condition on Windows and exit handling when a process
has been closed is incorrect.
R=sgjesse@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9307033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3790 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 14:19:25 +00:00
ager@google.com
6b5815328c
Changes to the process implementation.
...
- Make the list of active processes thread safe on Windows.
- Use only one thread on Windows to detect process termination.
- Stop the process termination thread when the standalone VM terminates.
R=sgjesse@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9307003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3780 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 09:09:23 +00:00
ajohnsen@google.com
c2b45bf04e
Add optional workingDirectory argument to Process.start.
...
Review URL: http://codereview.chromium.org//9108008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2987 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-05 09:54:54 +00:00
turnidge@google.com
8c64adf13e
Deal with unhandled exceptions the same way in all Dart api functions.
...
--
Terminology change: invalid handles are now called error handles.
Unhandled exceptions used to be a kind of valid handle. Now they are
a kind of error handle.
For the Dart_Invoke* functions, this means that the standard
error-checking blob drops from two tests to one test and is
harder to mess up.
Many other Dart api functions (Dart_ToString, for example) previously
dealt with unhandled exceptions by turning them into terse error
messages. Now these functions preserve information about the
exceptions and generate better error messages.
Changed Dart_HandleMessage to return success/failure. It seemed to fit.
--
Details:
Dart_IsValid becomes Dart_IsError (negated sense).
Dart_GetError now knows how to print a stack trace semi-nicely.
Dart_ExceptionOccurred -> Dart_IsUnhandledException.
Renamed ApiFailure class to ApiError to fit better.
ApiError now has a "data" pointer that points to either an error
message string or to an unhandled exception object.
Documentation changes aplenty.
Review URL: http://codereview.chromium.org//8501034
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1470 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-11 19:31:04 +00:00
ager@google.com
68166663f9
Renaming Array -> List in the VM API.
...
BUG=
TEST=
Review URL: http://codereview.chromium.org//8372094
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1195 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-04 12:25:53 +00:00
turnidge@google.com
e756497a78
Refactor the dart api a bit:
...
- Dart_Result is gone. Dart_Handle mostly replaces it.
- Name/signature changes
- IsValidResult -> IsValid
- GetErrorCString -> GetError
- many more...
- Make details of persistent handle freelist private.
- Add persistent "True" handle to api state.
Things I am not doing in this changelist:
- Documentation updates
Review URL: http://codereview.chromium.org//8380020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@778 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-26 20:38:41 +00:00
ager@google.com
86284155b9
Improve error handling in the process library.
...
Verify that the arguments have the types expected by the
implementation. Require a List instance containing builtin
Strings as the arguments. Require a builtin String path.
R=sgjesse@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//8383037
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@690 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-25 12:16:04 +00:00
sgjesse@google.com
b7485553a2
Fix deadlock in process exit handling
...
As glibc allocation routines are not re-entrant avoid calling delete in signal handler.
Instead the message send from the signal handler on process exit contains both the pid and the exit code. The internal _Process object always installs a data handler for the exit message and calls back into C++ to cleanup the resources allocated for running a process.
Changed the ActiveProcess (renamed to ProcessInfo) to form an explicitly linked list.
R=ager@google.com
BUG=dart:1
TEST=
Review URL: http://codereview.chromium.org//8227010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@325 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-11 11:26:12 +00:00
dgrove@google.com
4c0f559d23
Initial checkin.
...
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00