}
}
if (mergeFromACount == 0) {
nothingFromFirstProfile.enter();
return new RubyHash(getContext().getCoreLibrary().getHashClass(), hash.getDefaultBlock(), hash.getDefaultValue(), Arrays.copyOf(storeB, RubyHash.HASHES_SMALL * 2), storeBSize);
}
considerNothingFromSecondProfile.enter();
if (mergeFromACount == storeB.length) {
nothingFromSecondProfile.enter();
return new RubyHash(getContext().getCoreLibrary().getHashClass(), hash.getDefaultBlock(), hash.getDefaultValue(), Arrays.copyOf(storeB, RubyHash.HASHES_SMALL * 2), storeBSize);
}
considerResultIsSmallProfile.enter();
final int mergedSize = storeBSize + mergeFromACount;
if (storeBSize + mergeFromACount <= smallHashSize) {
resultIsSmallProfile.enter();
final Object[] merged = new Object[RubyHash.HASHES_SMALL * 2];
int index = 0;
for (int n = 0; n < storeASize; n++) {
if (mergeFromA[n]) {
merged[index] = storeA[n * 2];
merged[index + 1] = storeA[n * 2 + 1];
index += 2;
}
}
for (int n = 0; n < storeBSize; n++) {
merged[index] = storeB[n * 2];
merged[index + 1] = storeB[n * 2 + 1];
index += 2;
}
return new RubyHash(getContext().getCoreLibrary().getHashClass(), hash.getDefaultBlock(), hash.getDefaultValue(), merged, mergedSize);
}
CompilerDirectives.transferToInterpreter();
throw new UnsupportedOperationException();
}