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




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




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


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