1.1 --- a/src/share/vm/opto/idealKit.cpp Wed Jul 15 13:37:35 2009 -0700 1.2 +++ b/src/share/vm/opto/idealKit.cpp Thu Jul 16 14:10:42 2009 -0700 1.3 @@ -34,7 +34,7 @@ 1.4 const uint IdealKit::first_var = TypeFunc::Parms + 1; 1.5 1.6 //----------------------------IdealKit----------------------------------------- 1.7 -IdealKit::IdealKit(PhaseGVN &gvn, Node* control, Node* mem, bool delay_all_transforms) : 1.8 +IdealKit::IdealKit(PhaseGVN &gvn, Node* control, Node* mem, bool delay_all_transforms, bool has_declarations) : 1.9 _gvn(gvn), C(gvn.C) { 1.10 _initial_ctrl = control; 1.11 _initial_memory = mem; 1.12 @@ -47,6 +47,9 @@ 1.13 _pending_cvstates = new (C->node_arena()) GrowableArray<Node*>(C->node_arena(), init_size, 0, 0); 1.14 _delay_transform = new (C->node_arena()) GrowableArray<Node*>(C->node_arena(), init_size, 0, 0); 1.15 DEBUG_ONLY(_state = new (C->node_arena()) GrowableArray<int>(C->node_arena(), init_size, 0, 0)); 1.16 + if (!has_declarations) { 1.17 + declarations_done(); 1.18 + } 1.19 } 1.20 1.21 //-------------------------------if_then------------------------------------- 1.22 @@ -97,7 +100,7 @@ 1.23 //-------------------------------end_if------------------------------------- 1.24 // Merge the "then" and "else" cvstates. 1.25 // 1.26 -// The if_then() pushed the current state for later use 1.27 +// The if_then() pushed a copy of the current state for later use 1.28 // as the initial state for a future "else" clause. The 1.29 // current state then became the initial state for the 1.30 // then clause. If an "else" clause was encountered, it will 1.31 @@ -258,8 +261,8 @@ 1.32 return delay_transform(PhiNode::make(reg, n, ct)); 1.33 } 1.34 1.35 -//-----------------------------declares_done----------------------------------- 1.36 -void IdealKit::declares_done() { 1.37 +//-----------------------------declarations_done------------------------------- 1.38 +void IdealKit::declarations_done() { 1.39 _cvstate = new_cvstate(); // initialize current cvstate 1.40 set_ctrl(_initial_ctrl); // initialize control in current cvstate 1.41 set_all_memory(_initial_memory);// initialize memory in current cvstate 1.42 @@ -277,7 +280,9 @@ 1.43 1.44 //-----------------------------delay_transform----------------------------------- 1.45 Node* IdealKit::delay_transform(Node* n) { 1.46 - gvn().set_type(n, n->bottom_type()); 1.47 + if (!gvn().is_IterGVN() || !gvn().is_IterGVN()->delay_transform()) { 1.48 + gvn().set_type(n, n->bottom_type()); 1.49 + } 1.50 _delay_transform->push(n); 1.51 return n; 1.52 } 1.53 @@ -321,7 +326,9 @@ 1.54 Node* IdealKit::memory(uint alias_idx) { 1.55 MergeMemNode* mem = merged_memory(); 1.56 Node* p = mem->memory_at(alias_idx); 1.57 - _gvn.set_type(p, Type::MEMORY); // must be mapped 1.58 + if (!gvn().is_IterGVN() || !gvn().is_IterGVN()->delay_transform()) { 1.59 + _gvn.set_type(p, Type::MEMORY); // must be mapped 1.60 + } 1.61 return p; 1.62 } 1.63 1.64 @@ -462,9 +469,6 @@ 1.65 const TypePtr* adr_type = TypeRawPtr::BOTTOM; 1.66 uint adr_idx = C->get_alias_index(adr_type); 1.67 1.68 - // Clone initial memory 1.69 - MergeMemNode* cloned_mem = MergeMemNode::make(C, merged_memory()); 1.70 - 1.71 // Slow-path leaf call 1.72 int size = slow_call_type->domain()->cnt(); 1.73 CallNode *call = (CallNode*)new (C, size) CallLeafNode( slow_call_type, slow_call, leaf_name, adr_type); 1.74 @@ -489,9 +493,6 @@ 1.75 1.76 set_ctrl(transform( new (C, 1) ProjNode(call,TypeFunc::Control) )); 1.77 1.78 - // Set the incoming clone of memory as current memory 1.79 - set_all_memory(cloned_mem); 1.80 - 1.81 // Make memory for the call 1.82 Node* mem = _gvn.transform( new (C, 1) ProjNode(call, TypeFunc::Memory) ); 1.83