< prev index next >

src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp

Print this page
rev 7321 : 8078482: ppc: pass thread to throw_AbstractMethodError
Summary: Also improve check for Safepoints in signal handler.
Reviewed-by: kvn, simonis
   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2012, 2014 SAP AG. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file hat
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *


 273           }
 274         }
 275       }
 276     }
 277 
 278     if (thread->thread_state() == _thread_in_Java) {
 279       // Java thread running in Java code => find exception handler if any
 280       // a fault inside compiled code, the interpreter, or a stub
 281 
 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
 284       // in the zero page, because it is filled with 0x0. We ignore
 285       // explicit SIGILLs in the zero page.
 286       if (sig == SIGILL && (pc < (address) 0x200)) {
 287         if (TraceTraps) {
 288           tty->print_raw_cr("SIGILL happened inside zero page.");
 289         }
 290         goto report_and_die;
 291       }
 292 

 293       // Handle signal from NativeJump::patch_verified_entry().
 294       if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
 295           (!TrapBasedNotEntrantChecks && sig == SIGILL  && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
 296         if (TraceTraps) {
 297           tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL");
 298         }
 299         stub = SharedRuntime::get_handle_wrong_method_stub();
 300       }
 301 
 302       else if (sig == SIGSEGV &&
 303                // A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults
 304                // in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6),
 305                // especially when we try to read from the safepoint polling page. So the check
 306                //   (address)info->si_addr == os::get_standard_polling_page()
 307                // doesn't work for us. We use:
 308                ((NativeInstruction*)pc)->is_safepoint_poll()) {



 309         if (TraceTraps) {
 310           tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
 311         }
 312         stub = SharedRuntime::get_poll_stub(pc);
 313       }
 314 
 315       // SIGTRAP-based ic miss check in compiled code.
 316       else if (sig == SIGTRAP && TrapBasedICMissChecks &&
 317                nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
 318         if (TraceTraps) {
 319           tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
 320         }
 321         stub = SharedRuntime::get_ic_miss_stub();
 322       }
 323 
 324       // SIGTRAP-based implicit null check in compiled code.
 325       else if (sig == SIGTRAP && TrapBasedNullChecks &&
 326                nativeInstruction_at(pc)->is_sigtrap_null_check()) {
 327         if (TraceTraps) {
 328           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));


   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2012, 2015 SAP AG. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file hat
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *


 273           }
 274         }
 275       }
 276     }
 277 
 278     if (thread->thread_state() == _thread_in_Java) {
 279       // Java thread running in Java code => find exception handler if any
 280       // a fault inside compiled code, the interpreter, or a stub
 281 
 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
 284       // in the zero page, because it is filled with 0x0. We ignore
 285       // explicit SIGILLs in the zero page.
 286       if (sig == SIGILL && (pc < (address) 0x200)) {
 287         if (TraceTraps) {
 288           tty->print_raw_cr("SIGILL happened inside zero page.");
 289         }
 290         goto report_and_die;
 291       }
 292 
 293       CodeBlob *cb = NULL;
 294       // Handle signal from NativeJump::patch_verified_entry().
 295       if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) ||
 296           (!TrapBasedNotEntrantChecks && sig == SIGILL  && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) {
 297         if (TraceTraps) {
 298           tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL");
 299         }
 300         stub = SharedRuntime::get_handle_wrong_method_stub();
 301       }
 302 
 303       else if (sig == SIGSEGV &&
 304                // A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults
 305                // in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6),
 306                // especially when we try to read from the safepoint polling page. So the check
 307                //   (address)info->si_addr == os::get_standard_polling_page()
 308                // doesn't work for us. We use:
 309                ((NativeInstruction*)pc)->is_safepoint_poll() &&
 310                CodeCache::contains((void*) pc) &&
 311                ((cb = CodeCache::find_blob(pc)) != NULL) &&
 312                cb->is_nmethod()) {
 313         if (TraceTraps) {
 314           tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
 315         }
 316         stub = SharedRuntime::get_poll_stub(pc);
 317       }
 318 
 319       // SIGTRAP-based ic miss check in compiled code.
 320       else if (sig == SIGTRAP && TrapBasedICMissChecks &&
 321                nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) {
 322         if (TraceTraps) {
 323           tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));
 324         }
 325         stub = SharedRuntime::get_ic_miss_stub();
 326       }
 327 
 328       // SIGTRAP-based implicit null check in compiled code.
 329       else if (sig == SIGTRAP && TrapBasedNullChecks &&
 330                nativeInstruction_at(pc)->is_sigtrap_null_check()) {
 331         if (TraceTraps) {
 332           tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", p2i(pc));


< prev index next >