Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Unified Diff: runtime/vm/scavenger.cc

Issue 2929203002: [Fuchsia] Give VMOs names (Closed)
Patch Set: Fix tests Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/scavenger.h ('k') | runtime/vm/virtual_memory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 2309e6ca2aa3bb5c5b08cdf062cc4556206060b5..7445e77d26478ea91b087f44be9943f352039437 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -273,7 +273,7 @@ void SemiSpace::InitOnce() {
}
-SemiSpace* SemiSpace::New(intptr_t size_in_words) {
+SemiSpace* SemiSpace::New(intptr_t size_in_words, const char* name) {
{
MutexLocker locker(mutex_);
// TODO(koda): Cache one entry per size.
@@ -288,7 +288,8 @@ SemiSpace* SemiSpace::New(intptr_t size_in_words) {
} else {
intptr_t size_in_bytes = size_in_words << kWordSizeLog2;
VirtualMemory* reserved = VirtualMemory::Reserve(size_in_bytes);
- if ((reserved == NULL) || !reserved->Commit(false)) { // Not executable.
+ const bool kExecutable = false;
+ if ((reserved == NULL) || !reserved->Commit(kExecutable, name)) {
// TODO(koda): If cache_ is not empty, we could try to delete it.
delete reserved;
return NULL;
@@ -346,7 +347,11 @@ Scavenger::Scavenger(Heap* heap,
const intptr_t initial_semi_capacity_in_words =
max_semi_capacity_in_words /
(FLAG_new_gen_growth_factor * FLAG_new_gen_growth_factor);
- to_ = SemiSpace::New(initial_semi_capacity_in_words);
+
+ const intptr_t kVmNameSize = 128;
+ char vm_name[kVmNameSize];
+ Heap::RegionName(heap_, Heap::kNew, vm_name, kVmNameSize);
+ to_ = SemiSpace::New(initial_semi_capacity_in_words, vm_name);
if (to_ == NULL) {
OUT_OF_MEMORY();
}
@@ -390,7 +395,11 @@ SemiSpace* Scavenger::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
// Flip the two semi-spaces so that to_ is always the space for allocating
// objects.
SemiSpace* from = to_;
- to_ = SemiSpace::New(NewSizeInWords(from->size_in_words()));
+
+ const intptr_t kVmNameSize = 128;
+ char vm_name[kVmNameSize];
+ Heap::RegionName(heap_, Heap::kNew, vm_name, kVmNameSize);
+ to_ = SemiSpace::New(NewSizeInWords(from->size_in_words()), vm_name);
if (to_ == NULL) {
// TODO(koda): We could try to recover (collect old space, wait for another
// isolate to finish scavenge, etc.).
« no previous file with comments | « runtime/vm/scavenger.h ('k') | runtime/vm/virtual_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698