--- old/src/share/vm/opto/macro.hpp 2014-06-13 09:30:23.290023210 +0200 +++ new/src/share/vm/opto/macro.hpp 2014-06-13 09:30:22.901493239 +0200 @@ -37,7 +37,7 @@ private: PhaseIterGVN &_igvn; - // Helper methods roughly modelled after GraphKit: + // Helper methods roughly modeled after GraphKit: Node* top() const { return C->top(); } Node* intcon(jint con) const { return _igvn.intcon(con); } Node* longcon(jlong con) const { return _igvn.longcon(con); } @@ -101,6 +101,86 @@ void expand_lock_node(LockNode *lock); void expand_unlock_node(UnlockNode *unlock); + // More helper methods modeled after GraphKit for array copy + void insert_mem_bar(Node** ctrl, Node** mem, int opcode, Node* precedent = NULL); + Node* array_element_address(Node* ary, Node* idx, BasicType elembt); + Node* ConvI2L(Node* offset); + Node* make_leaf_call(Node* ctrl, Node* mem, + const TypeFunc* call_type, address call_addr, + const char* call_name, + const TypePtr* adr_type, + Node* parm0 = NULL, Node* parm1 = NULL, + Node* parm2 = NULL, Node* parm3 = NULL, + Node* parm4 = NULL, Node* parm5 = NULL, + Node* parm6 = NULL, Node* parm7 = NULL); + + // helper methods modeled after LibraryCallKit for array copy + Node* generate_guard(Node** ctrl, Node* test, RegionNode* region, float true_prob); + Node* generate_slow_guard(Node** ctrl, Node* test, RegionNode* region); + void generate_negative_guard(Node** ctrl, Node* index, RegionNode* region); + void generate_limit_guard(Node** ctrl, Node* offset, Node* subseq_length, Node* array_length, RegionNode* region); + + // More helper methods for array copy + Node* generate_nonpositive_guard(Node** ctrl, Node* index, bool never_negative); + void finish_arraycopy_call(Node* call, Node** ctrl, MergeMemNode** mem, const TypePtr* adr_type); + address basictype2arraycopy(BasicType t, + Node* src_offset, + Node* dest_offset, + bool disjoint_bases, + const char* &name, + bool dest_uninitialized); + Node* generate_arraycopy(ArrayCopyNode *ac, + AllocateArrayNode* alloc, + Node** ctrl, MergeMemNode* mem, Node** io, + const TypePtr* adr_type, + BasicType basic_elem_type, + Node* src, Node* src_offset, + Node* dest, Node* dest_offset, + Node* copy_length, + bool disjoint_bases = false, + bool length_never_negative = false, + RegionNode* slow_region = NULL); + void generate_clear_array(Node* ctrl, MergeMemNode* merge_mem, + const TypePtr* adr_type, + Node* dest, + BasicType basic_elem_type, + Node* slice_idx, + Node* slice_len, + Node* dest_size); + bool generate_block_arraycopy(Node** ctrl, MergeMemNode** mem, Node* io, + const TypePtr* adr_type, + BasicType basic_elem_type, + AllocateNode* alloc, + Node* src, Node* src_offset, + Node* dest, Node* dest_offset, + Node* dest_size, bool dest_uninitialized); + MergeMemNode* generate_slow_arraycopy(ArrayCopyNode *ac, + Node** ctrl, Node* mem, Node** io, + const TypePtr* adr_type, + Node* src, Node* src_offset, + Node* dest, Node* dest_offset, + Node* copy_length, bool dest_uninitialized); + Node* generate_checkcast_arraycopy(Node** ctrl, MergeMemNode** mem, + const TypePtr* adr_type, + Node* dest_elem_klass, + Node* src, Node* src_offset, + Node* dest, Node* dest_offset, + Node* copy_length, bool dest_uninitialized); + Node* generate_generic_arraycopy(Node** ctrl, MergeMemNode** mem, + const TypePtr* adr_type, + Node* src, Node* src_offset, + Node* dest, Node* dest_offset, + Node* copy_length, bool dest_uninitialized); + void generate_unchecked_arraycopy(Node** ctrl, MergeMemNode** mem, + const TypePtr* adr_type, + BasicType basic_elem_type, + bool disjoint_bases, + Node* src, Node* src_offset, + Node* dest, Node* dest_offset, + Node* copy_length, bool dest_uninitialized); + + void expand_arraycopy_node(ArrayCopyNode *ac); + int replace_input(Node *use, Node *oldref, Node *newref); void copy_call_debug_info(CallNode *oldcall, CallNode * newcall); Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path = false);