hotspot/src/share/vm/opto/generateOptoStub.cpp
changeset 22834 3e2df6a4a28c
parent 22819 f88b9c394e42
child 22838 82c7497fbad4
equal deleted inserted replaced
22833:92d74f188f73 22834:3e2df6a4a28c
   115   // Compute signature for C call.  Varies from the Java signature!
   115   // Compute signature for C call.  Varies from the Java signature!
   116   const Type **fields = TypeTuple::fields(2*parm_cnt+2);
   116   const Type **fields = TypeTuple::fields(2*parm_cnt+2);
   117   uint cnt = TypeFunc::Parms;
   117   uint cnt = TypeFunc::Parms;
   118   // The C routines gets the base of thread-local storage passed in as an
   118   // The C routines gets the base of thread-local storage passed in as an
   119   // extra argument.  Not all calls need it, but its cheap to add here.
   119   // extra argument.  Not all calls need it, but its cheap to add here.
   120   for( ; cnt<parm_cnt; cnt++ )
   120   for (uint pcnt = cnt; pcnt < parm_cnt; pcnt++, cnt++) {
   121     fields[cnt] = jdomain->field_at(cnt);
   121     // Convert ints to longs if required.
       
   122     if (CCallingConventionRequiresIntsAsLongs && jdomain->field_at(pcnt)->isa_int()) {
       
   123       fields[cnt++] = TypeLong::LONG;
       
   124       fields[cnt]   = Type::HALF; // must add an additional half for a long
       
   125     } else {
       
   126       fields[cnt] = jdomain->field_at(pcnt);
       
   127     }
       
   128   }
       
   129 
   122   fields[cnt++] = TypeRawPtr::BOTTOM; // Thread-local storage
   130   fields[cnt++] = TypeRawPtr::BOTTOM; // Thread-local storage
   123   // Also pass in the caller's PC, if asked for.
   131   // Also pass in the caller's PC, if asked for.
   124   if( return_pc )
   132   if( return_pc )
   125     fields[cnt++] = TypeRawPtr::BOTTOM; // Return PC
   133     fields[cnt++] = TypeRawPtr::BOTTOM; // Return PC
   126 
   134 
   167   call->jvms()->set_bci(0);
   175   call->jvms()->set_bci(0);
   168   call->jvms()->set_offsets(cnt);
   176   call->jvms()->set_offsets(cnt);
   169 
   177 
   170   // Set fixed predefined input arguments
   178   // Set fixed predefined input arguments
   171   cnt = 0;
   179   cnt = 0;
   172   for( i=0; i<TypeFunc::Parms; i++ )
   180   for (i = 0; i < TypeFunc::Parms; i++)
   173     call->init_req( cnt++, map()->in(i) );
   181     call->init_req(cnt++, map()->in(i));
   174   // A little too aggressive on the parm copy; return address is not an input
   182   // A little too aggressive on the parm copy; return address is not an input
   175   call->set_req(TypeFunc::ReturnAdr, top());
   183   call->set_req(TypeFunc::ReturnAdr, top());
   176   for( ; i<parm_cnt; i++ )    // Regular input arguments
   184   for (; i < parm_cnt; i++) { // Regular input arguments
   177     call->init_req( cnt++, map()->in(i) );
   185     // Convert ints to longs if required.
       
   186     if (CCallingConventionRequiresIntsAsLongs && jdomain->field_at(i)->isa_int()) {
       
   187       Node* int_as_long = _gvn.transform(new (C) ConvI2LNode(map()->in(i)));
       
   188       call->init_req(cnt++, int_as_long); // long
       
   189       call->init_req(cnt++, top());       // half
       
   190     } else {
       
   191       call->init_req(cnt++, map()->in(i));
       
   192     }
       
   193   }
   178 
   194 
   179   call->init_req( cnt++, thread );
   195   call->init_req( cnt++, thread );
   180   if( return_pc )             // Return PC, if asked for
   196   if( return_pc )             // Return PC, if asked for
   181     call->init_req( cnt++, returnadr() );
   197     call->init_req( cnt++, returnadr() );
   182   _gvn.transform_no_reclaim(call);
   198   _gvn.transform_no_reclaim(call);