Mercurial > hg > graal-compiler
diff src/share/vm/runtime/os.hpp @ 12355:cefad50507d8
Merge with hs25-b53
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 11 Oct 2013 10:38:03 +0200 |
parents | 6b0fd0964b87 da051ce490eb |
children | d8041d695d19 |
line wrap: on
line diff
--- a/src/share/vm/runtime/os.hpp Thu Oct 10 18:26:22 2013 +0200 +++ b/src/share/vm/runtime/os.hpp Fri Oct 11 10:38:03 2013 +0200 @@ -46,6 +46,8 @@ # include <setjmp.h> #endif +class AgentLibrary; + // os defines the interface to operating system; this includes traditional // OS services (time, I/O) as well as other functionality with system- // dependent code. @@ -89,6 +91,8 @@ typedef void (*java_call_t)(JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); class os: AllStatic { + friend class VMStructs; + public: enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel) @@ -137,7 +141,10 @@ public: static void init(void); // Called before command line parsing + static void init_before_ergo(void); // Called after command line parsing + // before VM ergonomics processing. static jint init_2(void); // Called after command line parsing + // and VM ergonomics processing static void init_globals(void) { // Called from init_globals() in init.cpp init_globals_ext(); } @@ -252,6 +259,11 @@ static size_t page_size_for_region(size_t region_min_size, size_t region_max_size, uint min_pages); + // Return the largest page size that can be used + static size_t max_page_size() { + // The _page_sizes array is sorted in descending order. + return _page_sizes[0]; + } // Methods for tracing page sizes returned by the above method; enabled by // TracePageSizes. The region_{min,max}_size parameters should be the values @@ -328,8 +340,8 @@ static char* non_memory_address_word(); // reserve, commit and pin the entire memory region - static char* reserve_memory_special(size_t size, char* addr = NULL, - bool executable = false); + static char* reserve_memory_special(size_t size, size_t alignment, + char* addr, bool executable); static bool release_memory_special(char* addr, size_t bytes); static void large_page_init(); static size_t large_page_size(); @@ -537,6 +549,17 @@ // Unload library static void dll_unload(void *lib); + // Return the handle of this process + static void* get_default_process_handle(); + + // Check for static linked agent library + static bool find_builtin_agent(AgentLibrary *agent_lib, const char *syms[], + size_t syms_len); + + // Find agent entry point + static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib, + const char *syms[], size_t syms_len); + // Print out system information; they are called by fatal error handler. // Output format may be different on different platforms. static void print_os_info(outputStream* st); @@ -725,10 +748,6 @@ // Hook for os specific jvm options that we don't want to abort on seeing static bool obsolete_option(const JavaVMOption *option); - // Read file line by line. If line is longer than bsize, - // rest of line is skipped. Returns number of bytes read or -1 on EOF - static int get_line_chars(int fd, char *buf, const size_t bsize); - // Extensions #include "runtime/os_ext.hpp" @@ -786,6 +805,14 @@ #endif public: +#ifndef PLATFORM_PRINT_NATIVE_STACK + // No platform-specific code for printing the native stack. + static bool platform_print_native_stack(outputStream* st, void* context, + char *buf, int buf_size) { + return false; + } +#endif + // debugging support (mostly used by debug.cpp but also fatal error handler) static bool find(address pc, outputStream* st = tty); // OS specific function to make sense out of an address @@ -806,6 +833,11 @@ // ResumeThread call) static void pause(); + // Builds a platform dependent Agent_OnLoad_<libname> function name + // which is used to find statically linked in agents. + static char* build_agent_function_name(const char *sym, const char *cname, + bool is_absolute_path); + class SuspendedThreadTaskContext { public: SuspendedThreadTaskContext(Thread* thread, void *ucontext) : _thread(thread), _ucontext(ucontext) {}