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 21 matching lines...) Expand all Loading... |
32 #include "spaces.h" | 32 #include "spaces.h" |
33 #include "v8memory.h" | 33 #include "v8memory.h" |
34 | 34 |
35 namespace v8 { | 35 namespace v8 { |
36 namespace internal { | 36 namespace internal { |
37 | 37 |
38 | 38 |
39 // ----------------------------------------------------------------------------- | 39 // ----------------------------------------------------------------------------- |
40 // Bitmap | 40 // Bitmap |
41 | 41 |
| 42 int Bitmap::CellsCount() { |
| 43 MemoryChunk* chunk = MemoryChunk::FromAddress(address()); |
| 44 ASSERT(chunk->is_valid()); |
| 45 size_t rLength = (chunk->area_start() - address()) << kBitsPerByteLog2; |
| 46 if (rLength > kLength) rLength = kLength; |
| 47 rLength &= ~(kBitsPerCell - 1); |
| 48 return CellsForLength(rLength); |
| 49 } |
| 50 |
42 void Bitmap::Clear(MemoryChunk* chunk) { | 51 void Bitmap::Clear(MemoryChunk* chunk) { |
43 Bitmap* bitmap = chunk->markbits(); | 52 Bitmap* bitmap = chunk->markbits(); |
44 for (int i = 0; i < bitmap->CellsCount(); i++) bitmap->cells()[i] = 0; | 53 for (int i = 0; i < bitmap->CellsCount(); i++) bitmap->cells()[i] = 0; |
45 chunk->ResetLiveBytes(); | 54 chunk->ResetLiveBytes(); |
46 } | 55 } |
47 | 56 |
48 | 57 |
49 // ----------------------------------------------------------------------------- | 58 // ----------------------------------------------------------------------------- |
50 // PageIterator | 59 // PageIterator |
51 | 60 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 Map* map = object->map(); | 348 Map* map = object->map(); |
340 Heap* heap = object->GetHeap(); | 349 Heap* heap = object->GetHeap(); |
341 return map == heap->raw_unchecked_free_space_map() | 350 return map == heap->raw_unchecked_free_space_map() |
342 || map == heap->raw_unchecked_one_pointer_filler_map() | 351 || map == heap->raw_unchecked_one_pointer_filler_map() |
343 || map == heap->raw_unchecked_two_pointer_filler_map(); | 352 || map == heap->raw_unchecked_two_pointer_filler_map(); |
344 } | 353 } |
345 | 354 |
346 } } // namespace v8::internal | 355 } } // namespace v8::internal |
347 | 356 |
348 #endif // V8_SPACES_INL_H_ | 357 #endif // V8_SPACES_INL_H_ |
OLD | NEW |