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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 bitmask |= 1 << rstart; | 213 bitmask |= 1 << rstart; |
214 } | 214 } |
215 | 215 |
216 if (bitmask) { | 216 if (bitmask) { |
217 SetRegionMarks(GetRegionMarks() & ~bitmask); | 217 SetRegionMarks(GetRegionMarks() & ~bitmask); |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
221 | 221 |
222 void Page::FlipMeaningOfInvalidatedWatermarkFlag() { | 222 void Page::FlipMeaningOfInvalidatedWatermarkFlag() { |
223 watermark_invalidated_mark_ ^= WATERMARK_INVALIDATED; | 223 watermark_invalidated_mark_ ^= 1 << WATERMARK_INVALIDATED; |
224 } | 224 } |
225 | 225 |
226 | 226 |
227 bool Page::IsWatermarkValid() { | 227 bool Page::IsWatermarkValid() { |
228 return (flags_ & WATERMARK_INVALIDATED) != watermark_invalidated_mark_; | 228 return (flags_ & (1 << WATERMARK_INVALIDATED)) != watermark_invalidated_mark_; |
229 } | 229 } |
230 | 230 |
231 | 231 |
232 void Page::InvalidateWatermark(bool value) { | 232 void Page::InvalidateWatermark(bool value) { |
233 if (value) { | 233 if (value) { |
234 flags_ = (flags_ & ~WATERMARK_INVALIDATED) | watermark_invalidated_mark_; | 234 flags_ = (flags_ & ~(1 << WATERMARK_INVALIDATED)) | |
| 235 watermark_invalidated_mark_; |
235 } else { | 236 } else { |
236 flags_ = (flags_ & ~WATERMARK_INVALIDATED) | | 237 flags_ = (flags_ & ~(1 << WATERMARK_INVALIDATED)) | |
237 (watermark_invalidated_mark_ ^ WATERMARK_INVALIDATED); | 238 (watermark_invalidated_mark_ ^ (1 << WATERMARK_INVALIDATED)); |
238 } | 239 } |
239 | 240 |
240 ASSERT(IsWatermarkValid() == !value); | 241 ASSERT(IsWatermarkValid() == !value); |
241 } | 242 } |
242 | 243 |
243 | 244 |
244 bool Page::GetPageFlag(PageFlag flag) { | 245 bool Page::GetPageFlag(PageFlag flag) { |
245 return (flags_ & flag) != 0; | 246 return (flags_ & (1 << flag)) != 0; |
246 } | 247 } |
247 | 248 |
248 | 249 |
249 void Page::SetPageFlag(PageFlag flag, bool value) { | 250 void Page::SetPageFlag(PageFlag flag, bool value) { |
250 if (value) { | 251 if (value) { |
251 flags_ |= flag; | 252 flags_ |= (1 << flag); |
252 } else { | 253 } else { |
253 flags_ &= ~flag; | 254 flags_ &= ~(1 << flag); |
254 } | 255 } |
255 } | 256 } |
256 | 257 |
257 | 258 |
258 void Page::ClearPageFlags() { | 259 void Page::ClearPageFlags() { |
259 flags_ = 0; | 260 flags_ = 0; |
260 } | 261 } |
261 | 262 |
262 | 263 |
263 void Page::ClearGCFields() { | 264 void Page::ClearGCFields() { |
(...skipping 18 matching lines...) Expand all Loading... |
282 | 283 |
283 bool Page::IsLargeObjectPage() { | 284 bool Page::IsLargeObjectPage() { |
284 return !GetPageFlag(IS_NORMAL_PAGE); | 285 return !GetPageFlag(IS_NORMAL_PAGE); |
285 } | 286 } |
286 | 287 |
287 | 288 |
288 void Page::SetIsLargeObjectPage(bool is_large_object_page) { | 289 void Page::SetIsLargeObjectPage(bool is_large_object_page) { |
289 SetPageFlag(IS_NORMAL_PAGE, !is_large_object_page); | 290 SetPageFlag(IS_NORMAL_PAGE, !is_large_object_page); |
290 } | 291 } |
291 | 292 |
| 293 bool Page::IsPageExecutable() { |
| 294 return GetPageFlag(IS_EXECUTABLE); |
| 295 } |
| 296 |
| 297 |
| 298 void Page::SetIsPageExecutable(bool is_page_executable) { |
| 299 SetPageFlag(IS_EXECUTABLE, is_page_executable); |
| 300 } |
| 301 |
292 | 302 |
293 // ----------------------------------------------------------------------------- | 303 // ----------------------------------------------------------------------------- |
294 // MemoryAllocator | 304 // MemoryAllocator |
295 | 305 |
296 bool MemoryAllocator::IsValidChunk(int chunk_id) { | 306 bool MemoryAllocator::IsValidChunk(int chunk_id) { |
297 if (!IsValidChunkId(chunk_id)) return false; | 307 if (!IsValidChunkId(chunk_id)) return false; |
298 | 308 |
299 ChunkInfo& c = chunks_[chunk_id]; | 309 ChunkInfo& c = chunks_[chunk_id]; |
300 return (c.address() != NULL) && (c.size() != 0) && (c.owner() != NULL); | 310 return (c.address() != NULL) && (c.size() != 0) && (c.owner() != NULL); |
301 } | 311 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 484 |
475 bool FreeListNode::IsFreeListNode(HeapObject* object) { | 485 bool FreeListNode::IsFreeListNode(HeapObject* object) { |
476 return object->map() == Heap::raw_unchecked_byte_array_map() | 486 return object->map() == Heap::raw_unchecked_byte_array_map() |
477 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() | 487 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() |
478 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); | 488 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); |
479 } | 489 } |
480 | 490 |
481 } } // namespace v8::internal | 491 } } // namespace v8::internal |
482 | 492 |
483 #endif // V8_SPACES_INL_H_ | 493 #endif // V8_SPACES_INL_H_ |
OLD | NEW |