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

Unified Diff: runtime/vm/heap.cc

Issue 566853005: Fix to allocation stub invalidation: we cannot just remove it as it will be collected even though c… (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
« no previous file with comments | « runtime/vm/compiler_test.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
===================================================================
--- runtime/vm/heap.cc (revision 40325)
+++ runtime/vm/heap.cc (working copy)
@@ -24,20 +24,22 @@
namespace dart {
-DEFINE_FLAG(bool, verbose_gc, false, "Enables verbose GC.");
-DEFINE_FLAG(int, verbose_gc_hdr, 40, "Print verbose GC header interval.");
-DEFINE_FLAG(bool, verify_before_gc, false,
- "Enables heap verification before GC.");
-DEFINE_FLAG(bool, verify_after_gc, false,
- "Enables heap verification after GC.");
+DEFINE_FLAG(bool, disable_alloc_stubs_after_gc, false, "Stress testing flag.");
DEFINE_FLAG(bool, gc_at_alloc, false, "GC at every allocation.");
DEFINE_FLAG(int, new_gen_ext_limit, 64,
"maximum total external size (MB) in new gen before triggering GC");
+DEFINE_FLAG(int, pretenure_interval, 10,
+ "Back off pretenuring after this many cycles.");
DEFINE_FLAG(int, pretenure_threshold, 98,
"Trigger pretenuring when this many percent are promoted.");
-DEFINE_FLAG(int, pretenure_interval, 10,
- "Back off pretenuring after this many cycles.");
+DEFINE_FLAG(bool, verbose_gc, false, "Enables verbose GC.");
+DEFINE_FLAG(int, verbose_gc_hdr, 40, "Print verbose GC header interval.");
+DEFINE_FLAG(bool, verify_after_gc, false,
+ "Enables heap verification after GC.");
+DEFINE_FLAG(bool, verify_before_gc, false,
+ "Enables heap verification before GC.");
+
Heap::Heap(Isolate* isolate,
intptr_t max_new_gen_semi_words,
intptr_t max_old_gen_words)
@@ -363,6 +365,15 @@
void Heap::UpdatePretenurePolicy() {
+ if (FLAG_disable_alloc_stubs_after_gc) {
+ ClassTable* table = isolate_->class_table();
+ for (intptr_t cid = kNumPredefinedCids; cid < table->NumCids(); ++cid) {
+ if (table->IsValidIndex(cid) && table->HasValidClassAt(cid)) {
+ const Class& cls = Class::Handle(isolate_, table->At(cid));
+ cls.SwitchAllocationStub();
+ }
+ }
+ }
ClassHeapStats* stats =
isolate_->class_table()->StatsWithUpdatedSize(kOneByteStringCid);
int allocated = stats->pre_gc.new_count;
« no previous file with comments | « runtime/vm/compiler_test.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698