Mercurial > hg > truffle
diff src/share/vm/runtime/os.hpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 897b7d18bebc 65906dc96aa1 |
children | e522a00b91aa |
line wrap: on
line diff
--- a/src/share/vm/runtime/os.hpp Mon Aug 20 15:21:31 2012 +0200 +++ b/src/share/vm/runtime/os.hpp Tue Aug 21 10:39:19 2012 +0200 @@ -99,6 +99,28 @@ _page_sizes[1] = 0; // sentinel } + static char* pd_reserve_memory(size_t bytes, char* addr = 0, + size_t alignment_hint = 0); + static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr); + static void pd_split_reserved_memory(char *base, size_t size, + size_t split, bool realloc); + static bool pd_commit_memory(char* addr, size_t bytes, bool executable = false); + static bool pd_commit_memory(char* addr, size_t size, size_t alignment_hint, + bool executable = false); + static bool pd_uncommit_memory(char* addr, size_t bytes); + static bool pd_release_memory(char* addr, size_t bytes); + + static char* pd_map_memory(int fd, const char* file_name, size_t file_offset, + char *addr, size_t bytes, bool read_only = false, + bool allow_exec = false); + static char* pd_remap_memory(int fd, const char* file_name, size_t file_offset, + char *addr, size_t bytes, bool read_only, + bool allow_exec); + static bool pd_unmap_memory(char *addr, size_t bytes); + static void pd_free_memory(char *addr, size_t bytes, size_t alignment_hint); + static void pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint); + + public: static void init(void); // Called before command line parsing static jint init_2(void); // Called after command line parsing @@ -236,8 +258,7 @@ static char* attempt_reserve_memory_at(size_t bytes, char* addr); static void split_reserved_memory(char *base, size_t size, size_t split, bool realloc); - static bool commit_memory(char* addr, size_t bytes, - bool executable = false); + static bool commit_memory(char* addr, size_t bytes, bool executable = false); static bool commit_memory(char* addr, size_t size, size_t alignment_hint, bool executable = false); static bool uncommit_memory(char* addr, size_t bytes); @@ -250,6 +271,7 @@ static bool guard_memory(char* addr, size_t bytes); static bool unguard_memory(char* addr, size_t bytes); static bool create_stack_guard_pages(char* addr, size_t bytes); + static bool pd_create_stack_guard_pages(char* addr, size_t bytes); static bool remove_stack_guard_pages(char* addr, size_t bytes); static char* map_memory(int fd, const char* file_name, size_t file_offset, @@ -404,6 +426,8 @@ static address current_stack_base(); static size_t current_stack_size(); + static void verify_stack_alignment() PRODUCT_RETURN; + static int message_box(const char* title, const char* message); static char* do_you_want_to_debug(const char* message); @@ -490,6 +514,7 @@ // 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); + static void print_os_info_brief(outputStream* st); static void print_cpu_info(outputStream* st); static void pd_print_cpu_info(outputStream* st); static void print_memory_info(outputStream* st); @@ -570,12 +595,15 @@ static void* thread_local_storage_at(int index); static void free_thread_local_storage(int index); + // Stack walk + static address get_caller_pc(int n = 0); + // General allocation (must be MT-safe) - static void* malloc (size_t size); - static void* realloc (void *memblock, size_t size); - static void free (void *memblock); + static void* malloc (size_t size, MEMFLAGS flags, address caller_pc = 0); + static void* realloc (void *memblock, size_t size, MEMFLAGS flags, address caller_pc = 0); + static void free (void *memblock, MEMFLAGS flags = mtNone); static bool check_heap(bool force = false); // verify C heap integrity - static char* strdup(const char *); // Like strdup + static char* strdup(const char *, MEMFLAGS flags = mtInternal); // Like strdup #ifndef PRODUCT static julong num_mallocs; // # of calls to malloc/realloc @@ -637,6 +665,10 @@ // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize); + // Get the default path to the core file + // Returns the length of the string + static int get_core_path(char* buffer, size_t bufferSize); + // JVMTI & JVM monitoring and management support // The thread_cpu_time() and current_thread_cpu_time() are only // supported if is_thread_cpu_time_supported() returns true. @@ -683,14 +715,17 @@ // Platform dependent stuff #ifdef TARGET_OS_FAMILY_linux # include "os_linux.hpp" +# include "os_posix.hpp" #endif #ifdef TARGET_OS_FAMILY_solaris # include "os_solaris.hpp" +# include "os_posix.hpp" #endif #ifdef TARGET_OS_FAMILY_windows # include "os_windows.hpp" #endif #ifdef TARGET_OS_FAMILY_bsd +# include "os_posix.hpp" # include "os_bsd.hpp" #endif #ifdef TARGET_OS_ARCH_linux_x86