/arkcompiler/ets_frontend/ets2panda/checker/ets/ |
H A D | arithmetic.cpp | 179 bool ETSChecker::CheckBinaryPlusMultDivOperandsForUnionType(const Type *leftType, const Type *rightType, in CheckBinaryPlusMultDivOperandsForUnionType() argument 190 if (rightType->IsETSUnionType()) { in CheckBinaryPlusMultDivOperandsForUnionType() 191 rightType->AsETSUnionType()->ToString(ss, false); in CheckBinaryPlusMultDivOperandsForUnionType() 205 auto [leftType, rightType, unboxedL, unboxedR] = types; in CheckBinaryOperatorMulDivMod() 208 RepairTypeErrorsInOperands(&leftType, &rightType); in CheckBinaryOperatorMulDivMod() 219 FlagExpressionWithUnboxing(rightType, unboxedR, right); in CheckBinaryOperatorMulDivMod() 221 if (!CheckBinaryPlusMultDivOperandsForUnionType(leftType, rightType, left, right)) { in CheckBinaryOperatorMulDivMod() 231 tsType = HandleArithmeticOperationOnTypes(leftType, rightType, operationType); in CheckBinaryOperatorMulDivMod() 239 const checker::Type *const rightType) in CheckBinaryOperatorPlusForEnums() 242 rightType in CheckBinaryOperatorPlusForEnums() 238 CheckBinaryOperatorPlusForEnums(const checker::Type *const leftType, const checker::Type *const rightType) CheckBinaryOperatorPlusForEnums() argument 413 CheckBinaryOperatorLogical(ir::Expression *left, ir::Expression *right, ir::Expression *expr, lexer::SourcePosition pos, checker::Type *leftType, checker::Type *rightType, Type *unboxedL, Type *unboxedR) CheckBinaryOperatorLogical() argument 449 LogOperatorCannotBeApplied(lexer::TokenType operationType, checker::Type *const leftType, checker::Type *const rightType, lexer::SourcePosition pos) LogOperatorCannotBeApplied() argument 456 CheckValidEqualReferenceType(checker::Type *const leftType, checker::Type *const rightType) CheckValidEqualReferenceType() argument 497 CheckBinaryOperatorStrictEqual(ir::Expression *left, lexer::TokenType operationType, lexer::SourcePosition pos, checker::Type *leftType, checker::Type *rightType) CheckBinaryOperatorStrictEqual() argument 533 CheckBinaryOperatorEqualError(checker::Type *const leftType, checker::Type *const rightType, checker::Type *tsType, lexer::SourcePosition pos) CheckBinaryOperatorEqualError() argument 561 CheckBinaryOperatorEqual(ir::Expression *left, ir::Expression *right, lexer::TokenType operationType, lexer::SourcePosition pos, checker::Type *leftType, checker::Type *rightType, Type *unboxedL, Type *unboxedR) CheckBinaryOperatorEqual() argument 643 NonNumericTypesAreAppropriateForComparison(Type *leftType, Type *rightType) NonNumericTypesAreAppropriateForComparison() argument 651 CheckBinaryOperatorLessGreater(ir::Expression *left, ir::Expression *right, lexer::TokenType operationType, lexer::SourcePosition pos, bool isEqualOp, checker::Type *leftType, checker::Type *rightType, Type *unboxedL, Type *unboxedR) CheckBinaryOperatorLessGreater() argument 712 CheckBinaryOperatorInstanceOf(lexer::SourcePosition pos, checker::Type *leftType, checker::Type *rightType) CheckBinaryOperatorInstanceOf() argument 763 auto *rightType = right->TsType(); CheckBinaryOperatorNullishCoalescing() local 839 checker::Type *rightType; global() member 852 checker::Type *const rightType = typeParams.rightType; CheckBinaryOperatorHelper() member in ark::es2panda::checker::checker 1054 auto rightType = right->Check(this); CheckBinaryOperator() local 1064 checker::Type *rightType = right->Check(this); CheckBinaryOperator() local [all...] |
H A D | helpers.cpp | 437 Type *ETSChecker::HandleBooleanLogicalOperatorsExtended(Type *leftType, Type *rightType, ir::BinaryExpression *expr) in HandleBooleanLogicalOperatorsExtended() argument 439 ASSERT(leftType->IsConditionalExprType() && rightType->IsConditionalExprType()); in HandleBooleanLogicalOperatorsExtended() 442 auto [resolveRight, rightValue] = IsResolvedAndValue(expr->Right(), rightType); in HandleBooleanLogicalOperatorsExtended() 444 if (!resolveLeft && !resolveRight && IsTypeIdenticalTo(leftType, rightType)) { in HandleBooleanLogicalOperatorsExtended() 456 return rightType->IsETSBooleanType() && resolveRight ? CreateETSBooleanType(rightValue) : rightType; in HandleBooleanLogicalOperatorsExtended() 461 return rightType->IsETSBooleanType() && resolveRight ? CreateETSBooleanType(rightValue) : rightType; in HandleBooleanLogicalOperatorsExtended() 475 Type *ETSChecker::HandleBooleanLogicalOperators(Type *leftType, Type *rightType, lexer::TokenType tokenType) in HandleBooleanLogicalOperators() argument 478 ASSERT(leftType->IsETSBooleanType() && rightType in HandleBooleanLogicalOperators() 1502 HandleStringConcatenation(Type *leftType, Type *rightType) HandleStringConcatenation() argument [all...] |
/arkcompiler/ets_frontend/es2panda/typescript/core/ |
H A D | binaryLikeExpression.cpp | 23 Type *Checker::CheckBinaryOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr, in CheckBinaryOperator() argument 27 CheckNonNullType(rightType, rightExpr->Start()); in CheckBinaryOperator() 29 if (leftType->HasTypeFlag(TypeFlag::BOOLEAN_LIKE) && rightType->HasTypeFlag(TypeFlag::BOOLEAN_LIKE)) { in CheckBinaryOperator() 68 if (!rightType->HasTypeFlag(TypeFlag::VALID_ARITHMETIC_TYPE)) { in CheckBinaryOperator() 77 if ((leftType->IsAnyType() && rightType->IsAnyType()) || in CheckBinaryOperator() 78 !(leftType->HasTypeFlag(TypeFlag::BIGINT_LIKE) || rightType->HasTypeFlag(TypeFlag::BIGINT_LIKE))) { in CheckBinaryOperator() 80 } else if (leftType->HasTypeFlag(TypeFlag::BIGINT_LIKE) && rightType->HasTypeFlag(TypeFlag::BIGINT_LIKE)) { in CheckBinaryOperator() 87 ThrowBinaryLikeError(op, leftType, rightType, expr->Start()); in CheckBinaryOperator() 94 Type *Checker::CheckPlusOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr, in CheckPlusOperator() argument 97 if (!leftType->HasTypeFlag(TypeFlag::STRING_LIKE) && !rightType in CheckPlusOperator() 126 CheckCompareOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr, const ir::Expression *rightExpr, const ir::AstNode *expr, lexer::TokenType op) CheckCompareOperator() argument 142 CheckAndOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr) CheckAndOperator() argument 154 CheckOrOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr) CheckOrOperator() argument 173 CheckInstanceofExpression(Type *leftType, Type *rightType, const ir::Expression *rightExpr, const ir::AstNode *expr) CheckInstanceofExpression() argument 192 CheckInExpression(Type *leftType, Type *rightType, const ir::Expression *leftExpr, const ir::Expression *rightExpr, const ir::AstNode *expr) CheckInExpression() argument [all...] |
H A D | helpers.cpp | 281 void Checker::ThrowBinaryLikeError(lexer::TokenType op, Type *leftType, Type *rightType, lexer::SourcePosition lineInfo) in ThrowBinaryLikeError() argument 284 ThrowTypeError({"operator ", op, " cannot be applied to types ", leftType, " and ", AsSrc(rightType)}, in ThrowBinaryLikeError() 288 ThrowTypeError({"operator ", op, " cannot be applied to types ", leftType, " and ", rightType}, lineInfo); in ThrowBinaryLikeError()
|
/arkcompiler/ets_frontend/ets2panda/checker/ts/ |
H A D | binaryLikeExpression.cpp | 23 void TSChecker::CheckBooleanLikeType(Type *leftType, Type *rightType, ir::AstNode *expr, lexer::TokenType op) in CheckBooleanLikeType() argument 25 if (leftType->HasTypeFlag(TypeFlag::BOOLEAN_LIKE) && rightType->HasTypeFlag(TypeFlag::BOOLEAN_LIKE)) { in CheckBooleanLikeType() 60 CheckNonNullType(leftRightType->rightType, rightExpr->Start()); in CheckBinaryOperator() 62 CheckBooleanLikeType(leftRightType->leftType, leftRightType->rightType, expr, op); in CheckBinaryOperator() 72 if (!leftRightType->rightType->HasTypeFlag(TypeFlag::VALID_ARITHMETIC_TYPE)) { in CheckBinaryOperator() 81 if ((leftRightType->leftType->IsAnyType() && leftRightType->rightType->IsAnyType()) || in CheckBinaryOperator() 83 leftRightType->rightType->HasTypeFlag(TypeFlag::BIGINT_LIKE))) { in CheckBinaryOperator() 86 leftRightType->rightType->HasTypeFlag(TypeFlag::BIGINT_LIKE)) { in CheckBinaryOperator() 93 ThrowBinaryLikeError(op, leftRightType->leftType, leftRightType->rightType, expr->Start()); in CheckBinaryOperator() 104 !leftRightType->rightType in CheckPlusOperator() 153 CheckAndOperator(Type *leftType, Type *rightType, ir::Expression *leftExpr) CheckAndOperator() argument 165 CheckOrOperator(Type *leftType, Type *rightType, ir::Expression *leftExpr) CheckOrOperator() argument 184 CheckInstanceofExpression(Type *leftType, Type *rightType, ir::Expression *rightExpr, ir::AstNode *expr) CheckInstanceofExpression() argument 203 CheckInExpression(Type *leftType, Type *rightType, ir::Expression *leftExpr, ir::Expression *rightExpr, ir::AstNode *expr) CheckInExpression() argument [all...] |
H A D | helpers.cpp | 279 void TSChecker::ThrowBinaryLikeError(lexer::TokenType op, Type *leftType, Type *rightType, in ThrowBinaryLikeError() argument 283 ThrowTypeError({"operator ", op, " cannot be applied to types ", leftType, " and ", AsSrc(rightType)}, in ThrowBinaryLikeError() 287 ThrowTypeError({"operator ", op, " cannot be applied to types ", leftType, " and ", rightType}, lineInfo); in ThrowBinaryLikeError()
|
/arkcompiler/ets_frontend/es2panda/ir/expressions/ |
H A D | binaryExpression.cpp | 132 auto *rightType = right_->Check(checker); in Check() local 146 return checker->CheckBinaryOperator(leftType, rightType, left_, right_, this, operator_); in Check() 149 return checker->CheckPlusOperator(leftType, rightType, left_, right_, this, operator_); in Check() 153 return checker->CheckCompareOperator(leftType, rightType, left_, right_, this, operator_); in Check() 159 if (checker->IsTypeEqualityComparableTo(leftType, rightType) || in Check() 160 checker->IsTypeEqualityComparableTo(rightType, leftType)) { in Check() 164 checker->ThrowBinaryLikeError(operator_, leftType, rightType, Start()); in Check() 167 return checker->CheckInstanceofExpression(leftType, rightType, right_, this); in Check() 170 return checker->CheckInExpression(leftType, rightType, left_, right_, this); in Check() 173 return checker->CheckAndOperator(leftType, rightType, left in Check() [all...] |
H A D | assignmentExpression.cpp | 201 auto *rightType = right_->Check(checker); in Check() local 215 return checker->CheckBinaryOperator(leftType, rightType, left_, right_, this, operator_); in Check() 218 return checker->CheckPlusOperator(leftType, rightType, left_, right_, this, operator_); in Check() 222 return checker->CheckCompareOperator(leftType, rightType, left_, right_, this, operator_); in Check() 225 checker->CheckAssignmentOperator(operator_, left_, leftType, rightType); in Check() 226 return rightType; in Check()
|
/arkcompiler/ets_frontend/ets2panda/checker/ |
H A D | TSchecker.h | 111 Type *rightType; member 283 [[noreturn]] void ThrowBinaryLikeError(lexer::TokenType op, Type *leftType, Type *rightType, 378 Type *CheckAndOperator(Type *leftType, Type *rightType, ir::Expression *leftExpr); 379 Type *CheckOrOperator(Type *leftType, Type *rightType, ir::Expression *leftExpr); 380 Type *CheckInstanceofExpression(Type *leftType, Type *rightType, ir::Expression *rightExpr, ir::AstNode *expr); 381 Type *CheckInExpression(Type *leftType, Type *rightType, ir::Expression *leftExpr, ir::Expression *rightExpr, 391 void CheckBooleanLikeType(Type *leftType, Type *rightType, ir::AstNode *expr, lexer::TokenType op);
|
H A D | ETSchecker.h | 290 [[nodiscard]] bool CheckBinaryPlusMultDivOperandsForUnionType(const Type *leftType, const Type *rightType, 304 const checker::Type *const rightType); 316 checker::Type *rightType, Type *unboxedL, Type *unboxedR); 319 checker::Type *rightType); 321 checker::Type *const rightType, 326 checker::Type *leftType, checker::Type *rightType, 333 checker::Type *rightType, Type *unboxedL, Type *unboxedR); 335 checker::Type *rightType); 520 Type *HandleBooleanLogicalOperators(Type *leftType, Type *rightType, lexer::TokenType tokenType); 521 Type *HandleBooleanLogicalOperatorsExtended(Type *leftType, Type *rightType, i [all...] |
H A D | TSAnalyzer.cpp | 340 checker::Type *rightType) const in CheckAssignmentExprOperatorType() 345 leftRightType.rightType = rightType; in CheckAssignmentExprOperatorType() 365 checker->CheckAssignmentOperator(expr->OperatorType(), expr->Left(), leftType, rightType); in CheckAssignmentExprOperatorType() 366 return rightType; in CheckAssignmentExprOperatorType() 414 auto *rightType = expr->Right()->Check(checker); in Check() local 416 return CheckAssignmentExprOperatorType(expr, leftType, rightType); in Check() 447 return checker->CheckAndOperator(leftRightType->leftType, leftRightType->rightType, expr->Left()); in CheckBinaryExprArithmLogical() 450 return checker->CheckOrOperator(leftRightType->leftType, leftRightType->rightType, expr->Left()); in CheckBinaryExprArithmLogical() 463 leftRightType.rightType in Check() [all...] |
H A D | TSAnalyzer.h | 42 checker::Type *rightType) const;
|
H A D | ETSAnalyzer.h | 56 checker::Type *rightType) const;
|
H A D | ETSAnalyzer.cpp | 807 checker::Type *rightType) const in GetSmartType() 814 smartType = checker->ResolveSmartType(rightType, leftType); in GetSmartType() 863 auto [rightType, relationNode] = CheckAssignmentExprOperatorType(expr, leftType); in Check() 864 if (rightType == nullptr) { in Check() 870 const checker::Type *sourceType = checker->TryGettingFunctionTypeFromInvokeFunction(rightType); in Check() 872 checker::AssignmentContext(checker->Relation(), relationNode, rightType, leftType, expr->Right()->Start(), in Check() 875 checker::Type *smartType = GetSmartType(expr, leftType, rightType); in Check()
|
/arkcompiler/ets_frontend/es2panda/typescript/ |
H A D | checker.h | 360 [[noreturn]] void ThrowBinaryLikeError(lexer::TokenType op, Type *leftType, Type *rightType, 459 Type *CheckBinaryOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr, 461 Type *CheckPlusOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr, 463 Type *CheckCompareOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr, 465 Type *CheckAndOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr); 466 Type *CheckOrOperator(Type *leftType, Type *rightType, const ir::Expression *leftExpr); 467 Type *CheckInstanceofExpression(Type *leftType, Type *rightType, const ir::Expression *rightExpr, 469 Type *CheckInExpression(Type *leftType, Type *rightType, const ir::Expression *leftExpr,
|
/arkcompiler/ets_runtime/ecmascript/compiler/ |
H A D | number_speculative_retype.h | 143 void ConvertForIntOperator(GateRef gate, GateType leftType, GateType rightType); 144 void ConvertForShiftAndLogicalOperator(GateRef gate, GateType leftType, GateType rightType); 145 void ConvertForDoubleOperator(GateRef gate, GateType leftType, GateType rightType);
|
H A D | compiler_log.cpp | 275 GateType rightType = acc_.GetGateType(right); in CollectGateTypeLogInfo() local 283 if (rightType.IsIntType()) { in CollectGateTypeLogInfo() 285 } else if (rightType.IsDoubleType()) { in CollectGateTypeLogInfo()
|
H A D | share_gate_meta_data.h | 448 static uint64_t ToValue(ParamType leftType, GateType rightType) in ToValue() argument 450 return LeftBits::Encode(leftType.Value()) | RightBits::Encode(rightType.Value()); in ToValue()
|
H A D | number_speculative_retype.cpp | 1035 void NumberSpeculativeRetype::ConvertForIntOperator(GateRef gate, GateType leftType, GateType rightType) in ConvertForIntOperator() argument 1041 acc_.ReplaceValueIn(gate, CheckAndConvertToInt32(right, rightType), 1); in ConvertForIntOperator() 1047 void NumberSpeculativeRetype::ConvertForShiftAndLogicalOperator(GateRef gate, GateType leftType, GateType rightType) in ConvertForShiftAndLogicalOperator() argument 1052 GateRef cRight = CheckAndConvertToInt32(right, rightType, ConvertSupport::ENABLE, OpType::SHIFT_AND_LOGICAL); in ConvertForShiftAndLogicalOperator() 1061 void NumberSpeculativeRetype::ConvertForDoubleOperator(GateRef gate, GateType leftType, GateType rightType) in ConvertForDoubleOperator() argument 1067 acc_.ReplaceValueIn(gate, CheckAndConvertToFloat64(right, rightType), 1); in ConvertForDoubleOperator()
|
H A D | typed_hcr_lowering.cpp | 739 GateType rightType = accessor.GetRightType(); in LowerTypeConvert() local 740 if (rightType.IsNumberType()) { in LowerTypeConvert()
|