< prev index next >

src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp

Print this page
rev 7507 : 8066964: ppc64: argument and return type profiling, fix problem with popframe


  74 #endif
  75 
  76   return csp;
  77 }
  78 
  79 char* os::non_memory_address_word() {
  80   // Must never look like an address returned by reserve_memory,
  81   // even in its subfields (as defined by the CPU immediate fields,
  82   // if the CPU splits constants across multiple instructions).
  83 
  84   return (char*) -1;
  85 }
  86 
  87 // OS specific thread initialization
  88 //
  89 // Calculate and store the limits of the memory stack.
  90 void os::initialize_thread(Thread *thread) { }
  91 
  92 // Frame information (pc, sp, fp) retrieved via ucontext
  93 // always looks like a C-frame according to the frame
  94 // conventions in frame_ppc64.hpp.
  95 address os::Aix::ucontext_get_pc(ucontext_t * uc) {

  96   return (address)uc->uc_mcontext.jmp_context.iar;
  97 }
  98 
  99 intptr_t* os::Aix::ucontext_get_sp(ucontext_t * uc) {
 100   // gpr1 holds the stack pointer on aix
 101   return (intptr_t*)uc->uc_mcontext.jmp_context.gpr[1/*REG_SP*/];
 102 }
 103 
 104 intptr_t* os::Aix::ucontext_get_fp(ucontext_t * uc) {
 105   return NULL;
 106 }
 107 
 108 void os::Aix::ucontext_set_pc(ucontext_t* uc, address new_pc) {
 109   uc->uc_mcontext.jmp_context.iar = (uint64_t) new_pc;
 110 }
 111 
 112 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
 113                                         intptr_t** ret_sp, intptr_t** ret_fp) {
 114 
 115   ExtendedPC  epc;


 469 
 470   VMError err(t, sig, pc, info, ucVoid);
 471   err.report_and_die();
 472 
 473   ShouldNotReachHere();
 474   return 0;
 475 }
 476 
 477 void os::Aix::init_thread_fpu_state(void) {
 478 #if !defined(USE_XLC_BUILTINS)
 479   // Disable FP exceptions.
 480   __asm__ __volatile__ ("mtfsfi 6,0");
 481 #else
 482   __mtfsfi(6, 0);
 483 #endif
 484 }
 485 
 486 ////////////////////////////////////////////////////////////////////////////////
 487 // thread stack
 488 
 489 size_t os::Aix::min_stack_allowed = 768*K;
 490 
 491 // Aix is always in floating stack mode. The stack size for a new
 492 // thread can be set via pthread_attr_setstacksize().
 493 bool os::Aix::supports_variable_stack_size() { return true; }
 494 
 495 // return default stack size for thr_type
 496 size_t os::Aix::default_stack_size(os::ThreadType thr_type) {
 497   // default stack size (compiler thread needs larger stack)
 498   // Notice that the setting for compiler threads here have no impact
 499   // because of the strange 'fallback logic' in os::create_thread().
 500   // Better set CompilerThreadStackSize in globals_<os_cpu>.hpp if you want to
 501   // specify a different stack size for compiler threads!
 502   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1024 * K);
 503   return s;
 504 }
 505 
 506 size_t os::Aix::default_guard_size(os::ThreadType thr_type) {
 507   return 2 * page_size();
 508 }
 509 
 510 /////////////////////////////////////////////////////////////////////////////
 511 // helper functions for fatal error handler
 512 
 513 void os::print_context(outputStream *st, void *context) {
 514   if (context == NULL) return;
 515 
 516   ucontext_t* uc = (ucontext_t*)context;
 517 
 518   st->print_cr("Registers:");
 519   st->print("pc =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.iar);
 520   st->print("lr =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.lr);
 521   st->print("ctr=" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.ctr);
 522   st->cr();




  74 #endif
  75 
  76   return csp;
  77 }
  78 
  79 char* os::non_memory_address_word() {
  80   // Must never look like an address returned by reserve_memory,
  81   // even in its subfields (as defined by the CPU immediate fields,
  82   // if the CPU splits constants across multiple instructions).
  83 
  84   return (char*) -1;
  85 }
  86 
  87 // OS specific thread initialization
  88 //
  89 // Calculate and store the limits of the memory stack.
  90 void os::initialize_thread(Thread *thread) { }
  91 
  92 // Frame information (pc, sp, fp) retrieved via ucontext
  93 // always looks like a C-frame according to the frame
  94 // conventions in frame_ppc.hpp.
  95 
  96 address os::Aix::ucontext_get_pc(const ucontext_t * uc) {
  97   return (address)uc->uc_mcontext.jmp_context.iar;
  98 }
  99 
 100 intptr_t* os::Aix::ucontext_get_sp(ucontext_t * uc) {
 101   // gpr1 holds the stack pointer on aix
 102   return (intptr_t*)uc->uc_mcontext.jmp_context.gpr[1/*REG_SP*/];
 103 }
 104 
 105 intptr_t* os::Aix::ucontext_get_fp(ucontext_t * uc) {
 106   return NULL;
 107 }
 108 
 109 void os::Aix::ucontext_set_pc(ucontext_t* uc, address new_pc) {
 110   uc->uc_mcontext.jmp_context.iar = (uint64_t) new_pc;
 111 }
 112 
 113 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
 114                                         intptr_t** ret_sp, intptr_t** ret_fp) {
 115 
 116   ExtendedPC  epc;


 470 
 471   VMError err(t, sig, pc, info, ucVoid);
 472   err.report_and_die();
 473 
 474   ShouldNotReachHere();
 475   return 0;
 476 }
 477 
 478 void os::Aix::init_thread_fpu_state(void) {
 479 #if !defined(USE_XLC_BUILTINS)
 480   // Disable FP exceptions.
 481   __asm__ __volatile__ ("mtfsfi 6,0");
 482 #else
 483   __mtfsfi(6, 0);
 484 #endif
 485 }
 486 
 487 ////////////////////////////////////////////////////////////////////////////////
 488 // thread stack
 489 
 490 size_t os::Aix::min_stack_allowed = 128*K;
 491 
 492 // Aix is always in floating stack mode. The stack size for a new
 493 // thread can be set via pthread_attr_setstacksize().
 494 bool os::Aix::supports_variable_stack_size() { return true; }
 495 
 496 // return default stack size for thr_type
 497 size_t os::Aix::default_stack_size(os::ThreadType thr_type) {
 498   // default stack size (compiler thread needs larger stack)
 499   // Notice that the setting for compiler threads here have no impact
 500   // because of the strange 'fallback logic' in os::create_thread().
 501   // Better set CompilerThreadStackSize in globals_<os_cpu>.hpp if you want to
 502   // specify a different stack size for compiler threads!
 503   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 504   return s;
 505 }
 506 
 507 size_t os::Aix::default_guard_size(os::ThreadType thr_type) {
 508   return 2 * page_size();
 509 }
 510 
 511 /////////////////////////////////////////////////////////////////////////////
 512 // helper functions for fatal error handler
 513 
 514 void os::print_context(outputStream *st, void *context) {
 515   if (context == NULL) return;
 516 
 517   ucontext_t* uc = (ucontext_t*)context;
 518 
 519   st->print_cr("Registers:");
 520   st->print("pc =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.iar);
 521   st->print("lr =" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.lr);
 522   st->print("ctr=" INTPTR_FORMAT "  ", uc->uc_mcontext.jmp_context.ctr);
 523   st->cr();


< prev index next >