--- a/hotspot/src/share/vm/opto/idealKit.cpp Mon Mar 21 02:30:49 2011 -0700
+++ b/hotspot/src/share/vm/opto/idealKit.cpp Mon Mar 21 11:28:14 2011 -0700
@@ -154,8 +154,18 @@
//
// Pushes the loop top cvstate first, then the else (loop exit) cvstate
// onto the stack.
-void IdealKit::loop(IdealVariable& iv, Node* init, BoolTest::mask relop, Node* limit, float prob, float cnt) {
+void IdealKit::loop(GraphKit* gkit, int nargs, IdealVariable& iv, Node* init, BoolTest::mask relop, Node* limit, float prob, float cnt) {
assert((state() & (BlockS|LoopS|IfThenS|ElseS)), "bad state for new loop");
+
+ // Sync IdealKit and graphKit.
+ gkit->set_all_memory(this->merged_memory());
+ gkit->set_control(this->ctrl());
+ // Add loop predicate.
+ gkit->add_predicate(nargs);
+ // Update IdealKit memory.
+ this->set_all_memory(gkit->merged_memory());
+ this->set_ctrl(gkit->control());
+
set(iv, init);
Node* head = make_label(1);
bind(head);