| 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 // ---------------------------------------------------------------------------- | 743 // ---------------------------------------------------------------------------- |
| 744 // All heap objects containing executable code (code objects) must be allocated | 744 // All heap objects containing executable code (code objects) must be allocated |
| 745 // from a 2 GB range of memory, so that they can call each other using 32-bit | 745 // from a 2 GB range of memory, so that they can call each other using 32-bit |
| 746 // displacements. This happens automatically on 32-bit platforms, where 32-bit | 746 // displacements. This happens automatically on 32-bit platforms, where 32-bit |
| 747 // displacements cover the entire 4GB virtual address space. On 64-bit | 747 // displacements cover the entire 4GB virtual address space. On 64-bit |
| 748 // platforms, we support this using the CodeRange object, which reserves and | 748 // platforms, we support this using the CodeRange object, which reserves and |
| 749 // manages a range of virtual memory. | 749 // manages a range of virtual memory. |
| 750 class CodeRange { | 750 class CodeRange { |
| 751 public: | 751 public: |
| 752 explicit CodeRange(Isolate* isolate); | 752 explicit CodeRange(Isolate* isolate); |
| 753 ~CodeRange() { TearDown(); } |
| 753 | 754 |
| 754 // Reserves a range of virtual memory, but does not commit any of it. | 755 // Reserves a range of virtual memory, but does not commit any of it. |
| 755 // Can only be called once, at heap initialization time. | 756 // Can only be called once, at heap initialization time. |
| 756 // Returns false on failure. | 757 // Returns false on failure. |
| 757 bool Setup(const size_t requested_size); | 758 bool Setup(const size_t requested_size); |
| 758 | 759 |
| 759 // Frees the range of virtual memory, and frees the data structures used to | 760 // Frees the range of virtual memory, and frees the data structures used to |
| 760 // manage it. | 761 // manage it. |
| 761 void TearDown(); | 762 void TearDown(); |
| 762 | 763 |
| (...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2501 } | 2502 } |
| 2502 // Must be small, since an iteration is used for lookup. | 2503 // Must be small, since an iteration is used for lookup. |
| 2503 static const int kMaxComments = 64; | 2504 static const int kMaxComments = 64; |
| 2504 }; | 2505 }; |
| 2505 #endif | 2506 #endif |
| 2506 | 2507 |
| 2507 | 2508 |
| 2508 } } // namespace v8::internal | 2509 } } // namespace v8::internal |
| 2509 | 2510 |
| 2510 #endif // V8_SPACES_H_ | 2511 #endif // V8_SPACES_H_ |
| OLD | NEW |