| OLD | NEW |
| 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 Loading... |
| 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 (NewSpacePage::IsAtStart(reinterpret_cast<Address>(rear_))) { |
| 44 NewSpacePage* rear_page = |
| 45 NewSpacePage::FromAddress(reinterpret_cast<Address>(rear_)); |
| 46 ASSERT(!rear_page->prev_page()->is_anchor()); |
| 47 rear_ = reinterpret_cast<intptr_t*>(rear_page->prev_page()->body_limit()); |
| 48 } |
| 43 *(--rear_) = reinterpret_cast<intptr_t>(target); | 49 *(--rear_) = reinterpret_cast<intptr_t>(target); |
| 44 *(--rear_) = size; | 50 *(--rear_) = size; |
| 45 // Assert no overflow into live objects. | 51 // Assert no overflow into live objects. |
| 46 ASSERT(reinterpret_cast<Address>(rear_) >= HEAP->new_space()->top()); | 52 #ifdef DEBUG |
| 53 SemiSpace::AssertValidRange(HEAP->new_space()->top(), |
| 54 reinterpret_cast<Address>(rear_)); |
| 55 #endif |
| 47 } | 56 } |
| 48 | 57 |
| 49 | 58 |
| 50 int Heap::MaxObjectSizeInPagedSpace() { | 59 int Heap::MaxObjectSizeInPagedSpace() { |
| 51 return Page::kMaxHeapObjectSize; | 60 return Page::kMaxHeapObjectSize; |
| 52 } | 61 } |
| 53 | 62 |
| 54 | 63 |
| 55 MaybeObject* Heap::AllocateStringFromUtf8(Vector<const char> str, | 64 MaybeObject* Heap::AllocateStringFromUtf8(Vector<const char> str, |
| 56 PretenureFlag pretenure) { | 65 PretenureFlag pretenure) { |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 | 701 |
| 693 | 702 |
| 694 Heap* _inline_get_heap_() { | 703 Heap* _inline_get_heap_() { |
| 695 return HEAP; | 704 return HEAP; |
| 696 } | 705 } |
| 697 | 706 |
| 698 | 707 |
| 699 } } // namespace v8::internal | 708 } } // namespace v8::internal |
| 700 | 709 |
| 701 #endif // V8_HEAP_INL_H_ | 710 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |