annotate src/share/vm/opto/macro.hpp @ 66:6dbf1a175d6b

6672848: (Escape Analysis) improve lock elimination with EA Summary: Remove lock/unlock MemBar nodes and specify locks in debug info for deoptimization. Reviewed-by: never
author kvn
date Fri, 14 Mar 2008 16:40:42 -0700
parents a61af66fc99e
children a8880a78d355
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 class AllocateNode;
a61af66fc99e Initial load
duke
parents:
diff changeset
26 class AllocateArrayNode;
a61af66fc99e Initial load
duke
parents:
diff changeset
27 class CallNode;
a61af66fc99e Initial load
duke
parents:
diff changeset
28 class Node;
a61af66fc99e Initial load
duke
parents:
diff changeset
29 class PhaseIterGVN;
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 class PhaseMacroExpand : public Phase {
a61af66fc99e Initial load
duke
parents:
diff changeset
32 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
33 PhaseIterGVN &_igvn;
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // Helper methods roughly modelled after GraphKit:
a61af66fc99e Initial load
duke
parents:
diff changeset
36 Node* top() const { return C->top(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
37 Node* intcon(jint con) const { return _igvn.intcon(con); }
a61af66fc99e Initial load
duke
parents:
diff changeset
38 Node* longcon(jlong con) const { return _igvn.longcon(con); }
a61af66fc99e Initial load
duke
parents:
diff changeset
39 Node* makecon(const Type *t) const { return _igvn.makecon(t); }
a61af66fc99e Initial load
duke
parents:
diff changeset
40 Node* basic_plus_adr(Node* base, int offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 return (offset == 0)? base: basic_plus_adr(base, MakeConX(offset));
a61af66fc99e Initial load
duke
parents:
diff changeset
42 }
a61af66fc99e Initial load
duke
parents:
diff changeset
43 Node* basic_plus_adr(Node* base, Node* ptr, int offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
44 return (offset == 0)? ptr: basic_plus_adr(base, ptr, MakeConX(offset));
a61af66fc99e Initial load
duke
parents:
diff changeset
45 }
a61af66fc99e Initial load
duke
parents:
diff changeset
46 Node* basic_plus_adr(Node* base, Node* offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
47 return basic_plus_adr(base, base, offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
48 }
a61af66fc99e Initial load
duke
parents:
diff changeset
49 Node* basic_plus_adr(Node* base, Node* ptr, Node* offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
50 Node* adr = new (C, 4) AddPNode(base, ptr, offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
51 return transform_later(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
52 }
a61af66fc99e Initial load
duke
parents:
diff changeset
53 Node* transform_later(Node* n) {
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // equivalent to _gvn.transform in GraphKit, Ideal, etc.
a61af66fc99e Initial load
duke
parents:
diff changeset
55 _igvn.register_new_node_with_optimizer(n);
a61af66fc99e Initial load
duke
parents:
diff changeset
56 return n;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 }
a61af66fc99e Initial load
duke
parents:
diff changeset
58 void set_eden_pointers(Node* &eden_top_adr, Node* &eden_end_adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
59 Node* make_load( Node* ctl, Node* mem, Node* base, int offset,
a61af66fc99e Initial load
duke
parents:
diff changeset
60 const Type* value_type, BasicType bt);
a61af66fc99e Initial load
duke
parents:
diff changeset
61 Node* make_store(Node* ctl, Node* mem, Node* base, int offset,
a61af66fc99e Initial load
duke
parents:
diff changeset
62 Node* value, BasicType bt);
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // projections extracted from a call node
a61af66fc99e Initial load
duke
parents:
diff changeset
65 ProjNode *_fallthroughproj;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 ProjNode *_fallthroughcatchproj;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 ProjNode *_ioproj_fallthrough;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 ProjNode *_ioproj_catchall;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 ProjNode *_catchallcatchproj;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 ProjNode *_memproj_fallthrough;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 ProjNode *_memproj_catchall;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 ProjNode *_resproj;
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 void expand_allocate(AllocateNode *alloc);
a61af66fc99e Initial load
duke
parents:
diff changeset
76 void expand_allocate_array(AllocateArrayNode *alloc);
a61af66fc99e Initial load
duke
parents:
diff changeset
77 void expand_allocate_common(AllocateNode* alloc,
a61af66fc99e Initial load
duke
parents:
diff changeset
78 Node* length,
a61af66fc99e Initial load
duke
parents:
diff changeset
79 const TypeFunc* slow_call_type,
a61af66fc99e Initial load
duke
parents:
diff changeset
80 address slow_call_address);
66
6dbf1a175d6b 6672848: (Escape Analysis) improve lock elimination with EA
kvn
parents: 0
diff changeset
81 bool eliminate_locking_node(AbstractLockNode *alock);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
82 void expand_lock_node(LockNode *lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 void expand_unlock_node(UnlockNode *unlock);
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 int replace_input(Node *use, Node *oldref, Node *newref);
a61af66fc99e Initial load
duke
parents:
diff changeset
86 void copy_call_debug_info(CallNode *oldcall, CallNode * newcall);
a61af66fc99e Initial load
duke
parents:
diff changeset
87 Node* opt_iff(Node* region, Node* iff);
a61af66fc99e Initial load
duke
parents:
diff changeset
88 void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
a61af66fc99e Initial load
duke
parents:
diff changeset
89 CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
a61af66fc99e Initial load
duke
parents:
diff changeset
90 const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1);
a61af66fc99e Initial load
duke
parents:
diff changeset
91 void extract_call_projections(CallNode *call);
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 Node* initialize_object(AllocateNode* alloc,
a61af66fc99e Initial load
duke
parents:
diff changeset
94 Node* control, Node* rawmem, Node* object,
a61af66fc99e Initial load
duke
parents:
diff changeset
95 Node* klass_node, Node* length,
a61af66fc99e Initial load
duke
parents:
diff changeset
96 Node* size_in_bytes);
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 Node* prefetch_allocation(Node* i_o,
a61af66fc99e Initial load
duke
parents:
diff changeset
99 Node*& needgc_false, Node*& contended_phi_rawmem,
a61af66fc99e Initial load
duke
parents:
diff changeset
100 Node* old_eden_top, Node* new_eden_top,
a61af66fc99e Initial load
duke
parents:
diff changeset
101 Node* length);
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
104 PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
105 bool expand_macro_nodes();
a61af66fc99e Initial load
duke
parents:
diff changeset
106
a61af66fc99e Initial load
duke
parents:
diff changeset
107 };