diff options
author | kvn <none@none> | 2008-03-13 16:31:32 -0700 |
---|---|---|
committer | kvn <none@none> | 2008-03-13 16:31:32 -0700 |
commit | fd2599a60e3412427cc3486e2103ad5e616c02c2 (patch) | |
tree | 8744e77a58e48fde2324feb2b07a4ca69d3b5c21 /src/share/vm/opto/cfgnode.hpp | |
parent | fff714b657393a0247bc3438777c0125ce6fa605 (diff) | |
download | jdk8u_hotspot-fd2599a60e3412427cc3486e2103ad5e616c02c2.tar.gz |
6673473: (Escape Analysis) Add the instance's field information to PhiNode
Summary: Avoid an infinite generation of instance's field values Phi nodes.
Reviewed-by: never
Diffstat (limited to 'src/share/vm/opto/cfgnode.hpp')
-rw-r--r-- | src/share/vm/opto/cfgnode.hpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/share/vm/opto/cfgnode.hpp b/src/share/vm/opto/cfgnode.hpp index b198a5bf7..79811ee6b 100644 --- a/src/share/vm/opto/cfgnode.hpp +++ b/src/share/vm/opto/cfgnode.hpp @@ -110,14 +110,15 @@ class JProjNode : public ProjNode { // input in slot 0. class PhiNode : public TypeNode { const TypePtr* const _adr_type; // non-null only for Type::MEMORY nodes. + const int _inst_id; // Instance id of the memory slice. + const int _inst_index; // Alias index of the instance memory slice. + // Array elements references have the same alias_idx but different offset. + const int _inst_offset; // Offset of the instance memory slice. // Size is bigger to hold the _adr_type field. virtual uint hash() const; // Check the type virtual uint cmp( const Node &n ) const; virtual uint size_of() const { return sizeof(*this); } - // Determine a unique non-trivial input, if any. - // Ignore casts if it helps. Return NULL on failure. - Node* unique_input(PhaseTransform *phase); // Determine if CMoveNode::is_cmove_id can be used at this join point. Node* is_cmove_id(PhaseTransform* phase, int true_path); @@ -127,8 +128,16 @@ public: Input // Input values are [1..len) }; - PhiNode( Node *r, const Type *t, const TypePtr* at = NULL ) - : TypeNode(t,r->req()), _adr_type(at) { + PhiNode( Node *r, const Type *t, const TypePtr* at = NULL, + const int iid = TypeOopPtr::UNKNOWN_INSTANCE, + const int iidx = Compile::AliasIdxTop, + const int ioffs = Type::OffsetTop ) + : TypeNode(t,r->req()), + _adr_type(at), + _inst_id(iid), + _inst_index(iidx), + _inst_offset(ioffs) + { init_class_id(Class_Phi); init_req(0, r); verify_adr_type(); @@ -152,6 +161,10 @@ public: return NULL; // not a copy! } + // Determine a unique non-trivial input, if any. + // Ignore casts if it helps. Return NULL on failure. + Node* unique_input(PhaseTransform *phase); + // Check for a simple dead loop. enum LoopSafety { Safe = 0, Unsafe, UnsafeLoop }; LoopSafety simple_data_loop_check(Node *in) const; @@ -161,6 +174,18 @@ public: virtual int Opcode() const; virtual bool pinned() const { return in(0) != 0; } virtual const TypePtr *adr_type() const { verify_adr_type(true); return _adr_type; } + + const int inst_id() const { return _inst_id; } + const int inst_index() const { return _inst_index; } + const int inst_offset() const { return _inst_offset; } + bool is_same_inst_field(const Type* tp, int id, int index, int offset) { + return type()->basic_type() == tp->basic_type() && + inst_id() == id && + inst_index() == index && + inst_offset() == offset && + type()->higher_equal(tp); + } + virtual const Type *Value( PhaseTransform *phase ) const; virtual Node *Identity( PhaseTransform *phase ); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |