[BCEL-info]setting of maxstack in helloify.java
Brought to you by:
dahm
|
From: Aarti T. <th...@cs...> - 2002-07-28 03:15:19
|
Hi,
I was trying to insert a method call instead of printing hello, in the
example provided , helloify.java.
I had question about setting of maxstack and thought you would be the best
person to ask.
I am attaching the changed helloify.java , as I was experimenting with it.
The method i am trying to insert is galileo.inst.Probe.pipeWrite. this
takes in two arguments one number and one string.If i insert this method
call once then the condition
if(code.getMaxStack() < 2)
mg.setMaxStack(2);
works fine, but if i have more than that for example 3 or 4 method calls
inserted then it gives me, java.lang.VerifyError-- Stack size too large.
Hence i changed it to 2 * no of times method call inserted, it worked
fine. But the lower limit for which the classfile works fine is 3.
I am a little confused, as to what exactly the max stack depends on, the
number of arguments taken by the method or the code length of the method.
Can any one please throw some light on this issue ?
Thanks,
Aarti.
|