< prev index next >

src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp

Print this page
rev 49172 : 8197405: Improve messages of AbstractMethodErrors and IncompatibleClassChangeErrors.
Reviewed-by: coleenp, dholmes, mdoerr, njian


 441       ShouldNotReachHere();
 442   }
 443   __ z_br(Z_R14);      // Return from result handler.
 444   return entry;
 445 }
 446 
 447 // Abstract method entry.
 448 // Attempt to execute abstract method. Throw exception.
 449 address TemplateInterpreterGenerator::generate_abstract_entry(void) {
 450   unsigned int entry_offset = __ offset();
 451 
 452   // Caller could be the call_stub or a compiled method (x86 version is wrong!).
 453 
 454   BLOCK_COMMENT("abstract_entry {");
 455 
 456   // Implement call of InterpreterRuntime::throw_AbstractMethodError.
 457   __ set_top_ijava_frame_at_SP_as_last_Java_frame(Z_SP, Z_R1);
 458   __ save_return_pc();       // Save Z_R14.
 459   __ push_frame_abi160(0);   // Without new frame the RT call could overwrite the saved Z_R14.
 460 
 461   __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError), Z_thread);

 462 
 463   __ pop_frame();
 464   __ restore_return_pc();    // Restore Z_R14.
 465   __ reset_last_Java_frame();
 466 
 467   // Restore caller sp for c2i case.
 468   __ resize_frame_absolute(Z_R10, Z_R0, true); // Cut the stack back to where the caller started.
 469 
 470   // branch to SharedRuntime::generate_forward_exception() which handles all possible callers,
 471   // i.e. call stub, compiled method, interpreted method.
 472   __ load_absolute_address(Z_tmp_1, StubRoutines::forward_exception_entry());
 473   __ z_br(Z_tmp_1);
 474 
 475   BLOCK_COMMENT("} abstract_entry");
 476 
 477   return __ addr_at(entry_offset);
 478 }
 479 
 480 address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
 481 #if INCLUDE_ALL_GCS


 669   Register offset = Z_tmp_2;
 670   const int flags_offset = in_bytes(ConstantPoolCache::base_offset() +
 671                                     ConstantPoolCacheEntry::flags_offset());
 672   __ get_cache_and_index_at_bcp(cache, offset, 1, index_size);
 673 
 674   // #args is in rightmost byte of the _flags field.
 675   __ z_llgc(size, Address(cache, offset, flags_offset+(sizeof(size_t)-1)));
 676   __ z_sllg(size, size, Interpreter::logStackElementSize); // Each argument size in bytes.
 677   __ z_agr(Z_esp, size);                                   // Pop arguments.
 678 
 679   __ check_and_handle_popframe(Z_thread);
 680   __ check_and_handle_earlyret(Z_thread);
 681 
 682   __ dispatch_next(state, step);
 683 
 684   BLOCK_COMMENT("} return_entry");
 685 
 686   return entry;
 687 }
 688 
 689 address TemplateInterpreterGenerator::generate_deopt_entry_for (TosState state,
 690                                                                int step,
 691                                                                address continuation) {
 692   address entry = __ pc();
 693 
 694   BLOCK_COMMENT("deopt_entry {");
 695 
 696   // TODO(ZASM): necessary? NULL last_sp until next java call
 697   // __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
 698   __ z_lg(Z_fp, _z_abi(callers_sp), Z_SP); // Restore frame pointer.
 699   __ restore_bcp();
 700   __ restore_locals();
 701   __ restore_esp();
 702 
 703   // Handle exceptions.
 704   {
 705     Label L;
 706     __ load_and_test_long(Z_R0/*pending_exception*/, thread_(pending_exception));
 707     __ z_bre(L);
 708     __ call_VM(noreg,
 709                CAST_FROM_FN_PTR(address,




 441       ShouldNotReachHere();
 442   }
 443   __ z_br(Z_R14);      // Return from result handler.
 444   return entry;
 445 }
 446 
 447 // Abstract method entry.
 448 // Attempt to execute abstract method. Throw exception.
 449 address TemplateInterpreterGenerator::generate_abstract_entry(void) {
 450   unsigned int entry_offset = __ offset();
 451 
 452   // Caller could be the call_stub or a compiled method (x86 version is wrong!).
 453 
 454   BLOCK_COMMENT("abstract_entry {");
 455 
 456   // Implement call of InterpreterRuntime::throw_AbstractMethodError.
 457   __ set_top_ijava_frame_at_SP_as_last_Java_frame(Z_SP, Z_R1);
 458   __ save_return_pc();       // Save Z_R14.
 459   __ push_frame_abi160(0);   // Without new frame the RT call could overwrite the saved Z_R14.
 460 
 461   __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodErrorWithMethod),
 462                   Z_thread, Z_method);
 463 
 464   __ pop_frame();
 465   __ restore_return_pc();    // Restore Z_R14.
 466   __ reset_last_Java_frame();
 467 
 468   // Restore caller sp for c2i case.
 469   __ resize_frame_absolute(Z_R10, Z_R0, true); // Cut the stack back to where the caller started.
 470 
 471   // branch to SharedRuntime::generate_forward_exception() which handles all possible callers,
 472   // i.e. call stub, compiled method, interpreted method.
 473   __ load_absolute_address(Z_tmp_1, StubRoutines::forward_exception_entry());
 474   __ z_br(Z_tmp_1);
 475 
 476   BLOCK_COMMENT("} abstract_entry");
 477 
 478   return __ addr_at(entry_offset);
 479 }
 480 
 481 address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
 482 #if INCLUDE_ALL_GCS


 670   Register offset = Z_tmp_2;
 671   const int flags_offset = in_bytes(ConstantPoolCache::base_offset() +
 672                                     ConstantPoolCacheEntry::flags_offset());
 673   __ get_cache_and_index_at_bcp(cache, offset, 1, index_size);
 674 
 675   // #args is in rightmost byte of the _flags field.
 676   __ z_llgc(size, Address(cache, offset, flags_offset+(sizeof(size_t)-1)));
 677   __ z_sllg(size, size, Interpreter::logStackElementSize); // Each argument size in bytes.
 678   __ z_agr(Z_esp, size);                                   // Pop arguments.
 679 
 680   __ check_and_handle_popframe(Z_thread);
 681   __ check_and_handle_earlyret(Z_thread);
 682 
 683   __ dispatch_next(state, step);
 684 
 685   BLOCK_COMMENT("} return_entry");
 686 
 687   return entry;
 688 }
 689 
 690 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state,
 691                                                                int step,
 692                                                                address continuation) {
 693   address entry = __ pc();
 694 
 695   BLOCK_COMMENT("deopt_entry {");
 696 
 697   // TODO(ZASM): necessary? NULL last_sp until next java call
 698   // __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
 699   __ z_lg(Z_fp, _z_abi(callers_sp), Z_SP); // Restore frame pointer.
 700   __ restore_bcp();
 701   __ restore_locals();
 702   __ restore_esp();
 703 
 704   // Handle exceptions.
 705   {
 706     Label L;
 707     __ load_and_test_long(Z_R0/*pending_exception*/, thread_(pending_exception));
 708     __ z_bre(L);
 709     __ call_VM(noreg,
 710                CAST_FROM_FN_PTR(address,


< prev index next >