src/cpu/x86/vm/c1_Runtime1_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File c1-coops Sdiff src/cpu/x86/vm

src/cpu/x86/vm/c1_Runtime1_x86.cpp

Print this page




1232     case register_finalizer_id:
1233       {
1234         __ set_info("register_finalizer", dont_gc_arguments);
1235 
1236         // This is called via call_runtime so the arguments
1237         // will be place in C abi locations
1238 
1239 #ifdef _LP64
1240         __ verify_oop(c_rarg0);
1241         __ mov(rax, c_rarg0);
1242 #else
1243         // The object is passed on the stack and we haven't pushed a
1244         // frame yet so it's one work away from top of stack.
1245         __ movptr(rax, Address(rsp, 1 * BytesPerWord));
1246         __ verify_oop(rax);
1247 #endif // _LP64
1248 
1249         // load the klass and check the has finalizer flag
1250         Label register_finalizer;
1251         Register t = rsi;
1252         __ movptr(t, Address(rax, oopDesc::klass_offset_in_bytes()));
1253         __ movl(t, Address(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc)));
1254         __ testl(t, JVM_ACC_HAS_FINALIZER);
1255         __ jcc(Assembler::notZero, register_finalizer);
1256         __ ret(0);
1257 
1258         __ bind(register_finalizer);
1259         __ enter();
1260         OopMap* oop_map = save_live_registers(sasm, 2 /*num_rt_args */);
1261         int call_offset = __ call_RT(noreg, noreg,
1262                                      CAST_FROM_FN_PTR(address, SharedRuntime::register_finalizer), rax);
1263         oop_maps = new OopMapSet();
1264         oop_maps->add_gc_map(call_offset, oop_map);
1265 
1266         // Now restore all the live registers
1267         restore_live_registers(sasm);
1268 
1269         __ leave();
1270         __ ret(0);
1271       }
1272       break;




1232     case register_finalizer_id:
1233       {
1234         __ set_info("register_finalizer", dont_gc_arguments);
1235 
1236         // This is called via call_runtime so the arguments
1237         // will be place in C abi locations
1238 
1239 #ifdef _LP64
1240         __ verify_oop(c_rarg0);
1241         __ mov(rax, c_rarg0);
1242 #else
1243         // The object is passed on the stack and we haven't pushed a
1244         // frame yet so it's one work away from top of stack.
1245         __ movptr(rax, Address(rsp, 1 * BytesPerWord));
1246         __ verify_oop(rax);
1247 #endif // _LP64
1248 
1249         // load the klass and check the has finalizer flag
1250         Label register_finalizer;
1251         Register t = rsi;
1252         __ load_klass(t, rax);
1253         __ movl(t, Address(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc)));
1254         __ testl(t, JVM_ACC_HAS_FINALIZER);
1255         __ jcc(Assembler::notZero, register_finalizer);
1256         __ ret(0);
1257 
1258         __ bind(register_finalizer);
1259         __ enter();
1260         OopMap* oop_map = save_live_registers(sasm, 2 /*num_rt_args */);
1261         int call_offset = __ call_RT(noreg, noreg,
1262                                      CAST_FROM_FN_PTR(address, SharedRuntime::register_finalizer), rax);
1263         oop_maps = new OopMapSet();
1264         oop_maps->add_gc_map(call_offset, oop_map);
1265 
1266         // Now restore all the live registers
1267         restore_live_registers(sasm);
1268 
1269         __ leave();
1270         __ ret(0);
1271       }
1272       break;


src/cpu/x86/vm/c1_Runtime1_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File