147 static bool pd_unmap_memory(char *addr, size_t bytes);
148 static void pd_free_memory(char *addr, size_t bytes, size_t alignment_hint);
149 static void pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint);
150
151 static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned);
152
153 public:
154 static void init(void); // Called before command line parsing
155 static void init_before_ergo(void); // Called after command line parsing
156 // before VM ergonomics processing.
157 static jint init_2(void); // Called after command line parsing
158 // and VM ergonomics processing
159 static void init_globals(void) { // Called from init_globals() in init.cpp
160 init_globals_ext();
161 }
162
163 // File names are case-insensitive on windows only
164 // Override me as needed
165 static int file_name_strcmp(const char* s1, const char* s2);
166
167 // get/unset environment variable
168 static bool getenv(const char* name, char* buffer, int len);
169 static bool unsetenv(const char* name);
170
171 static bool have_special_privileges();
172
173 static jlong javaTimeMillis();
174 static jlong javaTimeNanos();
175 static void javaTimeNanos_info(jvmtiTimerInfo *info_ptr);
176 static void javaTimeSystemUTC(jlong &seconds, jlong &nanos);
177 static void run_periodic_checks();
178 static bool supports_monotonic_clock();
179
180 // Returns the elapsed time in seconds since the vm started.
181 static double elapsedTime();
182
183 // Returns real time in seconds since an arbitrary point
184 // in the past.
185 static bool getTimesSecs(double* process_real_time,
186 double* process_user_time,
187 double* process_system_time);
188
574
575 // Return the handle of this process
576 static void* get_default_process_handle();
577
578 // Check for static linked agent library
579 static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
580 size_t syms_len);
581
582 // Find agent entry point
583 static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
584 const char *syms[], size_t syms_len);
585
586 // Print out system information; they are called by fatal error handler.
587 // Output format may be different on different platforms.
588 static void print_os_info(outputStream* st);
589 static void print_os_info_brief(outputStream* st);
590 static void print_cpu_info(outputStream* st);
591 static void pd_print_cpu_info(outputStream* st);
592 static void print_memory_info(outputStream* st);
593 static void print_dll_info(outputStream* st);
594 static void print_environment_variables(outputStream* st, const char** env_list, char* buffer, int len);
595 static void print_context(outputStream* st, void* context);
596 static void print_register_info(outputStream* st, void* context);
597 static void print_siginfo(outputStream* st, void* siginfo);
598 static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
599 static void print_date_and_time(outputStream* st);
600
601 static void print_location(outputStream* st, intptr_t x, bool verbose = false);
602 static size_t lasterror(char *buf, size_t len);
603 static int get_last_error();
604
605 // Determines whether the calling process is being debugged by a user-mode debugger.
606 static bool is_debugger_attached();
607
608 // wait for a key press if PauseAtExit is set
609 static void wait_for_keypress_at_exit(void);
610
611 // The following two functions are used by fatal error handler to trace
612 // native (C) frames. They are not part of frame.hpp/frame.cpp because
613 // frame.hpp/cpp assume thread is JavaThread, and also because different
614 // OS/compiler may have different convention or provide different API to
|
147 static bool pd_unmap_memory(char *addr, size_t bytes);
148 static void pd_free_memory(char *addr, size_t bytes, size_t alignment_hint);
149 static void pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint);
150
151 static size_t page_size_for_region(size_t region_size, size_t min_pages, bool must_be_aligned);
152
153 public:
154 static void init(void); // Called before command line parsing
155 static void init_before_ergo(void); // Called after command line parsing
156 // before VM ergonomics processing.
157 static jint init_2(void); // Called after command line parsing
158 // and VM ergonomics processing
159 static void init_globals(void) { // Called from init_globals() in init.cpp
160 init_globals_ext();
161 }
162
163 // File names are case-insensitive on windows only
164 // Override me as needed
165 static int file_name_strcmp(const char* s1, const char* s2);
166
167 // unset environment variable
168 static bool unsetenv(const char* name);
169
170 static bool have_special_privileges();
171
172 static jlong javaTimeMillis();
173 static jlong javaTimeNanos();
174 static void javaTimeNanos_info(jvmtiTimerInfo *info_ptr);
175 static void javaTimeSystemUTC(jlong &seconds, jlong &nanos);
176 static void run_periodic_checks();
177 static bool supports_monotonic_clock();
178
179 // Returns the elapsed time in seconds since the vm started.
180 static double elapsedTime();
181
182 // Returns real time in seconds since an arbitrary point
183 // in the past.
184 static bool getTimesSecs(double* process_real_time,
185 double* process_user_time,
186 double* process_system_time);
187
573
574 // Return the handle of this process
575 static void* get_default_process_handle();
576
577 // Check for static linked agent library
578 static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
579 size_t syms_len);
580
581 // Find agent entry point
582 static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
583 const char *syms[], size_t syms_len);
584
585 // Print out system information; they are called by fatal error handler.
586 // Output format may be different on different platforms.
587 static void print_os_info(outputStream* st);
588 static void print_os_info_brief(outputStream* st);
589 static void print_cpu_info(outputStream* st);
590 static void pd_print_cpu_info(outputStream* st);
591 static void print_memory_info(outputStream* st);
592 static void print_dll_info(outputStream* st);
593 static void print_environment_variables(outputStream* st, const char** env_list);
594 static void print_context(outputStream* st, void* context);
595 static void print_register_info(outputStream* st, void* context);
596 static void print_siginfo(outputStream* st, void* siginfo);
597 static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
598 static void print_date_and_time(outputStream* st);
599
600 static void print_location(outputStream* st, intptr_t x, bool verbose = false);
601 static size_t lasterror(char *buf, size_t len);
602 static int get_last_error();
603
604 // Determines whether the calling process is being debugged by a user-mode debugger.
605 static bool is_debugger_attached();
606
607 // wait for a key press if PauseAtExit is set
608 static void wait_for_keypress_at_exit(void);
609
610 // The following two functions are used by fatal error handler to trace
611 // native (C) frames. They are not part of frame.hpp/frame.cpp because
612 // frame.hpp/cpp assume thread is JavaThread, and also because different
613 // OS/compiler may have different convention or provide different API to
|