[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to assign RefType parameter in Jimple?
It sounds like you are looking for out parameters. Java does not have
them. All parameters are passed by value, and only into the method; you
cannot use them to pass values out.
Ondrej
On Wed, Jun 04, 2003 at 11:37:26PM +0200, Richard Stahl wrote:
> Hello,
>
> I would like to know how is it possible to find a corespondence between
> the local RefType variable and parameter variable if I would like to
> assign from local to parameter?
>
> Example:
>
> JAVA code:
>
> private Row exchange;
>
> public void setRow(Row row) {
> Row r = exchange;
> r = row;
> }
>
> public void getRow(Row row) {
> row = exchange;
> }
>
> and corresponding JIMPLE code:
>
> public void setRow(Row )
> {
> Producer r0;
> Row r1, r2, r3;
>
> r0 := @this: Producer;
> r1 := @parameter0: Row;
> r2 = r0.<PC: Row exchange>;
> r3 = r1;
> return;
> }
>
> public void getRow(Row )
> {
> Producer r0;
> Row r1, r2;
>
> r0 := @this: Producer;
> r1 := @parameter0: Row;
> r2 = r0.<PC: Row exchange>;
> return;
> }
>
> method setRow set the actual Row to the parameter type yet I can not see
> the relation between r3 and r2 in the code!
>
> method getRow assigns the parameter ref the Row from this object yet
> (again) I can not see the relation between r2 and r1 (which is returned)!
>
> I hope I make the problem understandable. Please, do not look at its
> usability - it is useless, i.e., I use it for testing purposes.
>
> Thank you very much in advance.
>
> Best regards,
>
> Richard
>