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 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2693 void LargeObjectSpace::TearDown() { | 2693 void LargeObjectSpace::TearDown() { |
2694 while (first_chunk_ != NULL) { | 2694 while (first_chunk_ != NULL) { |
2695 LargeObjectChunk* chunk = first_chunk_; | 2695 LargeObjectChunk* chunk = first_chunk_; |
2696 first_chunk_ = first_chunk_->next(); | 2696 first_chunk_ = first_chunk_->next(); |
2697 LOG(DeleteEvent("LargeObjectChunk", chunk->address())); | 2697 LOG(DeleteEvent("LargeObjectChunk", chunk->address())); |
2698 Page* page = Page::FromAddress(RoundUp(chunk->address(), Page::kPageSize)); | 2698 Page* page = Page::FromAddress(RoundUp(chunk->address(), Page::kPageSize)); |
2699 Executability executable = | 2699 Executability executable = |
2700 page->IsPageExecutable() ? EXECUTABLE : NOT_EXECUTABLE; | 2700 page->IsPageExecutable() ? EXECUTABLE : NOT_EXECUTABLE; |
2701 ObjectSpace space = kObjectSpaceLoSpace; | 2701 ObjectSpace space = kObjectSpaceLoSpace; |
2702 if (executable == EXECUTABLE) space = kObjectSpaceCodeSpace; | 2702 if (executable == EXECUTABLE) space = kObjectSpaceCodeSpace; |
2703 int size = chunk->size(); | 2703 size_t size = chunk->size(); |
2704 MemoryAllocator::FreeRawMemory(chunk->address(), | 2704 MemoryAllocator::FreeRawMemory(chunk->address(), size, executable); |
2705 chunk->size(), | 2705 MemoryAllocator::PerformAllocationCallback( |
2706 executable); | 2706 space, kAllocationActionFree, size); |
2707 MemoryAllocator::PerformAllocationCallback(space, kAllocationActionFree, | |
2708 size); | |
2709 } | 2707 } |
2710 | 2708 |
2711 size_ = 0; | 2709 size_ = 0; |
2712 page_count_ = 0; | 2710 page_count_ = 0; |
2713 } | 2711 } |
2714 | 2712 |
2715 | 2713 |
2716 #ifdef ENABLE_HEAP_PROTECTION | 2714 #ifdef ENABLE_HEAP_PROTECTION |
2717 | 2715 |
2718 void LargeObjectSpace::Protect() { | 2716 void LargeObjectSpace::Protect() { |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3032 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { | 3030 for (HeapObject* obj = obj_it.next(); obj != NULL; obj = obj_it.next()) { |
3033 if (obj->IsCode()) { | 3031 if (obj->IsCode()) { |
3034 Code* code = Code::cast(obj); | 3032 Code* code = Code::cast(obj); |
3035 code_kind_statistics[code->kind()] += code->Size(); | 3033 code_kind_statistics[code->kind()] += code->Size(); |
3036 } | 3034 } |
3037 } | 3035 } |
3038 } | 3036 } |
3039 #endif // DEBUG | 3037 #endif // DEBUG |
3040 | 3038 |
3041 } } // namespace v8::internal | 3039 } } // namespace v8::internal |
OLD | NEW |