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 RUNTIME_BIN_PLATFORM_H_ | 5 #ifndef RUNTIME_BIN_PLATFORM_H_ |
6 #define RUNTIME_BIN_PLATFORM_H_ | 6 #define RUNTIME_BIN_PLATFORM_H_ |
7 | 7 |
8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 namespace bin { | 12 namespace bin { |
13 | 13 |
14 class Platform { | 14 class Platform { |
15 public: | 15 public: |
16 // Perform platform specific initialization. | 16 // Perform platform specific initialization. |
17 static bool Initialize(); | 17 static bool Initialize(); |
18 | 18 |
19 // Returns the number of processors on the machine. | 19 // Returns the number of processors on the machine. |
20 static int NumberOfProcessors(); | 20 static int NumberOfProcessors(); |
21 | 21 |
22 // Returns a string representing the operating system ("linux", | 22 // Returns a string representing the operating system ("linux", |
23 // "macos", "windows", or "android"). The returned string should not be | 23 // "macos", "windows", or "android"). The returned string should not be |
24 // deallocated by the caller. | 24 // deallocated by the caller. |
25 static const char* OperatingSystem(); | 25 static const char* OperatingSystem(); |
26 | 26 |
| 27 // Returns a string representing the version of the operating system. The |
| 28 // format of the string is determined by the platform. The returned string |
| 29 // should not be deallocated by the caller. |
| 30 static const char* OperatingSystemVersion(); |
| 31 |
27 // Returns the architecture name of the processor the VM is running on | 32 // Returns the architecture name of the processor the VM is running on |
28 // (ia32, x64, arm, or arm64). | 33 // (ia32, x64, arm, or arm64). |
29 static const char* HostArchitecture() { | 34 static const char* HostArchitecture() { |
30 #if defined(HOST_ARCH_ARM) | 35 #if defined(HOST_ARCH_ARM) |
31 return "arm"; | 36 return "arm"; |
32 #elif defined(HOST_ARCH_ARM64) | 37 #elif defined(HOST_ARCH_ARM64) |
33 return "arm64"; | 38 return "arm64"; |
34 #elif defined(HOST_ARCH_IA32) | 39 #elif defined(HOST_ARCH_IA32) |
35 return "ia32"; | 40 return "ia32"; |
36 #elif defined(HOST_ARCH_X64) | 41 #elif defined(HOST_ARCH_X64) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 static char** argv_; // VM flags are argv_[1 ... script_index_ - 1] | 100 static char** argv_; // VM flags are argv_[1 ... script_index_ - 1] |
96 | 101 |
97 DISALLOW_ALLOCATION(); | 102 DISALLOW_ALLOCATION(); |
98 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform); | 103 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform); |
99 }; | 104 }; |
100 | 105 |
101 } // namespace bin | 106 } // namespace bin |
102 } // namespace dart | 107 } // namespace dart |
103 | 108 |
104 #endif // RUNTIME_BIN_PLATFORM_H_ | 109 #endif // RUNTIME_BIN_PLATFORM_H_ |
OLD | NEW |