use of org.wso2.ballerinalang.programfile.ProgramFileConstants.BLOB_OFFSET in project ballerina by ballerina-lang.
the class CodeGenerator method addVariableCountAttributeInfo.
private void addVariableCountAttributeInfo(ConstantPool constantPool, AttributeInfoPool attributeInfoPool, int[] fieldCount) {
UTF8CPEntry attribNameCPEntry = new UTF8CPEntry(AttributeInfo.Kind.VARIABLE_TYPE_COUNT_ATTRIBUTE.toString());
int attribNameCPIndex = constantPool.addCPEntry(attribNameCPEntry);
VarTypeCountAttributeInfo varCountAttribInfo = new VarTypeCountAttributeInfo(attribNameCPIndex);
varCountAttribInfo.setMaxLongVars(fieldCount[INT_OFFSET]);
varCountAttribInfo.setMaxDoubleVars(fieldCount[FLOAT_OFFSET]);
varCountAttribInfo.setMaxStringVars(fieldCount[STRING_OFFSET]);
varCountAttribInfo.setMaxIntVars(fieldCount[BOOL_OFFSET]);
varCountAttribInfo.setMaxByteVars(fieldCount[BLOB_OFFSET]);
varCountAttribInfo.setMaxRefVars(fieldCount[REF_OFFSET]);
attributeInfoPool.addAttributeInfo(AttributeInfo.Kind.VARIABLE_TYPE_COUNT_ATTRIBUTE, varCountAttribInfo);
}
Aggregations