30 #include "classfile/systemDictionary.hpp"
31 #include "classfile/vmSymbols.hpp"
32 #include "code/codeCache.hpp"
33 #include "code/icBuffer.hpp"
34 #include "code/vtableStubs.hpp"
35 #include "interpreter/interpreter.hpp"
36 #include "memory/allocation.inline.hpp"
37 #include "nativeInst_ppc.hpp"
38 #include "os_share_aix.hpp"
39 #include "prims/jniFastGetField.hpp"
40 #include "prims/jvm_misc.hpp"
41 #include "porting_aix.hpp"
42 #include "runtime/arguments.hpp"
43 #include "runtime/extendedPC.hpp"
44 #include "runtime/frame.inline.hpp"
45 #include "runtime/interfaceSupport.hpp"
46 #include "runtime/java.hpp"
47 #include "runtime/javaCalls.hpp"
48 #include "runtime/mutexLocker.hpp"
49 #include "runtime/osThread.hpp"
50 #include "runtime/sharedRuntime.hpp"
51 #include "runtime/stubRoutines.hpp"
52 #include "runtime/thread.inline.hpp"
53 #include "runtime/timer.hpp"
54 #include "utilities/events.hpp"
55 #include "utilities/vmError.hpp"
56 #ifdef COMPILER1
57 #include "c1/c1_Runtime1.hpp"
58 #endif
59 #ifdef COMPILER2
60 #include "opto/runtime.hpp"
61 #endif
62
63 // put OS-includes here
64 # include <ucontext.h>
65
66 address os::current_stack_pointer() {
67 address csp;
68
69 #if !defined(USE_XLC_BUILTINS)
357 // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else
358 // in the zero page, because it is filled with 0x0. We ignore
359 // explicit SIGILLs in the zero page.
360 if (sig == SIGILL && (pc < (address) 0x200)) {
361 if (TraceTraps) {
362 tty->print_raw_cr("SIGILL happened inside zero page.");
363 }
364 goto report_and_die;
365 }
366
367 // Handle signal from NativeJump::patch_verified_entry().
368 if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
369 (!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
370 if (TraceTraps) {
371 tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL");
372 }
373 stub = SharedRuntime::get_handle_wrong_method_stub();
374 goto run_stub;
375 }
376
377 else if (sig == SIGSEGV && os::is_poll_address(addr)) {
378 if (TraceTraps) {
379 tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
380 }
381 stub = SharedRuntime::get_poll_stub(pc);
382 goto run_stub;
383 }
384
385 // SIGTRAP-based ic miss check in compiled code.
386 else if (sig == SIGTRAP && TrapBasedICMissChecks &&
387 nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
388 if (TraceTraps) {
389 tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
390 }
391 stub = SharedRuntime::get_ic_miss_stub();
392 goto run_stub;
393 }
394
395 // SIGTRAP-based implicit null check in compiled code.
396 else if (sig == SIGTRAP && TrapBasedNullChecks &&
397 nativeInstruction_at(pc)->is_sigtrap_null_check()) {
398 if (TraceTraps) {
399 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
|
30 #include "classfile/systemDictionary.hpp"
31 #include "classfile/vmSymbols.hpp"
32 #include "code/codeCache.hpp"
33 #include "code/icBuffer.hpp"
34 #include "code/vtableStubs.hpp"
35 #include "interpreter/interpreter.hpp"
36 #include "memory/allocation.inline.hpp"
37 #include "nativeInst_ppc.hpp"
38 #include "os_share_aix.hpp"
39 #include "prims/jniFastGetField.hpp"
40 #include "prims/jvm_misc.hpp"
41 #include "porting_aix.hpp"
42 #include "runtime/arguments.hpp"
43 #include "runtime/extendedPC.hpp"
44 #include "runtime/frame.inline.hpp"
45 #include "runtime/interfaceSupport.hpp"
46 #include "runtime/java.hpp"
47 #include "runtime/javaCalls.hpp"
48 #include "runtime/mutexLocker.hpp"
49 #include "runtime/osThread.hpp"
50 #include "runtime/safepointMechanism.hpp"
51 #include "runtime/sharedRuntime.hpp"
52 #include "runtime/stubRoutines.hpp"
53 #include "runtime/thread.inline.hpp"
54 #include "runtime/timer.hpp"
55 #include "utilities/events.hpp"
56 #include "utilities/vmError.hpp"
57 #ifdef COMPILER1
58 #include "c1/c1_Runtime1.hpp"
59 #endif
60 #ifdef COMPILER2
61 #include "opto/runtime.hpp"
62 #endif
63
64 // put OS-includes here
65 # include <ucontext.h>
66
67 address os::current_stack_pointer() {
68 address csp;
69
70 #if !defined(USE_XLC_BUILTINS)
358 // On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else
359 // in the zero page, because it is filled with 0x0. We ignore
360 // explicit SIGILLs in the zero page.
361 if (sig == SIGILL && (pc < (address) 0x200)) {
362 if (TraceTraps) {
363 tty->print_raw_cr("SIGILL happened inside zero page.");
364 }
365 goto report_and_die;
366 }
367
368 // Handle signal from NativeJump::patch_verified_entry().
369 if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
370 (!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
371 if (TraceTraps) {
372 tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL");
373 }
374 stub = SharedRuntime::get_handle_wrong_method_stub();
375 goto run_stub;
376 }
377
378 else if ((SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY)
379 ? (sig == SIGTRAP && ((NativeInstruction*)pc)->is_safepoint_poll())
380 : (sig == SIGSEGV && os::is_poll_address(addr))) {
381 if (TraceTraps) {
382 tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (%s)", p2i(pc),
383 (SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? "SIGTRAP" : "SIGSEGV");
384 }
385 stub = SharedRuntime::get_poll_stub(pc);
386 goto run_stub;
387 }
388
389 // SIGTRAP-based ic miss check in compiled code.
390 else if (sig == SIGTRAP && TrapBasedICMissChecks &&
391 nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
392 if (TraceTraps) {
393 tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
394 }
395 stub = SharedRuntime::get_ic_miss_stub();
396 goto run_stub;
397 }
398
399 // SIGTRAP-based implicit null check in compiled code.
400 else if (sig == SIGTRAP && TrapBasedNullChecks &&
401 nativeInstruction_at(pc)->is_sigtrap_null_check()) {
402 if (TraceTraps) {
403 tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc);
|