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

Side by Side Diff: src/heap.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 1254
1255 Address* store_buffer_top_address() { 1255 Address* store_buffer_top_address() {
1256 return reinterpret_cast<Address*>(&roots_[kStoreBufferTopRootIndex]); 1256 return reinterpret_cast<Address*>(&roots_[kStoreBufferTopRootIndex]);
1257 } 1257 }
1258 1258
1259 // Get address of native contexts list for serialization support. 1259 // Get address of native contexts list for serialization support.
1260 Object** native_contexts_list_address() { 1260 Object** native_contexts_list_address() {
1261 return &native_contexts_list_; 1261 return &native_contexts_list_;
1262 } 1262 }
1263 1263
1264 // Verify the heap is in its normal state before or after a GC.
1265 void Verify();
1266
1264 #ifdef DEBUG 1267 #ifdef DEBUG
1265 void Print(); 1268 void Print();
1266 void PrintHandles(); 1269 void PrintHandles();
1267 1270
1268 // Verify the heap is in its normal state before or after a GC.
1269 void Verify();
1270 1271
1271 void OldPointerSpaceCheckStoreBuffer(); 1272 void OldPointerSpaceCheckStoreBuffer();
1272 void MapSpaceCheckStoreBuffer(); 1273 void MapSpaceCheckStoreBuffer();
1273 void LargeObjectSpaceCheckStoreBuffer(); 1274 void LargeObjectSpaceCheckStoreBuffer();
1274 1275
1275 // Report heap statistics. 1276 // Report heap statistics.
1276 void ReportHeapStatistics(const char* title); 1277 void ReportHeapStatistics(const char* title);
1277 void ReportCodeStatistics(const char* title); 1278 void ReportCodeStatistics(const char* title);
1278 1279 #endif
Michael Starzinger 2012/10/11 12:42:46 Empty newline after the #endif
mvstanton1 2012/10/12 08:40:50 Done.
1279 // Fill in bogus values in from space 1280 // Fill in bogus values in from space
1280 void ZapFromSpace(); 1281 void ZapFromSpace();
1281 #endif
1282 1282
1283 // Print short heap statistics. 1283 // Print short heap statistics.
1284 void PrintShortHeapStatistics(); 1284 void PrintShortHeapStatistics();
1285 1285
1286 // Makes a new symbol object 1286 // Makes a new symbol object
1287 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation 1287 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation
1288 // failed. 1288 // failed.
1289 // Please note this function does not perform a garbage collection. 1289 // Please note this function does not perform a garbage collection.
1290 MUST_USE_RESULT MaybeObject* CreateSymbol( 1290 MUST_USE_RESULT MaybeObject* CreateSymbol(
1291 const char* str, int length, int hash); 1291 const char* str, int length, int hash);
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
2194 public: 2194 public:
2195 inline AlwaysAllocateScope(); 2195 inline AlwaysAllocateScope();
2196 inline ~AlwaysAllocateScope(); 2196 inline ~AlwaysAllocateScope();
2197 2197
2198 private: 2198 private:
2199 // Implicitly disable artificial allocation failures. 2199 // Implicitly disable artificial allocation failures.
2200 DisallowAllocationFailure disallow_allocation_failure_; 2200 DisallowAllocationFailure disallow_allocation_failure_;
2201 }; 2201 };
2202 2202
2203 2203
2204 #ifdef DEBUG
2205 // Visitor class to verify interior pointers in spaces that do not contain 2204 // Visitor class to verify interior pointers in spaces that do not contain
2206 // or care about intergenerational references. All heap object pointers have to 2205 // or care about intergenerational references. All heap object pointers have to
2207 // point into the heap to a location that has a map pointer at its first word. 2206 // point into the heap to a location that has a map pointer at its first word.
2208 // Caveat: Heap::Contains is an approximation because it can return true for 2207 // Caveat: Heap::Contains is an approximation because it can return true for
2209 // objects in a heap space but above the allocation pointer. 2208 // objects in a heap space but above the allocation pointer.
2210 class VerifyPointersVisitor: public ObjectVisitor { 2209 class VerifyPointersVisitor: public ObjectVisitor {
2211 public: 2210 public:
2212 inline void VisitPointers(Object** start, Object** end); 2211 inline void VisitPointers(Object** start, Object** end);
2213 }; 2212 };
2214 #endif
2215 2213
2216 2214
2217 // Space iterator for iterating over all spaces of the heap. 2215 // Space iterator for iterating over all spaces of the heap.
2218 // Returns each space in turn, and null when it is done. 2216 // Returns each space in turn, and null when it is done.
2219 class AllSpaces BASE_EMBEDDED { 2217 class AllSpaces BASE_EMBEDDED {
2220 public: 2218 public:
2221 Space* next(); 2219 Space* next();
2222 AllSpaces() { counter_ = FIRST_SPACE; } 2220 AllSpaces() { counter_ = FIRST_SPACE; }
2223 private: 2221 private:
2224 int counter_; 2222 int counter_;
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
2794 AssertNoAllocation no_alloc; // i.e. no gc allowed. 2792 AssertNoAllocation no_alloc; // i.e. no gc allowed.
2795 2793
2796 private: 2794 private:
2797 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2795 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2798 }; 2796 };
2799 #endif // DEBUG || LIVE_OBJECT_LIST 2797 #endif // DEBUG || LIVE_OBJECT_LIST
2800 2798
2801 } } // namespace v8::internal 2799 } } // namespace v8::internal
2802 2800
2803 #endif // V8_HEAP_H_ 2801 #endif // V8_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698