2924 bool aligned = false;
2925 if (offset != NULL && head->init_trip()->is_Con()) {
2926 int element_size = type2aelembytes(t);
2927 aligned = (offset->find_intptr_t_type()->get_con() + head->init_trip()->get_int() * element_size) % HeapWordSize == 0;
2928 }
2929
2930 // Build a call to the fill routine
2931 const char* fill_name;
2932 address fill = StubRoutines::select_fill_function(t, aligned, fill_name);
2933 assert(fill != NULL, "what?");
2934
2935 // Convert float/double to int/long for fill routines
2936 if (t == T_FLOAT) {
2937 store_value = new MoveF2INode(store_value);
2938 _igvn.register_new_node_with_optimizer(store_value);
2939 } else if (t == T_DOUBLE) {
2940 store_value = new MoveD2LNode(store_value);
2941 _igvn.register_new_node_with_optimizer(store_value);
2942 }
2943
2944 if (CCallingConventionRequiresIntsAsLongs &&
2945 // See StubRoutines::select_fill_function for types. FLOAT has been converted to INT.
2946 (t == T_FLOAT || t == T_INT || is_subword_type(t))) {
2947 store_value = new ConvI2LNode(store_value);
2948 _igvn.register_new_node_with_optimizer(store_value);
2949 }
2950
2951 Node* mem_phi = store->in(MemNode::Memory);
2952 Node* result_ctrl;
2953 Node* result_mem;
2954 const TypeFunc* call_type = OptoRuntime::array_fill_Type();
2955 CallLeafNode *call = new CallLeafNoFPNode(call_type, fill,
2956 fill_name, TypeAryPtr::get_array_body_type(t));
2957 uint cnt = 0;
2958 call->init_req(TypeFunc::Parms + cnt++, from);
2959 call->init_req(TypeFunc::Parms + cnt++, store_value);
2960 if (CCallingConventionRequiresIntsAsLongs) {
2961 call->init_req(TypeFunc::Parms + cnt++, C->top());
2962 }
2963 #ifdef _LP64
2964 len = new ConvI2LNode(len);
2965 _igvn.register_new_node_with_optimizer(len);
2966 #endif
2967 call->init_req(TypeFunc::Parms + cnt++, len);
2968 #ifdef _LP64
2969 call->init_req(TypeFunc::Parms + cnt++, C->top());
2970 #endif
2971 call->init_req(TypeFunc::Control, head->init_control());
2972 call->init_req(TypeFunc::I_O, C->top()); // Does no I/O.
2973 call->init_req(TypeFunc::Memory, mem_phi->in(LoopNode::EntryControl));
2974 call->init_req(TypeFunc::ReturnAdr, C->start()->proj_out(TypeFunc::ReturnAdr));
2975 call->init_req(TypeFunc::FramePtr, C->start()->proj_out(TypeFunc::FramePtr));
2976 _igvn.register_new_node_with_optimizer(call);
2977 result_ctrl = new ProjNode(call,TypeFunc::Control);
2978 _igvn.register_new_node_with_optimizer(result_ctrl);
2979 result_mem = new ProjNode(call,TypeFunc::Memory);
2980 _igvn.register_new_node_with_optimizer(result_mem);
2981
2982 /* Disable following optimization until proper fix (add missing checks).
|
2924 bool aligned = false;
2925 if (offset != NULL && head->init_trip()->is_Con()) {
2926 int element_size = type2aelembytes(t);
2927 aligned = (offset->find_intptr_t_type()->get_con() + head->init_trip()->get_int() * element_size) % HeapWordSize == 0;
2928 }
2929
2930 // Build a call to the fill routine
2931 const char* fill_name;
2932 address fill = StubRoutines::select_fill_function(t, aligned, fill_name);
2933 assert(fill != NULL, "what?");
2934
2935 // Convert float/double to int/long for fill routines
2936 if (t == T_FLOAT) {
2937 store_value = new MoveF2INode(store_value);
2938 _igvn.register_new_node_with_optimizer(store_value);
2939 } else if (t == T_DOUBLE) {
2940 store_value = new MoveD2LNode(store_value);
2941 _igvn.register_new_node_with_optimizer(store_value);
2942 }
2943
2944 Node* mem_phi = store->in(MemNode::Memory);
2945 Node* result_ctrl;
2946 Node* result_mem;
2947 const TypeFunc* call_type = OptoRuntime::array_fill_Type();
2948 CallLeafNode *call = new CallLeafNoFPNode(call_type, fill,
2949 fill_name, TypeAryPtr::get_array_body_type(t));
2950 uint cnt = 0;
2951 call->init_req(TypeFunc::Parms + cnt++, from);
2952 call->init_req(TypeFunc::Parms + cnt++, store_value);
2953 #ifdef _LP64
2954 len = new ConvI2LNode(len);
2955 _igvn.register_new_node_with_optimizer(len);
2956 #endif
2957 call->init_req(TypeFunc::Parms + cnt++, len);
2958 #ifdef _LP64
2959 call->init_req(TypeFunc::Parms + cnt++, C->top());
2960 #endif
2961 call->init_req(TypeFunc::Control, head->init_control());
2962 call->init_req(TypeFunc::I_O, C->top()); // Does no I/O.
2963 call->init_req(TypeFunc::Memory, mem_phi->in(LoopNode::EntryControl));
2964 call->init_req(TypeFunc::ReturnAdr, C->start()->proj_out(TypeFunc::ReturnAdr));
2965 call->init_req(TypeFunc::FramePtr, C->start()->proj_out(TypeFunc::FramePtr));
2966 _igvn.register_new_node_with_optimizer(call);
2967 result_ctrl = new ProjNode(call,TypeFunc::Control);
2968 _igvn.register_new_node_with_optimizer(result_ctrl);
2969 result_mem = new ProjNode(call,TypeFunc::Memory);
2970 _igvn.register_new_node_with_optimizer(result_mem);
2971
2972 /* Disable following optimization until proper fix (add missing checks).
|