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

Unified Diff: src/objects.cc

Issue 11085070: Enable --verify-heap in release mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: After rebase plus one new issue fix Created 8 years, 2 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: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 4d8fe8eb059a0f0690f1849f071416500df6a740..1d1757fd4e4f3efbbdce695521cb2a37f8a45d17 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2169,6 +2169,12 @@ static void ZapEndOfFixedArray(Address new_end, int to_trim) {
template<RightTrimMode trim_mode>
static void RightTrimFixedArray(Heap* heap, FixedArray* elms, int to_trim) {
+#ifdef DEBUG
+ bool zapInFromGCMode = true;
+#else
+ bool zapInFromGCMode = FLAG_verify_heap;
+#endif
+
ASSERT(elms->map() != HEAP->fixed_cow_array_map());
// For now this trick is only applied to fixed arrays in new and paged space.
ASSERT(!HEAP->lo_space()->Contains(elms));
@@ -2179,12 +2185,8 @@ static void RightTrimFixedArray(Heap* heap, FixedArray* elms, int to_trim) {
Address new_end = elms->address() + FixedArray::SizeFor(len - to_trim);
- if (trim_mode == FROM_GC) {
-#ifdef DEBUG
- ZapEndOfFixedArray(new_end, to_trim);
-#endif
- } else {
- ZapEndOfFixedArray(new_end, to_trim);
+ if (trim_mode != FROM_GC || zapInFromGCMode) {
Michael Starzinger 2012/10/11 12:42:46 See comment about Heap::ShouldZapGarbage earlier.
mvstanton1 2012/10/12 08:40:50 Done.
+ ZapEndOfFixedArray(new_end, to_trim);
}
int size_delta = to_trim * kPointerSize;
@@ -9061,6 +9063,21 @@ MaybeObject* Map::PutPrototypeTransition(Object* prototype, Map* map) {
return cache;
}
Michael Starzinger 2012/10/11 12:42:46 Additional empty newline here.
mvstanton1 2012/10/12 08:40:50 Done.
+void Map::ZapTransitions() {
+ TransitionArray* transition_array = transitions();
+ MemsetPointer(transition_array->data_start(),
+ GetHeap()->the_hole_value(),
+ transition_array->length());
+}
+
+
+void Map::ZapPrototypeTransitions() {
+ FixedArray* proto_transitions = GetPrototypeTransitions();
+ MemsetPointer(proto_transitions->data_start(),
+ GetHeap()->the_hole_value(),
+ proto_transitions->length());
+}
+
MaybeObject* JSReceiver::SetPrototype(Object* value,
bool skip_hidden_prototypes) {

Powered by Google App Engine
This is Rietveld 408576698