< prev index next >

src/share/vm/opto/parse1.cpp

Print this page

        

@@ -816,57 +816,10 @@
     _exits.set_argument(0, ret_phi);  // here is where the parser finds it
     // Note:  ret_phi is not yet pushed, until do_exits.
   }
 }
 
-// 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, bool in) {
-  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->field_type(i);
-    int offset = base_offset + vt->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, in);
-      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);
-        if (offset == f->offset()) {
-          assert(f->type() == field_type, "inconsistent field type");
-          break;
-        }
-        BasicType bt = f->type()->basic_type();
-        if (bt == T_LONG || bt == T_DOUBLE) {
-          extra++;
-        }
-      }
-      assert(j != base_vk->nof_nonstatic_fields(), "must find");
-      Node* parm = NULL;
-      if (n->is_Start()) {
-        assert(in, "return from start?");
-        parm = gvn.transform(new ParmNode(n->as_Start(), base_input + j + extra));
-      } else {
-        if (in) {
-          assert(n->is_Call(), "nothing else here");
-          parm = n->in(base_input + j + extra);
-        } else {
-          parm = gvn.transform(new ProjNode(n->as_Call(), 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);
-}
-
 //----------------------------build_start_state-------------------------------
 // Construct a state which contains only the incoming arguments from an
 // unknown caller.  The method & bci will be NULL & InvocationEntryBci.
 JVMState* Compile::build_start_state(StartNode* start, const TypeFunc* tf) {
   int        arg_size_sig = tf->domain_sig()->cnt();

@@ -901,11 +854,11 @@
         // 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() && t->is_valuetypeptr()->klass() != C->env()->___Value_klass()) {
           ciValueKlass* vk = t->is_valuetypeptr()->value_type()->value_klass();
-          Node* vt = create_vt_node(start, vk, vk, 0, j, true);
+          Node* vt = ValueTypeNode::make(gvn, start, vk, j, true);
           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);
< prev index next >