Re: [rvm-research] Regarding the function call mechanism

Eliot Moss <[email protected]>
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <[email protected]>
On 3/25/2013 11:54 AM, Hari Krishnan wrote:

> I have a question. Is there any way I can say that the method arguments are mutated inMMTK or in
> Jikes RVM itself? how can it be done?

Dear Hari --

Do you mean: Is there a way to tell whether a method's arguments
are mutated?

Supposing that is your question, it could have two meanings:

1) For an argument x (say), there is an assignment x = ... that
occurs in the method.  This is easily checked statically by looking
at the bytecode of the method. If you mean "does it occur on a
particular invocation", then you require a dynamic check, but a
bytecode rewriting tool would allow you to instrument the places
where an argument is mutated.

By the way, in code generated by javac, I don't think argument
0 in an instance method (called 'this' in Java) is ever changed.

2) For an argument x that refers to some object, that *object*
is mutated by the method.  That is rather a harder question to
answer, since the object could be passed in a call, and mutated
that way.  If you mean a direct mutation (setting a field,
changing an array element) bytecode analysis could work fairly
well to determine that statically, or to instrument to tell you
dynamically.


If you are concerned about debugging a particular method, then
Eclipse watchpoints might be helpful.


As with many questions asked here, giving more background and
explaining what your overall objective is will likely obtain a
more useful answer.

Regards -- Eliot Moss

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.