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

Unified Diff: runtime/vm/scavenger.cc

Issue 98693010: - Promote objects early when a large percentage is being (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
===================================================================
--- runtime/vm/scavenger.cc (revision 31209)
+++ runtime/vm/scavenger.cc (working copy)
@@ -21,6 +21,9 @@
namespace dart {
+ DEFINE_FLAG(int, early_tenuring_threshold, 66, "Skip TO space when promoting"
+ " above this percentage.");
+
// Scavenger uses RawObject::kMarkBit to distinguish forwaded and non-forwarded
// objects. The kMarkBit does not intersect with the target address because of
// object alignment.
@@ -369,10 +372,22 @@
}
-void Scavenger::Epilogue(Isolate* isolate, bool invoke_api_callbacks) {
+void Scavenger::Epilogue(Isolate* isolate,
+ ScavengerVisitor* visitor,
+ bool invoke_api_callbacks) {
// All objects in the to space have been copied from the from space at this
// moment.
- survivor_end_ = top_;
+ int promotion_ratio = static_cast<int>(
+ (static_cast<double>(visitor->bytes_promoted()) /
+ static_cast<double>(to_->size())) * 100.0);
+ if (promotion_ratio < FLAG_early_tenuring_threshold) {
+ // Remember the limit to which objects have been copied.
+ survivor_end_ = top_;
+ } else {
+ // Move survivor end to the end of the to_ space, making all surviving
+ // objects candidates for promotion.
+ survivor_end_ = end_;
+ }
#if defined(DEBUG)
VerifyStoreBufferPointerVisitor verify_store_buffer_visitor(isolate, to_);
@@ -673,7 +688,7 @@
int64_t end = OS::GetCurrentTimeMicros();
heap_->RecordTime(kProcessToSpace, middle - start);
heap_->RecordTime(kIterateWeaks, end - middle);
- Epilogue(isolate, invoke_api_callbacks);
+ Epilogue(isolate, &visitor, invoke_api_callbacks);
if (FLAG_verify_after_gc) {
OS::PrintErr("Verifying after Scavenge...");
« no previous file with comments | « runtime/vm/scavenger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698