68
69 // projections extracted from a call node
70 ProjNode *_fallthroughproj;
71 ProjNode *_fallthroughcatchproj;
72 ProjNode *_ioproj_fallthrough;
73 ProjNode *_ioproj_catchall;
74 ProjNode *_catchallcatchproj;
75 ProjNode *_memproj_fallthrough;
76 ProjNode *_memproj_catchall;
77 ProjNode *_resproj;
78
79 // Additional data collected during macro expansion
80 bool _has_locks;
81
82 void expand_allocate(AllocateNode *alloc);
83 void expand_allocate_array(AllocateArrayNode *alloc);
84 void expand_allocate_common(AllocateNode* alloc,
85 Node* length,
86 const TypeFunc* slow_call_type,
87 address slow_call_address);
88 Node *value_from_mem(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc);
89 Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc, Node_Stack *value_phis, int level);
90
91 bool eliminate_boxing_node(CallStaticJavaNode *boxing);
92 bool eliminate_allocate_node(AllocateNode *alloc);
93 bool can_eliminate_allocation(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints);
94 bool scalar_replacement(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints_done);
95 void process_users_of_allocation(CallNode *alloc);
96
97 void eliminate_card_mark(Node *cm);
98 void mark_eliminated_box(Node* box, Node* obj);
99 void mark_eliminated_locking_nodes(AbstractLockNode *alock);
100 bool eliminate_locking_node(AbstractLockNode *alock);
101 void expand_lock_node(LockNode *lock);
102 void expand_unlock_node(UnlockNode *unlock);
103
104 // More helper methods modeled after GraphKit for array copy
105 void insert_mem_bar(Node** ctrl, Node** mem, int opcode, Node* precedent = NULL);
106 Node* array_element_address(Node* ary, Node* idx, BasicType elembt);
107 Node* ConvI2L(Node* offset);
108 Node* make_leaf_call(Node* ctrl, Node* mem,
109 const TypeFunc* call_type, address call_addr,
182 void expand_arraycopy_node(ArrayCopyNode *ac);
183
184 int replace_input(Node *use, Node *oldref, Node *newref);
185 void copy_call_debug_info(CallNode *oldcall, CallNode * newcall);
186 Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path = false);
187 void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
188 CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
189 const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1,
190 Node* parm2);
191 void extract_call_projections(CallNode *call);
192
193 Node* initialize_object(AllocateNode* alloc,
194 Node* control, Node* rawmem, Node* object,
195 Node* klass_node, Node* length,
196 Node* size_in_bytes);
197
198 Node* prefetch_allocation(Node* i_o,
199 Node*& needgc_false, Node*& contended_phi_rawmem,
200 Node* old_eden_top, Node* new_eden_top,
201 Node* length);
202
203 public:
204 PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn), _has_locks(false) {
205 _igvn.set_delay_transform(true);
206 }
207 void eliminate_macro_nodes();
208 bool expand_macro_nodes();
209
210 };
211
212 #endif // SHARE_VM_OPTO_MACRO_HPP
|
68
69 // projections extracted from a call node
70 ProjNode *_fallthroughproj;
71 ProjNode *_fallthroughcatchproj;
72 ProjNode *_ioproj_fallthrough;
73 ProjNode *_ioproj_catchall;
74 ProjNode *_catchallcatchproj;
75 ProjNode *_memproj_fallthrough;
76 ProjNode *_memproj_catchall;
77 ProjNode *_resproj;
78
79 // Additional data collected during macro expansion
80 bool _has_locks;
81
82 void expand_allocate(AllocateNode *alloc);
83 void expand_allocate_array(AllocateArrayNode *alloc);
84 void expand_allocate_common(AllocateNode* alloc,
85 Node* length,
86 const TypeFunc* slow_call_type,
87 address slow_call_address);
88 Node *value_from_mem(Node *mem, Node *ctl, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, AllocateNode *alloc);
89 Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, AllocateNode *alloc, Node_Stack *value_phis, int level);
90
91 bool eliminate_boxing_node(CallStaticJavaNode *boxing);
92 bool eliminate_allocate_node(AllocateNode *alloc);
93 bool can_eliminate_allocation(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints);
94 bool scalar_replacement(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints_done);
95 void process_users_of_allocation(CallNode *alloc);
96
97 void eliminate_card_mark(Node *cm);
98 void mark_eliminated_box(Node* box, Node* obj);
99 void mark_eliminated_locking_nodes(AbstractLockNode *alock);
100 bool eliminate_locking_node(AbstractLockNode *alock);
101 void expand_lock_node(LockNode *lock);
102 void expand_unlock_node(UnlockNode *unlock);
103
104 // More helper methods modeled after GraphKit for array copy
105 void insert_mem_bar(Node** ctrl, Node** mem, int opcode, Node* precedent = NULL);
106 Node* array_element_address(Node* ary, Node* idx, BasicType elembt);
107 Node* ConvI2L(Node* offset);
108 Node* make_leaf_call(Node* ctrl, Node* mem,
109 const TypeFunc* call_type, address call_addr,
182 void expand_arraycopy_node(ArrayCopyNode *ac);
183
184 int replace_input(Node *use, Node *oldref, Node *newref);
185 void copy_call_debug_info(CallNode *oldcall, CallNode * newcall);
186 Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path = false);
187 void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
188 CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
189 const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1,
190 Node* parm2);
191 void extract_call_projections(CallNode *call);
192
193 Node* initialize_object(AllocateNode* alloc,
194 Node* control, Node* rawmem, Node* object,
195 Node* klass_node, Node* length,
196 Node* size_in_bytes);
197
198 Node* prefetch_allocation(Node* i_o,
199 Node*& needgc_false, Node*& contended_phi_rawmem,
200 Node* old_eden_top, Node* new_eden_top,
201 Node* length);
202
203 Node* handle_arraycopy(ArrayCopyNode* ac, intptr_t offset, Node* ctl, BasicType ft, const Type *ftype, AllocateNode *alloc);
204
205 public:
206 PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn), _has_locks(false) {
207 _igvn.set_delay_transform(true);
208 }
209 void eliminate_macro_nodes();
210 bool expand_macro_nodes();
211
212 };
213
214 #endif // SHARE_VM_OPTO_MACRO_HPP
|