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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 heap->incremental_marking()->SetOldSpacePageFlags(chunk); | 344 heap->incremental_marking()->SetOldSpacePageFlags(chunk); |
345 return static_cast<LargePage*>(chunk); | 345 return static_cast<LargePage*>(chunk); |
346 } | 346 } |
347 | 347 |
348 | 348 |
349 intptr_t LargeObjectSpace::Available() { | 349 intptr_t LargeObjectSpace::Available() { |
350 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); | 350 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); |
351 } | 351 } |
352 | 352 |
353 | 353 |
354 template <typename StringType> | |
355 void NewSpace::ShrinkStringAtAllocationBoundary(String* string, int length) { | |
356 ASSERT(length <= string->length()); | |
357 ASSERT(string->IsSeqString()); | |
358 ASSERT(string->address() + StringType::SizeFor(string->length()) == | |
359 allocation_info_.top); | |
360 Address old_top = allocation_info_.top; | |
361 allocation_info_.top = | |
362 string->address() + StringType::SizeFor(length); | |
363 string->set_length(length); | |
364 if (Marking::IsBlack(Marking::MarkBitFrom(string))) { | |
365 int delta = static_cast<int>(old_top - allocation_info_.top); | |
366 MemoryChunk::IncrementLiveBytesFromMutator(string->address(), -delta); | |
367 } | |
368 } | |
369 | |
370 | |
371 bool FreeListNode::IsFreeListNode(HeapObject* object) { | 354 bool FreeListNode::IsFreeListNode(HeapObject* object) { |
372 Map* map = object->map(); | 355 Map* map = object->map(); |
373 Heap* heap = object->GetHeap(); | 356 Heap* heap = object->GetHeap(); |
374 return map == heap->raw_unchecked_free_space_map() | 357 return map == heap->raw_unchecked_free_space_map() |
375 || map == heap->raw_unchecked_one_pointer_filler_map() | 358 || map == heap->raw_unchecked_one_pointer_filler_map() |
376 || map == heap->raw_unchecked_two_pointer_filler_map(); | 359 || map == heap->raw_unchecked_two_pointer_filler_map(); |
377 } | 360 } |
378 | 361 |
379 } } // namespace v8::internal | 362 } } // namespace v8::internal |
380 | 363 |
381 #endif // V8_SPACES_INL_H_ | 364 #endif // V8_SPACES_INL_H_ |
OLD | NEW |