Mercurial > hg > truffle
comparison src/share/vm/runtime/os.cpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | d8041d695d19 |
children | ad431bf0de07 |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
234 static void signal_thread_entry(JavaThread* thread, TRAPS) { | 234 static void signal_thread_entry(JavaThread* thread, TRAPS) { |
235 os::set_priority(thread, NearMaxPriority); | 235 os::set_priority(thread, NearMaxPriority); |
236 while (true) { | 236 while (true) { |
237 int sig; | 237 int sig; |
238 { | 238 { |
239 // FIXME : Currently we have not decided what should be the status | 239 // FIXME : Currently we have not decieded what should be the status |
240 // for this java thread blocked here. Once we decide about | 240 // for this java thread blocked here. Once we decide about |
241 // that we should fix this. | 241 // that we should fix this. |
242 sig = os::signal_wait(); | 242 sig = os::signal_wait(); |
243 } | 243 } |
244 if (sig == os::sigexitnum_pd()) { | 244 if (sig == os::sigexitnum_pd()) { |
360 // JavaThread due to lack of memory. We would have to throw an exception | 360 // JavaThread due to lack of memory. We would have to throw an exception |
361 // in that case. However, since this must work and we do not allow | 361 // in that case. However, since this must work and we do not allow |
362 // exceptions anyway, check and abort if this fails. | 362 // exceptions anyway, check and abort if this fails. |
363 if (signal_thread == NULL || signal_thread->osthread() == NULL) { | 363 if (signal_thread == NULL || signal_thread->osthread() == NULL) { |
364 vm_exit_during_initialization("java.lang.OutOfMemoryError", | 364 vm_exit_during_initialization("java.lang.OutOfMemoryError", |
365 os::native_thread_creation_failed_msg()); | 365 "unable to create new native thread"); |
366 } | 366 } |
367 | 367 |
368 java_lang_Thread::set_thread(thread_oop(), signal_thread); | 368 java_lang_Thread::set_thread(thread_oop(), signal_thread); |
369 java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); | 369 java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); |
370 java_lang_Thread::set_daemon(thread_oop()); | 370 java_lang_Thread::set_daemon(thread_oop()); |
581 // look for cushion in front of prev. block | 581 // look for cushion in front of prev. block |
582 u_char* start_of_prev_block = find_cushion_backwards(end_of_prev_block_data); | 582 u_char* start_of_prev_block = find_cushion_backwards(end_of_prev_block_data); |
583 ptrdiff_t size = *size_addr_from_base(start_of_prev_block); | 583 ptrdiff_t size = *size_addr_from_base(start_of_prev_block); |
584 u_char* obj = start_of_prev_block + space_before; | 584 u_char* obj = start_of_prev_block + space_before; |
585 if (size <= 0 ) { | 585 if (size <= 0 ) { |
586 // start is bad; may have been confused by OS data in between objects | 586 // start is bad; mayhave been confused by OS data inbetween objects |
587 // search one more backwards | 587 // search one more backwards |
588 start_of_prev_block = find_cushion_backwards(start_of_prev_block); | 588 start_of_prev_block = find_cushion_backwards(start_of_prev_block); |
589 size = *size_addr_from_base(start_of_prev_block); | 589 size = *size_addr_from_base(start_of_prev_block); |
590 obj = start_of_prev_block + space_before; | 590 obj = start_of_prev_block + space_before; |
591 } | 591 } |
1009 } | 1009 } |
1010 | 1010 |
1011 if (Universe::heap()->is_in(addr)) { | 1011 if (Universe::heap()->is_in(addr)) { |
1012 HeapWord* p = Universe::heap()->block_start(addr); | 1012 HeapWord* p = Universe::heap()->block_start(addr); |
1013 bool print = false; | 1013 bool print = false; |
1014 // If we couldn't find it it just may mean that heap wasn't parsable | 1014 // If we couldn't find it it just may mean that heap wasn't parseable |
1015 // See if we were just given an oop directly | 1015 // See if we were just given an oop directly |
1016 if (p != NULL && Universe::heap()->block_is_obj(p)) { | 1016 if (p != NULL && Universe::heap()->block_is_obj(p)) { |
1017 print = true; | 1017 print = true; |
1018 } else if (p == NULL && ((oopDesc*)addr)->is_oop()) { | 1018 } else if (p == NULL && ((oopDesc*)addr)->is_oop()) { |
1019 p = (HeapWord*) addr; | 1019 p = (HeapWord*) addr; |
1079 return; | 1079 return; |
1080 } | 1080 } |
1081 | 1081 |
1082 } | 1082 } |
1083 | 1083 |
1084 #ifndef PRODUCT | |
1084 // Check if in metaspace. | 1085 // Check if in metaspace. |
1085 if (ClassLoaderDataGraph::contains((address)addr)) { | 1086 if (ClassLoaderDataGraph::contains((address)addr)) { |
1086 // Use addr->print() from the debugger instead (not here) | 1087 // Use addr->print() from the debugger instead (not here) |
1087 st->print_cr(INTPTR_FORMAT | 1088 st->print_cr(INTPTR_FORMAT |
1088 " is pointing into metadata", addr); | 1089 " is pointing into metadata", addr); |
1089 return; | 1090 return; |
1090 } | 1091 } |
1092 #endif | |
1091 | 1093 |
1092 // Try an OS specific find | 1094 // Try an OS specific find |
1093 if (os::find(addr, st)) { | 1095 if (os::find(addr, st)) { |
1094 return; | 1096 return; |
1095 } | 1097 } |
1099 | 1101 |
1100 // Looks like all platforms except IA64 can use the same function to check | 1102 // Looks like all platforms except IA64 can use the same function to check |
1101 // if C stack is walkable beyond current frame. The check for fp() is not | 1103 // if C stack is walkable beyond current frame. The check for fp() is not |
1102 // necessary on Sparc, but it's harmless. | 1104 // necessary on Sparc, but it's harmless. |
1103 bool os::is_first_C_frame(frame* fr) { | 1105 bool os::is_first_C_frame(frame* fr) { |
1104 #if (defined(IA64) && !defined(AIX)) && !defined(_WIN32) | 1106 #if defined(IA64) && !defined(_WIN32) |
1105 // On IA64 we have to check if the callers bsp is still valid | 1107 // On IA64 we have to check if the callers bsp is still valid |
1106 // (i.e. within the register stack bounds). | 1108 // (i.e. within the register stack bounds). |
1107 // Notice: this only works for threads created by the VM and only if | 1109 // Notice: this only works for threads created by the VM and only if |
1108 // we walk the current stack!!! If we want to be able to walk | 1110 // we walk the current stack!!! If we want to be able to walk |
1109 // arbitrary other threads, we'll have to somehow store the thread | 1111 // arbitrary other threads, we'll have to somehow store the thread |
1195 const char* home, | 1197 const char* home, |
1196 int home_len, | 1198 int home_len, |
1197 char fileSep, | 1199 char fileSep, |
1198 char pathSep) { | 1200 char pathSep) { |
1199 assert((fileSep == '/' && pathSep == ':') || | 1201 assert((fileSep == '/' && pathSep == ':') || |
1200 (fileSep == '\\' && pathSep == ';'), "unexpected separator chars"); | 1202 (fileSep == '\\' && pathSep == ';'), "unexpected seperator chars"); |
1201 | 1203 |
1202 // Scan the format string to determine the length of the actual | 1204 // Scan the format string to determine the length of the actual |
1203 // boot classpath, and handle platform dependencies as well. | 1205 // boot classpath, and handle platform dependencies as well. |
1204 int formatted_path_len = 0; | 1206 int formatted_path_len = 0; |
1205 const char* p; | 1207 const char* p; |
1260 "%/lib/sunrsasign.jar:" | 1262 "%/lib/sunrsasign.jar:" |
1261 "%/lib/jsse.jar:" | 1263 "%/lib/jsse.jar:" |
1262 "%/lib/jce.jar:" | 1264 "%/lib/jce.jar:" |
1263 "%/lib/charsets.jar:" | 1265 "%/lib/charsets.jar:" |
1264 "%/lib/jfr.jar:" | 1266 "%/lib/jfr.jar:" |
1267 #ifdef __APPLE__ | |
1268 "%/lib/JObjC.jar:" | |
1269 #endif | |
1265 #ifdef GRAAL | 1270 #ifdef GRAAL |
1266 "%/lib/graal.jar:" | 1271 "%/lib/graal.jar:" |
1267 #endif | 1272 #endif |
1268 "%/classes"; | 1273 "%/classes"; |
1269 char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep); | 1274 char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep); |
1444 | 1449 |
1445 // This is the working definition of a server class machine: | 1450 // This is the working definition of a server class machine: |
1446 // >= 2 physical CPU's and >=2GB of memory, with some fuzz | 1451 // >= 2 physical CPU's and >=2GB of memory, with some fuzz |
1447 // because the graphics memory (?) sometimes masks physical memory. | 1452 // because the graphics memory (?) sometimes masks physical memory. |
1448 // If you want to change the definition of a server class machine | 1453 // If you want to change the definition of a server class machine |
1449 // on some OS or platform, e.g., >=4GB on Windows platforms, | 1454 // on some OS or platform, e.g., >=4GB on Windohs platforms, |
1450 // then you'll have to parameterize this method based on that state, | 1455 // then you'll have to parameterize this method based on that state, |
1451 // as was done for logical processors here, or replicate and | 1456 // as was done for logical processors here, or replicate and |
1452 // specialize this method for each platform. (Or fix os to have | 1457 // specialize this method for each platform. (Or fix os to have |
1453 // some inheritance structure and use subclassing. Sigh.) | 1458 // some inheritance structure and use subclassing. Sigh.) |
1454 // If you want some platform to always or never behave as a server | 1459 // If you want some platform to always or never behave as a server |