comparison src/share/vm/runtime/os.hpp @ 6204:90d5a592ea8f

Merge
author coleenp
date Thu, 12 Jul 2012 14:26:25 -0400
parents 65906dc96aa1
children 957c266d8bc5 716e6ef4482a
comparison
equal deleted inserted replaced
6196:3759236eea14 6204:90d5a592ea8f
97 static void init_page_sizes(size_t default_page_size) { 97 static void init_page_sizes(size_t default_page_size) {
98 _page_sizes[0] = default_page_size; 98 _page_sizes[0] = default_page_size;
99 _page_sizes[1] = 0; // sentinel 99 _page_sizes[1] = 0; // sentinel
100 } 100 }
101 101
102 static char* pd_reserve_memory(size_t bytes, char* addr = 0,
103 size_t alignment_hint = 0);
104 static char* pd_attempt_reserve_memory_at(size_t bytes, char* addr);
105 static void pd_split_reserved_memory(char *base, size_t size,
106 size_t split, bool realloc);
107 static bool pd_commit_memory(char* addr, size_t bytes, bool executable = false);
108 static bool pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
109 bool executable = false);
110 static bool pd_uncommit_memory(char* addr, size_t bytes);
111 static bool pd_release_memory(char* addr, size_t bytes);
112
113 static char* pd_map_memory(int fd, const char* file_name, size_t file_offset,
114 char *addr, size_t bytes, bool read_only = false,
115 bool allow_exec = false);
116 static char* pd_remap_memory(int fd, const char* file_name, size_t file_offset,
117 char *addr, size_t bytes, bool read_only,
118 bool allow_exec);
119 static bool pd_unmap_memory(char *addr, size_t bytes);
120 static void pd_free_memory(char *addr, size_t bytes, size_t alignment_hint);
121 static void pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint);
122
123
102 public: 124 public:
103 static void init(void); // Called before command line parsing 125 static void init(void); // Called before command line parsing
104 static jint init_2(void); // Called after command line parsing 126 static jint init_2(void); // Called after command line parsing
105 static void init_globals(void) { // Called from init_globals() in init.cpp 127 static void init_globals(void) { // Called from init_globals() in init.cpp
106 init_globals_ext(); 128 init_globals_ext();
234 static char* reserve_memory(size_t bytes, char* addr = 0, 256 static char* reserve_memory(size_t bytes, char* addr = 0,
235 size_t alignment_hint = 0); 257 size_t alignment_hint = 0);
236 static char* attempt_reserve_memory_at(size_t bytes, char* addr); 258 static char* attempt_reserve_memory_at(size_t bytes, char* addr);
237 static void split_reserved_memory(char *base, size_t size, 259 static void split_reserved_memory(char *base, size_t size,
238 size_t split, bool realloc); 260 size_t split, bool realloc);
239 static bool commit_memory(char* addr, size_t bytes, 261 static bool commit_memory(char* addr, size_t bytes, bool executable = false);
240 bool executable = false);
241 static bool commit_memory(char* addr, size_t size, size_t alignment_hint, 262 static bool commit_memory(char* addr, size_t size, size_t alignment_hint,
242 bool executable = false); 263 bool executable = false);
243 static bool uncommit_memory(char* addr, size_t bytes); 264 static bool uncommit_memory(char* addr, size_t bytes);
244 static bool release_memory(char* addr, size_t bytes); 265 static bool release_memory(char* addr, size_t bytes);
245 266
248 bool is_committed = true); 269 bool is_committed = true);
249 270
250 static bool guard_memory(char* addr, size_t bytes); 271 static bool guard_memory(char* addr, size_t bytes);
251 static bool unguard_memory(char* addr, size_t bytes); 272 static bool unguard_memory(char* addr, size_t bytes);
252 static bool create_stack_guard_pages(char* addr, size_t bytes); 273 static bool create_stack_guard_pages(char* addr, size_t bytes);
274 static bool pd_create_stack_guard_pages(char* addr, size_t bytes);
253 static bool remove_stack_guard_pages(char* addr, size_t bytes); 275 static bool remove_stack_guard_pages(char* addr, size_t bytes);
254 276
255 static char* map_memory(int fd, const char* file_name, size_t file_offset, 277 static char* map_memory(int fd, const char* file_name, size_t file_offset,
256 char *addr, size_t bytes, bool read_only = false, 278 char *addr, size_t bytes, bool read_only = false,
257 bool allow_exec = false); 279 bool allow_exec = false);
571 static int allocate_thread_local_storage(); 593 static int allocate_thread_local_storage();
572 static void thread_local_storage_at_put(int index, void* value); 594 static void thread_local_storage_at_put(int index, void* value);
573 static void* thread_local_storage_at(int index); 595 static void* thread_local_storage_at(int index);
574 static void free_thread_local_storage(int index); 596 static void free_thread_local_storage(int index);
575 597
598 // Stack walk
599 static address get_caller_pc(int n = 0);
600
576 // General allocation (must be MT-safe) 601 // General allocation (must be MT-safe)
577 static void* malloc (size_t size); 602 static void* malloc (size_t size, MEMFLAGS flags, address caller_pc = 0);
578 static void* realloc (void *memblock, size_t size); 603 static void* realloc (void *memblock, size_t size, MEMFLAGS flags, address caller_pc = 0);
579 static void free (void *memblock); 604 static void free (void *memblock, MEMFLAGS flags = mtNone);
580 static bool check_heap(bool force = false); // verify C heap integrity 605 static bool check_heap(bool force = false); // verify C heap integrity
581 static char* strdup(const char *); // Like strdup 606 static char* strdup(const char *, MEMFLAGS flags = mtInternal); // Like strdup
582 607
583 #ifndef PRODUCT 608 #ifndef PRODUCT
584 static julong num_mallocs; // # of calls to malloc/realloc 609 static julong num_mallocs; // # of calls to malloc/realloc
585 static julong alloc_bytes; // # of bytes allocated 610 static julong alloc_bytes; // # of bytes allocated
586 static julong num_frees; // # of calls to free 611 static julong num_frees; // # of calls to free
638 static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); 663 static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread);
639 664
640 // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits 665 // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits
641 static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize); 666 static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize);
642 667
668 // Get the default path to the core file
669 // Returns the length of the string
670 static int get_core_path(char* buffer, size_t bufferSize);
671
643 // JVMTI & JVM monitoring and management support 672 // JVMTI & JVM monitoring and management support
644 // The thread_cpu_time() and current_thread_cpu_time() are only 673 // The thread_cpu_time() and current_thread_cpu_time() are only
645 // supported if is_thread_cpu_time_supported() returns true. 674 // supported if is_thread_cpu_time_supported() returns true.
646 // They are not supported on Solaris T1. 675 // They are not supported on Solaris T1.
647 676