< prev index next >

src/share/vm/c1/c1_LIRGenerator.cpp

Print this page

        

*** 1195,1205 **** --- 1195,1209 ---- } if (x->type()->is_void()) { __ return_op(LIR_OprFact::illegalOpr); } else { + #ifdef AARCH32 + LIR_Opr reg = java_result_register_for(x->type(), /*callee=*/true); + #else LIR_Opr reg = result_register_for(x->type(), /*callee=*/true); + #endif LIRItem result(x->result(), this); result.load_item_force(reg); __ return_op(result.result()); }
*** 2925,2935 **** --- 2929,2943 ---- LIR_Opr receiver = LIR_OprFact::illegalOpr; // setup result register LIR_Opr result_register = LIR_OprFact::illegalOpr; if (x->type() != voidType) { + #ifdef AARCH32 + result_register = java_result_register_for(x->type()); + #else result_register = result_register_for(x->type()); + #endif } CodeEmitInfo* info = state_for(x, x->state()); invoke_load_arguments(x, args, arg_list);
*** 3188,3245 **** if (compilation()->profile_arguments()) { int bci = x->bci_of_invoke(); ciMethodData* md = x->method()->method_data_or_null(); ciProfileData* data = md->bci_to_data(bci); if (data != NULL) { ! if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) || ! (data->is_VirtualCallTypeData() && data->as_VirtualCallTypeData()->has_arguments())) { ! ByteSize extra = data->is_CallTypeData() ? CallTypeData::args_data_offset() : VirtualCallTypeData::args_data_offset(); ! int base_offset = md->byte_offset_of_slot(data, extra); ! LIR_Opr mdp = LIR_OprFact::illegalOpr; ! ciTypeStackSlotEntries* args = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args() : ((ciVirtualCallTypeData*)data)->args(); ! Bytecodes::Code bc = x->method()->java_code_at_bci(bci); ! int start = 0; ! int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments(); ! if (x->callee()->is_loaded() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) { ! // first argument is not profiled at call (method handle invoke) ! assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected"); ! start = 1; ! } ! ciSignature* callee_signature = x->callee()->signature(); ! // method handle call to virtual method ! bool has_receiver = x->callee()->is_loaded() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc); ! ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL); ! ! bool ignored_will_link; ! ciSignature* signature_at_call = NULL; ! x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call); ! ciSignatureStream signature_at_call_stream(signature_at_call); ! ! // if called through method handle invoke, some arguments may have been popped ! for (int i = 0; i < stop && i+start < x->nb_profiled_args(); i++) { ! int off = in_bytes(TypeEntriesAtCall::argument_type_offset(i)) - in_bytes(TypeEntriesAtCall::args_data_offset()); ! ciKlass* exact = profile_type(md, base_offset, off, ! args->type(i), x->profiled_arg_at(i+start), mdp, ! !x->arg_needs_null_check(i+start), ! signature_at_call_stream.next_klass(), callee_signature_stream.next_klass()); ! if (exact != NULL) { ! md->set_argument_type(bci, i, exact); ! } } ! } else { #ifdef ASSERT ! Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke()); ! int n = x->nb_profiled_args(); ! assert(MethodData::profile_parameters() && (MethodData::profile_arguments_jsr292_only() || ! (x->inlined() && ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)))), ! "only at JSR292 bytecodes"); #endif - } } } } // profile parameters on entry to an inlined method void LIRGenerator::profile_parameters_at_call(ProfileCall* x) { if (compilation()->profile_parameters() && x->inlined()) { ciMethodData* md = x->callee()->method_data_or_null(); --- 3196,3253 ---- if (compilation()->profile_arguments()) { int bci = x->bci_of_invoke(); ciMethodData* md = x->method()->method_data_or_null(); ciProfileData* data = md->bci_to_data(bci); if (data != NULL) { ! if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) || ! (data->is_VirtualCallTypeData() && data->as_VirtualCallTypeData()->has_arguments())) { ! ByteSize extra = data->is_CallTypeData() ? CallTypeData::args_data_offset() : VirtualCallTypeData::args_data_offset(); ! int base_offset = md->byte_offset_of_slot(data, extra); ! LIR_Opr mdp = LIR_OprFact::illegalOpr; ! ciTypeStackSlotEntries* args = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args() : ((ciVirtualCallTypeData*)data)->args(); ! Bytecodes::Code bc = x->method()->java_code_at_bci(bci); ! int start = 0; ! int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments(); ! if (x->callee()->is_loaded() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) { ! // first argument is not profiled at call (method handle invoke) ! assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected"); ! start = 1; ! } ! ciSignature* callee_signature = x->callee()->signature(); ! // method handle call to virtual method ! bool has_receiver = x->callee()->is_loaded() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc); ! ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL); ! ! bool ignored_will_link; ! ciSignature* signature_at_call = NULL; ! x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call); ! ciSignatureStream signature_at_call_stream(signature_at_call); ! ! // if called through method handle invoke, some arguments may have been popped ! for (int i = 0; i < stop && i+start < x->nb_profiled_args(); i++) { ! int off = in_bytes(TypeEntriesAtCall::argument_type_offset(i)) - in_bytes(TypeEntriesAtCall::args_data_offset()); ! ciKlass* exact = profile_type(md, base_offset, off, ! args->type(i), x->profiled_arg_at(i+start), mdp, ! !x->arg_needs_null_check(i+start), ! signature_at_call_stream.next_klass(), callee_signature_stream.next_klass()); ! if (exact != NULL) { ! md->set_argument_type(bci, i, exact); } ! } ! } else { #ifdef ASSERT ! Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke()); ! int n = x->nb_profiled_args(); ! assert(MethodData::profile_parameters() && (MethodData::profile_arguments_jsr292_only() || ! (x->inlined() && ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)))), ! "only at JSR292 bytecodes"); #endif } } } + } // profile parameters on entry to an inlined method void LIRGenerator::profile_parameters_at_call(ProfileCall* x) { if (compilation()->profile_parameters() && x->inlined()) { ciMethodData* md = x->callee()->method_data_or_null();
*** 3324,3354 **** void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) { int bci = x->bci_of_invoke(); ciMethodData* md = x->method()->method_data_or_null(); ciProfileData* data = md->bci_to_data(bci); if (data != NULL) { ! assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type"); ! ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret(); ! LIR_Opr mdp = LIR_OprFact::illegalOpr; ! ! bool ignored_will_link; ! ciSignature* signature_at_call = NULL; ! x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call); ! ! // The offset within the MDO of the entry to update may be too large ! // to be used in load/store instructions on some platforms. So have ! // profile_type() compute the address of the profile in a register. ! ciKlass* exact = profile_type(md, md->byte_offset_of_slot(data, ret->type_offset()), 0, ! ret->type(), x->ret(), mdp, ! !x->needs_null_check(), ! signature_at_call->return_type()->as_klass(), ! x->callee()->signature()->return_type()->as_klass()); ! if (exact != NULL) { ! md->set_return_type(bci, exact); ! } } } void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) { // We can safely ignore accessors here, since c2 will inline them anyway, // accessors are also always mature. if (!x->inlinee()->is_accessor()) { --- 3332,3362 ---- void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) { int bci = x->bci_of_invoke(); ciMethodData* md = x->method()->method_data_or_null(); ciProfileData* data = md->bci_to_data(bci); if (data != NULL) { ! assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type"); ! ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret(); ! LIR_Opr mdp = LIR_OprFact::illegalOpr; ! ! bool ignored_will_link; ! ciSignature* signature_at_call = NULL; ! x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call); ! ! // The offset within the MDO of the entry to update may be too large ! // to be used in load/store instructions on some platforms. So have ! // profile_type() compute the address of the profile in a register. ! ciKlass* exact = profile_type(md, md->byte_offset_of_slot(data, ret->type_offset()), 0, ! ret->type(), x->ret(), mdp, ! !x->needs_null_check(), ! signature_at_call->return_type()->as_klass(), ! x->callee()->signature()->return_type()->as_klass()); ! if (exact != NULL) { ! md->set_return_type(bci, exact); } } + } void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) { // We can safely ignore accessors here, since c2 will inline them anyway, // accessors are also always mature. if (!x->inlinee()->is_accessor()) {
< prev index next >