3271 LIRItem value(x->recv(), this);
3272 value.load_item();
3273 recv = new_register(T_OBJECT);
3274 __ move(value.result(), recv);
3275 }
3276 __ profile_call(x->method(), x->bci_of_invoke(), x->callee(), mdo, recv, tmp, x->known_holder());
3277 }
3278
3279 void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) {
3280 int bci = x->bci_of_invoke();
3281 ciMethodData* md = x->method()->method_data_or_null();
3282 ciProfileData* data = md->bci_to_data(bci);
3283 assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type");
3284 ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret();
3285 LIR_Opr mdp = LIR_OprFact::illegalOpr;
3286
3287 bool ignored_will_link;
3288 ciSignature* signature_at_call = NULL;
3289 x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
3290
3291 ciKlass* exact = profile_type(md, 0, md->byte_offset_of_slot(data, ret->type_offset()),
3292 ret->type(), x->ret(), mdp,
3293 !x->needs_null_check(),
3294 signature_at_call->return_type()->as_klass(),
3295 x->callee()->signature()->return_type()->as_klass());
3296 if (exact != NULL) {
3297 md->set_return_type(bci, exact);
3298 }
3299 }
3300
3301 void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) {
3302 // We can safely ignore accessors here, since c2 will inline them anyway,
3303 // accessors are also always mature.
3304 if (!x->inlinee()->is_accessor()) {
3305 CodeEmitInfo* info = state_for(x, x->state(), true);
3306 // Notify the runtime very infrequently only to take care of counter overflows
3307 increment_event_counter_impl(info, x->inlinee(), (1 << Tier23InlineeNotifyFreqLog) - 1, InvocationEntryBci, false, true);
3308 }
3309 }
3310
3311 void LIRGenerator::increment_event_counter(CodeEmitInfo* info, int bci, bool backedge) {
|
3271 LIRItem value(x->recv(), this);
3272 value.load_item();
3273 recv = new_register(T_OBJECT);
3274 __ move(value.result(), recv);
3275 }
3276 __ profile_call(x->method(), x->bci_of_invoke(), x->callee(), mdo, recv, tmp, x->known_holder());
3277 }
3278
3279 void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) {
3280 int bci = x->bci_of_invoke();
3281 ciMethodData* md = x->method()->method_data_or_null();
3282 ciProfileData* data = md->bci_to_data(bci);
3283 assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type");
3284 ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret();
3285 LIR_Opr mdp = LIR_OprFact::illegalOpr;
3286
3287 bool ignored_will_link;
3288 ciSignature* signature_at_call = NULL;
3289 x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
3290
3291 ciKlass* exact = profile_type(md, md->byte_offset_of_slot(data, ret->type_offset()), 0,
3292 ret->type(), x->ret(), mdp,
3293 !x->needs_null_check(),
3294 signature_at_call->return_type()->as_klass(),
3295 x->callee()->signature()->return_type()->as_klass());
3296 if (exact != NULL) {
3297 md->set_return_type(bci, exact);
3298 }
3299 }
3300
3301 void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) {
3302 // We can safely ignore accessors here, since c2 will inline them anyway,
3303 // accessors are also always mature.
3304 if (!x->inlinee()->is_accessor()) {
3305 CodeEmitInfo* info = state_for(x, x->state(), true);
3306 // Notify the runtime very infrequently only to take care of counter overflows
3307 increment_event_counter_impl(info, x->inlinee(), (1 << Tier23InlineeNotifyFreqLog) - 1, InvocationEntryBci, false, true);
3308 }
3309 }
3310
3311 void LIRGenerator::increment_event_counter(CodeEmitInfo* info, int bci, bool backedge) {
|