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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 // platforms, we support this using the CodeRange object, which reserves and | 939 // platforms, we support this using the CodeRange object, which reserves and |
940 // manages a range of virtual memory. | 940 // manages a range of virtual memory. |
941 class CodeRange { | 941 class CodeRange { |
942 public: | 942 public: |
943 explicit CodeRange(Isolate* isolate); | 943 explicit CodeRange(Isolate* isolate); |
944 ~CodeRange() { TearDown(); } | 944 ~CodeRange() { TearDown(); } |
945 | 945 |
946 // Reserves a range of virtual memory, but does not commit any of it. | 946 // Reserves a range of virtual memory, but does not commit any of it. |
947 // Can only be called once, at heap initialization time. | 947 // Can only be called once, at heap initialization time. |
948 // Returns false on failure. | 948 // Returns false on failure. |
949 bool SetUp(const size_t requested_size); | 949 bool SetUp(size_t requested_size); |
950 | 950 |
951 // Frees the range of virtual memory, and frees the data structures used to | 951 // Frees the range of virtual memory, and frees the data structures used to |
952 // manage it. | 952 // manage it. |
953 void TearDown(); | 953 void TearDown(); |
954 | 954 |
955 bool exists() { return this != NULL && code_range_ != NULL; } | 955 bool exists() { return this != NULL && code_range_ != NULL; } |
956 Address start() { | 956 Address start() { |
957 if (this == NULL || code_range_ == NULL) return NULL; | 957 if (this == NULL || code_range_ == NULL) return NULL; |
958 return static_cast<Address>(code_range_->address()); | 958 return static_cast<Address>(code_range_->address()); |
959 } | 959 } |
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2981 } | 2981 } |
2982 // Must be small, since an iteration is used for lookup. | 2982 // Must be small, since an iteration is used for lookup. |
2983 static const int kMaxComments = 64; | 2983 static const int kMaxComments = 64; |
2984 }; | 2984 }; |
2985 #endif | 2985 #endif |
2986 | 2986 |
2987 | 2987 |
2988 } } // namespace v8::internal | 2988 } } // namespace v8::internal |
2989 | 2989 |
2990 #endif // V8_SPACES_H_ | 2990 #endif // V8_SPACES_H_ |
OLD | NEW |