Commit Graph

22 Commits

Author SHA1 Message Date
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
Martin Kustermann e2be5322e6 [vm] Use custom realloc() on Windows
Seemingly Windows doesn't always implement realloc() by freeing space if
the new buffer is significantly smaller than the old one.

This CL does so manually in our code base.

Issue b/178993708
Issue https://github.com/dart-lang/sdk/issues/44846

TEST=standalone{,_2}/io/large_file_read_small_file_test

Change-Id: I370346a693f8e8e879e079d91e9de5c756949a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183694
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-03-02 16:02:52 +00:00
Martin Kustermann c3def74ffe [vm/io] Shrink buffers using realloc() if actual used data is small
Issue b/178993708

TEST=standalone{,_2}/io/large_file_read_small_file_test

Change-Id: I3c6f09f4f79f6dd1150db2918cefed3587e34012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182268
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-02-02 20:04:22 +00:00
Ryan Macnak 95f87f321a [vm, io] Fix some MemorySanitizer issues.
Change-Id: Id6e085563b05861351c431a9c067387b4b01270b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137380
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-02-27 17:50:43 +00:00
Ryan Macnak cff0e751a5 [vm] Add Dart_NewExternalTypedDataWithFinalizer.
Allows the finalizer to be associated with the correct object when creating ByteData. The finalizer should be associated with the underlying ExternalUint8List, since it can outlive the ByteData via byteData.buffer.asUint8List()

Bug: b/78150644
Change-Id: I3db58792bbe3abf7ed41d2adaf225fa554b8fb25
Reviewed-on: https://dart-review.googlesource.com/52860
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-01 01:57:41 +00:00
Alexander Markov c1212311bf [VM] Fix OOM handling when allocating buffers in dart:io
Reland 1d6c1020c9 with the fix for ASAN
bots.

* Test standalone_2/file_error_test is updated for Dart 2.0 fixed-size
  integers.

* This update revealed that certain dart:io native methods do not handle
  out-of-memory properly when I/O buffers are allocated.
  This CL fixes this bug.

* Updated test point is extracted to a separate test
  standalone_2/file_error2_test as it needs custom ASAN options.

Change-Id: Ifb1fa59828f36dc03d45c18a41d45da6b989d70a
Reviewed-on: https://dart-review.googlesource.com/20908
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-15 18:06:31 +00:00
Alexander Markov f28005819b Revert "[VM] Fix OOM handling when allocating buffers in dart:io"
This reverts commit 1d6c1020c9.

Reason: failures on ASAN bots as ASAN is not configured to
accept memory allocations with huge size.
Change-Id: Ibb3b27f60017fb42e0f36caea2262125f5bb40d0
Reviewed-on: https://dart-review.googlesource.com/20900
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-14 21:33:25 +00:00
Alexander Markov 1d6c1020c9 [VM] Fix OOM handling when allocating buffers in dart:io
* Test standalone_2/file_error_test is updated for Dart 2.0 fixed-size
  integers.

* This update revealed that certain dart:io native methods do not handle
  out-of-memory properly when I/O buffers are allocated.
  This CL fixes this bug.

Change-Id: I6a9018ab86da7b163d9797d745544835dfb0f15c
Reviewed-on: https://dart-review.googlesource.com/20582
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-14 18:26:34 +00: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
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 45661a7091 Cleanup in //runtime/bin
R=iposva@google.com

Review URL: https://codereview.chromium.org/1800863002 .
2016-03-16 10:01:00 -07:00
koda@google.com a69d028eb3 Track external allocated memory for weak persistent handles.
The amount of external allocation is tracked per generation
and informs GC policy.

BUG=dart:11471
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33467 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 23:53:32 +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
iposva@google.com 1836035266 - Modify dart_api.h to be a proper C API.
- Verify that dart_api.h can be used from C
  by changing the test_extension to be a pure C file.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23476 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-31 16:36:27 +00:00
iposva@google.com b60d09b1fb - Add different types for persistent and weak persistent handles
in the Dart C API.
- Adapt code in the runtime.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23421 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 15:55:59 +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
asiva@google.com f930e3856b Add typed data interface to Dart API, this only changes the C++ API as dicussed in a previous email. The dart code in the library has not been changed yet.
Review URL: https://codereview.chromium.org//12255018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18846 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 18:43:44 +00:00
asiva@google.com c2cafbbe33 - Change the layout of external typed array objects to avoid the extra indirection when accessing elements in the array.
- Change the Dart API which create these external arrays to account for this change
Review URL: https://codereview.chromium.org//12093071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17937 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 18:53:21 +00:00
sgjesse@google.com 3130a75c97 Make all allocation of external arrays used for IO use the IOBuffer class
This will not make a difference right now, but when we start to do
something with io buffers they should originate from the same place.

R=ager@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15785 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-06 13:44:24 +00:00
sgjesse@google.com 27adbdd138 Start reading data from sockets directly into external byte arrays
This adds a new read function to Dart sockets which delivers data in a
system allocated buffer. For now just use that for socket input
streams.

The IOBuffer class does not do much at the moment, but the idea of
adding it is to be able to centralize the management of the IO
buffers. One thing I am considering here is to keep a cache of free
buffers which can be reused without freeing and re-allocating.

R=ager@google.com, ajhonsen@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14321 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 09:56:50 +00:00