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

Side by Side Diff: src/heap/heap.h

Issue 1314543014: [heap] Prevent leakage of GCCallbacksScope outside of heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-remove-alloc-failure-scope
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 2412 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 class AlwaysAllocateScope { 2423 class AlwaysAllocateScope {
2424 public: 2424 public:
2425 explicit inline AlwaysAllocateScope(Isolate* isolate); 2425 explicit inline AlwaysAllocateScope(Isolate* isolate);
2426 inline ~AlwaysAllocateScope(); 2426 inline ~AlwaysAllocateScope();
2427 2427
2428 private: 2428 private:
2429 Heap* heap_; 2429 Heap* heap_;
2430 }; 2430 };
2431 2431
2432 2432
2433 class GCCallbacksScope {
2434 public:
2435 explicit inline GCCallbacksScope(Heap* heap);
2436 inline ~GCCallbacksScope();
2437
2438 inline bool CheckReenter();
2439
2440 private:
2441 Heap* heap_;
2442 };
2443
2444
2445 // Visitor class to verify interior pointers in spaces that do not contain 2433 // Visitor class to verify interior pointers in spaces that do not contain
2446 // or care about intergenerational references. All heap object pointers have to 2434 // or care about intergenerational references. All heap object pointers have to
2447 // point into the heap to a location that has a map pointer at its first word. 2435 // point into the heap to a location that has a map pointer at its first word.
2448 // Caveat: Heap::Contains is an approximation because it can return true for 2436 // Caveat: Heap::Contains is an approximation because it can return true for
2449 // objects in a heap space but above the allocation pointer. 2437 // objects in a heap space but above the allocation pointer.
2450 class VerifyPointersVisitor : public ObjectVisitor { 2438 class VerifyPointersVisitor : public ObjectVisitor {
2451 public: 2439 public:
2452 inline void VisitPointers(Object** start, Object** end); 2440 inline void VisitPointers(Object** start, Object** end);
2453 }; 2441 };
2454 2442
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2732 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2745 2733
2746 private: 2734 private:
2747 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2735 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2748 }; 2736 };
2749 #endif // DEBUG 2737 #endif // DEBUG
2750 } 2738 }
2751 } // namespace v8::internal 2739 } // namespace v8::internal
2752 2740
2753 #endif // V8_HEAP_HEAP_H_ 2741 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698