Commit Graph

77 Commits

Author SHA1 Message Date
Zachary Anderson 9ce608e89d [dart:io] Adds ProcessInfo.{max,current}Rss. Adds OS::MaxRSS on Fuchsia.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2822943002 .
2017-04-17 14:41:40 -07:00
Zach Anderson 141b6351ba [dart:io][windows] Use WriteFile instead of _write
This CL changes File::Write on Windows to call directly to WriteFile()
instead of using _write(). This avoids a number of complexities:
1. Don't need to bother with text vs. binary mode.
2. Don't need to check both errno and GetLastError if _write() fails.
3. Don't need to convert to a wchar_t* for console output since we've
   already set the code page to UTF8.

fixes #29101

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2761673002 .
2017-03-29 13:19:25 -07:00
Jacob Richman 4360e99d18 Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Committed: https://github.com/dart-lang/sdk/commit/62be0eacfbb36bdc92a05c7c35bb4506621b6a3a
Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-21 10:07:26 -07:00
Jacob Richman 62be0eacfb Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-20 22:19:22 -07:00
Jacob Richman 88f8aacd5f Re-apply rolled back CL to apply dartfmt to runtime.
Fix observatory tests broken by running dartfmt due to line and column changes.
Temporarily reverted formatting for evaluate_activation_test.dart as dartfmt doesn't yet handle multitests.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2759973004 .
2017-03-20 21:44:59 -07:00
Ryan Macnak ea4744a06f Revert "Run dartfmt on all files under runtime."
This reverts commit 15f393f189.

The change caused many service test failures due to changed line numbers.

TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2762583003 .
2017-03-20 13:42:55 -07:00
Jacob Richman 15f393f189 Run dartfmt on all files under runtime.
I've omitted files where the formatter output is significantly uglier
than the original code and I'll send those files in a separate CL
with options for how to make the code look reasonable while still
taking advantage of the formatter.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2751423005 .
2017-03-20 13:13:50 -07:00
Zach Anderson bc07953866 [dart:io][windows] Make unicode characters display correctly.
This change has two pieces.
- Set the console code page to UTF8.
  - This makes strings printed with print() display correctly
- Set the file translation mode to _O_WTEXT when writing to a
  stdout or stderr that is connected to a console.
  - This makes strings printed with e.g. stdout.writeln()
    display correctly.

fixes #28571

R=asiva@google.com, fschneider@google.com

Review-Url: https://codereview.chromium.org/2698813002 .
2017-02-21 22:47:03 -08:00
Peter von der Ahé 00bed94e0c Fix various nits in VM patch files.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2705593002 .
2017-02-17 16:28:57 +01:00
Vyacheslav Egorov eb8c24e133 Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451623006 .
2016-10-27 10:09:22 +02:00
Vyacheslav Egorov 12968edb9c Revert "Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork.""
This reverts commit 4e7a31262e.

Windows bots are broken now.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2451893004 .
2016-10-26 17:07:18 +02:00
Vyacheslav Egorov 4e7a31262e Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This relands commit 2fed1c3905 with fixes to ensure that analyzer summaries are correctly created and XARM build does not try to use target binaries on the host.

R=zra@google.com
BUG=

Review URL: https://codereview.chromium.org/2453773002 .
2016-10-26 16:48:28 +02:00
Vyacheslav Egorov cf7ff42e60 Revert "Merge more Kernel infrastructure from kernel_sdk SDK fork."
This reverts commit 2fed1c3905.

SDK builds are failing

TBR=zra@google.com

Review URL: https://codereview.chromium.org/2455593002 .
2016-10-26 13:06:27 +02:00
Vyacheslav Egorov 2fed1c3905 Merge more Kernel infrastructure from kernel_sdk SDK fork.
- bring patched SDK generation scripts and VM patch tweaks that allow VM patch files to be parsed by analyzer front-end;
  Patched SDK is an SDK with all VM patches spliced into it. Kernel compiler is based on the analyzer front-end which does
  not have any patch files support/model so for it to produce Kernel files that match VM we need to generate a such patched SDKs.

- bring test script modifications that allow to test Kernel pipeline

BUG=
R=asiva@google.com, kmillikin@google.com, whesse@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2434123003 .
2016-10-26 13:02:54 +02:00
Matthias Hausner 1a6d1eca32 Implement @patch annotation for patch class members
Allow members of patch classes to be annotated with @patch. The VM
ignores the annotation. I simply replaces the original method
if the name matches, or reports an error if field names match.

Adding a bit is_patched to members to do more checking remains a
TODO. There are currently no unused bits available, and I don’t want
to increase the size of Function objects for this.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2230383003 .
2016-08-10 12:54:57 -07:00
Matthias Hausner e11ca24053 Use metadata annotation @patch for patch classes
Annotate patch classes and top-level patch functions with @patch
instead of the pseudo-keyword patch. This allows the analyzer
to read patch files, and matches the syntax that dart2js uses.

The deprecated syntax is still supported, but a warning is printed when detected.

BUG=

Review URL: https://codereview.chromium.org/2220883004 .
2016-08-09 09:48:03 -07:00
John McCutchan b9b0649b9c dart:developer service extension fixes
Fixes #25724
Fixes Florian Loitsch's emailed request (get rid of k prefix on constants).

- Rename ServiceExtensionResponse constants to not have a 'k' prefix.
- Provide more explanation on how to invoke service extensions (they require an 'isolateId' parameter).
- Require extension method names to begin with "ext." and recommend the template: "ext.package.command" to avoid conflicts with other packages.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1680593004 .
2016-02-10 08:54:51 -08:00
Rico Wind 38b579fa78 Add tracking of open processes to the new io resource tracking.
I plan on refactoring the io_resource_info.dart file a bit in a follow up, but I keept this simple

I also plan on adding some sort of sanity checking when the vm exits, to make sure
all 3 maps are empty (in debug mode)

This fixes issue #24314, before we would hold on to process that failed to start
running in the _processes map.

Closes #24314
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1331033003 .
2015-09-14 12:54:36 +02:00
sgjesse@google.com 5973b2c422 Make the construction of a ProcessResult public
There was really no need for it to be a private implementation.

BUG=http://dartbug.com/23070
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44935 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-07 13:05:45 +00:00
sgjesse@google.com 6ba8c7bd7f Fix another type bug in r43455
TBR=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43459 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 10:13:11 +00:00
sgjesse@google.com a99617c254 Fix type bug in r43455
TBR=lrn@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43456 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 08:45:23 +00:00
sgjesse@google.com 833e5d9aee Add support for killing a process with a given PID to dart:io
R=lrn@google.com, kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43455 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 08:20:33 +00:00
sgjesse@google.com 9aa4805e21 Add an option for starting a detached process with stdio connected
R=lrn@google.com, kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43393 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 13:38:38 +00:00
sgjesse@google.com f6a10fbdf1 Add support for starting a detached process
BUG=http://dartbug.com/20970
R=kustermann@google.com, lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43070 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 11:49:39 +00:00
zra@google.com 306ef8dd75 Fixes leak in Process.runSync().
This removes the call to _stdin._sink.destroy()
from my previous CL, which broke a test.
stdin is closed by the native implementation.
Closing again shouldn't cause a problem, but
it looks like destroy() attempts to do a lot
more than that.

OTOH adding the remove call is sufficient to
fix the leak, so let's just stick with that.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41395 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 14:32:30 +00:00
zra@google.com 4e15424820 Reverts 41378 for test failure.
Review URL: https://codereview.chromium.org//688443005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41386 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 01:57:22 +00:00
zra@google.com 2bb9c19ab8 Fixes memory leak in Process.runSync()
This was introduced in 36665 by https://codereview.chromium.org/307503002/

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41378 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-28 23:02:54 +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
johnmccutchan@google.com 1f62dad54d Add Proces owner of socket and fix printing of non-network sockets
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36729 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-28 07:15:02 +00:00
johnmccutchan@google.com a71fa873b1 Add processes to Observatory
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36665 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 11:20:30 +00:00
ajohnsen@google.com 03429c2ee6 Allow internal usage of SIGQUIT signal listening.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35616 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-01 08:01:09 +00:00
iposva@google.com 090e15d537 Do not try to move lines around after test!
- Fix typo in field name.

R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34935 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 17:58:47 +00:00
iposva@google.com 9adfe60489 - Apply review comments from https://codereview.chromium.org/232223004/
- Use isWindows where appropriate.

R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34934 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 17:49:31 +00:00
iposva@google.com 566ec5d5b9 - Do not keep the environment alive past the process spawn.
- Avoid creation of many temp objects while creating the process
  environment.
- "if (identical(true, value))" makes no sense.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34907 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-10 00:15:47 +00:00
ajohnsen@google.com 09a4f24413 Add exitCode getter counterpart to the existing setter in dart:io.
BUG=https://code.google.com/p/dart/issues/detail?id=16217
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33737 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 10:40:19 +00:00
ajohnsen@google.com c93bb293c5 Fix signal handler in checked mode..
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32424 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 13:19:23 +00:00
ajohnsen@google.com 2f60129fb0 Document ProcessSignal::watch.
We now also allow watching for SIGTERM.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32416 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 09:41:38 +00:00
sgjesse@google.com a89aa53071 Make the Platform.environment return value an unmodifiable map
R=ajohnsen@google.com, kustemann@google.com
BUG=http://dartbug.com/15872

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31468 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-06 10:18:22 +00:00
ajohnsen@google.com 38d0fad2c7 Signal handling, take 2.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31276 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-19 15:07:48 +00:00
ajohnsen@google.com f24f568571 Revert "Signal handling."
This reverts commit r31270.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31275 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-19 14:03:15 +00:00
ajohnsen@google.com e8d9794c70 Signal handling.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31270 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-19 13:08:26 +00:00
ajohnsen@google.com 8fdf9b8ee6 Use correct output encoding in Process.runSync.
BUG=https://code.google.com/p/dart/issues/detail?id=13149
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27283 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 10:33:53 +00:00
floitsch@google.com 35d7140e66 Remove Encoding-enum from dart:io and add interface in dart:convert.
BUG= http://dartbug.com/6284
BUG= http://dartbug.com/7966
R=nweiz@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26632 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 10:37:25 +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
ajohnsen@google.com f7d1f50329 Remove _BufferList from dart:io and now use BytesBuilder.
BUG=
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24941 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 10:39:02 +00:00
ajohnsen@google.com e01bcbaa0d Include parent environment by default, add option to not, for Process.
BUG=https://code.google.com/p/dart/issues/detail?id=9294,https://code.google.com/p/dart/issues/detail?id=9295
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24262 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 06:44:55 +00:00
ajohnsen@google.com ff7d45d16f Always escape " in Process on Windows.
BUG=https://code.google.com/p/dart/issues/detail?id=10895
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24232 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 14:50:33 +00:00
sgjesse@google.com 0cd11fcdc3 Remove Encoding.BINARY
THe Encoding.BINARY was a bad idea. It is now removed and null is used to indicate binary result from Process.run.

R=ajohnsen@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23977 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 13:06:11 +00:00
sgjesse@google.com c2d41fb1ba Add support for binary stdout/stderr data when using Process.run
R=ajohnsen@google.com
BUG=http://dartbug.com/9167

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23962 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 10:27:54 +00:00
ajohnsen@google.com e2350a610b Temporary, only escape quotes if run in shell.
This gets pub to pass. This patch should be reverted at some point.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23150 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 14:14:45 +00:00