< prev index next >

src/cpu/ppc/vm/interpreter_ppc.cpp

Print this page
rev 8111 : 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 that
  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  *


 410     __ cmpdi(CCR0, R3_RET, 0);
 411     __ beq(CCR0, done);
 412     __ ld(R3_RET, 0, R3_RET);
 413     __ verify_oop(R3_RET);
 414     break;
 415   case T_FLOAT:
 416      break;
 417   case T_DOUBLE:
 418      break;
 419   case T_VOID:
 420      break;
 421   default: ShouldNotReachHere();
 422   }
 423 
 424   __ BIND(done);
 425   __ blr();
 426 
 427   return entry;
 428 }
 429 
 430 
 431 // Call an accessor method (assuming it is resolved, otherwise drop into
 432 // vanilla (slow path) entry.
 433 address InterpreterGenerator::generate_jump_to_normal_entry(void) {
 434   address entry = __ pc();
 435   address normal_entry = Interpreter::entry_for_kind(Interpreter::zerolocals);
 436   assert(normal_entry != NULL, "should already be generated.");
 437   __ branch_to_entry(normal_entry, R11_scratch1);
 438   __ flush();
 439 
 440   return entry;
 441 }
 442 
 443 // Abstract method entry.
 444 //
 445 address InterpreterGenerator::generate_abstract_entry(void) {
 446   address entry = __ pc();
 447 
 448   //
 449   // Registers alive
 450   //   R16_thread     - JavaThread*


 456   //
 457   //   0       [TOP_IJAVA_FRAME_ABI]         <-- R1_SP
 458   //           alignment (optional)
 459   //           [outgoing Java arguments]
 460   //           ...
 461   //   PARENT  [PARENT_IJAVA_FRAME_ABI]
 462   //            ...
 463   //
 464 
 465   // Can't use call_VM here because we have not set up a new
 466   // interpreter state. Make the call to the vm and make it look like
 467   // our caller set up the JavaFrameAnchor.
 468   __ set_top_ijava_frame_at_SP_as_last_Java_frame(R1_SP, R12_scratch2/*tmp*/);
 469 
 470   // Push a new C frame and save LR.
 471   __ save_LR_CR(R0);
 472   __ push_frame_reg_args(0, R11_scratch1);
 473 
 474   // This is not a leaf but we have a JavaFrameAnchor now and we will
 475   // check (create) exceptions afterward so this is ok.
 476   __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));

 477 
 478   // Pop the C frame and restore LR.
 479   __ pop_frame();
 480   __ restore_LR_CR(R0);
 481 
 482   // Reset JavaFrameAnchor from call_VM_leaf above.
 483   __ reset_last_Java_frame();
 484 
 485 #ifdef CC_INTERP
 486   // Return to frame manager, it will handle the pending exception.
 487   __ blr();
 488 #else
 489   // We don't know our caller, so jump to the general forward exception stub,
 490   // which will also pop our full frame off. Satisfy the interface of
 491   // SharedRuntime::generate_forward_exception()
 492   __ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0);
 493   __ mtctr(R11_scratch1);
 494   __ bctr();
 495 #endif
 496 


   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 that
  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  *


 410     __ cmpdi(CCR0, R3_RET, 0);
 411     __ beq(CCR0, done);
 412     __ ld(R3_RET, 0, R3_RET);
 413     __ verify_oop(R3_RET);
 414     break;
 415   case T_FLOAT:
 416      break;
 417   case T_DOUBLE:
 418      break;
 419   case T_VOID:
 420      break;
 421   default: ShouldNotReachHere();
 422   }
 423 
 424   __ BIND(done);
 425   __ blr();
 426 
 427   return entry;
 428 }
 429 

 430 // Call an accessor method (assuming it is resolved, otherwise drop into
 431 // vanilla (slow path) entry.
 432 address InterpreterGenerator::generate_jump_to_normal_entry(void) {
 433   address entry = __ pc();
 434   address normal_entry = Interpreter::entry_for_kind(Interpreter::zerolocals);
 435   assert(normal_entry != NULL, "should already be generated.");
 436   __ branch_to_entry(normal_entry, R11_scratch1);
 437   __ flush();
 438 
 439   return entry;
 440 }
 441 
 442 // Abstract method entry.
 443 //
 444 address InterpreterGenerator::generate_abstract_entry(void) {
 445   address entry = __ pc();
 446 
 447   //
 448   // Registers alive
 449   //   R16_thread     - JavaThread*


 455   //
 456   //   0       [TOP_IJAVA_FRAME_ABI]         <-- R1_SP
 457   //           alignment (optional)
 458   //           [outgoing Java arguments]
 459   //           ...
 460   //   PARENT  [PARENT_IJAVA_FRAME_ABI]
 461   //            ...
 462   //
 463 
 464   // Can't use call_VM here because we have not set up a new
 465   // interpreter state. Make the call to the vm and make it look like
 466   // our caller set up the JavaFrameAnchor.
 467   __ set_top_ijava_frame_at_SP_as_last_Java_frame(R1_SP, R12_scratch2/*tmp*/);
 468 
 469   // Push a new C frame and save LR.
 470   __ save_LR_CR(R0);
 471   __ push_frame_reg_args(0, R11_scratch1);
 472 
 473   // This is not a leaf but we have a JavaFrameAnchor now and we will
 474   // check (create) exceptions afterward so this is ok.
 475   __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError),
 476                   R16_thread);
 477 
 478   // Pop the C frame and restore LR.
 479   __ pop_frame();
 480   __ restore_LR_CR(R0);
 481 
 482   // Reset JavaFrameAnchor from call_VM_leaf above.
 483   __ reset_last_Java_frame();
 484 
 485 #ifdef CC_INTERP
 486   // Return to frame manager, it will handle the pending exception.
 487   __ blr();
 488 #else
 489   // We don't know our caller, so jump to the general forward exception stub,
 490   // which will also pop our full frame off. Satisfy the interface of
 491   // SharedRuntime::generate_forward_exception()
 492   __ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0);
 493   __ mtctr(R11_scratch1);
 494   __ bctr();
 495 #endif
 496 


< prev index next >