Commit graph

45 commits

Author SHA1 Message Date
Ryan Macnak b68351fbc3 [vm] Update NULL to nullptr in runtime/bin.
TEST=build
Change-Id: Ie3be570c274b0275a995a0f54b5e6ccdfc77ccd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292287
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-04-12 01:11:05 +00:00
Zach Anderson f407419d0a [vm] Reland: Prefix HOST_OS_* and TARGET_OS_* with DART_
This relands https://dart-review.googlesource.com/c/sdk/+/205633
but without renaming TARGET_OS_IPHONE to DART_TARGET_OS_IPHONE.
It also changes uses of TARGET_OS_IOS to
DART_TARGET_OS_MACOS_IOS to be consistent with the rest of the
VM.

TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.

Change-Id: Ie775c19dd23cfdf5f65e5ebc6ee4ec3a561676fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205860
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-07-02 19:06:45 +00:00
Slava Egorov 42164cc140 Revert "[vm] Prefix HOST_OS_* and TARGET_OS_* with DART_"
This reverts commit aa9201b76b.

Reason for revert: blocks G3 roll (b/192627187)

Original change's description:
> [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
>
> TargetConditionals.h for XCode 13 defines several
> TARGET_OS_* preprocessor symbols that confuse the
> Dart build. There is probably a more targeted fix
> for this, but renaming the symbols that Dart uses
> will also prevent this problem if more symbols
> are added to the platform headers in the future.
>
> See: https://github.com/dart-lang/sdk/issues/46499
>
> TEST=It builds.
> Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=rmacnak@google.com,zra@google.com,asiva@google.com

Change-Id: Ib06ca418c7e9d3b4df62c72c033cd39f462f7667
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205790
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2021-07-02 14:02:02 +00:00
Zach Anderson aa9201b76b [vm] Prefix HOST_OS_* and TARGET_OS_* with DART_
TargetConditionals.h for XCode 13 defines several
TARGET_OS_* preprocessor symbols that confuse the
Dart build. There is probably a more targeted fix
for this, but renaming the symbols that Dart uses
will also prevent this problem if more symbols
are added to the platform headers in the future.

See: https://github.com/dart-lang/sdk/issues/46499

TEST=It builds.
Change-Id: I3b33a03b4a9a14b76d55fe12f8cdefec4b3c3664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205633
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-07-02 06:02:48 +00:00
Alexander Aprelev 05e5427800 [io/mac] Ensure FSEventsWatcher::Node is deleted synchronously with Callback that uses it.
This is follow-up to ed82bb6f4c

TEST=tests/standalone/io/file_system_watcher_large_set_test.dart

Change-Id: If02c922eafe1371c6e67196158896b9cb786bfd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202312
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2021-06-04 14:26:36 +00:00
Alexander Aprelev ed82bb6f4c [io/file_watcher] Ensure start/stop file watching requests are run on dart thread.
At present start/stop requests are scheduled on RunLoop thread.
This results in deadlocks since same RunLoop thread might be busy
with blocking writes of file watching events, not giving a chance
for Dart to read previously-written events. Reading would unblock
writer.
So this CL moves start/stop requests to run on Dart thread instead.

Fixes https://github.com/dart-lang/sdk/issues/45996

TEST=run analysis_server against flutter_gallery github-backed folder, switch between branches and ensure analyze_server remains responsive

Change-Id: I0464eeecf8e46ba3027fa0ed21cc323495d965c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201442
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-05-28 03:39:18 +00:00
Alexander Aprelev 8793e5aa01 Reland "[vm/io] Fix FileSystemWatcher enum name typo."
This reverts commit 34f636ce1d with the fix for the typo in patchset 2.

Change-Id: I419528f866f6edb707ca586f21a2a8c7f09323d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161620
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-02 20:41:32 +00:00
Alexander Markov 34f636ce1d Revert "[vm/io] Fix FileSystemWatcher enum name typo."
This reverts commit 0a036db596.

Reason for revert: build fails on android.

Original change's description:
> [vm/io] Fix FileSystemWatcher enum name typo.
> 
> Change-Id: Ie9f2e10847caf794ddc79229ce7bd35a3909896d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161600
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Alexander Aprelev <aam@google.com>

TBR=aam@google.com,rmacnak@google.com

Change-Id: Ibffe96077dacd6f7f9c8b383703d77b416a0cf20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161605
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-09-02 19:05:35 +00:00
Alexander Aprelev 0a036db596 [vm/io] Fix FileSystemWatcher enum name typo.
Change-Id: Ie9f2e10847caf794ddc79229ce7bd35a3909896d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-09-02 17:21:47 +00:00
Liam Appelbe ec599a5977 [VM] Remove retry logic from close(fd) calls
This covers Linux, Mac, Android, and Fuchsia.

Bug: https://github.com/dart-lang/sdk/issues/35954
Fixes: https://github.com/dart-lang/sdk/issues/35954
Change-Id: I8142332c530be8ad3ce46312a4a5ac750953c288
Reviewed-on: https://dart-review.googlesource.com/c/93320
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-02-15 23:28:17 +00:00
Ryan Macnak 0f24b9e7ae [standalone] Name dart:io threads, take 2.
Mac's pthread_setname_np assumes the current thread.

Bug: US-588
Change-Id: Ibbddd1f7bffeab10fd470a6176f68b1c0440aa99
Reviewed-on: https://dart-review.googlesource.com/c/93120
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-02-13 20:29:46 +00:00
Ryan Macnak d566a674d0 Revert "[standalone] Name dart:io threads."
This reverts commit cc3218b771.

Reason for revert: Mac build

Original change's description:
> [standalone] Name dart:io threads.
> 
> Change-Id: I5f5248366b39afab96a8b70b4f107ec5134b84f4
> Reviewed-on: https://dart-review.googlesource.com/c/92960
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,zra@google.com,asiva@google.com

Change-Id: I9071c955d4710f8146a661d15fa980f237b6eb81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/93064
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-02-13 18:04:49 +00:00
Ryan Macnak cc3218b771 [standalone] Name dart:io threads.
Change-Id: I5f5248366b39afab96a8b70b4f107ec5134b84f4
Reviewed-on: https://dart-review.googlesource.com/c/92960
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-02-13 17:23:56 +00:00
Zach Anderson 27c79f9459 [vm] Propagate more UTF8 conversion errors
Change-Id: I8d4f3a892a51bed8b922961bd74bcad727f66508
Reviewed-on: https://dart-review.googlesource.com/73280
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-09-06 02:23:21 +00:00
Carlo Bernaschina 05367c3db8 Update iOS FileSystemWatcher::WatchPath signature
TBR=zra@google.com

Review-Url: https://codereview.chromium.org/3011703002 .
2017-08-31 09:46:28 -07:00
Zachary Anderson d0295c873c [dart:io] Namespaces for file IO
Fuchsia requires the ability to sandbox Isolates w.r.t. file IO.
When a new Isolate starts, Fuchsia will pass the Isolate an object
called a namespace. We can translate the namespace object into a
file descriptor suitable for passing to the *at() family of
POSIX file system calls. The file system calls will then
have visibility only into the specified namespace.

We also plumb Namespaces through on all the other platforms as well to
make the change easier to test and so that in the future we can
implement e.g. per-isolate cwds.

This change adds a new internal class to dart:io called _Namespace,
which is implemented in a patch file. See:

sdk/lib/io/namespace_impl.dart
runtime/bin/namespace_patch.dart

The embedder can set up a non-default namespace by calling
_Namespace._setupNamespace during Isolate setup.

Instances of _Namespace have a native field that holds a pointer
to a native Namespace object. See:

runtime/bin/namespace.h

Calls from e.g. file_impl.dart are now also passed a
_Namespace object. The implementations in e.g. file.cc and
file_linux.cc then extract the namespace, and use it to compute a
file descriptor and path suitable for passing to e.g. openat().

related US-313

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

Review-Url: https://codereview.chromium.org/3007703002 .
2017-08-30 09:34:36 -07: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
Ryan Macnak 877284947b Rename TARGET_OS_* to HOST_OS_*.
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.

Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07:00
Zachary Anderson 479a97b129 clang-format runtime/bin
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2480793002 .
2016-11-04 12:30:56 -07: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
William Hesse e6b85bb28c Use #if TARGET_OS_IOS instead of #ifdef TARGET_OS_IOS.
New versions of the OS X SDK always define TARGET_OS_IOS, as 0 or 1.

BUG=https://github.com/dart-lang/sdk/issues/24501
BUG=https://github.com/dart-lang/sdk/issues/24453
R=iposva@google.com

Review URL: https://codereview.chromium.org/1388973002 .
2015-10-12 12:38:10 +02:00
Ivan Posva 7158d5fc26 Landing https://codereview.chromium.org/1171223003/ for Chinmay.
BUG=

Review URL: https://codereview.chromium.org//1174343006.
2015-06-13 06:36:24 -07:00
sgjesse@google.com 91e7a32eb5 Remove SetNonBlocking/SetBlocking methods from Socket and add missing close-on-exec
The methods SetNonBlocking/SetBlocking on Sockets where not implemented on Linux
and not used on Windwsm. Removed and call directly to FDUtils when needed.

In Socket::Accept setting close on exec was missing on OS X and Android.

R=kustermann@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43627 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-10 07:29:36 +00:00
ajohnsen@google.com cdaf11dc9d Don't use kFSEventStreamCreateFlagNoDefer as it messes with event flushing.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37171 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 10:44:20 +00:00
ajohnsen@google.com 0c157cd31e Move signal_blocker to platform and use it by default in TEMP_FAILURE_RETRY.
BUG=http://code.google.com/p/dart/issues/detail?id=16927
R=johnmccutchan@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33745 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 13:51:11 +00:00
ajohnsen@google.com 76368bfa29 Really really fix the build...
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32598 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 09:28:55 +00:00
ajohnsen@google.com 9afc9cac70 Fix mac os x build.t
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32597 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 09:16:30 +00:00
ajohnsen@google.com d00f632847 Use Thread::Compare instead of ==.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32596 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-12 08:47:01 +00:00
ajohnsen@google.com 9c08471e3a Remove DEBUG ifdefs.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32423 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 13:18:05 +00:00
ajohnsen@google.com d074156ac9 Move all run-loop calls into the run-loop thread, and use correct memory handling (retain/release).
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32421 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 12:49:33 +00:00
ajohnsen@google.com b88a51bd99 Fix file-watcher on mac by always starting/stopping through the run-loop thread.
This also fixes some system error-printing and maybe also early events.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32355 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-06 13:16:13 +00:00
ajohnsen@google.com 969eaf8068 Fix watch move event when path is a not a file.
BUG=https://code.google.com/p/dart/issues/detail?id=15458
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31328 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-20 11:28:53 +00:00
ajohnsen@google.com abdc2ade9d Rewrite file-system-watcher to better handle the different system APIs.
BUG=http://code.google.com/p/dart/issues/detail?id=14941
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30848 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-04 10:35:00 +00:00
ajohnsen@google.com 79cf8dc61f Don't report file-system move events on Mac OS, and use no-defer to avoid past events.
Mac OS does not have a proper way to report 'from' and 'to', thus making it impossible to reason the move direction, as other events may shuffle the order, events are received in.

BUG=https://code.google.com/p/dart/issues/detail?id=14806,https://code.google.com/p/dart/issues/detail?id=14793,https://code.google.com/p/dart/issues/detail?id=14849
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30710 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-27 11:48:14 +00:00
ajohnsen@google.com 7f9dfb1890 Fix move-watched-dir for MacOS.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29536 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 12:24:10 +00:00
ajohnsen@google.com 2101ba9c12 Add 'isDir' to FileSystemEvent.
BUG=https://code.google.com/p/dart/issues/detail?id=14425
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29371 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 17:14:43 +00:00
ajohnsen@google.com 483228ef66 If a move has matching target/destination, signal the event as create or delete.
BUG=https://code.google.com/p/dart/issues/detail?id=14424
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29354 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 12:07:46 +00:00
ajohnsen@google.com 4894d4548c Fix issue where we would double unwatch the path.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29164 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 10:26:00 +00:00
ajohnsen@google.com 33daee971b Use while(condition) around monitor wait, in file_system_watcher_macos.
This fixes a potential threading-issue, where the wacther could be used before it was fully initialized, if 'wait' woke up before notify.

BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29163 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 10:24:08 +00:00
ajohnsen@google.com b4be8b8080 Stop watching when removing watched path, for Mac OS X as well.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29161 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 08:42:07 +00:00
ajohnsen@google.com b8d9214b2c Be sure to enter monitor before notifying, in file_system_watcher_macos.
BUG=https://code.google.com/p/dart/issues/detail?id=13065
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27178 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-05 08:14:48 +00:00
ajohnsen@google.com 7c53dfaf3f Make file system watcher compile on Mac OS 106, and add a runtime-call to test if the system supports the feature.
BUG=
R=kustermann@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27064 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 15:42:02 +00:00
ajohnsen@google.com 38bae0af02 Add FileSystemWatcher class to dart:io.
BUG=
R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27048 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 12:43:08 +00:00