Mercurial > hg > graal-compiler
comparison src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp @ 14445:67fa91961822
8029940: PPC64 (part 122): C2 compiler port
Reviewed-by: kvn
author | goetz |
---|---|
date | Wed, 11 Dec 2013 00:06:11 +0100 |
parents | ec28f9c041ff |
children | 327e7269f90d |
comparison
equal
deleted
inserted
replaced
14444:492e67693373 | 14445:67fa91961822 |
---|---|
282 // A VM-related SIGILL may only occur if we are not in the zero page. | 282 // A VM-related SIGILL may only occur if we are not in the zero page. |
283 // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else | 283 // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else |
284 // in the zero page, because it is filled with 0x0. We ignore | 284 // in the zero page, because it is filled with 0x0. We ignore |
285 // explicit SIGILLs in the zero page. | 285 // explicit SIGILLs in the zero page. |
286 if (sig == SIGILL && (pc < (address) 0x200)) { | 286 if (sig == SIGILL && (pc < (address) 0x200)) { |
287 if (TraceTraps) | 287 if (TraceTraps) { |
288 tty->print_raw_cr("SIGILL happened inside zero page."); | 288 tty->print_raw_cr("SIGILL happened inside zero page."); |
289 } | |
289 goto report_and_die; | 290 goto report_and_die; |
290 } | 291 } |
291 | 292 |
292 // Handle signal from NativeJump::patch_verified_entry(). | 293 // Handle signal from NativeJump::patch_verified_entry(). |
293 if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) || | 294 if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) || |
294 (!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) { | 295 (!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) { |
295 if (TraceTraps) | 296 if (TraceTraps) { |
296 tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL"); | 297 tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL"); |
298 } | |
297 stub = SharedRuntime::get_handle_wrong_method_stub(); | 299 stub = SharedRuntime::get_handle_wrong_method_stub(); |
298 } | 300 } |
299 | 301 |
300 else if (sig == SIGSEGV && | 302 else if (sig == SIGSEGV && |
301 // A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults | 303 // A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults |
302 // in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6), | 304 // in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6), |
303 // especially when we try to read from the safepoint polling page. So the check | 305 // especially when we try to read from the safepoint polling page. So the check |
304 // (address)info->si_addr == os::get_standard_polling_page() | 306 // (address)info->si_addr == os::get_standard_polling_page() |
305 // doesn't work for us. We use: | 307 // doesn't work for us. We use: |
306 ((NativeInstruction*)pc)->is_safepoint_poll()) { | 308 ((NativeInstruction*)pc)->is_safepoint_poll()) { |
307 if (TraceTraps) | 309 if (TraceTraps) { |
308 tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc); | 310 tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc); |
311 } | |
309 stub = SharedRuntime::get_poll_stub(pc); | 312 stub = SharedRuntime::get_poll_stub(pc); |
310 } | 313 } |
311 | 314 |
312 // SIGTRAP-based ic miss check in compiled code. | 315 // SIGTRAP-based ic miss check in compiled code. |
313 else if (sig == SIGTRAP && TrapBasedICMissChecks && | 316 else if (sig == SIGTRAP && TrapBasedICMissChecks && |
314 nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) { | 317 nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) { |
315 if (TraceTraps) | 318 if (TraceTraps) { |
316 tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc); | 319 tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc); |
320 } | |
317 stub = SharedRuntime::get_ic_miss_stub(); | 321 stub = SharedRuntime::get_ic_miss_stub(); |
318 } | 322 } |
319 | 323 |
320 // SIGTRAP-based implicit null check in compiled code. | 324 // SIGTRAP-based implicit null check in compiled code. |
321 else if (sig == SIGTRAP && TrapBasedNullChecks && | 325 else if (sig == SIGTRAP && TrapBasedNullChecks && |
322 nativeInstruction_at(pc)->is_sigtrap_null_check()) { | 326 nativeInstruction_at(pc)->is_sigtrap_null_check()) { |
323 if (TraceTraps) | 327 if (TraceTraps) { |
324 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc); | 328 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc); |
329 } | |
325 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); | 330 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); |
326 } | 331 } |
327 | 332 |
328 // SIGSEGV-based implicit null check in compiled code. | 333 // SIGSEGV-based implicit null check in compiled code. |
329 else if (sig == SIGSEGV && ImplicitNullChecks && | 334 else if (sig == SIGSEGV && ImplicitNullChecks && |
330 CodeCache::contains((void*) pc) && | 335 CodeCache::contains((void*) pc) && |
331 !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) { | 336 !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) { |
332 if (TraceTraps) | 337 if (TraceTraps) { |
333 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc); | 338 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc); |
339 } | |
334 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); | 340 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); |
335 } | 341 } |
336 | 342 |
337 #ifdef COMPILER2 | 343 #ifdef COMPILER2 |
338 // SIGTRAP-based implicit range check in compiled code. | 344 // SIGTRAP-based implicit range check in compiled code. |
339 else if (sig == SIGTRAP && TrapBasedRangeChecks && | 345 else if (sig == SIGTRAP && TrapBasedRangeChecks && |
340 nativeInstruction_at(pc)->is_sigtrap_range_check()) { | 346 nativeInstruction_at(pc)->is_sigtrap_range_check()) { |
341 if (TraceTraps) | 347 if (TraceTraps) { |
342 tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc); | 348 tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc); |
349 } | |
343 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); | 350 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); |
344 } | 351 } |
345 #endif | 352 #endif |
346 else if (sig == SIGBUS) { | 353 else if (sig == SIGBUS) { |
347 // BugId 4454115: A read from a MappedByteBuffer can fault here if the | 354 // BugId 4454115: A read from a MappedByteBuffer can fault here if the |