src/share/vm/opto/callnode.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/callnode.hpp Mon Jan 19 10:37:00 2015
--- new/src/share/vm/opto/callnode.hpp Mon Jan 19 10:37:00 2015
*** 1061,1179 ****
--- 1061,1066 ----
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
// unlock is never a safepoint
virtual bool guaranteed_safepoint() { return false; }
};
class GraphKit;
class ArrayCopyNode : public CallNode {
private:
// What kind of arraycopy variant is this?
enum {
None, // not set yet
ArrayCopy, // System.arraycopy()
CloneBasic, // A clone that can be copied by 64 bit chunks
CloneOop, // An oop array clone
CopyOf, // Arrays.copyOf()
CopyOfRange // Arrays.copyOfRange()
} _kind;
#ifndef PRODUCT
static const char* _kind_names[CopyOfRange+1];
#endif
// Is the alloc obtained with
// AllocateArrayNode::Ideal_array_allocation() tighly coupled
// (arraycopy follows immediately the allocation)?
// We cache the result of LibraryCallKit::tightly_coupled_allocation
// here because it's much easier to find whether there's a tightly
// couple allocation at parse time than at macro expansion time. At
// macro expansion time, for every use of the allocation node we
// would need to figure out whether it happens after the arraycopy (and
// can be ignored) or between the allocation and the arraycopy. At
// parse time, it's straightforward because whatever happens after
// the arraycopy is not parsed yet so doesn't exist when
// LibraryCallKit::tightly_coupled_allocation() is called.
bool _alloc_tightly_coupled;
bool _arguments_validated;
static const TypeFunc* arraycopy_type() {
const Type** fields = TypeTuple::fields(ParmLimit - TypeFunc::Parms);
fields[Src] = TypeInstPtr::BOTTOM;
fields[SrcPos] = TypeInt::INT;
fields[Dest] = TypeInstPtr::BOTTOM;
fields[DestPos] = TypeInt::INT;
fields[Length] = TypeInt::INT;
fields[SrcLen] = TypeInt::INT;
fields[DestLen] = TypeInt::INT;
fields[SrcKlass] = TypeKlassPtr::BOTTOM;
fields[DestKlass] = TypeKlassPtr::BOTTOM;
const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
// create result type (range)
fields = TypeTuple::fields(0);
const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
return TypeFunc::make(domain, range);
}
ArrayCopyNode(Compile* C, bool alloc_tightly_coupled);
int get_count(PhaseGVN *phase) const;
static const TypePtr* get_address_type(PhaseGVN *phase, Node* n);
Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count);
bool finish_transform(PhaseGVN *phase, bool can_reshape,
Node* ctl, Node *mem);
public:
enum {
Src = TypeFunc::Parms,
SrcPos,
Dest,
DestPos,
Length,
SrcLen,
DestLen,
SrcKlass,
DestKlass,
ParmLimit
};
static ArrayCopyNode* make(GraphKit* kit, bool may_throw,
Node* src, Node* src_offset,
Node* dest, Node* dest_offset,
Node* length,
bool alloc_tightly_coupled,
Node* src_klass = NULL, Node* dest_klass = NULL,
Node* src_length = NULL, Node* dest_length = NULL);
void connect_outputs(GraphKit* kit);
bool is_arraycopy() const { assert(_kind != None, "should bet set"); return _kind == ArrayCopy; }
bool is_arraycopy_validated() const { assert(_kind != None, "should bet set"); return _kind == ArrayCopy && _arguments_validated; }
bool is_clonebasic() const { assert(_kind != None, "should bet set"); return _kind == CloneBasic; }
bool is_cloneoop() const { assert(_kind != None, "should bet set"); return _kind == CloneOop; }
bool is_copyof() const { assert(_kind != None, "should bet set"); return _kind == CopyOf; }
bool is_copyofrange() const { assert(_kind != None, "should bet set"); return _kind == CopyOfRange; }
void set_arraycopy(bool validated) { assert(_kind == None, "shouldn't bet set yet"); _kind = ArrayCopy; _arguments_validated = validated; }
void set_clonebasic() { assert(_kind == None, "shouldn't bet set yet"); _kind = CloneBasic; }
void set_cloneoop() { assert(_kind == None, "shouldn't bet set yet"); _kind = CloneOop; }
void set_copyof() { assert(_kind == None, "shouldn't bet set yet"); _kind = CopyOf; _arguments_validated = false; }
void set_copyofrange() { assert(_kind == None, "shouldn't bet set yet"); _kind = CopyOfRange; _arguments_validated = false; }
virtual int Opcode() const;
virtual uint size_of() const; // Size is bigger
virtual bool guaranteed_safepoint() { return false; }
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
bool is_alloc_tightly_coupled() const { return _alloc_tightly_coupled; }
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
};
#endif // SHARE_VM_OPTO_CALLNODE_HPP
src/share/vm/opto/callnode.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File