| /arkcompiler/ets_runtime/ecmascript/ |
| D | js_bigint.cpp | 27 uint32_t res = 0; in CharToInt() 28 if (c >= '0' && c <= '9') { in CharToInt() 29 res = c - '0'; in CharToInt() 40 ASSERT(conversionToRadix != 0); in Division() 41 uint32_t temp = 0; in Division() 42 remain = 0; in Division() 43 for (size_t i = 0; i < num.size(); i++) { in Division() 48 size_t count = 0; in Division() 49 while (count < num.size() && num[count] == '0') { in Division() 57 ASSERT(conversionToRadix != 0); in Conversion() [all …]
|
| D | js_bigint.h | 28 enum class Operate : uint32_t { AND = 0, OR, XOR }; 48 static bool Equal(const JSTaggedValue &x, const JSTaggedValue &y); 49 static bool SameValue(const JSTaggedValue &x, const JSTaggedValue &y); 50 static bool SameValueZero(const JSTaggedValue &x, const JSTaggedValue &y); 52 …static JSHandle<BigInt> BitwiseOp(JSThread *thread, Operate op, JSHandle<BigInt> x, JSHandle<BigIn… 53 static JSHandle<BigInt> BitwiseAND(JSThread *thread, JSHandle<BigInt> x, JSHandle<BigInt> y); 54 static JSHandle<BigInt> BitwiseXOR(JSThread *thread, JSHandle<BigInt> x, JSHandle<BigInt> y); 55 static JSHandle<BigInt> BitwiseOR(JSThread *thread, JSHandle<BigInt> x, JSHandle<BigInt> y); 62 static JSHandle<BigInt> UnaryMinus(JSThread *thread, JSHandle<BigInt> x); 63 static JSHandle<BigInt> BitwiseNOT(JSThread *thread, JSHandle<BigInt> x); [all …]
|
| /arkcompiler/runtime_core/libpandabase/utils/ |
| D | math_helpers.h | 30 * @param X - should be power of 2 31 * @return log2(X) or undefined if X 0 33 constexpr uint32_t GetIntLog2(const uint32_t X) in GetIntLog2() argument 35 ASSERT((X > 0) && !(X & (X - 1U))); in GetIntLog2() 36 return static_cast<uint32_t>(panda_bit_utils_ctz(X)); in GetIntLog2() 41 * @param X - of type uint64_t, should be power of 2 42 * @return log2(X) or undefined if X 0 44 constexpr uint64_t GetIntLog2(const uint64_t X) in GetIntLog2() argument 46 ASSERT((X > 0) && !(X & (X - 1U))); in GetIntLog2() 47 return static_cast<uint64_t>(panda_bit_utils_ctzll(X)); in GetIntLog2() [all …]
|
| D | bit_utils.h | 46 constexpr int Clz(T x) in Clz() argument 53 ASSERT(x != 0U); in Clz() 56 return panda_bit_utils_clzll(x); in Clz() 58 …return panda_bit_utils_clz(x) - (std::numeric_limits<uint32_t>::digits - std::numeric_limits<T>::d… in Clz() 62 constexpr int Ctz(T x) in Ctz() argument 69 ASSERT(x != 0U); in Ctz() 72 return panda_bit_utils_ctzll(x); in Ctz() 74 return panda_bit_utils_ctz(x); in Ctz() 78 constexpr int Popcount(T x) in Popcount() argument 87 return panda_bit_utils_popcountll(x); in Popcount() [all …]
|
| D | type_helpers.h | 45 constexpr size_t UnsignedDifference(size_t x, size_t y) in UnsignedDifference() argument 47 return x > y ? x - y : 0; in UnsignedDifference() 50 constexpr uint64_t UnsignedDifferenceUint64(uint64_t x, uint64_t y) in UnsignedDifferenceUint64() argument 52 return x > y ? x - y : 0; in UnsignedDifferenceUint64() 64 std::int64_t hi {0}; 65 std::int64_t lo {0}; 68 return (hi == 0) && (lo == v);
|
| /arkcompiler/ets_frontend/ts2panda/tests/ |
| D | scope.test.ts | 34 let variable = scope.add("x", VarDeclarationKind.NONE); 36 let { scope: sp, level: lv, v: outVariable } = scope.find("x"); 38 expect(lv).to.be.equal(0); 44 let variable = scope.add("x", VarDeclarationKind.VAR); 46 let { scope: sp, level: lv, v: outVariable } = scope.find("x"); 48 expect(lv).to.be.equal(0); 54 let variable = scope.add("x", VarDeclarationKind.LET); 56 let { scope: sp, level: lv, v: outVariable } = scope.find("x"); 58 expect(lv).to.be.equal(0); 64 let variable = scope.add("x", VarDeclarationKind.CONST); [all …]
|
| /arkcompiler/ets_runtime/ecmascript/compiler/ |
| D | common_stubs.cpp | 35 GateRef glue = PtrArgument(0); in GenerateCircuit() 36 GateRef x = TaggedArgument(1); in GenerateCircuit() local 39 Return(operationBuilder.Add(glue, x, y)); in GenerateCircuit() 44 GateRef glue = PtrArgument(0); in GenerateCircuit() 45 GateRef x = TaggedArgument(1); in GenerateCircuit() local 48 Return(operationBuilder.Sub(glue, x, y)); in GenerateCircuit() 53 GateRef glue = PtrArgument(0); in GenerateCircuit() 54 GateRef x = TaggedArgument(1); in GenerateCircuit() local 57 Return(operationBuilder.Mul(glue, x, y)); in GenerateCircuit() 62 GateRef glue = PtrArgument(0); in GenerateCircuit() [all …]
|
| D | circuit_builder-inl.h | 31 return TruncInt32ToInt1(Int32(0)); in False() 39 GateRef CircuitBuilder::Equal(GateRef x, GateRef y) in Equal() argument 41 auto xType = acc_.GetMachineType(x); in Equal() 50 return BinaryCmp(circuit_->Icmp(static_cast<uint64_t>(ICmpCondition::EQ)), x, y); in Equal() 53 return BinaryCmp(circuit_->Fcmp(static_cast<uint64_t>(FCmpCondition::OEQ)), x, y); in Equal() 59 GateRef CircuitBuilder::NotEqual(GateRef x, GateRef y) in NotEqual() argument 61 auto xType = acc_.GetMachineType(x); in NotEqual() 70 return BinaryCmp(circuit_->Icmp(static_cast<uint64_t>(ICmpCondition::NE)), x, y); in NotEqual() 73 return BinaryCmp(circuit_->Fcmp(static_cast<uint64_t>(FCmpCondition::ONE)), x, y); in NotEqual() 93 GateRef CircuitBuilder::GetInt64OfTInt(GateRef x) in GetInt64OfTInt() argument [all …]
|
| /arkcompiler/ets_runtime/test/aottest/try_catch_finally/ |
| D | try_catch_finally.ts | 16 var x; 18 mycars[0] = "Saab"; 22 var fin = 0; 23 var i = 0; 24 for (x in mycars) { 38 var c2 = 0, fin2 = 0; 39 for (x in mycars) { 55 var c3 = 0, fin3 = 0; 56 for (x in mycars) { 67 fin3 = 0; [all …]
|
| /arkcompiler/ets_frontend/ts2panda/tests/expression/ |
| D | typeOf.test.ts | 41 IRNode.pg = new PandaGen("", creatAstFromSnippet("typeof 5"), 0, undefined); 45 new Typeof(new Imm(0)), 54 IRNode.pg = new PandaGen("", creatAstFromSnippet("typeof Number(\"5\")"), 0, undefined); 59 new Tryldglobalbyname(new Imm(0), "Number"), 73 it("typeof x", function () { 74 let insns = compileMainSnippet("typeof x"); 75 IRNode.pg = new PandaGen("", creatAstFromSnippet("typeof x"), 0, undefined); 79 new Ldobjbyname(new Imm(0), "x"), 87 it("typeof(x)", function () { 88 let insns = compileMainSnippet("typeof(x)"); [all …]
|
| D | cmpBinary.test.ts | 58 IRNode.pg = new PandaGen("foo", creatAstFromSnippet("2 < 3;"), 0, undefined); 67 new Less(new Imm(0), lhs), 81 IRNode.pg = new PandaGen("foo", creatAstFromSnippet("3 > 1;"), 0, undefined); 90 new Greater(new Imm(0), lhs), 104 IRNode.pg = new PandaGen("foo", creatAstFromSnippet("3 <= 4;"), 0, undefined); 113 new Lesseq(new Imm(0), lhs), 127 IRNode.pg = new PandaGen("foo", creatAstFromSnippet("3 >= 2;"), 0, undefined); 136 new Greatereq(new Imm(0), lhs), 150 IRNode.pg = new PandaGen("foo", creatAstFromSnippet("3 == 3;"), 0, undefined); 159 new Eq(new Imm(0), lhs), [all …]
|
| /arkcompiler/ets_runtime/ecmascript/builtins/ |
| D | builtins_number.cpp | 42 // 2. Else Let n be +0. in NumberConstructor() 43 JSTaggedNumber numberValue(0); in NumberConstructor() 44 if (argv->GetArgsNumber() > 0) { in NumberConstructor() 45 JSHandle<JSTaggedValue> value = GetCallArg(argv, 0); in NumberConstructor() 78 JSTaggedValue msg = GetCallArg(argv, 0).GetTaggedValue(); in IsFinite() 93 JSHandle<JSTaggedValue> msg = GetCallArg(argv, 0); in IsInteger() 114 JSTaggedValue msg = GetCallArg(argv, 0).GetTaggedValue(); in IsNaN() 130 JSHandle<JSTaggedValue> msg = GetCallArg(argv, 0); in IsSafeInteger() 153 JSHandle<JSTaggedValue> msg = GetCallArg(argv, 0); in ParseFloat() 169 double result = NumberHelper::StringToDouble(str.begin(), str.end(), 0, base::IGNORE_TRAILING); in ParseFloat() [all …]
|
| D | builtins_date.cpp | 47 if (length == 0) { // no value in DateConstructor() 50 JSHandle<JSTaggedValue> value = GetCallArg(argv, 0); in DateConstructor() 69 std::array<int64_t, DATE_LENGTH> fields = {0, 0, 1, 0, 0, 0, 0, 0, 0}; in DateConstructor() 73 uint32_t i = 0; in DateConstructor() 83 if (i == 0 && fields[0] >= 0 && fields[0] < JSDate::HUNDRED) { in DateConstructor() 84 fields[0] += JSDate::NINETEEN_HUNDRED_YEAR; in DateConstructor() 148 JSTaggedNumber res = JSTaggedValue::ToNumber(thread, GetCallArg(argv, 0)); in SetTime() 183 EcmaInterpreter::NewRuntimeCallInfo(thread, undefined, objectHandle, undefined, 0); in ToJSON() 213 JSHandle<JSTaggedValue> hint = GetCallArg(argv, 0); in ToPrimitive() 246 // Let x be ? thisTimeValue(this value). in ToLocaleString() [all …]
|
| /arkcompiler/runtime_core/tests/cts-generator/cts-template/ |
| D | fp.yaml | 52 ldai 0 65 # sin(PI * x / 2) approximation using polynom A1*x + A3*x^3 + A5*x^5 + A7*x^7 66 … # Where A[i] is coefficients of Chebyshev polynomial approximation of sin(PI * x / 2) on [-1; 1] 68 mov.64 v1, a0 # v1 = x 69 lda.64 a0 # x 71 fmul2.64 v2 # x*A1 72 sta.64 v0 # v0 = A1 * x 74 call.short pow, v2, v1 # acc = x^3 76 fmul2.64 v2 # acc = A3 * x^3 78 sta.64 v0 # v0 = A1*x + A3*x^3 [all …]
|
| /arkcompiler/runtime_core/verification/util/ |
| D | int_set.h | 46 bool Contains(T x) const in Contains() argument 48 return repr_->Contains(x); in Contains() 56 void Insert(T x) in Insert() argument 58 repr_->Insert(x); in Insert() 91 return repr.repr_[0]; in TheOnlyElement() 220 virtual ReprType Type() const = 0; 221 virtual bool Contains(T x) const = 0; 222 virtual void Insert(T x) = 0; 223 virtual size_t Size() const = 0; 224 virtual IntSet<T, THRESHOLD> Intersect(const SmallRepr &other) const = 0; [all …]
|
| /arkcompiler/runtime_core/compiler/tests/ |
| D | graph_cloner_test.cpp | 36 CONSTANT(0, 0); // initial in TEST_F() 39 PARAMETER(13, 0).s32(); // X in TEST_F() 44 INST(14, Opcode::Compare).CC(ConditionCode::CC_LT).b().Inputs(0, 13); // i < X in TEST_F() 45 INST(15, Opcode::IfImm).SrcType(DataType::BOOL).CC(CC_NE).Imm(0).Inputs(14); in TEST_F() 49 INST(4, Opcode::Phi).s32().Inputs(0, 10); in TEST_F() 50 INST(7, Opcode::SaveState).Inputs(0, 1, 2, 3).SrcVregs({0, 1, 2, 3}); in TEST_F() 52 INST(9, Opcode::StoreArray).s32().Inputs(3, 8, 0); // a[i] = 0 in TEST_F() 54 INST(5, Opcode::Compare).CC(ConditionCode::CC_LT).b().Inputs(10, 13); // i < X in TEST_F() 55 INST(6, Opcode::IfImm).SrcType(DataType::BOOL).CC(CC_NE).Imm(0).Inputs(5); in TEST_F() 59 INST(16, Opcode::Phi).s32().Inputs(0, 10); in TEST_F() [all …]
|
| /arkcompiler/runtime_core/irtoc/scripts/ |
| D | common.irt | 29 …arm64: {fp: 29, sp: 31, ret: 0, arg0: 0, arg1: 1, arg2: 2, arg3: 3, arg4: 4, arg5: 5, arg6: 6, arg… 30 arm32: {fp: 11, sp: 13, ret: 0, arg0: 0, arg1: 1, arg2: 2, arg3: 3}, 31 x86_64: {fp: 9, sp: 10, ret: 0, arg0: 7, arg1: 6, arg2: 2, arg3: 1, arg4: 8, arg5: 5} 35 …= Regmap.new(Options.arch_info.temp_regs.each_with_index.map { |x, i| ["tmp#{i}".to_sym, x] }.to_h, 39 arm64: (19..28).each_with_index.map { |x, i| ["callee#{i}".to_sym, x] }.to_h, 40 arm32: (4..10).each_with_index.map { |x, i| ["callee#{i}".to_sym, x] }.to_h, 41 x86_64: (11..15).each_with_index.map { |x, i| ["callee#{i}".to_sym, x] }.to_h, 45 arm64: (0..18).each_with_index.map { |x, i| ["caller#{i}".to_sym, x] }.to_h, 46 arm32: (0..3).each_with_index.map { |x, i| ["caller#{i}".to_sym, x] }.to_h, 47 x86_64: (0..8).each_with_index.map { |x, i| ["caller#{i}".to_sym, x] }.to_h, [all …]
|
| /arkcompiler/runtime_core/irtoc/lang/ |
| D | regmask.rb | 23 @value = 0 33 if args[0].is_a?(Regmap) 34 @regmap = args[0] 36 elsif args[0].nil? 38 elsif args[0].is_a?(RegMask) 39 @regmap = args[-0].regmap 40 @value = args[0].value 84 @value & (1 << position) != 0 91 other_value = other.data.values.inject(0) { |res, x| res | (1 << x) } 109 other_value = other.data.values.inject(0) { |res, x| res | (1 << x) } [all …]
|
| /arkcompiler/runtime_core/runtime/interpreter/ |
| D | math_helpers.h | 29 constexpr T operator()(const T &x, const T &y) const in operator() 34 return static_cast<T>(static_cast<unsigned_type>(x) << shift); in operator() 40 constexpr T operator()(const T &x, const T &y) const in operator() 45 return static_cast<T>(static_cast<unsigned_type>(x) >> shift); in operator() 51 constexpr T operator()(const T &x, const T &y) const in operator() 56 return x >> shift; // NOLINT(hicpp-signed-bitwise) in operator() 62 constexpr T operator()(const T &x, const T &y) const in operator() 65 return std::fmod(x, y); in operator() 71 constexpr int32_t operator()(const T &x, const T &y) const in operator() 75 if (x > y) { in operator() [all …]
|
| /arkcompiler/ets_frontend/es2panda/typescript/types/ |
| D | typeFlag.h | 26 NONE = 0, 27 NUMBER = 1ULL << 0, // x: number 28 STRING = 1ULL << 1, // x: string 29 BOOLEAN = 1ULL << 2, // x: boolean 30 VOID = 1ULL << 3, // x: void 31 NULL_TYPE = 1ULL << 4, // x: null 32 UNDEFINED = 1ULL << 5, // x: undefined 33 UNKNOWN = 1ULL << 6, // x: unknown 34 NEVER = 1ULL << 7, // x: never 35 UNION = 1ULL << 8, // x: a | b [all …]
|
| /arkcompiler/ets_frontend/testTs/ |
| D | test-case.patch | 728 @@ -0,0 +1,11 @@ 746 @@ -0,0 +1,18 @@ 762 + const x: string; 763 + export default x; 788 @@ -3,4 +3,6 @@ export declare var x; 802 @@ -0,0 +1,6 @@ 814 @@ -0,0 +1,2 @@ 822 @@ -0,0 +1,4 @@ 833 @@ -0,0 +1,5 @@ 835 +import {x} from "./reExportX"; [all …]
|
| /arkcompiler/runtime_core/libpandabase/tests/ |
| D | string_helpers_test.cpp | 30 EXPECT_EQ(Format("%s %d %c", "a", 10, 0x31), "a 10 1"); in TEST() 33 for (size_t i = 0; i < 10000; i++) { in TEST() 44 errno = 0; in TEST() 45 int i = 0; in TEST() 47 ASSERT_FALSE(ParseInt("x", &i)); in TEST() 49 errno = 0; in TEST() 50 ASSERT_FALSE(ParseInt("123x", &i)); in TEST() 55 ASSERT_EQ(0, errno); in TEST() 56 i = 0; in TEST() 61 i = 0; in TEST() [all …]
|
| /arkcompiler/runtime_core/runtime/mem/ |
| D | runslots_allocator.h | 239 // |x|x|x|x|x|x|x|x|x|x|x|x|x|x|x| 247 // |0|0|0|0|0|0|0|0|0|0| 307 return start_mem_ != 0; in IsInitialized()
|
| /arkcompiler/ets_runtime/ecmascript/compiler/assembler/x64/ |
| D | assembler_x64.h | 22 rax = 0, 42 Times1 = 0, 72 int32_t disp_ = 0; 73 uint8_t rex_ = 0; 74 uint8_t sib_ = 0; 75 uint8_t moderm_ = 0; 89 void Pushq(Register x); 90 void Pushq(Immediate x); 91 void Push(Register x); 92 void Popq(Register x); [all …]
|
| /arkcompiler/runtime_core/runtime/templates/ |
| D | shorty_values.h.erb | 23 #define SHORTY_<%= type.name.upcase %> 0x<%= type.code.to_s(16) %> 35 #define SHORTY_FIRST_NONVOID 0x<%= first_nonvoid.to_s(16) %> 37 #define SHORTY_FIRST_32 0x<%= first_32.to_s(16) %> 39 #define SHORTY_LAST_INT32 0x<%= last_int32.to_s(16) %> 41 #define SHORTY_FIRST_64 0x<%= first_64.to_s(16) %> 43 #define SHORTY_FIRST_FLOAT 0x<%= first_float.to_s(16) %>
|