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




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




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


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