Zachary Anderson
71d356d5fe
[fuchsia][dart:io] Allow the embedder to specify handles for stdio
...
The content handlers on Fuchsia can potentially give each Isolate
different handles to use for stdout and stderr. This change provides
a hook for an embedder to call to supply the handles to Dart, and
removes hardcoding of stdio handles to 0, 1, 2.
Change-Id: Ic03b77adc9a911e9c754562fa6a91f9929e10dfc
Reviewed-on: https://dart-review.googlesource.com/36122
Commit-Queue: Zach Anderson <zra@google.com >
Reviewed-by: Ryan Macnak <rmacnak@google.com >
2018-01-22 21:09:39 +00:00
Zachary Anderson
747868f2b1
[dart:io] Remove DART_IO_DISABLED
...
This was only used by Dartium.
Review-Url: https://codereview.chromium.org/3009523002 .
2017-08-24 11:17:52 -07:00
Zachary Anderson
6cd8a79078
VM: Re-format to use at most one newline between functions
...
R=asiva@google.com
Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Zach Anderson
b3093ecee6
[dart:io] Move Platform.ansiSupported to {Stdin,Stdout}.supportsAnsiEscapes
...
On Windows, some Windows 10 builds support only ANSI output, but not
input, so these need to be separated.
I'm also improving the detection on Mac and Linux to avoid hardcoding
the result. Instead, supportsAnsiEscapes will be true if isatty() and
the TERM environment variable contains the string 'xterm'.
related #28614
R=lrn@google.com
Review-Url: https://codereview.chromium.org/2753233002 .
2017-03-17 12:35:36 -07:00
Zach Anderson
9506cb9975
Error checking for Stdio calls
...
R=johnmccutchan@google.com
Review-Url: https://codereview.chromium.org/2585443002 .
2016-12-15 11:12:42 -08:00
Zachary Anderson
7308e58c3f
Really remove io support when dart:io is unsupported.
...
Previously we would compile in implementaitions of native calls for
IO functions that would never be used. This CL provides implementations
that throw a Dart exception if they're called by mistake. It also uses
a DART_IO_DISABLED preprocessor define to clean up the build files and
check that we're not including code we shouldn't.
R=iposva@google.com , johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1839463002 .
2016-03-29 11:22:03 -07:00
Zachary Anderson
45661a7091
Cleanup in //runtime/bin
...
R=iposva@google.com
Review URL: https://codereview.chromium.org/1800863002 .
2016-03-16 10:01:00 -07:00
Todd Turnidge
4e3643f445
Prefer Dart_SetReturnValue over Dart_PropagateError when it makes sense.
...
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1665993002 .
2016-02-03 15:41:54 -08:00
sgjesse@google.com
30ae29f4f2
Reapply revert of "Make stdout/stderr async"
...
This re-applies r42909 which was reverted in r42910 with a few fixes.
TBR=ajohnsen@google.com
BUG=
Review URL: https://codereview.chromium.org//851253002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42953 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-16 13:35:37 +00:00
sgjesse@google.com
c831cdf97f
Revert "Revert "Make stdout/stderr async""
...
This reverts commit r42909
TBR=ricow@google.com
BUG=
Review URL: https://codereview.chromium.org//850333002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42910 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 14:33:35 +00:00
sgjesse@google.com
bc1be9c45f
Revert "Make stdout/stderr async"
...
This makes writes to the stdout and stderr IOSinks in dart:io blocking again.
To get the non-blocking behaviour the getter "nonBlocking" will return an
IOSink with real non-blocking behaviour.
Updated the class exposed for stderr to also support checking for whether it
is connected to a terminal and checking the terminal size.
R=ajohnsen@google.com , iposva@google.com
BUG=
Review URL: https://codereview.chromium.org//807833002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42909 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 14:18:16 +00:00
iposva@google.com
14ecdbd66a
- Separate the thread implementation used in bin/ and vm/
...
to allow us to make VM specific changes.
R=asiva@google.com
Review URL: https://codereview.chromium.org//463993002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39172 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:19:53 +00:00
johnmccutchan@google.com
b3f2fb14d0
Reduce CPU usage when no isolates need to be profiled (e.g. when an isolate calls readLineSync or sleep the isolate owns the thread but is blocked).
...
This CL does the following:
- Introduces two new API entry points: Dart_IsolateBlocked and Dart_IsolateUnblocked.
- The thread interrupter thread goes into a deep sleep if no isolates need to be profiled (not scheduled on a thread or are in a blocking call).
- When an isolate unblocks, the thread interrupter thread resumes regular interrupts.
- dart:io readLineSync and sleep mark that they are making a blocking call.
This fixes https://code.google.com/p/dart/issues/detail?id=18126 reducing CPU usage to 0% when waiting for stdin or sleeping.
R=ajohnsen@google.com , iposva@google.com
Review URL: https://codereview.chromium.org//297183003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36632 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-26 11:53:49 +00:00
ajohnsen@google.com
5e564f370d
Add getter for hasTerminal, terminalColumns and terminalLines on stdin.
...
BUG=https://code.google.com/p/dart/issues/detail?id=15557
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//102123010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31255 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-19 10:59:58 +00:00