src/share/vm/c1/c1_GraphBuilder.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File c1-coops Sdiff src/share/vm/c1

src/share/vm/c1/c1_GraphBuilder.cpp

Print this page




2769   int index;
2770   Value local;
2771 
2772   // find all the locals that the interpreter thinks contain live oops
2773   const BitMap live_oops = method()->live_local_oops_at_bci(osr_bci);
2774 
2775   // compute the offset into the locals so that we can treat the buffer
2776   // as if the locals were still in the interpreter frame
2777   int locals_offset = BytesPerWord * (method()->max_locals() - 1);
2778   for_each_local_value(state, index, local) {
2779     int offset = locals_offset - (index + local->type()->size() - 1) * BytesPerWord;
2780     Value get;
2781     if (local->type()->is_object_kind() && !live_oops.at(index)) {
2782       // The interpreter thinks this local is dead but the compiler
2783       // doesn't so pretend that the interpreter passed in null.
2784       get = append(new Constant(objectNull));
2785     } else {
2786       get = append(new UnsafeGetRaw(as_BasicType(local->type()), e,
2787                                     append(new Constant(new IntConstant(offset))),
2788                                     0,
2789                                     true));
2790     }
2791     _state->store_local(index, get);
2792   }
2793 
2794   // the storage for the OSR buffer is freed manually in the LIRGenerator.
2795 
2796   assert(state->caller_state() == NULL, "should be top scope");
2797   state->clear_locals();
2798   Goto* g = new Goto(target, false);
2799   append(g);
2800   _osr_entry->set_end(g);
2801   target->merge(_osr_entry->end()->state());
2802 
2803   scope_data()->set_stream(NULL);
2804 }
2805 
2806 
2807 ValueStack* GraphBuilder::state_at_entry() {
2808   ValueStack* state = new ValueStack(scope(), NULL);
2809 




2769   int index;
2770   Value local;
2771 
2772   // find all the locals that the interpreter thinks contain live oops
2773   const BitMap live_oops = method()->live_local_oops_at_bci(osr_bci);
2774 
2775   // compute the offset into the locals so that we can treat the buffer
2776   // as if the locals were still in the interpreter frame
2777   int locals_offset = BytesPerWord * (method()->max_locals() - 1);
2778   for_each_local_value(state, index, local) {
2779     int offset = locals_offset - (index + local->type()->size() - 1) * BytesPerWord;
2780     Value get;
2781     if (local->type()->is_object_kind() && !live_oops.at(index)) {
2782       // The interpreter thinks this local is dead but the compiler
2783       // doesn't so pretend that the interpreter passed in null.
2784       get = append(new Constant(objectNull));
2785     } else {
2786       get = append(new UnsafeGetRaw(as_BasicType(local->type()), e,
2787                                     append(new Constant(new IntConstant(offset))),
2788                                     0,
2789                                     true /*unaligned*/, true /*wide*/));
2790     }
2791     _state->store_local(index, get);
2792   }
2793 
2794   // the storage for the OSR buffer is freed manually in the LIRGenerator.
2795 
2796   assert(state->caller_state() == NULL, "should be top scope");
2797   state->clear_locals();
2798   Goto* g = new Goto(target, false);
2799   append(g);
2800   _osr_entry->set_end(g);
2801   target->merge(_osr_entry->end()->state());
2802 
2803   scope_data()->set_stream(NULL);
2804 }
2805 
2806 
2807 ValueStack* GraphBuilder::state_at_entry() {
2808   ValueStack* state = new ValueStack(scope(), NULL);
2809 


src/share/vm/c1/c1_GraphBuilder.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File