< prev index next >

src/hotspot/share/opto/parseHelper.cpp

Print this page




 318 
 319   // Push resultant oop onto stack
 320   push(obj);
 321 
 322   // Keep track of whether opportunities exist for StringBuilder
 323   // optimizations.
 324   if (OptimizeStringConcat &&
 325       (klass == C->env()->StringBuilder_klass() ||
 326        klass == C->env()->StringBuffer_klass())) {
 327     C->set_has_stringbuilder(true);
 328   }
 329 
 330   // Keep track of boxed values for EliminateAutoBox optimizations.
 331   if (C->eliminate_boxing() && klass->is_box_klass()) {
 332     C->set_has_boxed_value(true);
 333   }
 334 }
 335 
 336 //------------------------------do_vdefault-------------------------------------
 337 void Parse::do_vdefault() {
 338   // Fixme additional checks needed?
 339   bool will_link;
 340   ciValueKlass* vk = iter().get_klass(will_link)->as_value_klass();
 341   assert(will_link, "vdefault: typeflow responsibility");
 342 
 343   // Create a new ValueTypeNode
 344   Node* vt = ValueTypeNode::make_default(_gvn, vk);
 345 
 346   push(_gvn.transform(vt));
 347 }
 348 
 349 //------------------------------do_vwithfield-----------------------------------
 350 void Parse::do_vwithfield() {
 351   // Fixme additional checks needed?
 352   bool will_link;
 353   ciField* field = iter().get_field(will_link);
 354   assert(will_link, "vdefault: typeflow responsibility");
 355   BasicType bt = field->layout_type();
 356   Node* val = type2size[bt] == 1 ? pop() : pop_pair();
 357   Node* vt = pop();
 358   assert(vt->is_ValueType(), "value type expected here");
 359 
 360   ValueTypeNode* new_vt = vt->clone()->as_ValueType();
 361   new_vt->set_oop(_gvn.zerocon(T_VALUETYPE));
 362   int offset = field->offset();
 363   uint i = 0;
 364   for (; i < new_vt->field_count() && new_vt->field_offset(i) != offset; i++) {}
 365   assert(i < new_vt->field_count(), "where's the field");
 366   new_vt->set_field_value(i, val);
 367 
 368   push(_gvn.transform(new_vt));
 369 }
 370 
 371 #ifndef PRODUCT
 372 //------------------------------dump_map_adr_mem-------------------------------
 373 // Debug dump of the mapping from address types to MergeMemNode indices.
 374 void Parse::dump_map_adr_mem() const {
 375   tty->print_cr("--- Mapping from address types to memory Nodes ---");
 376   MergeMemNode *mem = map() == NULL ? NULL : (map()->memory()->is_MergeMem() ?
 377                                       map()->memory()->as_MergeMem() : NULL);
 378   for (uint i = 0; i < (uint)C->num_alias_types(); i++) {
 379     C->alias_type(i)->print_on(tty);
 380     tty->print("\t");
 381     // Node mapping, if any
 382     if (mem && i < mem->req() && mem->in(i) && mem->in(i) != mem->empty_memory()) {
 383       mem->in(i)->dump();
 384     } else {
 385       tty->cr();




 318 
 319   // Push resultant oop onto stack
 320   push(obj);
 321 
 322   // Keep track of whether opportunities exist for StringBuilder
 323   // optimizations.
 324   if (OptimizeStringConcat &&
 325       (klass == C->env()->StringBuilder_klass() ||
 326        klass == C->env()->StringBuffer_klass())) {
 327     C->set_has_stringbuilder(true);
 328   }
 329 
 330   // Keep track of boxed values for EliminateAutoBox optimizations.
 331   if (C->eliminate_boxing() && klass->is_box_klass()) {
 332     C->set_has_boxed_value(true);
 333   }
 334 }
 335 
 336 //------------------------------do_vdefault-------------------------------------
 337 void Parse::do_vdefault() {

 338   bool will_link;
 339   ciValueKlass* vk = iter().get_klass(will_link)->as_value_klass();
 340   assert(will_link, "vdefault: typeflow responsibility");
 341   // Create and push a new default ValueTypeNode
 342   push(ValueTypeNode::make_default(_gvn, vk));



 343 }
 344 
 345 //------------------------------do_vwithfield-----------------------------------
 346 void Parse::do_vwithfield() {

 347   bool will_link;
 348   ciField* field = iter().get_field(will_link);
 349   assert(will_link, "vdefault: typeflow responsibility");
 350   BasicType bt = field->layout_type();
 351   Node* val = type2size[bt] == 1 ? pop() : pop_pair();
 352   Node* vt = pop();
 353   assert(vt->is_ValueType(), "value type expected here");
 354 
 355   ValueTypeNode* new_vt = vt->clone()->as_ValueType();
 356   new_vt->set_oop(_gvn.zerocon(T_VALUETYPE));
 357   int offset = field->offset();
 358   uint i = 0;
 359   for (; i < new_vt->field_count() && new_vt->field_offset(i) != offset; i++) {}
 360   assert(i < new_vt->field_count(), "field not found");
 361   new_vt->set_field_value(i, val);
 362 
 363   push(_gvn.transform(new_vt));
 364 }
 365 
 366 #ifndef PRODUCT
 367 //------------------------------dump_map_adr_mem-------------------------------
 368 // Debug dump of the mapping from address types to MergeMemNode indices.
 369 void Parse::dump_map_adr_mem() const {
 370   tty->print_cr("--- Mapping from address types to memory Nodes ---");
 371   MergeMemNode *mem = map() == NULL ? NULL : (map()->memory()->is_MergeMem() ?
 372                                       map()->memory()->as_MergeMem() : NULL);
 373   for (uint i = 0; i < (uint)C->num_alias_types(); i++) {
 374     C->alias_type(i)->print_on(tty);
 375     tty->print("\t");
 376     // Node mapping, if any
 377     if (mem && i < mem->req() && mem->in(i) && mem->in(i) != mem->empty_memory()) {
 378       mem->in(i)->dump();
 379     } else {
 380       tty->cr();


< prev index next >