comparison src/os_cpu/aix_ppc/vm/os_aix_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 666e6ce3976c
children 71a71b0bc844
comparison
equal deleted inserted replaced
14444:492e67693373 14445:67fa91961822
65 65
66 address os::current_stack_pointer() { 66 address os::current_stack_pointer() {
67 address csp; 67 address csp;
68 68
69 #if !defined(USE_XLC_BUILTINS) 69 #if !defined(USE_XLC_BUILTINS)
70 // inline assembly for `ppc_mr regno(csp), PPC_SP': 70 // inline assembly for `mr regno(csp), R1_SP':
71 __asm__ __volatile__ ("mr %0, 1":"=r"(csp):); 71 __asm__ __volatile__ ("mr %0, 1":"=r"(csp):);
72 #else 72 #else
73 csp = (address) __builtin_frame_address(0); 73 csp = (address) __builtin_frame_address(0);
74 #endif 74 #endif
75 75
261 // to handle_unexpected_exception way down below. 261 // to handle_unexpected_exception way down below.
262 thread->disable_stack_red_zone(); 262 thread->disable_stack_red_zone();
263 tty->print_raw_cr("An irrecoverable stack overflow has occurred."); 263 tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
264 goto report_and_die; 264 goto report_and_die;
265 } else { 265 } else {
266 // this means a segv happened inside our stack, but not in 266 // This means a segv happened inside our stack, but not in
267 // the guarded zone. I'd like to know when this happens, 267 // the guarded zone. I'd like to know when this happens,
268 tty->print_raw_cr("SIGSEGV happened inside stack but outside yellow and red zone."); 268 tty->print_raw_cr("SIGSEGV happened inside stack but outside yellow and red zone.");
269 goto report_and_die; 269 goto report_and_die;
270 } 270 }
271 271
310 // A VM-related SIGILL may only occur if we are not in the zero page. 310 // A VM-related SIGILL may only occur if we are not in the zero page.
311 // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else 311 // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else
312 // in the zero page, because it is filled with 0x0. We ignore 312 // in the zero page, because it is filled with 0x0. We ignore
313 // explicit SIGILLs in the zero page. 313 // explicit SIGILLs in the zero page.
314 if (sig == SIGILL && (pc < (address) 0x200)) { 314 if (sig == SIGILL && (pc < (address) 0x200)) {
315 if (TraceTraps) 315 if (TraceTraps) {
316 tty->print_raw_cr("SIGILL happened inside zero page."); 316 tty->print_raw_cr("SIGILL happened inside zero page.");
317 }
317 goto report_and_die; 318 goto report_and_die;
318 } 319 }
319 320
320 // Handle signal from NativeJump::patch_verified_entry(). 321 // Handle signal from NativeJump::patch_verified_entry().
321 if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) || 322 if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
322 (!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) { 323 (!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
323 if (TraceTraps) 324 if (TraceTraps) {
324 tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL"); 325 tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL");
326 }
325 stub = SharedRuntime::get_handle_wrong_method_stub(); 327 stub = SharedRuntime::get_handle_wrong_method_stub();
326 goto run_stub; 328 goto run_stub;
327 } 329 }
328 330
329 else if (sig == SIGSEGV && os::is_poll_address(addr)) { 331 else if (sig == SIGSEGV && os::is_poll_address(addr)) {
330 if (TraceTraps) 332 if (TraceTraps) {
331 tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc); 333 tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
334 }
332 stub = SharedRuntime::get_poll_stub(pc); 335 stub = SharedRuntime::get_poll_stub(pc);
333 goto run_stub; 336 goto run_stub;
334 } 337 }
335 338
336 // SIGTRAP-based ic miss check in compiled code 339 // SIGTRAP-based ic miss check in compiled code.
337 else if (sig == SIGTRAP && TrapBasedICMissChecks && 340 else if (sig == SIGTRAP && TrapBasedICMissChecks &&
338 nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) { 341 nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
339 if (TraceTraps) 342 if (TraceTraps) {
340 tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc); 343 tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
344 }
341 stub = SharedRuntime::get_ic_miss_stub(); 345 stub = SharedRuntime::get_ic_miss_stub();
342 goto run_stub; 346 goto run_stub;
343 } 347 }
344 348
345 #ifdef COMPILER2
346 // SIGTRAP-based implicit null check in compiled code. 349 // SIGTRAP-based implicit null check in compiled code.
347 else if (sig == SIGTRAP && TrapBasedNullChecks && 350 else if (sig == SIGTRAP && TrapBasedNullChecks &&
348 nativeInstruction_at(pc)->is_sigtrap_null_check()) { 351 nativeInstruction_at(pc)->is_sigtrap_null_check()) {
349 if (TraceTraps) 352 if (TraceTraps) {
350 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc); 353 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
354 }
351 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); 355 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
352 goto run_stub; 356 goto run_stub;
353 } 357 }
354 #endif
355 358
356 // SIGSEGV-based implicit null check in compiled code. 359 // SIGSEGV-based implicit null check in compiled code.
357 else if (sig == SIGSEGV && ImplicitNullChecks && 360 else if (sig == SIGSEGV && ImplicitNullChecks &&
358 CodeCache::contains((void*) pc) && 361 CodeCache::contains((void*) pc) &&
359 !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) { 362 !MacroAssembler::needs_explicit_null_check((intptr_t) info->si_addr)) {
360 if (TraceTraps) 363 if (TraceTraps) {
361 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc); 364 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc);
365 }
362 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); 366 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
363 } 367 }
364 368
365 #ifdef COMPILER2 369 #ifdef COMPILER2
366 // SIGTRAP-based implicit range check in compiled code. 370 // SIGTRAP-based implicit range check in compiled code.
367 else if (sig == SIGTRAP && TrapBasedRangeChecks && 371 else if (sig == SIGTRAP && TrapBasedRangeChecks &&
368 nativeInstruction_at(pc)->is_sigtrap_range_check()) { 372 nativeInstruction_at(pc)->is_sigtrap_range_check()) {
369 if (TraceTraps) 373 if (TraceTraps) {
370 tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc); 374 tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
375 }
371 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); 376 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
372 goto run_stub; 377 goto run_stub;
373 } 378 }
374 #endif 379 #endif
375 380