JS: Add intrinsics for bitwise ops. #KT-13554

This commit is contained in:
Ilya Gorbunov
2016-09-28 07:17:58 +03:00
parent 62fb47d137
commit 19922135fd
2 changed files with 5 additions and 2 deletions
@@ -115,7 +115,10 @@ public enum PrimitiveBinaryOperationFIF implements FunctionIntrinsicFactory {
private static final DescriptorPredicate PRIMITIVE_NUMBERS_COMPARE_TO_OPERATIONS =
pattern(NamePredicate.PRIMITIVE_NUMBERS_MAPPED_TO_PRIMITIVE_JS, "compareTo");
private static final DescriptorPredicate INT_WITH_BIT_OPERATIONS = pattern("Int.or|and|xor|shl|shr|ushr");
private static final Predicate<FunctionDescriptor> INT_WITH_BIT_OPERATIONS = Predicates.or(
pattern("Int.or|and|xor|shl|shr|ushr"),
pattern("Short|Byte.or|and|xor")
);
private static final DescriptorPredicate BOOLEAN_OPERATIONS = pattern("Boolean.or|and|xor");
private static final DescriptorPredicate STRING_PLUS = pattern("String.plus");
@@ -49,7 +49,7 @@ public enum PrimitiveUnaryOperationFIF implements FunctionIntrinsicFactory {
pattern(NamePredicate.PRIMITIVE_NUMBERS_MAPPED_TO_PRIMITIVE_JS, UNARY_OPERATIONS);
@NotNull
private static final Predicate<FunctionDescriptor> PRIMITIVE_UNARY_OPERATION_NAMES =
Predicates.or(UNARY_OPERATION_FOR_PRIMITIVE_NUMBER, pattern("Boolean.not"), pattern("Int.inv"));
Predicates.or(UNARY_OPERATION_FOR_PRIMITIVE_NUMBER, pattern("Boolean.not"), pattern("Int|Short|Byte.inv"));
@NotNull
private static final DescriptorPredicate NO_PARAMETERS = new DescriptorPredicate() {
@Override