| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 // Reserves a range of virtual memory, but does not commit any of it. | 887 // Reserves a range of virtual memory, but does not commit any of it. |
| 888 // Can only be called once, at heap initialization time. | 888 // Can only be called once, at heap initialization time. |
| 889 // Returns false on failure. | 889 // Returns false on failure. |
| 890 bool SetUp(const size_t requested_size); | 890 bool SetUp(const size_t requested_size); |
| 891 | 891 |
| 892 // Frees the range of virtual memory, and frees the data structures used to | 892 // Frees the range of virtual memory, and frees the data structures used to |
| 893 // manage it. | 893 // manage it. |
| 894 void TearDown(); | 894 void TearDown(); |
| 895 | 895 |
| 896 bool exists() { return this != NULL && code_range_ != NULL; } | 896 bool exists() { return this != NULL && code_range_ != NULL; } |
| 897 Address start() { | |
| 898 if (this == NULL || code_range_ == NULL) return NULL; | |
| 899 return static_cast<Address>(code_range_->address()); | |
| 900 } | |
| 901 bool contains(Address address) { | 897 bool contains(Address address) { |
| 902 if (this == NULL || code_range_ == NULL) return false; | 898 if (this == NULL || code_range_ == NULL) return false; |
| 903 Address start = static_cast<Address>(code_range_->address()); | 899 Address start = static_cast<Address>(code_range_->address()); |
| 904 return start <= address && address < start + code_range_->size(); | 900 return start <= address && address < start + code_range_->size(); |
| 905 } | 901 } |
| 906 | 902 |
| 907 // Allocates a chunk of memory from the large-object portion of | 903 // Allocates a chunk of memory from the large-object portion of |
| 908 // the code range. On platforms with no separate code range, should | 904 // the code range. On platforms with no separate code range, should |
| 909 // not be called. | 905 // not be called. |
| 910 MUST_USE_RESULT Address AllocateRawMemory(const size_t requested_size, | 906 MUST_USE_RESULT Address AllocateRawMemory(const size_t requested_size, |
| (...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2827 } | 2823 } |
| 2828 // Must be small, since an iteration is used for lookup. | 2824 // Must be small, since an iteration is used for lookup. |
| 2829 static const int kMaxComments = 64; | 2825 static const int kMaxComments = 64; |
| 2830 }; | 2826 }; |
| 2831 #endif | 2827 #endif |
| 2832 | 2828 |
| 2833 | 2829 |
| 2834 } } // namespace v8::internal | 2830 } } // namespace v8::internal |
| 2835 | 2831 |
| 2836 #endif // V8_SPACES_H_ | 2832 #endif // V8_SPACES_H_ |
| OLD | NEW |