| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 #endif | 342 #endif |
| 343 | 343 |
| 344 if (allocation_info_.limit() - old_top < size_in_bytes) { | 344 if (allocation_info_.limit() - old_top < size_in_bytes) { |
| 345 return SlowAllocateRaw(size_in_bytes); | 345 return SlowAllocateRaw(size_in_bytes); |
| 346 } | 346 } |
| 347 | 347 |
| 348 HeapObject* obj = HeapObject::FromAddress(old_top); | 348 HeapObject* obj = HeapObject::FromAddress(old_top); |
| 349 allocation_info_.set_top(allocation_info_.top() + size_in_bytes); | 349 allocation_info_.set_top(allocation_info_.top() + size_in_bytes); |
| 350 ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); | 350 ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); |
| 351 | 351 |
| 352 HeapProfiler* profiler = heap()->isolate()->heap_profiler(); | |
| 353 if (profiler != NULL && profiler->is_tracking_allocations()) { | |
| 354 profiler->NewObjectEvent(obj->address(), size_in_bytes); | |
| 355 } | |
| 356 | |
| 357 return obj; | 352 return obj; |
| 358 } | 353 } |
| 359 | 354 |
| 360 | 355 |
| 361 LargePage* LargePage::Initialize(Heap* heap, MemoryChunk* chunk) { | 356 LargePage* LargePage::Initialize(Heap* heap, MemoryChunk* chunk) { |
| 362 heap->incremental_marking()->SetOldSpacePageFlags(chunk); | 357 heap->incremental_marking()->SetOldSpacePageFlags(chunk); |
| 363 return static_cast<LargePage*>(chunk); | 358 return static_cast<LargePage*>(chunk); |
| 364 } | 359 } |
| 365 | 360 |
| 366 | 361 |
| 367 intptr_t LargeObjectSpace::Available() { | 362 intptr_t LargeObjectSpace::Available() { |
| 368 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); | 363 return ObjectSizeFor(heap()->isolate()->memory_allocator()->Available()); |
| 369 } | 364 } |
| 370 | 365 |
| 371 | 366 |
| 372 bool FreeListNode::IsFreeListNode(HeapObject* object) { | 367 bool FreeListNode::IsFreeListNode(HeapObject* object) { |
| 373 Map* map = object->map(); | 368 Map* map = object->map(); |
| 374 Heap* heap = object->GetHeap(); | 369 Heap* heap = object->GetHeap(); |
| 375 return map == heap->raw_unchecked_free_space_map() | 370 return map == heap->raw_unchecked_free_space_map() |
| 376 || map == heap->raw_unchecked_one_pointer_filler_map() | 371 || map == heap->raw_unchecked_one_pointer_filler_map() |
| 377 || map == heap->raw_unchecked_two_pointer_filler_map(); | 372 || map == heap->raw_unchecked_two_pointer_filler_map(); |
| 378 } | 373 } |
| 379 | 374 |
| 380 } } // namespace v8::internal | 375 } } // namespace v8::internal |
| 381 | 376 |
| 382 #endif // V8_SPACES_INL_H_ | 377 #endif // V8_SPACES_INL_H_ |
| OLD | NEW |