src/cpu/ppc/vm/stubGenerator_ppc.cpp

Print this page




 507   // AbstractMethodError on entry) are either at call sites or
 508   // otherwise assume that stack unwinding will be initiated, so
 509   // caller saved registers were assumed volatile in the compiler.
 510   //
 511   // Note that we generate only this stub into a RuntimeStub, because
 512   // it needs to be properly traversed and ignored during GC, so we
 513   // change the meaning of the "__" macro within this method.
 514   //
 515   // Note: the routine set_pc_not_at_call_for_caller in
 516   // SharedRuntime.cpp requires that this code be generated into a
 517   // RuntimeStub.
 518   address generate_throw_exception(const char* name, address runtime_entry, bool restore_saved_exception_pc,
 519                                    Register arg1 = noreg, Register arg2 = noreg) {
 520     CodeBuffer code(name, 1024 DEBUG_ONLY(+ 512), 0);
 521     MacroAssembler* masm = new MacroAssembler(&code);
 522 
 523     OopMapSet* oop_maps  = new OopMapSet();
 524     int frame_size_in_bytes = frame::abi_reg_args_size;
 525     OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0);
 526 
 527     StubCodeMark mark(this, "StubRoutines", "throw_exception");
 528 
 529     address start = __ pc();
 530 
 531     __ save_LR_CR(R11_scratch1);
 532 
 533     // Push a frame.
 534     __ push_frame_reg_args(0, R11_scratch1);
 535 
 536     address frame_complete_pc = __ pc();
 537 
 538     if (restore_saved_exception_pc) {
 539       __ unimplemented("StubGenerator::throw_exception with restore_saved_exception_pc", 74);
 540     }
 541 
 542     // Note that we always have a runtime stub frame on the top of
 543     // stack by this point. Remember the offset of the instruction
 544     // whose address will be moved to R11_scratch1.
 545     address gc_map_pc = __ get_PC_trash_LR(R11_scratch1);
 546 
 547     __ set_last_Java_frame(/*sp*/R1_SP, /*pc*/R11_scratch1);
 548 


 829     __ unimplemented("StubRoutines::handler_for_unsafe_access", 93);
 830     return start;
 831   }
 832 
 833 #if !defined(PRODUCT)
 834   // Wrapper which calls oopDesc::is_oop_or_null()
 835   // Only called by MacroAssembler::verify_oop
 836   static void verify_oop_helper(const char* message, oop o) {
 837     if (!o->is_oop_or_null()) {
 838       fatal(message);
 839     }
 840     ++ StubRoutines::_verify_oop_count;
 841   }
 842 #endif
 843 
 844   // Return address of code to be called from code generated by
 845   // MacroAssembler::verify_oop.
 846   //
 847   // Don't generate, rather use C++ code.
 848   address generate_verify_oop() {
 849     StubCodeMark mark(this, "StubRoutines", "verify_oop");
 850 
 851     // this is actually a `FunctionDescriptor*'.
 852     address start = 0;
 853 
 854 #if !defined(PRODUCT)
 855     start = CAST_FROM_FN_PTR(address, verify_oop_helper);
 856 #endif
 857 
 858     return start;
 859   }
 860 
 861   // Fairer handling of safepoints for native methods.
 862   //
 863   // Generate code which reads from the polling page. This special handling is needed as the
 864   // linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults in 64bit mode
 865   // (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6), especially when we try
 866   // to read from the safepoint polling page.
 867   address generate_load_from_poll() {
 868     StubCodeMark mark(this, "StubRoutines", "generate_load_from_poll");
 869     address start = __ function_entry();
 870     __ unimplemented("StubRoutines::verify_oop", 95);  // TODO PPC port




 507   // AbstractMethodError on entry) are either at call sites or
 508   // otherwise assume that stack unwinding will be initiated, so
 509   // caller saved registers were assumed volatile in the compiler.
 510   //
 511   // Note that we generate only this stub into a RuntimeStub, because
 512   // it needs to be properly traversed and ignored during GC, so we
 513   // change the meaning of the "__" macro within this method.
 514   //
 515   // Note: the routine set_pc_not_at_call_for_caller in
 516   // SharedRuntime.cpp requires that this code be generated into a
 517   // RuntimeStub.
 518   address generate_throw_exception(const char* name, address runtime_entry, bool restore_saved_exception_pc,
 519                                    Register arg1 = noreg, Register arg2 = noreg) {
 520     CodeBuffer code(name, 1024 DEBUG_ONLY(+ 512), 0);
 521     MacroAssembler* masm = new MacroAssembler(&code);
 522 
 523     OopMapSet* oop_maps  = new OopMapSet();
 524     int frame_size_in_bytes = frame::abi_reg_args_size;
 525     OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0);
 526 


 527     address start = __ pc();
 528 
 529     __ save_LR_CR(R11_scratch1);
 530 
 531     // Push a frame.
 532     __ push_frame_reg_args(0, R11_scratch1);
 533 
 534     address frame_complete_pc = __ pc();
 535 
 536     if (restore_saved_exception_pc) {
 537       __ unimplemented("StubGenerator::throw_exception with restore_saved_exception_pc", 74);
 538     }
 539 
 540     // Note that we always have a runtime stub frame on the top of
 541     // stack by this point. Remember the offset of the instruction
 542     // whose address will be moved to R11_scratch1.
 543     address gc_map_pc = __ get_PC_trash_LR(R11_scratch1);
 544 
 545     __ set_last_Java_frame(/*sp*/R1_SP, /*pc*/R11_scratch1);
 546 


 827     __ unimplemented("StubRoutines::handler_for_unsafe_access", 93);
 828     return start;
 829   }
 830 
 831 #if !defined(PRODUCT)
 832   // Wrapper which calls oopDesc::is_oop_or_null()
 833   // Only called by MacroAssembler::verify_oop
 834   static void verify_oop_helper(const char* message, oop o) {
 835     if (!o->is_oop_or_null()) {
 836       fatal(message);
 837     }
 838     ++ StubRoutines::_verify_oop_count;
 839   }
 840 #endif
 841 
 842   // Return address of code to be called from code generated by
 843   // MacroAssembler::verify_oop.
 844   //
 845   // Don't generate, rather use C++ code.
 846   address generate_verify_oop() {


 847     // this is actually a `FunctionDescriptor*'.
 848     address start = 0;
 849 
 850 #if !defined(PRODUCT)
 851     start = CAST_FROM_FN_PTR(address, verify_oop_helper);
 852 #endif
 853 
 854     return start;
 855   }
 856 
 857   // Fairer handling of safepoints for native methods.
 858   //
 859   // Generate code which reads from the polling page. This special handling is needed as the
 860   // linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults in 64bit mode
 861   // (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6), especially when we try
 862   // to read from the safepoint polling page.
 863   address generate_load_from_poll() {
 864     StubCodeMark mark(this, "StubRoutines", "generate_load_from_poll");
 865     address start = __ function_entry();
 866     __ unimplemented("StubRoutines::verify_oop", 95);  // TODO PPC port