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

Unified Diff: vm/heap.h

Issue 10223015: Add a stub_code_space in the heap alongside code_space so that stub code generation happens here an… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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 | « vm/gc_marker.cc ('k') | vm/heap.cc » ('j') | vm/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/heap.h
===================================================================
--- vm/heap.h (revision 6972)
+++ vm/heap.h (working copy)
@@ -29,7 +29,8 @@
enum Space {
kNew,
kOld,
- kExecutable
+ kDartCode,
+ kStubCode,
};
enum ApiCallbacks {
@@ -40,6 +41,7 @@
// Default allocation sizes in MB for the old gen and code heaps.
static const intptr_t kHeapSizeInMB = 512;
static const intptr_t kCodeHeapSizeInMB = 8;
+ static const intptr_t kStubCodeHeapSizeInKB = 256;
~Heap();
@@ -53,8 +55,10 @@
return AllocateNew(size);
case kOld:
return AllocateOld(size);
- case kExecutable:
- return AllocateCode(size);
+ case kDartCode:
+ return AllocateCode(code_space_, size);
+ case kStubCode:
+ return AllocateCode(stub_code_space_, size);
default:
UNREACHABLE();
}
@@ -67,8 +71,10 @@
return new_space_->TryAllocate(size);
case kOld:
return old_space_->TryAllocate(size);
- case kExecutable:
+ case kDartCode:
return code_space_->TryAllocate(size);
+ case kStubCode:
+ return stub_code_space_->TryAllocate(size);
default:
UNREACHABLE();
}
@@ -78,11 +84,13 @@
// Heap contains the specified address.
bool Contains(uword addr) const;
bool CodeContains(uword addr) const;
+ bool StubCodeContains(uword addr) const;
// Visit all pointers in the space.
void IterateNewPointers(ObjectPointerVisitor* visitor);
void IterateOldPointers(ObjectPointerVisitor* visitor);
void IterateCodePointers(ObjectPointerVisitor* visitor);
+ void IterateStubCodePointers(ObjectPointerVisitor* visitor);
// Find an object by visiting all pointers in the specified heap space,
// the 'visitor' is used to determine if an object is found or not.
@@ -92,6 +100,7 @@
// The 'visitor' function should return false if the object is not found,
// traversal through the heap space continues.
RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor);
+ RawInstructions* FindObjectInStubCodeSpace(FindObjectVisitor* visitor);
void CollectGarbage(Space space);
void CollectGarbage(Space space, ApiCallbacks api_callbacks);
@@ -113,12 +122,13 @@
uword AllocateNew(intptr_t size);
uword AllocateOld(intptr_t size);
- uword AllocateCode(intptr_t size);
+ uword AllocateCode(PageSpace* space, intptr_t size);
// The different spaces used for allocation.
Scavenger* new_space_;
PageSpace* old_space_;
PageSpace* code_space_;
+ PageSpace* stub_code_space_;
DISALLOW_COPY_AND_ASSIGN(Heap);
};
« no previous file with comments | « vm/gc_marker.cc ('k') | vm/heap.cc » ('j') | vm/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698