58 |
58 |
59 // Typedef for structured exception handling support |
59 // Typedef for structured exception handling support |
60 typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); |
60 typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); |
61 |
61 |
62 class os: AllStatic { |
62 class os: AllStatic { |
|
63 public: |
|
64 enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel) |
|
65 |
63 private: |
66 private: |
64 enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel) |
|
65 |
|
66 static OSThread* _starting_thread; |
67 static OSThread* _starting_thread; |
67 static address _polling_page; |
68 static address _polling_page; |
68 static volatile int32_t * _mem_serialize_page; |
69 static volatile int32_t * _mem_serialize_page; |
69 static uintptr_t _serialize_page_mask; |
70 static uintptr_t _serialize_page_mask; |
|
71 public: |
70 static size_t _page_sizes[page_sizes_max]; |
72 static size_t _page_sizes[page_sizes_max]; |
71 |
73 |
|
74 private: |
72 static void init_page_sizes(size_t default_page_size) { |
75 static void init_page_sizes(size_t default_page_size) { |
73 _page_sizes[0] = default_page_size; |
76 _page_sizes[0] = default_page_size; |
74 _page_sizes[1] = 0; // sentinel |
77 _page_sizes[1] = 0; // sentinel |
75 } |
78 } |
76 |
79 |
77 public: |
80 public: |
78 |
81 static void init(void); // Called before command line parsing |
79 static void init(void); // Called before command line parsing |
82 static jint init_2(void); // Called after command line parsing |
80 static jint init_2(void); // Called after command line parsing |
|
81 |
83 |
82 // File names are case-insensitive on windows only |
84 // File names are case-insensitive on windows only |
83 // Override me as needed |
85 // Override me as needed |
84 static int file_name_strcmp(const char* s1, const char* s2); |
86 static int file_name_strcmp(const char* s1, const char* s2); |
85 |
87 |
139 |
141 |
140 // number of CPUs |
142 // number of CPUs |
141 static int processor_count() { |
143 static int processor_count() { |
142 return _processor_count; |
144 return _processor_count; |
143 } |
145 } |
|
146 static void set_processor_count(int count) { _processor_count = count; } |
144 |
147 |
145 // Returns the number of CPUs this process is currently allowed to run on. |
148 // Returns the number of CPUs this process is currently allowed to run on. |
146 // Note that on some OSes this can change dynamically. |
149 // Note that on some OSes this can change dynamically. |
147 static int active_processor_count(); |
150 static int active_processor_count(); |
148 |
151 |