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

Unified Diff: runtime/vm/pages.cc

Issue 792163003: Deletion barrier preparation: validate overwritten references. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
Index: runtime/vm/pages.cc
===================================================================
--- runtime/vm/pages.cc (revision 42249)
+++ runtime/vm/pages.cc (working copy)
@@ -876,6 +876,28 @@
}
+uword PageSpace::TryAllocateSmiInitializedLocked(intptr_t size,
+ GrowthPolicy growth_policy) {
+ uword result = TryAllocateDataBumpLocked(size, growth_policy);
+ if (collections() != 0) {
+#if defined(DEBUG)
+ FATAL1("%" Pd " GCs before TryAllocateSmiInitializedLocked", collections());
+#else
+ // Shouldn't happen, but prefer slight slowdown over (exploitable?) crash.
Ivan Posva 2015/01/02 17:09:39 FATAL should better not be exploitable. We "reach"
koda 2015/01/02 17:30:53 Done.
+ memset(reinterpret_cast<void*>(result), 0, size);
+#endif // DEBUG
+ }
+#if defined(DEBUG)
+ RawObject** begin = reinterpret_cast<RawObject**>(result);
+ RawObject** end = reinterpret_cast<RawObject**>(result + size);
+ for (RawObject** current = begin; current < end; ++current) {
+ ASSERT(!(*current)->IsHeapObject());
+ }
+#endif
+ return result;
+}
+
+
PageSpaceController::PageSpaceController(Heap* heap,
int heap_growth_ratio,
int heap_growth_max,
@@ -1001,8 +1023,8 @@
return 0;
} else {
ASSERT(total_time >= gc_time);
- int result= static_cast<int>((static_cast<double>(gc_time) /
- static_cast<double>(total_time)) * 100);
+ int result = static_cast<int>((static_cast<double>(gc_time) /
+ static_cast<double>(total_time)) * 100);
return result;
}
}
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/raw_object.h » ('j') | runtime/vm/raw_object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698