Commit Graph

24 Commits

Author SHA1 Message Date
Ryan Macnak e14b3a86f0 Report errno on mprotect failure.
Bug: b/70275153
Change-Id: I81b868b25428b39835935846ba2c9f9f67b3e84d
Reviewed-on: https://dart-review.googlesource.com/33665
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-01-10 01:37:49 +00:00
Ryan Macnak a144e263ce Allocate from the root VMAR on Fuchsia.
Removes the need for the VmarList.

Overallocate VMOs instead of VMARs to get aligned memory.

Change-Id: I0c2c85e952b8c6958e28ac734b5ba54c7712a512
Reviewed-on: https://dart-review.googlesource.com/30383
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-19 21:47:44 +00:00
Ryan Macnak b247090c9e [vm] Align old-space pages.
Allows quick access to the page header for any old-space object, which is a convenient place to keep forwarding information.

Also combine the reserve and commit operations of VirtualMemory.

Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: Id3fe06932f7bef882bb1cc29d72441b0a3602eb6
Reviewed-on: https://dart-review.googlesource.com/17046
Reviewed-by: Erik Corry <erikcorry@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-10-30 22:02:20 +00:00
Zachary Anderson 1393e84863 [Fuchsia] Give VMOs names
This CL assigns names to vmos formatted as "isolate space type" where
isolate is the name of the isolate, space is "oldspace" or "newspace",
and type is "code" or "data".

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2929203002 .
2017-06-09 15:33:18 -07:00
Erik Corry 6617737ff5 Replace 'the the' with 'the'
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2830353002 .
2017-04-24 08:50:37 +02:00
Ryan Macnak 8b217ec519 Rename references to "external pages" as "image pages" to avoid confusion with the kind of external memory associated with finalizers.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2654183002 .
2017-01-26 09:53:06 -08:00
Zachary Anderson cf631890c6 Fuchsia: Memory reservation and partial unmapping
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2594733003 .
2016-12-21 07:46:41 -08:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

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

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Zachary Anderson 64e9017629 Fuchsia: Platform specific calls needed to Initialize and Cleanup VM.
fuchsia_test now succeeds.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2148533002 .
2016-07-13 09:12:28 -07:00
Florian Schneider 1f7458ddf8 VM: Precompiled rodata snapshot.
For now only contains PC descriptors and stack maps and one-byte strings.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1584443002 .
2016-02-15 09:15:26 +01:00
Ryan Macnak cf9c55735d Initialize VirtualMemory::embedder_allocated_.
Review URL: https://codereview.chromium.org/1406023011 .
2015-10-26 17:15:24 -07:00
Zachary Anderson 1fb050baa0 Fixes shutdown crashes.
- Restores fix to debug message queue.
- Fixes for precompilation.

BUG=
R=johnmccutchan@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1406013004 .
2015-10-26 15:43:27 -07:00
Ryan Macnak 9764a9f037 -Setup heap page for precompiled instructions to make heap verifier etc happy.
-Pre-mark instructions when writing the snapshot.
-Write the megamorphic miss function to the snapshot.
-Add missing ExceptionHandlers for megamorphic miss code.
-Add missing C++ entry points.
-Relocate Function and Code entry_points_ when reading precompiled snapshot.
-Don't try to load a script again when running from a precompiled snapshot.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1336763002 .
2015-09-16 11:22:57 -07:00
koda@google.com 624cf5b13e Propagate failures from VirtualMemory::Commit.
BUG=23314

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45515 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-05 00:01:29 +00:00
koda@google.com 0b85873fc8 Deletion barrier preparation: validate overwritten references.
With the upcoming deletion barrier, every update of a pointer field must know whether the previous value was a valid pointer.

Currently, we always use StorePointer/StoreSmi, both for initialization and updates.

Initialization, and thus the potential for overwriting garbage values, appears in three places:
1. Object::Allocate/Foo::New.
2. Creating isolate from full snapshot.
3. Allocation in generated code.

Case 1 already null-initializes all underlying memory.
Case 2 is addressed by this CL by exploiting that:
i) fresh pages are zero-filled by OS, and
ii) freelist headers use only even values.
Case 3 is remains a TODO for future CLs.

(An alternative solution for case 2 would have been to add an init_foo method for every set_foo called.)

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42584 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-02 18:16:13 +00:00
koda@google.com b6b054e3f1 Add VerifiedMemory helper for write-barrier verification.
Allocates hidden extra memory after VirtualMemory, and
verified writes are duplicated at a fixed offset.

This CL only adds the helper.
Next steps:
1. Use Reserve when reserving semi-spaces and heap pages.
2. Use Write for storing pointers (+ offset in generated code).
3. Use Accept for GC-related object lifecycle.
4. Call Verify regularly.
5. Fix failures (= places where we forget/ignore write barriers).

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41399 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-29 19:56:12 +00:00
koda@google.com 2965f45064 Simplify VirtualMemory by removing unused ReserveAligned method.
Also add the ability to truncate without actually unmapping.
Note: We never create holes in the underlying reservation.

This CL is in preparation for using a thin wrapper around VirtualMemory to verify our upcoming concurrent write barrier.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41017 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 15:59:28 +00:00
koda@google.com 6c4eff32c9 If a large object is truncated, also truncate the page.
If GC sweeper finds a truncated large object, the page is shrunk to fit.

Allows reclaiming memory when a large string is externalized.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37842 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 22:59:07 +00:00
fschneider@google.com 78fbacbd87 Fix flag to switch write protection of code pages on/off.
TBR=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32549 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-11 10:17:03 +00:00
fschneider@google.com d6178535b2 Landing: Write protect executable pages in the VM.
Change executable pages to be read/execute but not writable by default.

All pages are made temporarily writable just before a full GC, because both
the mark and sweep phases write to the pages. When allocating in a page and
when patching code, the pages are made temporarily writable.

The order of allocation of Code and Instructions objects is changed so that
a GC will not occur after Instructions is allocated. (A full GC would
render the Instructions unwritable.) A scoped object is used to make memory
protection simpler.

Original CL: https://codereview.chromium.org/106593002/

I added a cc test that is expected to crash.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32493 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-10 12:18:06 +00:00
iposva@google.com d68bf3be66 - Add the ability to protect VirtualMemory.
- Write protect the VM isolate once it has been constructed.
Review URL: https://chromiumcodereview.appspot.com//10830045

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9984 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-27 18:07:59 +00:00
sgjesse@google.com 65896148c9 Move utils.h and utils.cc from runtime/vm to runtime/platform
Moved additional parts of globals.h from vm/ to platform/ to support
types and constants used by utils.*.

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

BUG=
TEST=

Review URL: http://codereview.chromium.org//9209001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3337 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 13:23:40 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00