JsonArray queryIdList = new JsonArray(sourceInfo, program.getJavaScriptObject());
JsonArray dimList = new JsonArray(sourceInfo, program.getJavaScriptObject());
JType cur = arrayType;
for (int i = 0; i < dims; ++i) {
// Walk down each type from most dims to least.
JArrayType curArrayType = (JArrayType) cur;
JLiteral classLit = x.getClassLiterals().get(i);
classLitList.exprs.add(classLit);
JLiteral typeIdLit = program.getLiteralInt(program.getTypeId(curArrayType));
typeIdList.exprs.add(typeIdLit);
JLiteral queryIdLit = program.getLiteralInt(tryGetQueryId(curArrayType));
queryIdList.exprs.add(queryIdLit);
dimList.exprs.add(x.dims.get(i));
cur = curArrayType.getElementType();
}
call.addArgs(classLitList, typeIdList, queryIdList, dimList,
program.getLiteralInt(dims), getSeedTypeLiteralFor(cur));
ctx.replaceMe(call);
}