hotspot/src/share/vm/shark/sharkState.cpp
changeset 14622 8e94e4186d35
parent 13728 882756847a04
equal deleted inserted replaced
14621:fd9265ab0f67 14622:8e94e4186d35
   129                        BasicBlock* this_block) {
   129                        BasicBlock* this_block) {
   130   // Method
   130   // Method
   131   Value *this_method = this->method();
   131   Value *this_method = this->method();
   132   Value *other_method = other->method();
   132   Value *other_method = other->method();
   133   if (this_method != other_method) {
   133   if (this_method != other_method) {
   134     PHINode *phi = builder()->CreatePHI(SharkType::Method*_type(), "method");
   134     PHINode *phi = builder()->CreatePHI(SharkType::Method_type(), 0, "method");
   135     phi->addIncoming(this_method, this_block);
   135     phi->addIncoming(this_method, this_block);
   136     phi->addIncoming(other_method, other_block);
   136     phi->addIncoming(other_method, other_block);
   137     set_method(phi);
   137     set_method(phi);
   138   }
   138   }
   139 
   139 
   140   // Temporary oop slot
   140   // Temporary oop slot
   141   Value *this_oop_tmp = this->oop_tmp();
   141   Value *this_oop_tmp = this->oop_tmp();
   142   Value *other_oop_tmp = other->oop_tmp();
   142   Value *other_oop_tmp = other->oop_tmp();
   143   if (this_oop_tmp != other_oop_tmp) {
   143   if (this_oop_tmp != other_oop_tmp) {
   144     assert(this_oop_tmp && other_oop_tmp, "can't merge NULL with non-NULL");
   144     assert(this_oop_tmp && other_oop_tmp, "can't merge NULL with non-NULL");
   145     PHINode *phi = builder()->CreatePHI(SharkType::oop_type(), "oop_tmp");
   145     PHINode *phi = builder()->CreatePHI(SharkType::oop_type(), 0, "oop_tmp");
   146     phi->addIncoming(this_oop_tmp, this_block);
   146     phi->addIncoming(this_oop_tmp, this_block);
   147     phi->addIncoming(other_oop_tmp, other_block);
   147     phi->addIncoming(other_oop_tmp, other_block);
   148     set_oop_tmp(phi);
   148     set_oop_tmp(phi);
   149   }
   149   }
   150 
   150 
   241 
   241 
   242 SharkOSREntryState::SharkOSREntryState(SharkTopLevelBlock* block,
   242 SharkOSREntryState::SharkOSREntryState(SharkTopLevelBlock* block,
   243                                        Value*              method,
   243                                        Value*              method,
   244                                        Value*              osr_buf)
   244                                        Value*              osr_buf)
   245   : SharkState(block) {
   245   : SharkState(block) {
   246   assert(!block->stack_depth_at_entry(), "entry block shouldn't have stack");
   246   assert(block->stack_depth_at_entry() == 0, "entry block shouldn't have stack");
   247   set_num_monitors(block->ciblock()->monitor_count());
   247   set_num_monitors(block->ciblock()->monitor_count());
   248 
   248 
   249   // Local variables
   249   // Local variables
   250   for (int i = 0; i < max_locals(); i++) {
   250   for (int i = 0; i < max_locals(); i++) {
   251     ciType *type = block->local_type_at_entry(i);
   251     ciType *type = block->local_type_at_entry(i);
   285   BasicBlock *saved_insert_point = builder()->GetInsertBlock();
   285   BasicBlock *saved_insert_point = builder()->GetInsertBlock();
   286   builder()->SetInsertPoint(block->entry_block());
   286   builder()->SetInsertPoint(block->entry_block());
   287   char name[18];
   287   char name[18];
   288 
   288 
   289   // Method
   289   // Method
   290   set_method(builder()->CreatePHI(SharkType::Method*_type(), "method"));
   290   set_method(builder()->CreatePHI(SharkType::Method_type(), 0, "method"));
   291 
   291 
   292   // Local variables
   292   // Local variables
   293   for (int i = 0; i < max_locals(); i++) {
   293   for (int i = 0; i < max_locals(); i++) {
   294     ciType *type = block->local_type_at_entry(i);
   294     ciType *type = block->local_type_at_entry(i);
   295     if (type->basic_type() == (BasicType) ciTypeFlow::StateVector::T_NULL) {
   295     if (type->basic_type() == (BasicType) ciTypeFlow::StateVector::T_NULL) {
   305     case T_DOUBLE:
   305     case T_DOUBLE:
   306     case T_OBJECT:
   306     case T_OBJECT:
   307     case T_ARRAY:
   307     case T_ARRAY:
   308       snprintf(name, sizeof(name), "local_%d_", i);
   308       snprintf(name, sizeof(name), "local_%d_", i);
   309       value = SharkValue::create_phi(
   309       value = SharkValue::create_phi(
   310         type, builder()->CreatePHI(SharkType::to_stackType(type), name));
   310         type, builder()->CreatePHI(SharkType::to_stackType(type), 0, name));
   311       break;
   311       break;
   312 
   312 
   313     case T_ADDRESS:
   313     case T_ADDRESS:
   314       value = SharkValue::address_constant(type->as_return_address()->bci());
   314       value = SharkValue::address_constant(type->as_return_address()->bci());
   315       break;
   315       break;
   343     case T_DOUBLE:
   343     case T_DOUBLE:
   344     case T_OBJECT:
   344     case T_OBJECT:
   345     case T_ARRAY:
   345     case T_ARRAY:
   346       snprintf(name, sizeof(name), "stack_%d_", i);
   346       snprintf(name, sizeof(name), "stack_%d_", i);
   347       value = SharkValue::create_phi(
   347       value = SharkValue::create_phi(
   348         type, builder()->CreatePHI(SharkType::to_stackType(type), name));
   348         type, builder()->CreatePHI(SharkType::to_stackType(type), 0, name));
   349       break;
   349       break;
   350 
   350 
   351     case T_ADDRESS:
   351     case T_ADDRESS:
   352       value = SharkValue::address_constant(type->as_return_address()->bci());
   352       value = SharkValue::address_constant(type->as_return_address()->bci());
   353       break;
   353       break;