JS: Add intrinsics for bitwise ops. #KT-13554
This commit is contained in:
+4
-1
@@ -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");
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user