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

Unified Diff: runtime/vm/snapshot.cc

Issue 792163003: Deletion barrier preparation: validate overwritten references. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 12 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/raw_object.cc ('k') | runtime/vm/virtual_memory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
===================================================================
--- runtime/vm/snapshot.cc (revision 42583)
+++ runtime/vm/snapshot.cc (working copy)
@@ -825,8 +825,12 @@
ASSERT(isolate()->no_gc_scope_depth() != 0);
ASSERT(Utils::IsAligned(size, kObjectAlignment));
+ // Allocate memory where all words look like smis. This is currently
+ // only needed for DEBUG-mode validation in StorePointer/StoreSmi, but will
+ // be essential with the upcoming deletion barrier.
uword address =
- old_space()->TryAllocateDataBumpLocked(size, PageSpace::kForceGrowth);
+ old_space()->TryAllocateSmiInitializedLocked(size,
+ PageSpace::kForceGrowth);
if (address == 0) {
// Use the preallocated out of memory exception to avoid calling
// into dart code or allocating any code.
@@ -836,18 +840,6 @@
object_store()->preallocated_unhandled_exception());
Isolate::Current()->long_jump_base()->Jump(1, error);
}
-#if defined(DEBUG)
- // Zap the uninitialized memory area.
- uword current = address;
- uword end = address + size;
- while (current < end) {
- *reinterpret_cast<intptr_t*>(current) = kZapUninitializedWord;
- current += kWordSize;
- }
-#endif // defined(DBEUG)
- // Make sure to initialize the last word, as this can be left untouched in
- // case the object deserialized has an alignment tail.
- *reinterpret_cast<RawObject**>(address + size - kWordSize) = Object::null();
VerifiedMemory::Accept(address, size);
RawObject* raw_obj = reinterpret_cast<RawObject*>(address + kHeapObjectTag);
« no previous file with comments | « runtime/vm/raw_object.cc ('k') | runtime/vm/virtual_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698