Mercurial > hg > truffle
comparison src/share/vm/runtime/os.cpp @ 14518:d8041d695d19
Merged with jdk9/dev/hotspot changeset 3812c088b945
author | twisti |
---|---|
date | Tue, 11 Mar 2014 18:45:59 -0700 |
parents | cefad50507d8 8a9bb7821e28 |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14141:f97c5ec83832 | 14518:d8041d695d19 |
---|---|
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 decieded what should be the status | 239 // FIXME : Currently we have not decided 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 "unable to create new native thread"); | 365 os::native_thread_creation_failed_msg()); |
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; mayhave been confused by OS data inbetween objects | 586 // start is bad; may have been confused by OS data in between 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 parseable | 1014 // If we couldn't find it it just may mean that heap wasn't parsable |
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 | |
1085 // Check if in metaspace. | 1084 // Check if in metaspace. |
1086 if (ClassLoaderDataGraph::contains((address)addr)) { | 1085 if (ClassLoaderDataGraph::contains((address)addr)) { |
1087 // Use addr->print() from the debugger instead (not here) | 1086 // Use addr->print() from the debugger instead (not here) |
1088 st->print_cr(INTPTR_FORMAT | 1087 st->print_cr(INTPTR_FORMAT |
1089 " is pointing into metadata", addr); | 1088 " is pointing into metadata", addr); |
1090 return; | 1089 return; |
1091 } | 1090 } |
1092 #endif | |
1093 | 1091 |
1094 // Try an OS specific find | 1092 // Try an OS specific find |
1095 if (os::find(addr, st)) { | 1093 if (os::find(addr, st)) { |
1096 return; | 1094 return; |
1097 } | 1095 } |
1101 | 1099 |
1102 // Looks like all platforms except IA64 can use the same function to check | 1100 // Looks like all platforms except IA64 can use the same function to check |
1103 // if C stack is walkable beyond current frame. The check for fp() is not | 1101 // if C stack is walkable beyond current frame. The check for fp() is not |
1104 // necessary on Sparc, but it's harmless. | 1102 // necessary on Sparc, but it's harmless. |
1105 bool os::is_first_C_frame(frame* fr) { | 1103 bool os::is_first_C_frame(frame* fr) { |
1106 #if defined(IA64) && !defined(_WIN32) | 1104 #if (defined(IA64) && !defined(AIX)) && !defined(_WIN32) |
1107 // On IA64 we have to check if the callers bsp is still valid | 1105 // On IA64 we have to check if the callers bsp is still valid |
1108 // (i.e. within the register stack bounds). | 1106 // (i.e. within the register stack bounds). |
1109 // Notice: this only works for threads created by the VM and only if | 1107 // Notice: this only works for threads created by the VM and only if |
1110 // we walk the current stack!!! If we want to be able to walk | 1108 // we walk the current stack!!! If we want to be able to walk |
1111 // arbitrary other threads, we'll have to somehow store the thread | 1109 // arbitrary other threads, we'll have to somehow store the thread |
1197 const char* home, | 1195 const char* home, |
1198 int home_len, | 1196 int home_len, |
1199 char fileSep, | 1197 char fileSep, |
1200 char pathSep) { | 1198 char pathSep) { |
1201 assert((fileSep == '/' && pathSep == ':') || | 1199 assert((fileSep == '/' && pathSep == ':') || |
1202 (fileSep == '\\' && pathSep == ';'), "unexpected seperator chars"); | 1200 (fileSep == '\\' && pathSep == ';'), "unexpected separator chars"); |
1203 | 1201 |
1204 // Scan the format string to determine the length of the actual | 1202 // Scan the format string to determine the length of the actual |
1205 // boot classpath, and handle platform dependencies as well. | 1203 // boot classpath, and handle platform dependencies as well. |
1206 int formatted_path_len = 0; | 1204 int formatted_path_len = 0; |
1207 const char* p; | 1205 const char* p; |
1262 "%/lib/sunrsasign.jar:" | 1260 "%/lib/sunrsasign.jar:" |
1263 "%/lib/jsse.jar:" | 1261 "%/lib/jsse.jar:" |
1264 "%/lib/jce.jar:" | 1262 "%/lib/jce.jar:" |
1265 "%/lib/charsets.jar:" | 1263 "%/lib/charsets.jar:" |
1266 "%/lib/jfr.jar:" | 1264 "%/lib/jfr.jar:" |
1267 #ifdef __APPLE__ | |
1268 "%/lib/JObjC.jar:" | |
1269 #endif | |
1270 #ifdef GRAAL | 1265 #ifdef GRAAL |
1271 "%/lib/graal.jar:" | 1266 "%/lib/graal.jar:" |
1272 #endif | 1267 #endif |
1273 "%/classes"; | 1268 "%/classes"; |
1274 char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep); | 1269 char* sysclasspath = format_boot_path(classpath_format, home, home_len, fileSep, pathSep); |
1449 | 1444 |
1450 // This is the working definition of a server class machine: | 1445 // This is the working definition of a server class machine: |
1451 // >= 2 physical CPU's and >=2GB of memory, with some fuzz | 1446 // >= 2 physical CPU's and >=2GB of memory, with some fuzz |
1452 // because the graphics memory (?) sometimes masks physical memory. | 1447 // because the graphics memory (?) sometimes masks physical memory. |
1453 // If you want to change the definition of a server class machine | 1448 // If you want to change the definition of a server class machine |
1454 // on some OS or platform, e.g., >=4GB on Windohs platforms, | 1449 // on some OS or platform, e.g., >=4GB on Windows platforms, |
1455 // then you'll have to parameterize this method based on that state, | 1450 // then you'll have to parameterize this method based on that state, |
1456 // as was done for logical processors here, or replicate and | 1451 // as was done for logical processors here, or replicate and |
1457 // specialize this method for each platform. (Or fix os to have | 1452 // specialize this method for each platform. (Or fix os to have |
1458 // some inheritance structure and use subclassing. Sigh.) | 1453 // some inheritance structure and use subclassing. Sigh.) |
1459 // If you want some platform to always or never behave as a server | 1454 // If you want some platform to always or never behave as a server |