typo in TemplateInterpreterGenerator::set_short_entry_points?

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Fri Oct 30 14:06:10 PDT 2009


set_entry_point is only ever used with the tos states of bytecode  
templates in templateTable.cpp and none of those use the subword tos  
states like btos,ctos and stos.  Those are all smeared into itos:

   def(Bytecodes::_i2c                 , ____|____|____|____, itos,  
itos, convert             ,  _ )

The subword types don't really exist in the representation of the  
stack and locals.  Probably btos,ctos and stos could be converted into  
ShouldNotReachHere in the switch below.

tom

On Oct 30, 2009, at 6:10 AM, Christian Thalinger wrote:

> I'm currently trying to find a bug somewhere in the interpreter (JSR  
> 292
> related) and I stumbled across this code:
>
> void TemplateInterpreterGenerator::set_short_entry_points(Template*  
> t, address& bep, address& cep, address& sep, address& aep, address&  
> iep, address& lep, address& fep, address& dep, address& vep) {
>  assert(t->is_valid(), "template must exist");
>  switch (t->tos_in()) {
>    case btos: vep = __ pc(); __ pop(btos); bep = __ pc();  
> generate_and_dispatch(t); break;
>    case ctos: vep = __ pc(); __ pop(ctos); sep = __ pc();  
> generate_and_dispatch(t); break;
>    case stos: vep = __ pc(); __ pop(stos); sep = __ pc();  
> generate_and_dispatch(t); break;
>    case atos: vep = __ pc(); __ pop(atos); aep = __ pc();  
> generate_and_dispatch(t); break;
>    case itos: vep = __ pc(); __ pop(itos); iep = __ pc();  
> generate_and_dispatch(t); break;
>    case ltos: vep = __ pc(); __ pop(ltos); lep = __ pc();  
> generate_and_dispatch(t); break;
>    case ftos: vep = __ pc(); __ pop(ftos); fep = __ pc();  
> generate_and_dispatch(t); break;
>    case dtos: vep = __ pc(); __ pop(dtos); dep = __ pc();  
> generate_and_dispatch(t); break;
>    case vtos: set_vtos_entry_points(t, bep, cep, sep, aep, iep, lep,  
> fep, dep, vep);     break;
>    default  : ShouldNotReachHere 
> ();                                                 break;
>  }
> }
>
> I'm not exactly sure but it looks a little odd that for ctos the cep
> does not get set properly but sep instead.  This means that cep always
> stays _illegal_bytecode_sequence.  Does ctos always use sep by
> definition?
>
> -- Christian
>



More information about the hotspot-dev mailing list