src/share/vm/opto/escape.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/escape.hpp	Tue Nov  1 11:32:54 2011
--- new/src/share/vm/opto/escape.hpp	Tue Nov  1 11:32:53 2011

*** 72,100 **** --- 72,101 ---- // to the static memory. // // C2 does not have local variables. However for the purposes of constructing // the connection graph, the following IR nodes are treated as local variables: // Phi (pointer values) ! // LoadP, LoadN // Proj#5 (value returned from callnodes including allocations) // CheckCastPP, CastPP // // The LoadP, Proj and CheckCastPP behave like variables assigned to only once. // Only a Phi can have multiple assignments. Each input to a Phi is treated // as an assignment to it. // // The following node types are JavaObject: // ! // top() ! // phantom_object (general globally escaped object) // Allocate // AllocateArray // Parm (for incoming arguments) // CastX2P ("unsafe" operations) // CreateEx // ConP // LoadKlass // ThreadLocal + // CallStaticJava (which returns Object) // // AddP nodes are fields. // // After building the graph, a pass is made over the nodes, deleting deferred // nodes and copying the edges from the target of the deferred edge to the
*** 129,141 **** --- 130,144 ---- } NodeType; typedef enum { UnknownEscape = 0, NoEscape = 1, // A scalar replaceable object with unique type. ArgEscape = 2, // An object passed as argument or referenced by + ControlEscape = 2, // Complex control flow or some limitations do not + // allow scalar replacement of not escaping object. + ArgEscape = 3, // An object passed as argument or referenced by // argument (and not globally escape during call). ! GlobalEscape = 3 // An object escapes the method and thread. ! GlobalEscape = 4 // An object escapes the method and thread. } EscapeState; typedef enum { UnknownEdge = 0, PointsToEdge = 1,
*** 152,177 **** --- 155,174 ---- }; NodeType _type; EscapeState _escape; GrowableArray<uint>* _edges; // outgoing edges public: Node* _node; // Ideal node corresponding to this PointsTo node. int _offset; // Object fields offsets. bool _scalar_replaceable;// Not escaped object could be replaced with scalar bool _hidden_alias; // This node is an argument to a function. // which may return it creating a hidden alias. + public: PointsToNode(): _type(UnknownType), _escape(UnknownEscape), _edges(NULL), _node(NULL), ! _offset(-1), _scalar_replaceable(true), _hidden_alias(false) {} ! _offset(-1) {} EscapeState escape_state() const { return _escape; } NodeType node_type() const { return _type;} int offset() { return _offset;}
*** 231,242 **** --- 228,239 ---- uint _phantom_object; // Index of globally escaping object // that pointer values loaded from // a field which has not been set // are assumed to point to. ! uint _oop_null; // ConP(#NULL)->_idx ! uint _noop_null; // ConN(#NULL)->_idx Compile * _compile; // Compile object for current compilation PhaseIterGVN * _igvn; // Value numbering // Address of an element in _nodes. Used when the element is to be modified
*** 337,349 **** --- 334,354 ---- } // Set the escape state of a node void set_escape_state(uint ni, PointsToNode::EscapeState es); + // Find fields initializing values for allocations. + void find_init_values(Node* n, VectorSet* visited, PhaseTransform* phase); + // Adjust escape state after Connection Graph is built. ! void adjust_escape_state(int nidx, PhaseTransform* phase); ! void adjust_escape_state(Node* n); + // Propagate escape states to referenced nodes. + bool propagate_escape_state(GrowableArray<int>* cg_worklist, + GrowableArray<uint>* worklist, + PointsToNode::EscapeState esc_state); + // Compute the escape information bool compute_escape(); public: ConnectionGraph(Compile *C, PhaseIterGVN *igvn);
*** 355,379 **** --- 360,369 ---- static void do_analysis(Compile *C, PhaseIterGVN *igvn); // escape state of a node PointsToNode::EscapeState escape_state(Node *n); // other information we have collected bool is_scalar_replaceable(Node *n) { if (_collecting || (n->_idx >= nodes_size())) return false; PointsToNode* ptn = ptnode_adr(n->_idx); return ptn->escape_state() == PointsToNode::NoEscape && ptn->_scalar_replaceable; } bool hidden_alias(Node *n) { if (_collecting || (n->_idx >= nodes_size())) return true; PointsToNode* ptn = ptnode_adr(n->_idx); return (ptn->escape_state() != PointsToNode::NoEscape) || ptn->_hidden_alias; } #ifndef PRODUCT void dump(); #endif };

src/share/vm/opto/escape.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File