LabelNode defaultLabel = new LabelNode("default");
ByteCodeNode switchBlock;
if (constantValues.size() < 1000) {
Block switchCaseBlocks = new Block(context);
LookupSwitchBuilder switchBuilder = lookupSwitchBuilder();
for (Entry<Integer, Collection<TypedByteCodeNode>> bucket : hashBuckets.asMap().entrySet()) {
LabelNode label = new LabelNode("inHash" + bucket.getKey());
switchBuilder.addCase(bucket.getKey(), label);
Collection<TypedByteCodeNode> testValues = bucket.getValue();
Block caseBlock = buildInCase(context, type, label, match, defaultLabel, testValues, false);
switchCaseBlocks
.append(caseBlock.setDescription("case " + bucket.getKey()));
}
switchBuilder.defaultCase(defaultLabel);
switchBlock = new Block(context)
.comment("lookupSwitch(hashCode(<stackValue>))")
.dup(type)
.invokeStatic(Operations.class, "hashCode", int.class, type)
.append(switchBuilder.build())
.append(switchCaseBlocks);
}
else {
// for huge IN lists, use a Set
FunctionBinding functionBinding = bootstrapFunctionBinder.bindFunction(