| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 Page* top_page = Page::FromAddress(new_top); | 2055 Page* top_page = Page::FromAddress(new_top); |
| 2056 ASSERT(top_page->is_valid()); | 2056 ASSERT(top_page->is_valid()); |
| 2057 | 2057 |
| 2058 SetAllocationInfo(&allocation_info_, top_page); | 2058 SetAllocationInfo(&allocation_info_, top_page); |
| 2059 allocation_info_.top = new_top; | 2059 allocation_info_.top = new_top; |
| 2060 | 2060 |
| 2061 int new_size = live_maps * Map::kSize; | 2061 int new_size = live_maps * Map::kSize; |
| 2062 accounting_stats_.DeallocateBytes(accounting_stats_.Size()); | 2062 accounting_stats_.DeallocateBytes(accounting_stats_.Size()); |
| 2063 accounting_stats_.AllocateBytes(new_size); | 2063 accounting_stats_.AllocateBytes(new_size); |
| 2064 | 2064 |
| 2065 // Flush allocation watermarks. |
| 2066 for (Page* p = first_page_; p != top_page; p = p->next_page()) { |
| 2067 p->SetAllocationWatermark(p->AllocationTop()); |
| 2068 } |
| 2069 top_page->SetAllocationWatermark(new_top); |
| 2070 |
| 2065 #ifdef DEBUG | 2071 #ifdef DEBUG |
| 2066 if (FLAG_enable_slow_asserts) { | 2072 if (FLAG_enable_slow_asserts) { |
| 2067 intptr_t actual_size = 0; | 2073 intptr_t actual_size = 0; |
| 2068 for (Page* p = first_page_; p != top_page; p = p->next_page()) | 2074 for (Page* p = first_page_; p != top_page; p = p->next_page()) |
| 2069 actual_size += kMapsPerPage * Map::kSize; | 2075 actual_size += kMapsPerPage * Map::kSize; |
| 2070 actual_size += (new_top - top_page->ObjectAreaStart()); | 2076 actual_size += (new_top - top_page->ObjectAreaStart()); |
| 2071 ASSERT(accounting_stats_.Size() == actual_size); | 2077 ASSERT(accounting_stats_.Size() == actual_size); |
| 2072 } | 2078 } |
| 2073 #endif | 2079 #endif |
| 2074 | 2080 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2287 | 2293 |
| 2288 private: | 2294 private: |
| 2289 LargeObjectChunk* current_; | 2295 LargeObjectChunk* current_; |
| 2290 HeapObjectCallback size_func_; | 2296 HeapObjectCallback size_func_; |
| 2291 }; | 2297 }; |
| 2292 | 2298 |
| 2293 | 2299 |
| 2294 } } // namespace v8::internal | 2300 } } // namespace v8::internal |
| 2295 | 2301 |
| 2296 #endif // V8_SPACES_H_ | 2302 #endif // V8_SPACES_H_ |
| OLD | NEW |