.comment("int rightBlockPosition = decodePosition(rightPageAddress)")
.append(rightBlockPosition.set(invokeStatic(SyntheticAddress.class, "decodePosition", int.class, rightPageAddress)));
for (int i = 0; i < sortChannels.size(); i++) {
int sortChannel = sortChannels.get(i);
SortOrder sortOrder = sortOrders.get(i);
Block block = new Block(context)
.setDescription("compare channel " + sortChannel + " " + sortOrder);
Type sortType = sortTypes.get(i);
ByteCodeExpression leftBlock = context.getVariable("pagesIndex")
.invoke("getChannel", ObjectArrayList.class, constantInt(sortChannel))
.invoke("get", Object.class, leftBlockIndex)
.cast(com.facebook.presto.spi.block.Block.class);
ByteCodeExpression rightBlock = context.getVariable("pagesIndex")
.invoke("getChannel", ObjectArrayList.class, constantInt(sortChannel))
.invoke("get", Object.class, rightBlockIndex)
.cast(com.facebook.presto.spi.block.Block.class);
block.append(getStatic(SortOrder.class, sortOrder.name())
.invoke("compareBlockValue",
int.class,
ImmutableList.of(Type.class, com.facebook.presto.spi.block.Block.class, int.class, com.facebook.presto.spi.block.Block.class, int.class),
constantType(context, callSiteBinder, sortType),
leftBlock,