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

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

Issue 1683001: Put empty pages discovered during sweeping to the end of the list of pages... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 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 | « src/spaces.cc ('k') | test/cctest/test-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 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 140
141 bool Page::IsRSetSet(Address address, int offset) { 141 bool Page::IsRSetSet(Address address, int offset) {
142 uint32_t bitmask = 0; 142 uint32_t bitmask = 0;
143 Address rset_address = ComputeRSetBitPosition(address, offset, &bitmask); 143 Address rset_address = ComputeRSetBitPosition(address, offset, &bitmask);
144 return (Memory::uint32_at(rset_address) & bitmask) != 0; 144 return (Memory::uint32_at(rset_address) & bitmask) != 0;
145 } 145 }
146 146
147 147
148 bool Page::GetPageFlag(PageFlag flag) {
149 return (flags & flag) != 0;
150 }
151
152
153 void Page::SetPageFlag(PageFlag flag, bool value) {
154 if (value) {
155 flags |= flag;
156 } else {
157 flags &= ~flag;
158 }
159 }
160
161
162 bool Page::WasInUseBeforeMC() {
163 return GetPageFlag(WAS_IN_USE_BEFORE_MC);
164 }
165
166
167 void Page::SetWasInUseBeforeMC(bool was_in_use) {
168 SetPageFlag(WAS_IN_USE_BEFORE_MC, was_in_use);
169 }
170
171
172 bool Page::IsLargeObjectPage() {
173 return !GetPageFlag(IS_NORMAL_PAGE);
174 }
175
176
177 void Page::SetIsLargeObjectPage(bool is_large_object_page) {
178 SetPageFlag(IS_NORMAL_PAGE, !is_large_object_page);
179 }
180
181
148 // ----------------------------------------------------------------------------- 182 // -----------------------------------------------------------------------------
149 // MemoryAllocator 183 // MemoryAllocator
150 184
151 bool MemoryAllocator::IsValidChunk(int chunk_id) { 185 bool MemoryAllocator::IsValidChunk(int chunk_id) {
152 if (!IsValidChunkId(chunk_id)) return false; 186 if (!IsValidChunkId(chunk_id)) return false;
153 187
154 ChunkInfo& c = chunks_[chunk_id]; 188 ChunkInfo& c = chunks_[chunk_id];
155 return (c.address() != NULL) && (c.size() != 0) && (c.owner() != NULL); 189 return (c.address() != NULL) && (c.size() != 0) && (c.owner() != NULL);
156 } 190 }
157 191
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 371
338 bool FreeListNode::IsFreeListNode(HeapObject* object) { 372 bool FreeListNode::IsFreeListNode(HeapObject* object) {
339 return object->map() == Heap::raw_unchecked_byte_array_map() 373 return object->map() == Heap::raw_unchecked_byte_array_map()
340 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() 374 || object->map() == Heap::raw_unchecked_one_pointer_filler_map()
341 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); 375 || object->map() == Heap::raw_unchecked_two_pointer_filler_map();
342 } 376 }
343 377
344 } } // namespace v8::internal 378 } } // namespace v8::internal
345 379
346 #endif // V8_SPACES_INL_H_ 380 #endif // V8_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/spaces.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698