comparison src/share/vm/c1/c1_LIRGenerator.cpp @ 989:148e5441d916

6863023: need non-perm oops in code cache for JSR 292 Summary: Make a special root-list for those few nmethods which might contain non-perm oops. Reviewed-by: twisti, kvn, never, jmasa, ysr
author jrose
date Tue, 15 Sep 2009 21:53:47 -0700
parents c6386080541b
children 323bd24c6520
comparison
equal deleted inserted replaced
987:00977607da34 989:148e5441d916
438 if (!obj->is_loaded() || PatchALot) { 438 if (!obj->is_loaded() || PatchALot) {
439 assert(info != NULL, "info must be set if class is not loaded"); 439 assert(info != NULL, "info must be set if class is not loaded");
440 __ oop2reg_patch(NULL, r, info); 440 __ oop2reg_patch(NULL, r, info);
441 } else { 441 } else {
442 // no patching needed 442 // no patching needed
443 __ oop2reg(obj->encoding(), r); 443 __ oop2reg(obj->constant_encoding(), r);
444 } 444 }
445 } 445 }
446 446
447 447
448 void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, 448 void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index,
829 assert(data != NULL, "must have profiling data"); 829 assert(data != NULL, "must have profiling data");
830 assert(data->is_BranchData(), "need BranchData for two-way branches"); 830 assert(data->is_BranchData(), "need BranchData for two-way branches");
831 int taken_count_offset = md->byte_offset_of_slot(data, BranchData::taken_offset()); 831 int taken_count_offset = md->byte_offset_of_slot(data, BranchData::taken_offset());
832 int not_taken_count_offset = md->byte_offset_of_slot(data, BranchData::not_taken_offset()); 832 int not_taken_count_offset = md->byte_offset_of_slot(data, BranchData::not_taken_offset());
833 LIR_Opr md_reg = new_register(T_OBJECT); 833 LIR_Opr md_reg = new_register(T_OBJECT);
834 __ move(LIR_OprFact::oopConst(md->encoding()), md_reg); 834 __ move(LIR_OprFact::oopConst(md->constant_encoding()), md_reg);
835 LIR_Opr data_offset_reg = new_register(T_INT); 835 LIR_Opr data_offset_reg = new_register(T_INT);
836 __ cmove(lir_cond(cond), 836 __ cmove(lir_cond(cond),
837 LIR_OprFact::intConst(taken_count_offset), 837 LIR_OprFact::intConst(taken_count_offset),
838 LIR_OprFact::intConst(not_taken_count_offset), 838 LIR_OprFact::intConst(not_taken_count_offset),
839 data_offset_reg); 839 data_offset_reg);
1069 signature.append(T_INT); // thread 1069 signature.append(T_INT); // thread
1070 signature.append(T_OBJECT); // methodOop 1070 signature.append(T_OBJECT); // methodOop
1071 LIR_OprList* args = new LIR_OprList(); 1071 LIR_OprList* args = new LIR_OprList();
1072 args->append(getThreadPointer()); 1072 args->append(getThreadPointer());
1073 LIR_Opr meth = new_register(T_OBJECT); 1073 LIR_Opr meth = new_register(T_OBJECT);
1074 __ oop2reg(method()->encoding(), meth); 1074 __ oop2reg(method()->constant_encoding(), meth);
1075 args->append(meth); 1075 args->append(meth);
1076 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), voidType, NULL); 1076 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), voidType, NULL);
1077 } 1077 }
1078 1078
1079 if (x->type()->is_void()) { 1079 if (x->type()->is_void()) {
1782 signature.append(T_INT); // thread 1782 signature.append(T_INT); // thread
1783 signature.append(T_OBJECT); // methodOop 1783 signature.append(T_OBJECT); // methodOop
1784 LIR_OprList* args = new LIR_OprList(); 1784 LIR_OprList* args = new LIR_OprList();
1785 args->append(getThreadPointer()); 1785 args->append(getThreadPointer());
1786 LIR_Opr meth = new_register(T_OBJECT); 1786 LIR_Opr meth = new_register(T_OBJECT);
1787 __ oop2reg(method()->encoding(), meth); 1787 __ oop2reg(method()->constant_encoding(), meth);
1788 args->append(meth); 1788 args->append(meth);
1789 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), voidType, NULL); 1789 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), voidType, NULL);
1790 } 1790 }
1791 1791
1792 // move exception oop into fixed register 1792 // move exception oop into fixed register
2205 signature.append(T_INT); // thread 2205 signature.append(T_INT); // thread
2206 signature.append(T_OBJECT); // methodOop 2206 signature.append(T_OBJECT); // methodOop
2207 LIR_OprList* args = new LIR_OprList(); 2207 LIR_OprList* args = new LIR_OprList();
2208 args->append(getThreadPointer()); 2208 args->append(getThreadPointer());
2209 LIR_Opr meth = new_register(T_OBJECT); 2209 LIR_Opr meth = new_register(T_OBJECT);
2210 __ oop2reg(method()->encoding(), meth); 2210 __ oop2reg(method()->constant_encoding(), meth);
2211 args->append(meth); 2211 args->append(meth);
2212 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), voidType, NULL); 2212 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), voidType, NULL);
2213 } 2213 }
2214 2214
2215 if (method()->is_synchronized()) { 2215 if (method()->is_synchronized()) {
2216 LIR_Opr obj; 2216 LIR_Opr obj;
2217 if (method()->is_static()) { 2217 if (method()->is_static()) {
2218 obj = new_register(T_OBJECT); 2218 obj = new_register(T_OBJECT);
2219 __ oop2reg(method()->holder()->java_mirror()->encoding(), obj); 2219 __ oop2reg(method()->holder()->java_mirror()->constant_encoding(), obj);
2220 } else { 2220 } else {
2221 Local* receiver = x->state()->local_at(0)->as_Local(); 2221 Local* receiver = x->state()->local_at(0)->as_Local();
2222 assert(receiver != NULL, "must already exist"); 2222 assert(receiver != NULL, "must already exist");
2223 obj = receiver->operand(); 2223 obj = receiver->operand();
2224 } 2224 }
2658 offset = in_bytes(methodOopDesc::backedge_counter_offset() + 2658 offset = in_bytes(methodOopDesc::backedge_counter_offset() +
2659 InvocationCounter::counter_offset()); 2659 InvocationCounter::counter_offset());
2660 } 2660 }
2661 2661
2662 LIR_Opr meth = new_register(T_OBJECT); 2662 LIR_Opr meth = new_register(T_OBJECT);
2663 __ oop2reg(method()->encoding(), meth); 2663 __ oop2reg(method()->constant_encoding(), meth);
2664 LIR_Opr result = increment_and_return_counter(meth, offset, InvocationCounter::count_increment); 2664 LIR_Opr result = increment_and_return_counter(meth, offset, InvocationCounter::count_increment);
2665 __ cmp(lir_cond_aboveEqual, result, LIR_OprFact::intConst(limit)); 2665 __ cmp(lir_cond_aboveEqual, result, LIR_OprFact::intConst(limit));
2666 CodeStub* overflow = new CounterOverflowStub(info, info->bci()); 2666 CodeStub* overflow = new CounterOverflowStub(info, info->bci());
2667 __ branch(lir_cond_aboveEqual, T_INT, overflow); 2667 __ branch(lir_cond_aboveEqual, T_INT, overflow);
2668 __ branch_destination(overflow->continuation()); 2668 __ branch_destination(overflow->continuation());