< prev index next >

src/share/vm/opto/parse1.cpp

Print this page
rev 10494 : more
rev 10496 : more
rev 10513 : fix incremental inlining with value types

*** 788,807 **** } } // Helper function to create a ValueTypeNode from its fields passed as // arguments. Fields are passed in order of increasing offsets. ! static Node* create_vt_node(StartNode* start, ciValueKlass* vk, ciValueKlass* base_vk, int base_offset, int base_input, Compile* C) { assert(base_offset >= 0, "offset in value type always positive"); ! PhaseGVN& gvn = *C->initial_gvn(); ValueTypeNode* vt = ValueTypeNode::make(gvn, vk); for (uint i = 0; i < vt->field_count(); i++) { ciType* field_type = vt->get_field_type(i); int offset = base_offset + vt->get_field_offset(i) - (base_offset > 0 ? vk->first_field_offset() : 0); if (field_type->is_valuetype()) { ciValueKlass* embedded_vk = field_type->as_value_klass(); ! Node* embedded_vt = create_vt_node(start, embedded_vk, base_vk, offset, base_input, C); vt->set_field_value(i, embedded_vt); } else { int j = 0; int extra = 0; for (; j < base_vk->nof_nonstatic_fields(); j++) { ciField* f = base_vk->nonstatic_field_at(j); --- 788,807 ---- } } // Helper function to create a ValueTypeNode from its fields passed as // arguments. Fields are passed in order of increasing offsets. ! Node* Compile::create_vt_node(Node* n, ciValueKlass* vk, ciValueKlass* base_vk, int base_offset, int base_input) { assert(base_offset >= 0, "offset in value type always positive"); ! PhaseGVN& gvn = *initial_gvn(); ValueTypeNode* vt = ValueTypeNode::make(gvn, vk); for (uint i = 0; i < vt->field_count(); i++) { ciType* field_type = vt->get_field_type(i); int offset = base_offset + vt->get_field_offset(i) - (base_offset > 0 ? vk->first_field_offset() : 0); if (field_type->is_valuetype()) { ciValueKlass* embedded_vk = field_type->as_value_klass(); ! Node* embedded_vt = create_vt_node(n, embedded_vk, base_vk, offset, base_input); vt->set_field_value(i, embedded_vt); } else { int j = 0; int extra = 0; for (; j < base_vk->nof_nonstatic_fields(); j++) { ciField* f = base_vk->nonstatic_field_at(j);
*** 813,826 **** if (bt == T_LONG || bt == T_DOUBLE) { extra++; } } assert(j != base_vk->nof_nonstatic_fields(), "must find"); ! Node* parm = gvn.transform(new ParmNode(start, base_input + j + extra)); vt->set_field_value(i, parm); // Record all these guys for later GVN. ! C->record_for_igvn(parm); } } return gvn.transform(vt); } --- 813,832 ---- if (bt == T_LONG || bt == T_DOUBLE) { extra++; } } assert(j != base_vk->nof_nonstatic_fields(), "must find"); ! Node* parm = NULL; ! if (n->is_Start()) { ! parm = gvn.transform(new ParmNode(n->as_Start(), base_input + j + extra)); ! } else { ! assert(n->is_Call(), "nothing else here"); ! parm = n->in(base_input + j + extra); ! } vt->set_field_value(i, parm); // Record all these guys for later GVN. ! record_for_igvn(parm); } } return gvn.transform(vt); }
*** 860,880 **** // argument per field of the value type. Build ValueTypeNodes // from the value type arguments. const Type* t = tf->domain_sig()->field_at(i); if (t->isa_valuetypeptr()) { ciValueKlass* vk = t->is_valuetypeptr()->value_type()->value_klass(); ! Node* vt = create_vt_node(start, vk, vk, 0, j, C); map->init_req(i, gvn.transform(vt)); ! int extra = 0; ! for (int k = 0; k < vk->nof_nonstatic_fields(); k++) { ! ciField* f = vk->nonstatic_field_at(k); ! BasicType bt = f->type()->basic_type(); ! if (bt == T_LONG || bt == T_DOUBLE) { ! extra++; ! } ! } ! j += extra + vk->nof_nonstatic_fields(); } else { Node* parm = gvn.transform(new ParmNode(start, j)); map->init_req(i, parm); // Record all these guys for later GVN. record_for_igvn(parm); --- 866,878 ---- // argument per field of the value type. Build ValueTypeNodes // from the value type arguments. const Type* t = tf->domain_sig()->field_at(i); if (t->isa_valuetypeptr()) { ciValueKlass* vk = t->is_valuetypeptr()->value_type()->value_klass(); ! Node* vt = create_vt_node(start, vk, vk, 0, j); map->init_req(i, gvn.transform(vt)); ! j += vk->value_arg_slots(); } else { Node* parm = gvn.transform(new ParmNode(start, j)); map->init_req(i, parm); // Record all these guys for later GVN. record_for_igvn(parm);
< prev index next >