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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 static int size_; | 642 static int size_; |
643 // Allocated executable space size in bytes. | 643 // Allocated executable space size in bytes. |
644 static int size_executable_; | 644 static int size_executable_; |
645 | 645 |
646 // The initial chunk of virtual memory. | 646 // The initial chunk of virtual memory. |
647 static VirtualMemory* initial_chunk_; | 647 static VirtualMemory* initial_chunk_; |
648 | 648 |
649 // Allocated chunk info: chunk start address, chunk size, and owning space. | 649 // Allocated chunk info: chunk start address, chunk size, and owning space. |
650 class ChunkInfo BASE_EMBEDDED { | 650 class ChunkInfo BASE_EMBEDDED { |
651 public: | 651 public: |
652 ChunkInfo() : address_(NULL), size_(0), owner_(NULL) {} | 652 ChunkInfo() : address_(NULL), |
653 void init(Address a, size_t s, PagedSpace* o) { | 653 size_(0), |
654 address_ = a; | 654 owner_(NULL), |
655 size_ = s; | 655 executable_(NOT_EXECUTABLE) {} |
656 owner_ = o; | 656 inline void init(Address a, size_t s, PagedSpace* o); |
657 } | |
658 Address address() { return address_; } | 657 Address address() { return address_; } |
659 size_t size() { return size_; } | 658 size_t size() { return size_; } |
660 PagedSpace* owner() { return owner_; } | 659 PagedSpace* owner() { return owner_; } |
| 660 // We save executability of the owner to allow using it |
| 661 // when collecting stats after the owner has been destroyed. |
| 662 Executability executable() const { return executable_; } |
661 | 663 |
662 private: | 664 private: |
663 Address address_; | 665 Address address_; |
664 size_t size_; | 666 size_t size_; |
665 PagedSpace* owner_; | 667 PagedSpace* owner_; |
| 668 Executability executable_; |
666 }; | 669 }; |
667 | 670 |
668 // Chunks_, free_chunk_ids_ and top_ act as a stack of free chunk ids. | 671 // Chunks_, free_chunk_ids_ and top_ act as a stack of free chunk ids. |
669 static List<ChunkInfo> chunks_; | 672 static List<ChunkInfo> chunks_; |
670 static List<int> free_chunk_ids_; | 673 static List<int> free_chunk_ids_; |
671 static int max_nof_chunks_; | 674 static int max_nof_chunks_; |
672 static int top_; | 675 static int top_; |
673 | 676 |
674 // Push/pop a free chunk id onto/from the stack. | 677 // Push/pop a free chunk id onto/from the stack. |
675 static void Push(int free_chunk_id); | 678 static void Push(int free_chunk_id); |
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2222 | 2225 |
2223 private: | 2226 private: |
2224 LargeObjectChunk* current_; | 2227 LargeObjectChunk* current_; |
2225 HeapObjectCallback size_func_; | 2228 HeapObjectCallback size_func_; |
2226 }; | 2229 }; |
2227 | 2230 |
2228 | 2231 |
2229 } } // namespace v8::internal | 2232 } } // namespace v8::internal |
2230 | 2233 |
2231 #endif // V8_SPACES_H_ | 2234 #endif // V8_SPACES_H_ |
OLD | NEW |