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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 // We cannot free a chunk contained in the initial chunk because it was not | 609 // We cannot free a chunk contained in the initial chunk because it was not |
610 // allocated with AllocateRawMemory. Instead we uncommit the virtual | 610 // allocated with AllocateRawMemory. Instead we uncommit the virtual |
611 // memory. | 611 // memory. |
612 if (InInitialChunk(c.address())) { | 612 if (InInitialChunk(c.address())) { |
613 // TODO(1240712): VirtualMemory::Uncommit has a return value which | 613 // TODO(1240712): VirtualMemory::Uncommit has a return value which |
614 // is ignored here. | 614 // is ignored here. |
615 initial_chunk_->Uncommit(c.address(), c.size()); | 615 initial_chunk_->Uncommit(c.address(), c.size()); |
616 Counters::memory_allocated.Decrement(static_cast<int>(c.size())); | 616 Counters::memory_allocated.Decrement(static_cast<int>(c.size())); |
617 } else { | 617 } else { |
618 LOG(DeleteEvent("PagedChunk", c.address())); | 618 LOG(DeleteEvent("PagedChunk", c.address())); |
619 FreeRawMemory(c.address(), c.size(), c.owner()->executable()); | 619 FreeRawMemory(c.address(), c.size(), c.executable()); |
620 } | 620 } |
621 c.init(NULL, 0, NULL); | 621 c.init(NULL, 0, NULL); |
622 Push(chunk_id); | 622 Push(chunk_id); |
623 } | 623 } |
624 | 624 |
625 | 625 |
626 Page* MemoryAllocator::FindFirstPageInSameChunk(Page* p) { | 626 Page* MemoryAllocator::FindFirstPageInSameChunk(Page* p) { |
627 int chunk_id = GetChunkId(p); | 627 int chunk_id = GetChunkId(p); |
628 ASSERT(IsValidChunk(chunk_id)); | 628 ASSERT(IsValidChunk(chunk_id)); |
629 | 629 |
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { | 2976 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { |
2977 if (obj->IsCode()) { | 2977 if (obj->IsCode()) { |
2978 Code* code = Code::cast(obj); | 2978 Code* code = Code::cast(obj); |
2979 code_kind_statistics[code->kind()] += code->Size(); | 2979 code_kind_statistics[code->kind()] += code->Size(); |
2980 } | 2980 } |
2981 } | 2981 } |
2982 } | 2982 } |
2983 #endif // DEBUG | 2983 #endif // DEBUG |
2984 | 2984 |
2985 } } // namespace v8::internal | 2985 } } // namespace v8::internal |
OLD | NEW |