hotspot/src/share/vm/c1/c1_ValueStack.cpp
changeset 5707 6c66849ed24e
parent 5547 f4b087cbb361
child 6745 a34ef8968a84
equal deleted inserted replaced
5706:0c91076143f9 5707:6c66849ed24e
   117   );
   117   );
   118 }
   118 }
   119 
   119 
   120 
   120 
   121 // apply function to all values of a list; factored out from values_do(f)
   121 // apply function to all values of a list; factored out from values_do(f)
   122 void ValueStack::apply(Values list, void f(Value*)) {
   122 void ValueStack::apply(Values list, ValueVisitor* f) {
   123   for (int i = 0; i < list.length(); i++) {
   123   for (int i = 0; i < list.length(); i++) {
   124     Value* va = list.adr_at(i);
   124     Value* va = list.adr_at(i);
   125     Value v0 = *va;
   125     Value v0 = *va;
   126     if (v0 != NULL) {
   126     if (v0 != NULL) {
   127       if (!v0->type()->is_illegal()) {
   127       if (!v0->type()->is_illegal()) {
   128         assert(v0->as_HiWord() == NULL, "should never see HiWord during traversal");
   128         assert(v0->as_HiWord() == NULL, "should never see HiWord during traversal");
   129         f(va);
   129         f->visit(va);
   130 #ifdef ASSERT
   130 #ifdef ASSERT
   131         Value v1 = *va;
   131         Value v1 = *va;
   132         if (v0 != v1) {
   132         if (v0 != v1) {
   133           assert(v1->type()->is_illegal() || v0->type()->tag() == v1->type()->tag(), "types must match");
   133           assert(v1->type()->is_illegal() || v0->type()->tag() == v1->type()->tag(), "types must match");
   134           if (v0->type()->is_double_word()) {
   134           if (v0->type()->is_double_word()) {
   141     }
   141     }
   142   }
   142   }
   143 }
   143 }
   144 
   144 
   145 
   145 
   146 void ValueStack::values_do(void f(Value*)) {
   146 void ValueStack::values_do(ValueVisitor* f) {
   147   apply(_stack, f);
   147   apply(_stack, f);
   148   apply(_locks, f);
   148   apply(_locks, f);
   149 
   149 
   150   ValueStack* state = this;
   150   ValueStack* state = this;
   151   for_each_state(state) {
   151   for_each_state(state) {