Skip to content

Commit 91810c9

Browse files
committed
[asm-cherry-pick] Use MethodWriter to compute maxLocals / maxStack
Make class MethodWriter public and add accessors for maxLocals and maxStack. This is the simplest way to compute the maxs using the ASM framework. It is used in the optimizer, see 90781e8.
1 parent 34e3220 commit 91810c9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/asm/scala/tools/asm/MethodWriter.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* @author Eric Bruneton
3838
* @author Eugene Kuleshov
3939
*/
40-
class MethodWriter extends MethodVisitor {
40+
public class MethodWriter extends MethodVisitor {
4141

4242
/**
4343
* Pseudo access flag used to denote constructors.
@@ -235,11 +235,19 @@ class MethodWriter extends MethodVisitor {
235235
*/
236236
private int maxStack;
237237

238+
public int getMaxStack() {
239+
return maxStack;
240+
}
241+
238242
/**
239243
* Maximum number of local variables for this method.
240244
*/
241245
private int maxLocals;
242246

247+
public int getMaxLocals() {
248+
return maxLocals;
249+
}
250+
243251
/**
244252
* Number of local variables in the current stack map frame.
245253
*/

0 commit comments

Comments
 (0)