| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 // We cannot free a chunk contained in the initial chunk because it was not | 650 // We cannot free a chunk contained in the initial chunk because it was not |
| 651 // allocated with AllocateRawMemory. Instead we uncommit the virtual | 651 // allocated with AllocateRawMemory. Instead we uncommit the virtual |
| 652 // memory. | 652 // memory. |
| 653 if (InInitialChunk(c.address())) { | 653 if (InInitialChunk(c.address())) { |
| 654 // TODO(1240712): VirtualMemory::Uncommit has a return value which | 654 // TODO(1240712): VirtualMemory::Uncommit has a return value which |
| 655 // is ignored here. | 655 // is ignored here. |
| 656 initial_chunk_->Uncommit(c.address(), c.size()); | 656 initial_chunk_->Uncommit(c.address(), c.size()); |
| 657 COUNTERS->memory_allocated()->Decrement(static_cast<int>(c.size())); | 657 COUNTERS->memory_allocated()->Decrement(static_cast<int>(c.size())); |
| 658 } else { | 658 } else { |
| 659 LOG(DeleteEvent("PagedChunk", c.address())); | 659 LOG(DeleteEvent("PagedChunk", c.address())); |
| 660 ObjectSpace space = static_cast<ObjectSpace>(1 << c.owner()->identity()); | 660 ObjectSpace space = static_cast<ObjectSpace>(1 << c.owner_identity()); |
| 661 size_t size = c.size(); | 661 size_t size = c.size(); |
| 662 FreeRawMemory(c.address(), size, c.executable()); | 662 FreeRawMemory(c.address(), size, c.executable()); |
| 663 PerformAllocationCallback(space, kAllocationActionFree, size); | 663 PerformAllocationCallback(space, kAllocationActionFree, size); |
| 664 } | 664 } |
| 665 c.init(NULL, 0, NULL); | 665 c.init(NULL, 0, NULL); |
| 666 Push(chunk_id); | 666 Push(chunk_id); |
| 667 } | 667 } |
| 668 | 668 |
| 669 | 669 |
| 670 Page* MemoryAllocator::FindFirstPageInSameChunk(Page* p) { | 670 Page* MemoryAllocator::FindFirstPageInSameChunk(Page* p) { |
| (...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3043 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { | 3043 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { |
| 3044 if (obj->IsCode()) { | 3044 if (obj->IsCode()) { |
| 3045 Code* code = Code::cast(obj); | 3045 Code* code = Code::cast(obj); |
| 3046 isolate->code_kind_statistics()[code->kind()] += code->Size(); | 3046 isolate->code_kind_statistics()[code->kind()] += code->Size(); |
| 3047 } | 3047 } |
| 3048 } | 3048 } |
| 3049 } | 3049 } |
| 3050 #endif // DEBUG | 3050 #endif // DEBUG |
| 3051 | 3051 |
| 3052 } } // namespace v8::internal | 3052 } } // namespace v8::internal |
| OLD | NEW |