return oprerator?

Maxim Kizub max at immsp.kiev.ua
Fri Jan 22 05:42:10 PST 1999


Hello.

I can't find the return operator for non-constant
number of args.

I.e. I can find only popargs_xxC, and I need popargs_xxR.
How can I replace it, if it does not exists?

I use a loop to push arguments from first-order function, like:

       idx = methodref_nargs();

        CHECK_NULL(INVOKEMETHODREF, stack(idx), 34);

        slot_alloctmp(tmp);  /* ptr to methodref->data */
        slot_alloctmp(tmp1); /* ptr to
methodref->data+methodref->args_len */
        slot_alloctmp(tmp2); /* intermidiate register */

        load_offset_int(tmp2,stack(idx),methodref_args_len);
       
cbranch_int_const_eq(tmp2,0,reference_label(INVOKEMETHODREF,35));

        move_ref(tmp,stack(idx));
        add_int_const(tmp,tmp,methodref_data_offset);
        move_ref(tmp1,tmp);
        add_int(tmp1,tmp1,tmp2);
        
        set_label(INVOKEMETHODREF,36);
        load_int(tmp2,tmp);
        pusharg_int(tmp2,0);
        add_int_const(tmp,tmp,sizeof(jint));
        cbranch_int_lt(tmp,tmp1,reference_label(INVOKEMETHODREF,36));
        set_label(INVOKEMETHODREF,35);

        slot_freetmp(tmp1);
        slot_freetmp(tmp2);

Should I use a loop like this and use popargs() instead of pusharg_int ?

BTW, someone can explain me how reference_label(...) works?

Also, I can't understand, how tmp slots are allocated - I use
slot_alloctmp/slot_freetmp, but in many places slot_freetmp
is not used ?!

Also, I use store_ref_offset, store_int_offset, store_xxx_offset to
store values to first-order function object, but read them by
load_int (move_int?) - is it valid? Or it will work only on
some platforms? I really don't like to use callMethodV-like
method for method reference invokation... It's going to be
too slow, since you need to fill a special structure...

Regards
  Maxim Kizub


More information about the kaffe mailing list