| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 // ---------------------------------------------------------------------------- | 402 // ---------------------------------------------------------------------------- |
| 403 // All heap objects containing executable code (code objects) must be allocated | 403 // All heap objects containing executable code (code objects) must be allocated |
| 404 // from a 2 GB range of memory, so that they can call each other using 32-bit | 404 // from a 2 GB range of memory, so that they can call each other using 32-bit |
| 405 // displacements. This happens automatically on 32-bit platforms, where 32-bit | 405 // displacements. This happens automatically on 32-bit platforms, where 32-bit |
| 406 // displacements cover the entire 4GB virtual address space. On 64-bit | 406 // displacements cover the entire 4GB virtual address space. On 64-bit |
| 407 // platforms, we support this using the CodeRange object, which reserves and | 407 // platforms, we support this using the CodeRange object, which reserves and |
| 408 // manages a range of virtual memory. | 408 // manages a range of virtual memory. |
| 409 class CodeRange { | 409 class CodeRange { |
| 410 public: | 410 public: |
| 411 explicit CodeRange(Isolate* isolate); | 411 explicit CodeRange(Isolate* isolate); |
| 412 ~CodeRange() { TearDown(); } |
| 412 | 413 |
| 413 // Reserves a range of virtual memory, but does not commit any of it. | 414 // Reserves a range of virtual memory, but does not commit any of it. |
| 414 // Can only be called once, at heap initialization time. | 415 // Can only be called once, at heap initialization time. |
| 415 // Returns false on failure. | 416 // Returns false on failure. |
| 416 bool Setup(const size_t requested_size); | 417 bool Setup(const size_t requested_size); |
| 417 | 418 |
| 418 // Frees the range of virtual memory, and frees the data structures used to | 419 // Frees the range of virtual memory, and frees the data structures used to |
| 419 // manage it. | 420 // manage it. |
| 420 void TearDown(); | 421 void TearDown(); |
| 421 | 422 |
| (...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2304 } | 2305 } |
| 2305 // Must be small, since an iteration is used for lookup. | 2306 // Must be small, since an iteration is used for lookup. |
| 2306 static const int kMaxComments = 64; | 2307 static const int kMaxComments = 64; |
| 2307 }; | 2308 }; |
| 2308 #endif | 2309 #endif |
| 2309 | 2310 |
| 2310 | 2311 |
| 2311 } } // namespace v8::internal | 2312 } } // namespace v8::internal |
| 2312 | 2313 |
| 2313 #endif // V8_SPACES_H_ | 2314 #endif // V8_SPACES_H_ |
| OLD | NEW |