465 if (!obj->is_loaded() || PatchALot) { |
465 if (!obj->is_loaded() || PatchALot) { |
466 assert(info != NULL, "info must be set if class is not loaded"); |
466 assert(info != NULL, "info must be set if class is not loaded"); |
467 __ klass2reg_patch(NULL, r, info); |
467 __ klass2reg_patch(NULL, r, info); |
468 } else { |
468 } else { |
469 // no patching needed |
469 // no patching needed |
470 __ oop2reg(obj->constant_encoding(), r); |
470 __ metadata2reg(obj->constant_encoding(), r); |
471 } |
471 } |
472 } |
472 } |
473 |
473 |
474 |
474 |
475 void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, |
475 void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, |
953 int t = taken_count_offset; |
953 int t = taken_count_offset; |
954 taken_count_offset = not_taken_count_offset; |
954 taken_count_offset = not_taken_count_offset; |
955 not_taken_count_offset = t; |
955 not_taken_count_offset = t; |
956 } |
956 } |
957 |
957 |
958 LIR_Opr md_reg = new_register(T_OBJECT); |
958 LIR_Opr md_reg = new_register(T_METADATA); |
959 __ oop2reg(md->constant_encoding(), md_reg); |
959 __ metadata2reg(md->constant_encoding(), md_reg); |
960 |
960 |
961 LIR_Opr data_offset_reg = new_pointer_register(); |
961 LIR_Opr data_offset_reg = new_pointer_register(); |
962 __ cmove(lir_cond(cond), |
962 __ cmove(lir_cond(cond), |
963 LIR_OprFact::intptrConst(taken_count_offset), |
963 LIR_OprFact::intptrConst(taken_count_offset), |
964 LIR_OprFact::intptrConst(not_taken_count_offset), |
964 LIR_OprFact::intptrConst(not_taken_count_offset), |
1190 BasicTypeList signature; |
1190 BasicTypeList signature; |
1191 signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread |
1191 signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread |
1192 signature.append(T_OBJECT); // Method* |
1192 signature.append(T_OBJECT); // Method* |
1193 LIR_OprList* args = new LIR_OprList(); |
1193 LIR_OprList* args = new LIR_OprList(); |
1194 args->append(getThreadPointer()); |
1194 args->append(getThreadPointer()); |
1195 LIR_Opr meth = new_register(T_OBJECT); |
1195 LIR_Opr meth = new_register(T_METADATA); |
1196 __ oop2reg(method()->constant_encoding(), meth); |
1196 __ metadata2reg(method()->constant_encoding(), meth); |
1197 args->append(meth); |
1197 args->append(meth); |
1198 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), voidType, NULL); |
1198 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), voidType, NULL); |
1199 } |
1199 } |
1200 |
1200 |
1201 if (x->type()->is_void()) { |
1201 if (x->type()->is_void()) { |
2551 offset = md->byte_offset_of_slot(data, BranchData::not_taken_offset()); |
2551 offset = md->byte_offset_of_slot(data, BranchData::not_taken_offset()); |
2552 } else { |
2552 } else { |
2553 assert(data->is_JumpData(), "need JumpData for branches"); |
2553 assert(data->is_JumpData(), "need JumpData for branches"); |
2554 offset = md->byte_offset_of_slot(data, JumpData::taken_offset()); |
2554 offset = md->byte_offset_of_slot(data, JumpData::taken_offset()); |
2555 } |
2555 } |
2556 LIR_Opr md_reg = new_register(T_OBJECT); |
2556 LIR_Opr md_reg = new_register(T_METADATA); |
2557 __ oop2reg(md->constant_encoding(), md_reg); |
2557 __ metadata2reg(md->constant_encoding(), md_reg); |
2558 |
2558 |
2559 increment_counter(new LIR_Address(md_reg, offset, |
2559 increment_counter(new LIR_Address(md_reg, offset, |
2560 NOT_LP64(T_INT) LP64_ONLY(T_LONG)), DataLayout::counter_increment); |
2560 NOT_LP64(T_INT) LP64_ONLY(T_LONG)), DataLayout::counter_increment); |
2561 } |
2561 } |
2562 |
2562 |
2609 BasicTypeList signature; |
2609 BasicTypeList signature; |
2610 signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread |
2610 signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT)); // thread |
2611 signature.append(T_OBJECT); // Method* |
2611 signature.append(T_OBJECT); // Method* |
2612 LIR_OprList* args = new LIR_OprList(); |
2612 LIR_OprList* args = new LIR_OprList(); |
2613 args->append(getThreadPointer()); |
2613 args->append(getThreadPointer()); |
2614 LIR_Opr meth = new_register(T_OBJECT); |
2614 LIR_Opr meth = new_register(T_METADATA); |
2615 __ oop2reg(method()->constant_encoding(), meth); |
2615 __ metadata2reg(method()->constant_encoding(), meth); |
2616 args->append(meth); |
2616 args->append(meth); |
2617 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), voidType, NULL); |
2617 call_runtime(&signature, args, CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), voidType, NULL); |
2618 } |
2618 } |
2619 |
2619 |
2620 if (method()->is_synchronized()) { |
2620 if (method()->is_synchronized()) { |
3030 assert(frequency == 0 || is_power_of_2(frequency + 1), "Frequency must be x^2 - 1 or 0"); |
3030 assert(frequency == 0 || is_power_of_2(frequency + 1), "Frequency must be x^2 - 1 or 0"); |
3031 int level = _compilation->env()->comp_level(); |
3031 int level = _compilation->env()->comp_level(); |
3032 assert(level > CompLevel_simple, "Shouldn't be here"); |
3032 assert(level > CompLevel_simple, "Shouldn't be here"); |
3033 |
3033 |
3034 int offset = -1; |
3034 int offset = -1; |
3035 LIR_Opr counter_holder = new_register(T_OBJECT); |
3035 LIR_Opr counter_holder = new_register(T_METADATA); |
3036 LIR_Opr meth; |
3036 LIR_Opr meth; |
3037 if (level == CompLevel_limited_profile) { |
3037 if (level == CompLevel_limited_profile) { |
3038 offset = in_bytes(backedge ? Method::backedge_counter_offset() : |
3038 offset = in_bytes(backedge ? Method::backedge_counter_offset() : |
3039 Method::invocation_counter_offset()); |
3039 Method::invocation_counter_offset()); |
3040 __ oop2reg(method->constant_encoding(), counter_holder); |
3040 __ metadata2reg(method->constant_encoding(), counter_holder); |
3041 meth = counter_holder; |
3041 meth = counter_holder; |
3042 } else if (level == CompLevel_full_profile) { |
3042 } else if (level == CompLevel_full_profile) { |
3043 offset = in_bytes(backedge ? MethodData::backedge_counter_offset() : |
3043 offset = in_bytes(backedge ? MethodData::backedge_counter_offset() : |
3044 MethodData::invocation_counter_offset()); |
3044 MethodData::invocation_counter_offset()); |
3045 ciMethodData* md = method->method_data_or_null(); |
3045 ciMethodData* md = method->method_data_or_null(); |
3046 assert(md != NULL, "Sanity"); |
3046 assert(md != NULL, "Sanity"); |
3047 __ oop2reg(md->constant_encoding(), counter_holder); |
3047 __ metadata2reg(md->constant_encoding(), counter_holder); |
3048 meth = new_register(T_OBJECT); |
3048 meth = new_register(T_METADATA); |
3049 __ oop2reg(method->constant_encoding(), meth); |
3049 __ metadata2reg(method->constant_encoding(), meth); |
3050 } else { |
3050 } else { |
3051 ShouldNotReachHere(); |
3051 ShouldNotReachHere(); |
3052 } |
3052 } |
3053 LIR_Address* counter = new LIR_Address(counter_holder, offset, T_INT); |
3053 LIR_Address* counter = new LIR_Address(counter_holder, offset, T_INT); |
3054 LIR_Opr result = new_register(T_INT); |
3054 LIR_Opr result = new_register(T_INT); |