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

Unified Diff: runtime/vm/heap.cc

Issue 578443003: Support old-space allocation in generated code (bump block only for now). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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
Index: runtime/vm/heap.cc
===================================================================
--- runtime/vm/heap.cc (revision 40518)
+++ runtime/vm/heap.cc (working copy)
@@ -38,6 +38,7 @@
"Enables heap verification after GC.");
DEFINE_FLAG(bool, verify_before_gc, false,
"Enables heap verification before GC.");
+DEFINE_FLAG(bool, pretenure_all, false, "Global pretenuring (for testing).");
Heap::Heap(Isolate* isolate,
@@ -404,16 +405,31 @@
}
-uword Heap::TopAddress() {
- return reinterpret_cast<uword>(new_space_->TopAddress());
+uword Heap::TopAddress(Heap::Space space) {
+ if (space == kNew) {
+ return reinterpret_cast<uword>(new_space_->TopAddress());
+ } else {
+ ASSERT(space == kPretenured);
+ return reinterpret_cast<uword>(old_space_->TopAddress());
+ }
}
-uword Heap::EndAddress() {
- return reinterpret_cast<uword>(new_space_->EndAddress());
+uword Heap::EndAddress(Heap::Space space) {
+ if (space == kNew) {
+ return reinterpret_cast<uword>(new_space_->EndAddress());
+ } else {
+ ASSERT(space == kPretenured);
+ return reinterpret_cast<uword>(old_space_->EndAddress());
+ }
}
+Heap::Space Heap::SpaceForAllocation(intptr_t cid) const {
+ return FLAG_pretenure_all ? kPretenured : kNew;
+}
+
+
void Heap::Init(Isolate* isolate,
intptr_t max_new_gen_words,
intptr_t max_old_gen_words) {
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | runtime/vm/stub_code_x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698