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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 template <typename StringType> | 341 template <typename StringType> |
342 void NewSpace::ShrinkStringAtAllocationBoundary(String* string, int length) { | 342 void NewSpace::ShrinkStringAtAllocationBoundary(String* string, int length) { |
343 ASSERT(length <= string->length()); | 343 ASSERT(length <= string->length()); |
344 ASSERT(string->IsSeqString()); | 344 ASSERT(string->IsSeqString()); |
345 ASSERT(string->address() + StringType::SizeFor(string->length()) == | 345 ASSERT(string->address() + StringType::SizeFor(string->length()) == |
346 allocation_info_.top); | 346 allocation_info_.top); |
347 Address old_top = allocation_info_.top; | 347 Address old_top = allocation_info_.top; |
348 allocation_info_.top = | 348 allocation_info_.top = |
349 string->address() + StringType::SizeFor(length); | 349 string->address() + StringType::SizeFor(length); |
350 string->set_length(length); | 350 string->set_length(length); |
351 if (Marking::IsBlack(Marking::MarkBitFrom(string))) { | 351 if (MarkCompactCollector::IsLiveBytesUpdateRequired(string)) { |
352 int delta = static_cast<int>(old_top - allocation_info_.top); | 352 int delta = static_cast<int>(old_top - allocation_info_.top); |
353 MemoryChunk::IncrementLiveBytes(string->address(), -delta); | 353 MemoryChunk::IncrementLiveBytes(string->address(), -delta); |
354 } | 354 } |
355 } | 355 } |
356 | 356 |
357 | 357 |
358 bool FreeListNode::IsFreeListNode(HeapObject* object) { | 358 bool FreeListNode::IsFreeListNode(HeapObject* object) { |
359 Map* map = object->map(); | 359 Map* map = object->map(); |
360 Heap* heap = object->GetHeap(); | 360 Heap* heap = object->GetHeap(); |
361 return map == heap->raw_unchecked_free_space_map() | 361 return map == heap->raw_unchecked_free_space_map() |
362 || map == heap->raw_unchecked_one_pointer_filler_map() | 362 || map == heap->raw_unchecked_one_pointer_filler_map() |
363 || map == heap->raw_unchecked_two_pointer_filler_map(); | 363 || map == heap->raw_unchecked_two_pointer_filler_map(); |
364 } | 364 } |
365 | 365 |
366 } } // namespace v8::internal | 366 } } // namespace v8::internal |
367 | 367 |
368 #endif // V8_SPACES_INL_H_ | 368 #endif // V8_SPACES_INL_H_ |
OLD | NEW |