hotspot/src/share/vm/c1/c1_Instruction.cpp
changeset 5707 6c66849ed24e
parent 5547 f4b087cbb361
child 6453 970dc585ab63
--- a/hotspot/src/share/vm/c1/c1_Instruction.cpp	Thu Jun 03 14:20:27 2010 -0700
+++ b/hotspot/src/share/vm/c1/c1_Instruction.cpp	Fri Jun 04 11:18:04 2010 -0700
@@ -29,8 +29,6 @@
 // Implementation of Instruction
 
 
-int Instruction::_next_id = 0;
-
 #ifdef ASSERT
 void Instruction::create_hi_word() {
   assert(type()->is_double_word() && _hi_word == NULL, "only double word has high word");
@@ -193,22 +191,22 @@
 }
 
 
-void ArithmeticOp::other_values_do(void f(Value*)) {
+void ArithmeticOp::other_values_do(ValueVisitor* f) {
   if (lock_stack() != NULL) lock_stack()->values_do(f);
 }
 
-void NullCheck::other_values_do(void f(Value*)) {
+void NullCheck::other_values_do(ValueVisitor* f) {
   lock_stack()->values_do(f);
 }
 
-void AccessArray::other_values_do(void f(Value*)) {
+void AccessArray::other_values_do(ValueVisitor* f) {
   if (lock_stack() != NULL) lock_stack()->values_do(f);
 }
 
 
 // Implementation of AccessField
 
-void AccessField::other_values_do(void f(Value*)) {
+void AccessField::other_values_do(ValueVisitor* f) {
   if (state_before() != NULL) state_before()->values_do(f);
   if (lock_stack() != NULL) lock_stack()->values_do(f);
 }
@@ -270,7 +268,7 @@
 
 // Implementation of CompareOp
 
-void CompareOp::other_values_do(void f(Value*)) {
+void CompareOp::other_values_do(ValueVisitor* f) {
   if (state_before() != NULL) state_before()->values_do(f);
 }
 
@@ -302,12 +300,12 @@
 }
 
 
-void StateSplit::state_values_do(void f(Value*)) {
+void StateSplit::state_values_do(ValueVisitor* f) {
   if (state() != NULL) state()->values_do(f);
 }
 
 
-void BlockBegin::state_values_do(void f(Value*)) {
+void BlockBegin::state_values_do(ValueVisitor* f) {
   StateSplit::state_values_do(f);
 
   if (is_set(BlockBegin::exception_entry_flag)) {
@@ -318,13 +316,13 @@
 }
 
 
-void MonitorEnter::state_values_do(void f(Value*)) {
+void MonitorEnter::state_values_do(ValueVisitor* f) {
   StateSplit::state_values_do(f);
   _lock_stack_before->values_do(f);
 }
 
 
-void Intrinsic::state_values_do(void f(Value*)) {
+void Intrinsic::state_values_do(ValueVisitor* f) {
   StateSplit::state_values_do(f);
   if (lock_stack() != NULL) lock_stack()->values_do(f);
 }
@@ -349,8 +347,9 @@
 
   assert(args != NULL, "args must exist");
 #ifdef ASSERT
-  values_do(assert_value);
-#endif // ASSERT
+  AssertValues assert_value;
+  values_do(&assert_value);
+#endif
 
   // provide an initial guess of signature size.
   _signature = new BasicTypeList(number_of_arguments() + (has_receiver() ? 1 : 0));
@@ -368,7 +367,7 @@
 }
 
 
-void Invoke::state_values_do(void f(Value*)) {
+void Invoke::state_values_do(ValueVisitor* f) {
   StateSplit::state_values_do(f);
   if (state_before() != NULL) state_before()->values_do(f);
   if (state()        != NULL) state()->values_do(f);
@@ -500,30 +499,27 @@
 }
 
 
-void Constant::other_values_do(void f(Value*)) {
+void Constant::other_values_do(ValueVisitor* f) {
   if (state() != NULL) state()->values_do(f);
 }
 
 
 // Implementation of NewArray
 
-void NewArray::other_values_do(void f(Value*)) {
+void NewArray::other_values_do(ValueVisitor* f) {
   if (state_before() != NULL) state_before()->values_do(f);
 }
 
 
 // Implementation of TypeCheck
 
-void TypeCheck::other_values_do(void f(Value*)) {
+void TypeCheck::other_values_do(ValueVisitor* f) {
   if (state_before() != NULL) state_before()->values_do(f);
 }
 
 
 // Implementation of BlockBegin
 
-int BlockBegin::_next_block_id = 0;
-
-
 void BlockBegin::set_end(BlockEnd* end) {
   assert(end != NULL, "should not reset block end to NULL");
   BlockEnd* old_end = _end;
@@ -738,7 +734,7 @@
 }
 
 
-void BlockBegin::block_values_do(void f(Value*)) {
+void BlockBegin::block_values_do(ValueVisitor* f) {
   for (Instruction* n = this; n != NULL; n = n->next()) n->values_do(f);
 }
 
@@ -930,7 +926,7 @@
 }
 
 
-void BlockList::values_do(void f(Value*)) {
+void BlockList::values_do(ValueVisitor* f) {
   for (int i = length() - 1; i >= 0; i--) at(i)->block_values_do(f);
 }
 
@@ -973,7 +969,7 @@
 }
 
 
-void BlockEnd::other_values_do(void f(Value*)) {
+void BlockEnd::other_values_do(ValueVisitor* f) {
   if (state_before() != NULL) state_before()->values_do(f);
 }
 
@@ -1012,6 +1008,6 @@
 
 // Implementation of Throw
 
-void Throw::state_values_do(void f(Value*)) {
+void Throw::state_values_do(ValueVisitor* f) {
   BlockEnd::state_values_do(f);
 }