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

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

Issue 8477030: Ensure that promotion queue does not overlap with objects relocated to ToSpace. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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
« src/heap.h ('K') | « src/heap.cc ('k') | src/spaces.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 22 matching lines...) Expand all
33 #include "list-inl.h" 33 #include "list-inl.h"
34 #include "objects.h" 34 #include "objects.h"
35 #include "v8-counters.h" 35 #include "v8-counters.h"
36 #include "store-buffer.h" 36 #include "store-buffer.h"
37 #include "store-buffer-inl.h" 37 #include "store-buffer-inl.h"
38 38
39 namespace v8 { 39 namespace v8 {
40 namespace internal { 40 namespace internal {
41 41
42 void PromotionQueue::insert(HeapObject* target, int size) { 42 void PromotionQueue::insert(HeapObject* target, int size) {
43 if (emergency_stack_ != NULL) {
44 emergency_stack_->Add(Entry(target, size));
45 return;
46 }
47
43 if (NewSpacePage::IsAtStart(reinterpret_cast<Address>(rear_))) { 48 if (NewSpacePage::IsAtStart(reinterpret_cast<Address>(rear_))) {
44 NewSpacePage* rear_page = 49 NewSpacePage* rear_page =
45 NewSpacePage::FromAddress(reinterpret_cast<Address>(rear_)); 50 NewSpacePage::FromAddress(reinterpret_cast<Address>(rear_));
46 ASSERT(!rear_page->prev_page()->is_anchor()); 51 ASSERT(!rear_page->prev_page()->is_anchor());
47 rear_ = reinterpret_cast<intptr_t*>(rear_page->prev_page()->body_limit()); 52 rear_ = reinterpret_cast<intptr_t*>(rear_page->prev_page()->body_limit());
48 } 53 }
54
55 Page* rear_page = Page::FromAddress(reinterpret_cast<Address>(rear_ - 2));
56 Page* limit_page = Page::FromAllocationTop(reinterpret_cast<Address>(limit_));
57 if (rear_page == limit_page && (rear_ - 2) < limit_) {
58 RelocateQueueHead();
Erik Corry 2011/11/07 16:35:25 This one asserts that there is something to reloca
59 emergency_stack_->Add(Entry(target, size));
60 return;
61 }
62
49 *(--rear_) = reinterpret_cast<intptr_t>(target); 63 *(--rear_) = reinterpret_cast<intptr_t>(target);
50 *(--rear_) = size; 64 *(--rear_) = size;
51 // Assert no overflow into live objects. 65 // Assert no overflow into live objects.
52 #ifdef DEBUG 66 #ifdef DEBUG
53 SemiSpace::AssertValidRange(HEAP->new_space()->top(), 67 SemiSpace::AssertValidRange(HEAP->new_space()->top(),
54 reinterpret_cast<Address>(rear_)); 68 reinterpret_cast<Address>(rear_));
55 #endif 69 #endif
56 } 70 }
57 71
58 72
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 690
677 691
678 Heap* _inline_get_heap_() { 692 Heap* _inline_get_heap_() {
679 return HEAP; 693 return HEAP;
680 } 694 }
681 695
682 696
683 } } // namespace v8::internal 697 } } // namespace v8::internal
684 698
685 #endif // V8_HEAP_INL_H_ 699 #endif // V8_HEAP_INL_H_
OLDNEW
« src/heap.h ('K') | « src/heap.cc ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698