| OLD | NEW |
| 1 // Copyright 2006-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2010 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 | 149 |
| 150 | 150 |
| 151 uint32_t Page::GetRegionMaskForAddress(Address addr) { | 151 uint32_t Page::GetRegionMaskForAddress(Address addr) { |
| 152 return 1 << GetRegionNumberForAddress(addr); | 152 return 1 << GetRegionNumberForAddress(addr); |
| 153 } | 153 } |
| 154 | 154 |
| 155 | 155 |
| 156 uint32_t Page::GetRegionMaskForSpan(Address start, int length_in_bytes) { | 156 uint32_t Page::GetRegionMaskForSpan(Address start, int length_in_bytes) { |
| 157 uint32_t result = 0; | 157 uint32_t result = 0; |
| 158 if (length_in_bytes >= kPageSize) { | 158 static const intptr_t kRegionMask = (1 << kRegionSizeLog2) - 1; |
| 159 if (length_in_bytes + (OffsetFrom(start) & kRegionMask) >= kPageSize) { |
| 159 result = kAllRegionsDirtyMarks; | 160 result = kAllRegionsDirtyMarks; |
| 160 } else if (length_in_bytes > 0) { | 161 } else if (length_in_bytes > 0) { |
| 161 int start_region = GetRegionNumberForAddress(start); | 162 int start_region = GetRegionNumberForAddress(start); |
| 162 int end_region = | 163 int end_region = |
| 163 GetRegionNumberForAddress(start + length_in_bytes - kPointerSize); | 164 GetRegionNumberForAddress(start + length_in_bytes - kPointerSize); |
| 164 uint32_t start_mask = (~0) << start_region; | 165 uint32_t start_mask = (~0) << start_region; |
| 165 uint32_t end_mask = ~((~1) << end_region); | 166 uint32_t end_mask = ~((~1) << end_region); |
| 166 result = start_mask & end_mask; | 167 result = start_mask & end_mask; |
| 167 // if end_region < start_region, the mask is ored. | 168 // if end_region < start_region, the mask is ored. |
| 168 if (result == 0) result = start_mask | end_mask; | 169 if (result == 0) result = start_mask | end_mask; |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 475 |
| 475 bool FreeListNode::IsFreeListNode(HeapObject* object) { | 476 bool FreeListNode::IsFreeListNode(HeapObject* object) { |
| 476 return object->map() == HEAP->raw_unchecked_byte_array_map() | 477 return object->map() == HEAP->raw_unchecked_byte_array_map() |
| 477 || object->map() == HEAP->raw_unchecked_one_pointer_filler_map() | 478 || object->map() == HEAP->raw_unchecked_one_pointer_filler_map() |
| 478 || object->map() == HEAP->raw_unchecked_two_pointer_filler_map(); | 479 || object->map() == HEAP->raw_unchecked_two_pointer_filler_map(); |
| 479 } | 480 } |
| 480 | 481 |
| 481 } } // namespace v8::internal | 482 } } // namespace v8::internal |
| 482 | 483 |
| 483 #endif // V8_SPACES_INL_H_ | 484 #endif // V8_SPACES_INL_H_ |
| OLD | NEW |