* All constant elements in the array are initialized
* in the constructor. All non-constant elements, if any,
* are initialized each time the IN list is evaluated.
*/
/* Assign the initializer to the DataValueDescriptor[] field */
MethodBuilder cb = acb.getConstructor();
cb.pushNewArray(ClassName.DataValueDescriptor, listSize);
cb.setField(arrayField);
/* Set the array elements that are constant */
int numConstants = 0;
MethodBuilder nonConstantMethod = null;
MethodBuilder currentConstMethod = cb;
for (int index = 0; index < listSize; index++)
{
MethodBuilder setArrayMethod;
if (rightOperandList.elementAt(index) instanceof ConstantNode)
{
numConstants++;
/*if too many statements are added to a method,
*size of method can hit 65k limit, which will
*lead to the class format errors at load time.
*To avoid this problem, when number of statements added
*to a method is > 2048, remaing statements are added to a new function
*and called from the function which created the function.
*See Beetle 5135 or 4293 for further details on this type of problem.
*/
if(currentConstMethod.statementNumHitLimit(1))
{
MethodBuilder genConstantMethod = acb.newGeneratedFun("void", Modifier.PRIVATE);
currentConstMethod.pushThis();
currentConstMethod.callMethod(VMOpcode.INVOKEVIRTUAL,
(String) null,
genConstantMethod.getName(),
"void", 0);
//if it is a generate function, close the metod.
if(currentConstMethod != cb){
currentConstMethod.methodReturn();
currentConstMethod.complete();