comparison src/cpu/x86/vm/graalRuntime_x86.cpp @ 8968:e41c32a4d573

Change the register_finalizer stub to not overwrite any registers.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 09 Apr 2013 19:28:34 +0200
parents c3657d00e343
children 4fc644c79b9f
comparison
equal deleted inserted replaced
8944:e7766460ddb3 8968:e41c32a4d573
877 { 877 {
878 __ set_info("register_finalizer", dont_gc_arguments); 878 __ set_info("register_finalizer", dont_gc_arguments);
879 879
880 // This is called via call_runtime so the arguments 880 // This is called via call_runtime so the arguments
881 // will be place in C abi locations 881 // will be place in C abi locations
882
883 #ifdef _LP64
884 __ verify_oop(j_rarg0); 882 __ verify_oop(j_rarg0);
885 __ mov(rax, j_rarg0);
886 #else
887 // The object is passed on the stack and we haven't pushed a
888 // frame yet so it's one work away from top of stack.
889 __ movptr(rax, Address(rsp, 1 * BytesPerWord));
890 __ verify_oop(rax);
891 #endif // _LP64
892
893 // load the klass and check the has finalizer flag
894 Label register_finalizer;
895 Register t = rsi;
896 __ load_klass(t, rax);
897 __ movl(t, Address(t, Klass::access_flags_offset()));
898 __ testl(t, JVM_ACC_HAS_FINALIZER);
899 __ jcc(Assembler::notZero, register_finalizer);
900 __ ret(0);
901
902 __ bind(register_finalizer);
903 __ enter(); 883 __ enter();
904 OopMap* oop_map = save_live_registers(sasm, 2 /*num_rt_args */); 884 OopMap* oop_map = save_live_registers(sasm, 2 /*num_rt_args */);
905 int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, SharedRuntime::register_finalizer), rax); 885 int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, SharedRuntime::register_finalizer), j_rarg0);
906 oop_maps = new OopMapSet(); 886 oop_maps = new OopMapSet();
907 oop_maps->add_gc_map(call_offset, oop_map); 887 oop_maps->add_gc_map(call_offset, oop_map);
908 888
909 // Now restore all the live registers 889 // Now restore all the live registers
910 restore_live_registers(sasm); 890 restore_live_registers(sasm);