Skip to content
Permalink
Branch: master
Commits on Jul 3, 2019
  1. [vm] Cleanup C99 header includes

    mdempsky authored and commit-bot@chromium.org committed Jul 3, 2019
    Now that MSVC 2013 is required (commit f4824d3), we can simply use C99
    headers that are provided [1]. This means we can rely on <stdint.h> to
    provide intXX_t and uintXX_t types, and <inttypes.h> to provide PRIxx
    macros.
    
    [1] https://devblogs.microsoft.com/cppblog/c99-library-support-in-visual-studio-2013/
    
    Change-Id: I0cc707907f8aca05ae543188cc01e6c50d517f5a
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107839
    Auto-Submit: Matthew Dempsky <mdempsky@google.com>
    Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
    Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commits on Jul 2, 2019
  1. [vm] Remove platform/math.h

    mdempsky authored and commit-bot@chromium.org committed Jul 2, 2019
    It seems safe to assume that <math.h> works on all supported platforms
    now.
    
    Change-Id: Iffb6618f6035c8cc10657c55ccc3ca7cd5d9525c
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107825
    Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on Jul 1, 2019
  1. [vm] Remove vestigial verified_memory_test.cc file

    mdempsky authored and commit-bot@chromium.org committed Jul 1, 2019
    verified_memory.{cc,h} were removed in 2016 (commit 006bab2), but
    this file was accidentally left behind.
    
    Change-Id: I7aca921ab402bc3ca8ee621be088f9a852d09eb9
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107828
    Reviewed-by: Siva Annamalai <asiva@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
  2. [vm] Drop support for MSVC older than 2013

    mdempsky authored and commit-bot@chromium.org committed Jul 1, 2019
    Google has required MSVC 2013 since Q2 2015, and Chromium has required
    MSVC 2015 since Dec 2016. It seems safe for Dart to assume MSVC 2013.
    
    Change-Id: I2ad2549d70b0a96085aa96e90ef15ad4c7b7acb8
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107062
    Reviewed-by: Régis Crelier <regis@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on Jun 21, 2019
  1. [vm] Use std::unique_ptr for kernel::Program

    mdempsky authored and commit-bot@chromium.org committed Jun 21, 2019
    Updates #37244.
    
    Change-Id: I994298162966eca9cf5217cad2ae0aae4f438b4c
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106950
    Reviewed-by: Régis Crelier <regis@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on Jun 18, 2019
  1. [vm] Document why we don't use thread_local on iOS

    mdempsky authored and commit-bot@chromium.org committed Jun 18, 2019
    For more background, see:
    
    https://stackoverflow.com/a/29929949
    https://github.com/abseil/abseil-cpp/blob/8f117240/absl/base/config.h#L142
    
    Change-Id: I604bfcc0bac9fe5f59340e668fe01aeecdea8073
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106433
    Reviewed-by: Ryan Macnak <rmacnak@google.com>
    Commit-Queue: Ryan Macnak <rmacnak@google.com>
  2. [vm] Use std::unique_ptr for ThreadPool::Task

    mdempsky authored and commit-bot@chromium.org committed Jun 18, 2019
    Updates #37244.
    
    Change-Id: I32a5180a17fe43be5e18367d784cf756dffc6aeb
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106009
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: Régis Crelier <regis@google.com>
  3. [vm] Replace MessageHandler::task_ with task_running_

    mdempsky authored and commit-bot@chromium.org committed Jun 18, 2019
    MessageHandler doesn't actually need a reference to the
    ThreadPool::Task, it just wants to know if one is running or not.
    Replacing it with a simple boolean will simplify switching
    ThreadPool::Task to use std::unique_ptr.
    
    Updates #37244.
    
    Change-Id: Ie69ec38523f009ba559678fd544efa4cc8ead7dd
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106008
    Reviewed-by: Régis Crelier <regis@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on Jun 17, 2019
  1. [vm] Use std::unique_ptr for IsolateSpawnState

    mdempsky authored and commit-bot@chromium.org committed Jun 17, 2019
    Updates #37244.
    
    Change-Id: I03b4f0b291bd4e4e9cde5de31ec80da2b8b6c6cf
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101740
    Reviewed-by: Siva Annamalai <asiva@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on Jun 8, 2019
  1. [vm] Fix memory leak in TestCase::EvaluateExpression

    mdempsky authored and commit-bot@chromium.org committed Jun 8, 2019
    The Dart_KernelCompilationResult type is clumsy to use because it has
    multiple owning pointers, and TestCase needs to be better about
    remembering to release memory in all code paths. But adding this
    free() call at least fixes the reported leak.
    
    Fixes #37154.
    
    Change-Id: I075ccfd20c55026f2443c3d0aef3d2d62192ab3b
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105406
    Reviewed-by: Siva Annamalai <asiva@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on Jun 6, 2019
  1. [vm] Censor mirroring of dart:ffi when --enable-ffi=false

    mdempsky authored and commit-bot@chromium.org committed Jun 6, 2019
    Updates #37044.
    
    Change-Id: I51b11fe8f326e1f98d86fc674147176afae873a9
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105327
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
    Commit-Queue: Ryan Macnak <rmacnak@google.com>
    Reviewed-by: Samir Jindel <sjindel@google.com>
    Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commits on May 13, 2019
  1. [vm] Eliminate Mutex/Monitor indirection where possible

    mdempsky authored and commit-bot@chromium.org committed May 13, 2019
    In many cases, the Mutexes and Monitors have to be marked "mutable"
    because they're used to synchronize const accessor methods.
    
    Small text segment improvement for Product builds:
    
    $ size dart.{arm,x64}.{before,after}
       text	   data	    bss	    dec	    hex	filename
    19726069	 409960	 392332	20528361	1393ce9	dart.arm.before
    19725525	 409960	 392332	20527817	1393ac9	dart.arm.after
    22576021	 600376	1782824	24959221	17cd8f5	dart.x64.before
    22574821	 600376	1782824	24958021	17cd445	dart.x64.after
    
    Change-Id: I68f5cd5ad452044df8bfebd160910496036a3e6b
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101745
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commits on May 11, 2019
  1. [vm] Simplify IsolateSpawnState

    mdempsky authored and commit-bot@chromium.org committed May 11, 2019
    Move SpawnCount logic into SpawnIsolateTask, where it logically makes
    more sense. This eliminates some code and also prevents
    IsolateSpawnState from having lingering pointers to the parent
    Isolate's fields after it might have been reclaimed.
    
    Change-Id: If8d827f299ee90dd54faf896609a7acdfbb87608
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101628
    Reviewed-by: Siva Annamalai <asiva@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on May 10, 2019
  1. [vm] Fix -O0 build after CL 101222

    mdempsky authored and commit-bot@chromium.org committed May 10, 2019
    const objects that are declared in .h files are supposed to have
    out-of-line definitions in their corresponding .cc file. It seems like
    CL 101222 happened to expose this for Message::kIllegalPort.
    
    Change-Id: I9656037581eb6406eaf3289dfcf705db90862a26
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102122
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
    Auto-Submit: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: Régis Crelier <regis@google.com>
Commits on May 8, 2019
  1. [vm] Remove IsolateSpawnState::package_root

    mdempsky authored and commit-bot@chromium.org committed May 8, 2019
    Change-Id: I5a35f0e3c233353eafcb4e772abeeb6abc11daba
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101626
    Reviewed-by: Ryan Macnak <rmacnak@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on May 6, 2019
  1. [vm] Use std::unique_ptr with Message

    mdempsky authored and commit-bot@chromium.org committed May 6, 2019
    Message is a C++ type with a simple ownership model appropriate for
    std::unique_ptr. This CL applies the following changes:
    
    1. All uses of "new Message(...)" are replaced with
    "Message::New(...)", which is effectively
    "std::make_unique<Message>(...)". (The latter was only added in C++14,
    but Dart still compiles in C++11 mode.)
    
    2. All owning Message* are replaced with std::unique_ptr<Message>. The
    notable exception is MessageQueue, which still uses raw Message*
    internally to simplify the linked list handling.
    
    3. All "delete message;" statements are removed.
    
    4. Uses of "NULL" replaced with "nullptr" as necessary.
    
    Change-Id: I05b5804289f2a225bfa05d3c1631129358fed373
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101222
    Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on May 3, 2019
  1. [vm] Remove unnecessary indirection in AlternativeGenerationList

    mdempsky authored and commit-bot@chromium.org committed May 3, 2019
    Change-Id: I2f3da7d68cf1b9b568e3841cd8b7c8a79d467e3f
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101063
    Reviewed-by: Teagan Strickland <sstrickl@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on May 1, 2019
  1. [vm] Replace ^= assignments with = where possible

    mdempsky authored and commit-bot@chromium.org committed May 1, 2019
    Change-Id: I04ac2e9c4b8bb654b7c660e728be3867aa4e1513
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100923
    Reviewed-by: Ryan Macnak <rmacnak@google.com>
    Commit-Queue: Matthew Dempsky <mdempsky@google.com>
Commits on Mar 23, 2019
  1. [vm] Delete disallowed constructors/operators

    mdempsky authored and commit-bot@chromium.org committed Mar 23, 2019
    This allows the compiler to emit better errors. It also allows the
    compiler to detect when a class accidentally references its own
    supposedly disallowed constructors/operators (e.g., see dartutils.cc).
    
    Notably, this exposes a number of private member variables that are
    unused, but some that are used only in certain build configurations.
    It would arguably be better to only define the variables when they're
    needed, but that's deferred to a subsequent CL.
    
    Change-Id: I5d0e6697eebebc9321fae1ff49cc68caf557b903
    Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97175
    Commit-Queue: Siva Annamalai <asiva@google.com>
    Reviewed-by: Siva Annamalai <asiva@google.com>
Commits on Jan 31, 2019
  1. [vm] Simplify VirtualMemory::Truncate

    mdempsky authored and commit-bot@chromium.org committed Jan 31, 2019
    Callers always want to try to unmap the trailing pages, and the
    OS-specific FreeSubSegment helper routine can never fail. Simplify
    code accordingly.
    
    Change-Id: I32e4bc72f626e15032d73326bee76a4a2ef71025
    Reviewed-on: https://dart-review.googlesource.com/c/91146
    Auto-Submit: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: Zach Anderson <zra@google.com>
    Reviewed-by: Ryan Macnak <rmacnak@google.com>
    Commit-Queue: Ryan Macnak <rmacnak@google.com>
Commits on Jan 25, 2019
  1. [vm] Fix header includes

    mdempsky authored and commit-bot@chromium.org committed Jan 25, 2019
    In https://dart-review.googlesource.com/c/sdk/+/91104, I meant to
    delete #include <endian.h>, and accidentally removed #include
    <errno.h> instead.
    
    Change-Id: I52e55350d2817c3e6543a8bf806492f1b1dcf3db
    Reviewed-on: https://dart-review.googlesource.com/c/91109
    Auto-Submit: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: Siva Annamalai <asiva@google.com>
    Commit-Queue: Siva Annamalai <asiva@google.com>
  2. [vm] Implement VirtualMemory::Allocate using AllocateAligned

    mdempsky authored and commit-bot@chromium.org committed Jan 25, 2019
    Instead of implementing separate aligned and unaligned memory
    allocation primitives for each OS, just change the unaligned allocator
    into a wrapper around the aligned primitive.
    
    While here, we can optimize the AllocateAligned logic slightly: if we
    want an N-page-aligned allocation, we only need to increase the
    allocation size by N-1 pages instead of N.
    
    Notably, this means 1-page-aligned allocations don't require any extra
    alignment pages, so the new logic behaves identically as before on
    Android, Fuchsia, Linux, and macOS.
    
    On Windows, it behaves slightly differently only in that unaligned
    requests used to be handled as a single VirtualAlloc call with
    MEM_RESERVE | MEM_COMMIT, but now they're handled as two separate
    calls (reserve *then* commit). Naively, I don't expect this matters in
    practice, but if it does, we can always add a fast path for
    alignment==page_size_ without affecting the OS-independent API.
    
    Change-Id: I42b2cf5dfc6e137546d8acfb6cc8939a01687948
    Reviewed-on: https://dart-review.googlesource.com/c/91081
    Commit-Queue: Ryan Macnak <rmacnak@google.com>
    Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commits on Jan 24, 2019
  1. [vm] Remove unused endian-conversion code

    mdempsky authored and commit-bot@chromium.org committed Jan 24, 2019
    These seem to have accidentally snuck in as part of
    https://codereview.chromium.org/14299008
    
    Change-Id: I861eba1655d6f175ddfabf2a39908168b890d911
    Reviewed-on: https://dart-review.googlesource.com/c/91104
    Reviewed-by: Siva Annamalai <asiva@google.com>
    Commit-Queue: Siva Annamalai <asiva@google.com>
  2. [vm] Deduplicate POSIX-based memory allocation code

    mdempsky authored and commit-bot@chromium.org committed Jan 24, 2019
    The Android, Linux, and macOS VirtualMemory implementations were
    identical and using the same POSIX-standardized interfaces, so
    deduplicate them into a common virtual_memory_posix.cc implementation.
    
    Change-Id: I58a2aaa959aac69af52d9faba88865a4ef20d004
    Reviewed-on: https://dart-review.googlesource.com/c/91080
    Commit-Queue: Ryan Macnak <rmacnak@google.com>
    Reviewed-by: Siva Annamalai <asiva@google.com>
    Reviewed-by: Ryan Macnak <rmacnak@google.com>
    Auto-Submit: Matthew Dempsky <mdempsky@google.com>
  3. [fuchsia] Always allocate executable memory in W^X mode

    mdempsky authored and commit-bot@chromium.org committed Jan 24, 2019
    In W^X mode (i.e., FLAG_write_protect_code), the Dart VM allocates
    code memory with is_executable==false and then later makes it
    executable with Protect(kReadExecute). However, on Fuchsia, this will
    require a VMO with ZX_RIGHT_EXECUTE (which soon will not be the
    default).
    
    This CL takes the approach of always adding ZX_RIGHT_EXECUTE when in
    W^X mode. This is suboptimal because it means all VM allocated memory
    can be changed to executable, but currently the OS-independent
    VirtualMemory::Allocate API doesn't provide us a way to identify
    memory that doesn't need to be executable now but will in the future.
    (Note that ZX_RIGHT_EXECUTE only *allows* mapping the memory as
    executable; the memory is still initially mapped by
    VirtualMemory::Allocate as non-executable.)
    
    Extending the VirtualMemory::Allocate API is tracked in FL-172.
    
    Bug: SEC-42
    Change-Id: I20555c546c5ab1798c4c36b7394f6221d3993c9e
    Reviewed-on: https://dart-review.googlesource.com/c/90882
    Reviewed-by: Zach Anderson <zra@google.com>
    Commit-Queue: Zach Anderson <zra@google.com>
Commits on Jan 10, 2019
  1. [fuchsia] Just use dlopen like on other OSes

    mdempsky authored and zanderso committed Jan 10, 2019
    SEC-42
    
    Change-Id: I8c0781614e6cd711424df7a3f69f2efacc9bf31b
    Reviewed-on: https://dart-review.googlesource.com/c/87162
    Reviewed-by: Ryan Macnak <rmacnak@google.com>
    Reviewed-by: Zach Anderson <zra@google.com>
    Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Commits on Sep 25, 2018
  1. [fuchsia] Add zx_vmo_replace_as_executable calls

    mdempsky authored and commit-bot@chromium.org committed Sep 25, 2018
    In the future, newly created VMOs on Fuchsia will not be mappable as
    executable by default. In preparation for that, start using
    zx_vmo_replace_as_executable to mark Fuchsia's VMOs as executable as
    needed.
    
    SEC-42
    
    TEST=CQ
    
    Change-Id: I9df86bbb33b02042260727d64e74b7146eb1d1a6
    Reviewed-on: https://dart-review.googlesource.com/76304
    Reviewed-by: Zach Anderson <zra@google.com>
    Commit-Queue: Zach Anderson <zra@google.com>
You can’t perform that action at this time.