| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
| 6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 | 873 |
| 874 // Frees the range of virtual memory, and frees the data structures used to | 874 // Frees the range of virtual memory, and frees the data structures used to |
| 875 // manage it. | 875 // manage it. |
| 876 void TearDown(); | 876 void TearDown(); |
| 877 | 877 |
| 878 bool valid() { return code_range_ != NULL; } | 878 bool valid() { return code_range_ != NULL; } |
| 879 Address start() { | 879 Address start() { |
| 880 DCHECK(valid()); | 880 DCHECK(valid()); |
| 881 return static_cast<Address>(code_range_->address()); | 881 return static_cast<Address>(code_range_->address()); |
| 882 } | 882 } |
| 883 size_t size() { |
| 884 DCHECK(valid()); |
| 885 return code_range_->size(); |
| 886 } |
| 883 bool contains(Address address) { | 887 bool contains(Address address) { |
| 884 if (!valid()) return false; | 888 if (!valid()) return false; |
| 885 Address start = static_cast<Address>(code_range_->address()); | 889 Address start = static_cast<Address>(code_range_->address()); |
| 886 return start <= address && address < start + code_range_->size(); | 890 return start <= address && address < start + code_range_->size(); |
| 887 } | 891 } |
| 888 | 892 |
| 889 // Allocates a chunk of memory from the large-object portion of | 893 // Allocates a chunk of memory from the large-object portion of |
| 890 // the code range. On platforms with no separate code range, should | 894 // the code range. On platforms with no separate code range, should |
| 891 // not be called. | 895 // not be called. |
| 892 MUST_USE_RESULT Address AllocateRawMemory(const size_t requested_size, | 896 MUST_USE_RESULT Address AllocateRawMemory(const size_t requested_size, |
| (...skipping 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2879 count = 0; | 2883 count = 0; |
| 2880 } | 2884 } |
| 2881 // Must be small, since an iteration is used for lookup. | 2885 // Must be small, since an iteration is used for lookup. |
| 2882 static const int kMaxComments = 64; | 2886 static const int kMaxComments = 64; |
| 2883 }; | 2887 }; |
| 2884 #endif | 2888 #endif |
| 2885 } | 2889 } |
| 2886 } // namespace v8::internal | 2890 } // namespace v8::internal |
| 2887 | 2891 |
| 2888 #endif // V8_HEAP_SPACES_H_ | 2892 #endif // V8_HEAP_SPACES_H_ |
| OLD | NEW |