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

Side by Side Diff: src/heap.h

Issue 362723003: Added a promotion queue unit test that test promotion queue memory corruption (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | src/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_H_ 5 #ifndef V8_HEAP_H_
6 #define V8_HEAP_H_ 6 #define V8_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 ASSERT(GetHeadPage() == Page::FromAllocationTop(limit)); 418 ASSERT(GetHeadPage() == Page::FromAllocationTop(limit));
419 limit_ = reinterpret_cast<intptr_t*>(limit); 419 limit_ = reinterpret_cast<intptr_t*>(limit);
420 420
421 if (limit_ <= rear_) { 421 if (limit_ <= rear_) {
422 return; 422 return;
423 } 423 }
424 424
425 RelocateQueueHead(); 425 RelocateQueueHead();
426 } 426 }
427 427
428 bool IsBelowPromotionQueue(Address to_space_top) {
429 // If the given to-space top pointer and the head of the promotion queue
430 // are not on the same page, then the to-space objects are below the
431 // promotion queue.
432 if (GetHeadPage() != Page::FromAddress(to_space_top)) {
433 return true;
434 }
435 // If the to space top pointer is smaller or equal than the promotion
436 // queue head, then the to-space objects are below the promotion queue.
437 return reinterpret_cast<intptr_t*>(to_space_top) <= rear_;
438 }
439
428 bool is_empty() { 440 bool is_empty() {
429 return (front_ == rear_) && 441 return (front_ == rear_) &&
430 (emergency_stack_ == NULL || emergency_stack_->length() == 0); 442 (emergency_stack_ == NULL || emergency_stack_->length() == 0);
431 } 443 }
432 444
433 inline void insert(HeapObject* target, int size); 445 inline void insert(HeapObject* target, int size);
434 446
435 void remove(HeapObject** target, int* size) { 447 void remove(HeapObject** target, int* size) {
436 ASSERT(!is_empty()); 448 ASSERT(!is_empty());
437 if (front_ == rear_) { 449 if (front_ == rear_) {
(...skipping 2327 matching lines...) Expand 10 before | Expand all | Expand 10 after
2765 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2777 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2766 2778
2767 private: 2779 private:
2768 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2780 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2769 }; 2781 };
2770 #endif // DEBUG 2782 #endif // DEBUG
2771 2783
2772 } } // namespace v8::internal 2784 } } // namespace v8::internal
2773 2785
2774 #endif // V8_HEAP_H_ 2786 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698