| /arkcompiler/ets_frontend/ets2panda/checker/ |
| D | TSAnalyzer.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 29 checker::Type *TSAnalyzer::Check(ir::CatchClause *st) const in Check() function in ark::es2panda::checker::TSAnalyzer 32 ir::Expression *typeAnnotation = st->Param()->AsAnnotatedExpression()->TypeAnnotation(); in Check() 35 checker::Type *catchParamType = typeAnnotation->Check(checker); in Check() 37 if (!catchParamType->HasTypeFlag(checker::TypeFlag::ANY_OR_UNKNOWN)) { in Check() 38 …checker->ThrowTypeError("Catch clause variable type annotation must be 'any' or 'unknown' if speci… in Check() 39 st->Start()); in Check() 43 st->Body()->Check(checker); in Check() 48 checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::ClassDefinition *node) const in Check() function in ark::es2panda::checker::TSAnalyzer [all …]
|
| /arkcompiler/runtime_core/tests/cts-generator/cts-template/ |
| D | test-schema.json | 2 "type": "object", string 4 "file-name", 10 "file-name": { 11 "type": "string" string 14 "type": "boolean" string 17 "type": "boolean" string 20 "type": "object", string 28 "type": "string" string 31 "type": "string" string 34 "type": "array", string [all …]
|
| D | monitor.yaml | 1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 14 --- 16 - name: PandaAssembly 68 - file-name: 'monitor' 79 … that case monitor is acquired by thread and monitor count is set to 1. The thread becomes the 88 - file-name: 'null_monitor' 89 description: Check panda.NullPointerException when accumulator contains null 92 - sig: monitorenter 97 - sig: monitorexit [all …]
|
| D | jmp.yaml | 1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 16 - file-name: "jmp" 23 - branch_target 25 - x_none 27 - file-name: "op_none" 30 - sig: jmp imm:i32 33 … description: Check execution is transferred, jump forward, backward, jump on current instruction. 34 code-template: | 37 check-type: exit-positive [all …]
|
| /arkcompiler/runtime_core/static_core/tests/cts-generator/cts-template/ |
| D | test-schema.json | 2 "type": "object", string 4 "file-name", 10 "file-name": { 11 "type": "string" string 14 "type": "boolean" string 17 "type": "boolean" string 20 "type": "object", string 28 "type": "string" string 31 "type": "string" string 34 "type": "array", string [all …]
|
| D | jmp.yaml | 1 # Copyright (c) 2021-2024 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 16 - file-name: "jmp" 23 - branch_target 25 - x_none 27 - file-name: "op_none" 30 - sig: jmp imm:i32 33 … description: Check execution is transferred, jump forward, backward, jump on current instruction. 34 code-template: | 37 check-type: exit-positive [all …]
|
| D | mov.obj.yaml | 1 # Copyright (c) 2021-2024 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 16 - file-name: "mov.obj" 18 title: Move register-to-register 21 - x_none 23 - file-name: "op_p" 26 - sig: mov.obj v1:out:ref, v2:in:ref 29 code-template: | 43 header-template: [] 44 …description: Check mov.obj with different type of arguments (empty object, with fields, with stati… [all …]
|
| /arkcompiler/ets_frontend/ets2panda/checker/typeChecker/ |
| D | TypeChecker.cpp | 2 * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 23 if (!node->TsType()->IsETSObjectType()) { in VisitArrowFunctionExpression() 24 LogTypeError({"Cannot infer arrow function type from context for type: '", node->TsType(), in VisitArrowFunctionExpression() 25 "', consider adding type explicitly"}, in VisitArrowFunctionExpression() 26 node->Start()); in VisitArrowFunctionExpression() 33 case ScriptExtension::ETS: in RunTypeChecker() 34 return ETSTypeChecker(checker).Check(node); in RunTypeChecker() 35 case ScriptExtension::JS: in RunTypeChecker() 36 return JSTypeChecker(checker).Check(node); in RunTypeChecker() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ir/ets/ |
| D | etsPrimitiveType.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 36 dumper->Add({{"type", "ETSPrimitiveType"}}); in Dump() 42 case PrimitiveType::BYTE: in Dump() 43 dumper->Add("byte"); in Dump() 45 case PrimitiveType::INT: in Dump() 46 dumper->Add("int"); in Dump() 48 case PrimitiveType::LONG: in Dump() 49 dumper->Add("long"); in Dump() 51 case PrimitiveType::SHORT: in Dump() [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/Array/LastIndexOf/ |
| D | builtinArrayLastIndexOf.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 81 print('---- Case group #1: int[] ----') //: ---- Case group #1: int[] ---- 83 print('case 1.1: ', literalIntArrayWithHole.lastIndexOf(4)) //: case 1.1: 4 87 'case 1.2: ', 89 ) //: case 1.2: 4 93 'case 1.3: ', 95 ) //: case 1.3: 2 97 print('case 1.4: ', nIntArray.lastIndexOf(4)) //: case 1.4: 4 99 print('case 1.5: ', literalIntArrayWithHole.lastIndexOf(undefined)) //: case 1.5: -1 101 print('case 1.6: ', nIntArray.lastIndexOf(nIntArray.length)) //: case 1.6: -1 [all …]
|
| /arkcompiler/ets_frontend/es2panda/ir/ts/ |
| D | tsAsExpression.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 35 …dumper->Add({{"type", "TSAsExpression"}, {"expression", expression_}, {"typeAnnotation", typeAnnot… in Dump() 40 expression_->Compile(pg); in Compile() 45 switch (arg->Type()) { in IsValidConstAssertionArgument() 46 case ir::AstNodeType::NUMBER_LITERAL: in IsValidConstAssertionArgument() 47 case ir::AstNodeType::STRING_LITERAL: in IsValidConstAssertionArgument() 48 case ir::AstNodeType::BIGINT_LITERAL: in IsValidConstAssertionArgument() 49 case ir::AstNodeType::BOOLEAN_LITERAL: in IsValidConstAssertionArgument() 50 case ir::AstNodeType::ARRAY_EXPRESSION: in IsValidConstAssertionArgument() 51 case ir::AstNodeType::OBJECT_EXPRESSION: in IsValidConstAssertionArgument() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ir/statements/ |
| D | labelledStatement.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 28 ident_->SetTransformedNode(transformationName, transformedNode); in TransformChildren() 29 ident_ = transformedNode->AsIdentifier(); in TransformChildren() 33 body_->SetTransformedNode(transformationName, transformedNode); in TransformChildren() 34 body_ = transformedNode->AsStatement(); in TransformChildren() 46 dumper->Add({{"type", "LabelledStatement"}, {"label", ident_}, {"body", body_}}); in Dump() 52 ident_->Dump(dumper); in Dump() 53 dumper->Add(":"); in Dump() 54 dumper->Endl(); in Dump() [all …]
|
| D | switchCaseStatement.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 30 test_->SetTransformedNode(transformationName, transformedNode); in TransformChildren() 31 test_ = transformedNode->AsExpression(); in TransformChildren() 37 it->SetTransformedNode(transformationName, transformedNode); in TransformChildren() 38 it = transformedNode->AsStatement(); in TransformChildren() 56 …dumper->Add({{"type", "SwitchCase"}, {"test", AstDumper::Nullish(test_)}, {"consequent", consequen… in Dump() 62 dumper->Add("case "); in Dump() 63 test_->Dump(dumper); in Dump() 64 dumper->Add(":"); in Dump() [all …]
|
| /arkcompiler/runtime_core/libabckit/include/cpp/headers/ |
| D | base_concepts.h | 7 * http://www.apache.org/licenses/LICENSE-2.0 30 * @brief Lightweight checker that ensures core<->target API conversion validity 31 * It is designed to be empty class type. 32 * In case of inheritance the empty base optimization will be applied 34 * In case of non-static member, it should be combined with ABCKIT_NO_UNIQUE_ADDRESS attribute 35 * @tparam TargetT - View class for a target specialized C API (not core) 41 * @brief Provides compile-time static contract checks 47 * pre-C++20 concept idiom with SFINAE and decltype to check type expression valideness 48 * @tparam T - type that is inspected againts the contract 49 * @note A general case to be matched (to false) if more specialized case fail [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ir/base/ |
| D | spreadElement.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 32 …sion(static_cast<AnnotatedExpression const &>(other), allocator), decorators_(allocator->Adapter()) in SpreadElement() 37 argument_ = other.argument_->Clone(allocator, this)->AsExpression(); in SpreadElement() 41 decorators_.emplace_back(decorator->Clone(allocator, this)); in SpreadElement() 47 …if (auto *const clone = allocator->New<SpreadElement>(Tag {}, *this, allocator); clone != nullptr)… in Clone() 49 clone->SetParent(parent); in Clone() 60 switch (argument_->Type()) { in ValidateExpression() 61 case AstNodeType::OBJECT_EXPRESSION: { in ValidateExpression() 62 info = argument_->AsObjectExpression()->ValidateExpression(); in ValidateExpression() [all …]
|
| D | property.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 36 auto *const key = key_ != nullptr ? key_->Clone(allocator, nullptr)->AsExpression() : nullptr; in Clone() 37 …auto *const value = value_ != nullptr ? value_->Clone(allocator, nullptr)->AsExpression() : nullpt… in Clone() 39 if (auto *const clone = allocator->New<Property>(Tag {}, *this, key, value); clone != nullptr) { in Clone() 41 key->SetParent(clone); in Clone() 44 value->SetParent(clone); in Clone() 47 clone->SetParent(parent); in Clone() 62 switch (value_->Type()) { in ConvertibleToPatternProperty() 63 case AstNodeType::OBJECT_EXPRESSION: { in ConvertibleToPatternProperty() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ir/expressions/ |
| D | assignmentExpression.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 36 switch (left_->Type()) { in ConvertibleToAssignmentPatternLeft() 37 case AstNodeType::ARRAY_EXPRESSION: { in ConvertibleToAssignmentPatternLeft() 38 return left_->AsArrayExpression()->ConvertibleToArrayPattern(); in ConvertibleToAssignmentPatternLeft() 40 case AstNodeType::SPREAD_ELEMENT: { in ConvertibleToAssignmentPatternLeft() 41 return mustBePattern && left_->AsSpreadElement()->ConvertibleToRest(false); in ConvertibleToAssignmentPatternLeft() 43 case AstNodeType::OBJECT_EXPRESSION: { in ConvertibleToAssignmentPatternLeft() 44 return left_->AsObjectExpression()->ConvertibleToObjectPattern(); in ConvertibleToAssignmentPatternLeft() 46 case AstNodeType::ASSIGNMENT_EXPRESSION: { in ConvertibleToAssignmentPatternLeft() [all …]
|
| D | arrayExpression.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 39 decorators_(allocator->Adapter()), in ArrayExpression() 40 elements_(allocator->Adapter()) in ArrayExpression() 48 elements_.emplace_back(element->Clone(allocator, this)->AsExpression()); in ArrayExpression() 52 decorators_.emplace_back(decorator->Clone(allocator, this)); in ArrayExpression() 58 …if (auto *const clone = allocator->New<ArrayExpression>(Tag {}, *this, allocator); clone != nullpt… in Clone() 60 clone->SetParent(parent); in Clone() 72 switch (it->Type()) { in ConvertibleToArrayPattern() 73 case AstNodeType::ARRAY_EXPRESSION: { in ConvertibleToArrayPattern() [all …]
|
| /arkcompiler/runtime_core/static_core/tests/cts-generator/generator/ |
| D | generator.rb | 1 # Copyright (c) 2021-2024 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 37 TEST_NAME = 'file-name' 48 TEST_PANDA_OPTIONS = 'panda-options' 49 TEST_RUN_OPTIONS = 'runner-options' 52 COMMAND_FILE_NAME = 'file-name' 53 TEST_CODE_TEMPLATE = 'code-template' 54 TEST_HEADER_TEMPLATE = 'header-template' 55 TEST_CHECK_TYPE = 'check-type' 59 TEST_TEMPLATE_CASES = 'template-cases' [all …]
|
| /arkcompiler/runtime_core/tests/cts-generator/generator/ |
| D | generator.rb | 1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 37 TEST_NAME = 'file-name' 48 TEST_PANDA_OPTIONS = 'panda-options' 49 TEST_RUN_OPTIONS = 'runner-options' 52 COMMAND_FILE_NAME = 'file-name' 53 TEST_CODE_TEMPLATE = 'code-template' 54 TEST_HEADER_TEMPLATE = 'header-template' 55 TEST_CHECK_TYPE = 'check-type' 59 TEST_TEMPLATE_CASES = 'template-cases' [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/map/Get/ |
| D | builtinMapGet.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 43 …ap = new Map([[0, 0], [0.0, 5], [-1, 1], [2.5, -2.5], [NaN, Infinity], [2000, -0.0], [56, "oops"],… 45 // Check without params 49 // Check with adding element undefined 54 // Check with single param 60 print(myMap.get(2.5)); //: -2.5 64 print("1/x: " + 1 / myMap.get(2000)); //: 1/x: -Infinity 66 // Check with 2 params 70 // Check with 3 params 72 print(myMap.get(-1, 10.2, 15)); //: 1 [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/checked/ |
| D | ets_string_builder_reserve_uber.sts | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 //! CHECKER AOT IR Builder, check StringBuilder internal buffer reserve 18 //! RUN_PAOC options: "--compiler-regex='.*reserve[0-9]*' --compiler-inlining=true" 26 //! CHECKER JIT IR Builder, check StringBuilder internal buffer reserve 28 //! RUN force_jit: true, options: "--compiler-regex='.*reserve[0-9]*' --compiler-inlining… 36 // CHECKER JIT IR Builder, check StringBuilder internal buffer reallocation events occured (u… 38 // RUN force_jit: true, options: "--compiler-reserve-string-builder-buffer=false --compil… 39 // EVENT_NEXT /SbBufferRealloc,\d+,0x[0-9a-fA-F]+,32.*/ 40 // EVENT_NEXT /SbBufferRealloc,\d+,0x[0-9a-fA-F]+,64.*/ 42 //! CHECKER JIT IR Builder, check StringBuilder internal buffer reallocation events not occur… [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/Array/ForEach/ |
| D | builtinArrayForEach.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 49 // Check without args 70 // Check inside try-block 89 //aot: [trace] Check Type: BuiltinInstanceHClassMismatch 98 //aot: [trace] Check Type: InconsistentElementsKind 105 print('case 1 forEach') //: case 1 forEach 113 print(arr2.forEach(x => x == 1)); //aot: [trace] Check Type: BuiltinInstanceHClassMismatch 120 print('case 2 forEach') //: case 2 forEach 138 print('case 3 forEach') //: case 3 forEach 150 print(marr.forEach(x => x == 1)); //aot: [trace] Check Type: BuiltinInstanceHClassMismatch [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/Array/Pop/ |
| D | builtinArrayPop.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 20 var x = [1,2.1,-1,null,undefined,,false,NaN] 38 // Check inside try-block 81 //aot: [trace] Check Type: BuiltinInstanceHClassMismatch 100 printPop(-1); //pgo: 2 101 //aot: [trace] Check Type: NotCallTarget1 102 //aot: -1 105 //aot: [trace] Check Type: NotCallTarget1 111 print('case 1 pop') //: case 1 pop 119 print(arr2.pop()); //aot: [trace] Check Type: BuiltinInstanceHClassMismatch [all …]
|
| /arkcompiler/ets_frontend/es2panda/ir/expressions/ |
| D | binaryExpression.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 33 dumper->Add({{"type", IsLogical() ? "LogicalExpression" : "BinaryExpression"}, in Dump() 42 compiler::VReg lhs = pg->AllocReg(); in CompileLogical() 47 auto *skipRight = pg->AllocLabel(); in CompileLogical() 48 auto *endLabel = pg->AllocLabel(); in CompileLogical() 50 // left -> acc -> lhs -> toboolean -> acc -> bool_lhs in CompileLogical() 51 left_->Compile(pg); in CompileLogical() 52 pg->StoreAccumulator(this, lhs); in CompileLogical() 55 pg->BranchIfFalse(this, skipRight); in CompileLogical() 57 pg->BranchIfTrue(this, skipRight); in CompileLogical() [all …]
|