src/share/vm/c1/c1_GraphBuilder.cpp

Print this page




3072   // the storage for the OSR buffer is freed manually in the LIRGenerator.
3073 
3074   assert(state->caller_state() == NULL, "should be top scope");
3075   state->clear_locals();
3076   Goto* g = new Goto(target, false);
3077   append(g);
3078   _osr_entry->set_end(g);
3079   target->merge(_osr_entry->end()->state());
3080 
3081   scope_data()->set_stream(NULL);
3082 }
3083 
3084 
3085 ValueStack* GraphBuilder::state_at_entry() {
3086   ValueStack* state = new ValueStack(scope(), NULL);
3087 
3088   // Set up locals for receiver
3089   int idx = 0;
3090   if (!method()->is_static()) {
3091     // we should always see the receiver
3092     state->store_local(idx, new Local(method()->holder(), objectType, idx));
3093     idx = 1;
3094   }
3095 
3096   // Set up locals for incoming arguments
3097   ciSignature* sig = method()->signature();
3098   for (int i = 0; i < sig->count(); i++) {
3099     ciType* type = sig->type_at(i);
3100     BasicType basic_type = type->basic_type();
3101     // don't allow T_ARRAY to propagate into locals types
3102     if (basic_type == T_ARRAY) basic_type = T_OBJECT;
3103     ValueType* vt = as_ValueType(basic_type);
3104     state->store_local(idx, new Local(type, vt, idx));
3105     idx += type->size();
3106   }
3107 
3108   // lock synchronized method
3109   if (method()->is_synchronized()) {
3110     state->lock(NULL);
3111   }
3112 
3113   return state;
3114 }
3115 
3116 
3117 GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope)
3118   : _scope_data(NULL)
3119   , _instruction_count(0)
3120   , _osr_entry(NULL)
3121   , _memory(new MemoryBuffer())
3122   , _compilation(compilation)
3123   , _inline_bailout_msg(NULL)
3124 {




3072   // the storage for the OSR buffer is freed manually in the LIRGenerator.
3073 
3074   assert(state->caller_state() == NULL, "should be top scope");
3075   state->clear_locals();
3076   Goto* g = new Goto(target, false);
3077   append(g);
3078   _osr_entry->set_end(g);
3079   target->merge(_osr_entry->end()->state());
3080 
3081   scope_data()->set_stream(NULL);
3082 }
3083 
3084 
3085 ValueStack* GraphBuilder::state_at_entry() {
3086   ValueStack* state = new ValueStack(scope(), NULL);
3087 
3088   // Set up locals for receiver
3089   int idx = 0;
3090   if (!method()->is_static()) {
3091     // we should always see the receiver
3092     state->store_local(idx, new Local(method()->holder(), objectType, idx, true));
3093     idx = 1;
3094   }
3095 
3096   // Set up locals for incoming arguments
3097   ciSignature* sig = method()->signature();
3098   for (int i = 0; i < sig->count(); i++) {
3099     ciType* type = sig->type_at(i);
3100     BasicType basic_type = type->basic_type();
3101     // don't allow T_ARRAY to propagate into locals types
3102     if (basic_type == T_ARRAY) basic_type = T_OBJECT;
3103     ValueType* vt = as_ValueType(basic_type);
3104     state->store_local(idx, new Local(type, vt, idx, false));
3105     idx += type->size();
3106   }
3107 
3108   // lock synchronized method
3109   if (method()->is_synchronized()) {
3110     state->lock(NULL);
3111   }
3112 
3113   return state;
3114 }
3115 
3116 
3117 GraphBuilder::GraphBuilder(Compilation* compilation, IRScope* scope)
3118   : _scope_data(NULL)
3119   , _instruction_count(0)
3120   , _osr_entry(NULL)
3121   , _memory(new MemoryBuffer())
3122   , _compilation(compilation)
3123   , _inline_bailout_msg(NULL)
3124 {