comparison src/share/vm/opto/idealKit.cpp @ 2383:9dc311b8473e

7008866: Missing loop predicate for loop with multiple entries Summary: Add predicates when loop head bytecode is parsed instead of when back branch bytecode is parsed. Reviewed-by: never
author kvn
date Mon, 21 Mar 2011 11:28:14 -0700
parents f95d63e2154a
children 1d1603768966 07acc51c1d2a
comparison
equal deleted inserted replaced
2382:3ef1a1866a60 2383:9dc311b8473e
152 // goto top 152 // goto top
153 // * } else // exits loop 153 // * } else // exits loop
154 // 154 //
155 // Pushes the loop top cvstate first, then the else (loop exit) cvstate 155 // Pushes the loop top cvstate first, then the else (loop exit) cvstate
156 // onto the stack. 156 // onto the stack.
157 void IdealKit::loop(IdealVariable& iv, Node* init, BoolTest::mask relop, Node* limit, float prob, float cnt) { 157 void IdealKit::loop(GraphKit* gkit, int nargs, IdealVariable& iv, Node* init, BoolTest::mask relop, Node* limit, float prob, float cnt) {
158 assert((state() & (BlockS|LoopS|IfThenS|ElseS)), "bad state for new loop"); 158 assert((state() & (BlockS|LoopS|IfThenS|ElseS)), "bad state for new loop");
159
160 // Sync IdealKit and graphKit.
161 gkit->set_all_memory(this->merged_memory());
162 gkit->set_control(this->ctrl());
163 // Add loop predicate.
164 gkit->add_predicate(nargs);
165 // Update IdealKit memory.
166 this->set_all_memory(gkit->merged_memory());
167 this->set_ctrl(gkit->control());
168
159 set(iv, init); 169 set(iv, init);
160 Node* head = make_label(1); 170 Node* head = make_label(1);
161 bind(head); 171 bind(head);
162 _pending_cvstates->push(head); // push for use at end_loop 172 _pending_cvstates->push(head); // push for use at end_loop
163 _cvstate = copy_cvstate(); 173 _cvstate = copy_cvstate();