8337225: Demote maxStack and maxLocals from CodeModel to CodeAttribute

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2024-07-29 21:58:08 +00:00
parent bd36b6ae5d
commit ab27090aa0
13 changed files with 166 additions and 88 deletions

View file

@ -43,17 +43,7 @@ import jdk.internal.javac.PreviewFeature;
@PreviewFeature(feature = PreviewFeature.Feature.CLASSFILE_API)
public sealed interface CodeModel
extends CompoundElement<CodeElement>, AttributedElement, MethodElement
permits CodeAttribute, BufferedCodeBuilder.Model, CodeImpl {
/**
* {@return the maximum size of the local variable table}
*/
int maxLocals();
/**
* {@return the maximum size of the operand stack}
*/
int maxStack();
permits CodeAttribute, BufferedCodeBuilder.Model {
/**
* {@return the enclosing method, if known}

View file

@ -47,6 +47,16 @@ import jdk.internal.javac.PreviewFeature;
public sealed interface CodeAttribute extends Attribute<CodeAttribute>, CodeModel
permits BoundAttribute.BoundCodeAttribute {
/**
* {@return the maximum size of the local variable table}
*/
int maxLocals();
/**
* {@return the maximum size of the operand stack}
*/
int maxStack();
/**
* {@return The length of the code array in bytes}
*/