< prev index next >

src/cpu/x86/vm/stubGenerator_x86_64.cpp

Print this page
rev 4131 : 8014431: cleanup warnings indicated by the -Wunused-value compiler option on linux
8015265: revise the fix for 8007037
Reviewed-by: sspitsyn, dholmes, dcubed, coleenp
Contributed-by: jeremymanson@google.com, calvin.cheung@oracle.com


  75 
  76 static address handle_unsafe_access() {
  77   JavaThread* thread = JavaThread::current();
  78   address pc = thread->saved_exception_pc();
  79   // pc is the instruction which we must emulate
  80   // doing a no-op is fine:  return garbage from the load
  81   // therefore, compute npc
  82   address npc = Assembler::locate_next_instruction(pc);
  83 
  84   // request an async exception
  85   thread->set_pending_unsafe_access_error();
  86 
  87   // return address of next instruction to execute
  88   return npc;
  89 }
  90 
  91 class StubGenerator: public StubCodeGenerator {
  92  private:
  93 
  94 #ifdef PRODUCT
  95 #define inc_counter_np(counter) (0)
  96 #else
  97   void inc_counter_np_(int& counter) {
  98     // This can destroy rscratch1 if counter is far from the code cache
  99     __ incrementl(ExternalAddress((address)&counter));
 100   }
 101 #define inc_counter_np(counter) \
 102   BLOCK_COMMENT("inc_counter " #counter); \
 103   inc_counter_np_(counter);
 104 #endif
 105 
 106   // Call stubs are used to call Java from C
 107   //
 108   // Linux Arguments:
 109   //    c_rarg0:   call wrapper address                   address
 110   //    c_rarg1:   result                                 address
 111   //    c_rarg2:   result type                            BasicType
 112   //    c_rarg3:   method                                 methodOop
 113   //    c_rarg4:   (interpreter) entry point              address
 114   //    c_rarg5:   parameters                             intptr_t*
 115   //    16(rbp): parameter size (in words)              int




  75 
  76 static address handle_unsafe_access() {
  77   JavaThread* thread = JavaThread::current();
  78   address pc = thread->saved_exception_pc();
  79   // pc is the instruction which we must emulate
  80   // doing a no-op is fine:  return garbage from the load
  81   // therefore, compute npc
  82   address npc = Assembler::locate_next_instruction(pc);
  83 
  84   // request an async exception
  85   thread->set_pending_unsafe_access_error();
  86 
  87   // return address of next instruction to execute
  88   return npc;
  89 }
  90 
  91 class StubGenerator: public StubCodeGenerator {
  92  private:
  93 
  94 #ifdef PRODUCT
  95 #define inc_counter_np(counter) ((void)0)
  96 #else
  97   void inc_counter_np_(int& counter) {
  98     // This can destroy rscratch1 if counter is far from the code cache
  99     __ incrementl(ExternalAddress((address)&counter));
 100   }
 101 #define inc_counter_np(counter) \
 102   BLOCK_COMMENT("inc_counter " #counter); \
 103   inc_counter_np_(counter);
 104 #endif
 105 
 106   // Call stubs are used to call Java from C
 107   //
 108   // Linux Arguments:
 109   //    c_rarg0:   call wrapper address                   address
 110   //    c_rarg1:   result                                 address
 111   //    c_rarg2:   result type                            BasicType
 112   //    c_rarg3:   method                                 methodOop
 113   //    c_rarg4:   (interpreter) entry point              address
 114   //    c_rarg5:   parameters                             intptr_t*
 115   //    16(rbp): parameter size (in words)              int


< prev index next >