| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_VIRTUAL_MEMORY_H_ | 5 #ifndef VM_VIRTUAL_MEMORY_H_ |
| 6 #define VM_VIRTUAL_MEMORY_H_ | 6 #define VM_VIRTUAL_MEMORY_H_ |
| 7 | 7 |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
| 11 | 11 |
| 12 namespace dart { | 12 namespace dart { |
| 13 | 13 |
| 14 class VirtualMemory { | 14 class VirtualMemory { |
| 15 public: | 15 public: |
| 16 // Read-write-execute is not available because it is never used. | |
| 17 enum Protection { | 16 enum Protection { |
| 18 kNoAccess, | 17 kNoAccess, |
| 19 kReadOnly, | 18 kReadOnly, |
| 20 kReadWrite, | 19 kReadWrite, |
| 21 kReadExecute, | 20 kReadExecute, |
| 21 kReadWriteExecute |
| 22 }; | 22 }; |
| 23 | 23 |
| 24 // The reserved memory is unmapped on destruction. | 24 // The reserved memory is unmapped on destruction. |
| 25 ~VirtualMemory(); | 25 ~VirtualMemory(); |
| 26 | 26 |
| 27 uword start() const { return region_.start(); } | 27 uword start() const { return region_.start(); } |
| 28 uword end() const { return region_.end(); } | 28 uword end() const { return region_.end(); } |
| 29 void* address() const { return region_.pointer(); } | 29 void* address() const { return region_.pointer(); } |
| 30 intptr_t size() const { return region_.size(); } | 30 intptr_t size() const { return region_.size(); } |
| 31 | 31 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 void* reserved_pointer_; | 90 void* reserved_pointer_; |
| 91 | 91 |
| 92 static uword page_size_; | 92 static uword page_size_; |
| 93 | 93 |
| 94 DISALLOW_IMPLICIT_CONSTRUCTORS(VirtualMemory); | 94 DISALLOW_IMPLICIT_CONSTRUCTORS(VirtualMemory); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace dart | 97 } // namespace dart |
| 98 | 98 |
| 99 #endif // VM_VIRTUAL_MEMORY_H_ | 99 #endif // VM_VIRTUAL_MEMORY_H_ |
| OLD | NEW |