Home
last modified time | relevance | path

Searched refs:BigInt (Results 1 – 25 of 53) sorted by relevance

123

/arkcompiler/ets_runtime/ecmascript/tests/
Djs_bigint_test.cpp64 JSHandle<BigInt> bigint1 = BigIntHelper::SetBigInt(thread, str1); in HWTEST_F_L0()
65 JSHandle<BigInt> bigint2 = BigIntHelper::SetBigInt(thread, str2); in HWTEST_F_L0()
66 JSHandle<BigInt> bigint3 = BigIntHelper::SetBigInt(thread, str3); in HWTEST_F_L0()
67 JSHandle<BigInt> bigint4 = BigIntHelper::SetBigInt(thread, str4); in HWTEST_F_L0()
68 …EXPECT_EQ(BigInt::Compare(bigint1.GetTaggedValue(), bigint1.GetTaggedValue()), ComparisonResult::E… in HWTEST_F_L0()
69 …EXPECT_EQ(BigInt::Compare(bigint3.GetTaggedValue(), bigint2.GetTaggedValue()), ComparisonResult::L… in HWTEST_F_L0()
70 …EXPECT_EQ(BigInt::Compare(bigint1.GetTaggedValue(), bigint2.GetTaggedValue()), ComparisonResult::L… in HWTEST_F_L0()
71 …EXPECT_EQ(BigInt::Compare(bigint2.GetTaggedValue(), bigint1.GetTaggedValue()), ComparisonResult::G… in HWTEST_F_L0()
72 …EXPECT_EQ(BigInt::Compare(bigint2.GetTaggedValue(), bigint3.GetTaggedValue()), ComparisonResult::G… in HWTEST_F_L0()
73 …EXPECT_EQ(BigInt::Compare(bigint3.GetTaggedValue(), bigint4.GetTaggedValue()), ComparisonResult::L… in HWTEST_F_L0()
[all …]
Djs_serializer_test.cpp777 JSHandle<BigInt> bigInt1 = BigIntHelper::SetBigInt(thread, str1); in BigIntTest()
778 JSHandle<BigInt> bigInt2 = BigIntHelper::SetBigInt(thread, str2); in BigIntTest()
779 JSHandle<BigInt> bigInt3 = BigIntHelper::SetBigInt(thread, str3); in BigIntTest()
780 JSHandle<BigInt> bigInt4 = BigInt::Uint32ToBigInt(thread, 0); // 0 : test case in BigIntTest()
781 JSHandle<BigInt> bigInt5 = BigIntHelper::SetBigInt(thread, str4, BigInt::DECIMAL); in BigIntTest()
782 JSHandle<BigInt> bigInt6 = BigInt::Uint64ToBigInt(thread, ULLONG_MAX); in BigIntTest()
783 JSHandle<BigInt> bigInt7 = BigInt::Uint64ToBigInt(thread, UINT_MAX); in BigIntTest()
784 … JSHandle<BigInt> bigInt8 = BigInt::Uint32ToBigInt(thread, std::numeric_limits<uint32_t>::max()); in BigIntTest()
785 … JSHandle<BigInt> bigInt9 = BigInt::Uint32ToBigInt(thread, std::numeric_limits<uint32_t>::min()); in BigIntTest()
786 JSHandle<BigInt> bigInt10 = BigInt::Int64ToBigInt(thread, LLONG_MAX); in BigIntTest()
[all …]
Djs_number_format_test.cpp185 JSHandle<BigInt> jsBigInt(thread, BigInt::NumberToBigInt(thread, number)); in HWTEST_F_L0()
/arkcompiler/ets_runtime/ecmascript/
Djs_bigint.h31 class BigInt : public TaggedObject {
46 CAST_CHECK(BigInt, IsBigInt);
47 static JSHandle<BigInt> CreateBigint(JSThread *thread, uint32_t size);
53 …static JSHandle<BigInt> BitwiseOp(JSThread *thread, Operate op, JSHandle<BigInt> x, JSHandle<BigIn…
54 static JSHandle<BigInt> BitwiseAND(JSThread *thread, JSHandle<BigInt> x, JSHandle<BigInt> y);
55 static JSHandle<BigInt> BitwiseXOR(JSThread *thread, JSHandle<BigInt> x, JSHandle<BigInt> y);
56 static JSHandle<BigInt> BitwiseOR(JSThread *thread, JSHandle<BigInt> x, JSHandle<BigInt> y);
57 … static JSHandle<BigInt> BitwiseSubOne(JSThread *thread, JSHandle<BigInt> bigint, uint32_t maxLen);
58 static JSHandle<BigInt> BitwiseAddOne(JSThread *thread, JSHandle<BigInt> bigint);
59 static JSHandle<EcmaString> ToString(JSThread *thread, JSHandle<BigInt> bigint,
[all …]
Djs_bigint.cpp68 JSHandle<BigInt> BigInt::GetUint64MaxBigint(JSThread *thread) in GetUint64MaxBigint()
70 JSHandle<BigInt> bigint = CreateBigint(thread, 3); in GetUint64MaxBigint()
71 RETURN_HANDLE_IF_ABRUPT_COMPLETION(BigInt, thread); in GetUint64MaxBigint()
78 JSHandle<BigInt> BigInt::GetInt64MaxBigint(JSThread *thread) in GetInt64MaxBigint()
80 JSHandle<BigInt> bigint = CreateBigint(thread, 2); in GetInt64MaxBigint()
81 RETURN_HANDLE_IF_ABRUPT_COMPLETION(BigInt, thread); in GetInt64MaxBigint()
87 JSHandle<BigInt> BigIntHelper::SetBigInt(JSThread *thread, const CString &numStr, uint32_t currentR… in SetBigInt()
95 if (currentRadix != BigInt::BINARY) { in SetBigInt()
96 binaryStr = Conversion(numStr.substr(flag), BigInt::BINARY, currentRadix); in SetBigInt()
101 JSHandle<BigInt> bigint; in SetBigInt()
[all …]
Djs_tagged_value-inl.h72 BigInt *bigint = BigInt::Cast(GetTaggedObject()); in ToBoolean()
138 return BigInt::Int32ToBigInt(thread, 1).GetTaggedValue(); in ToBigInt()
141 return BigInt::Int32ToBigInt(thread, 0).GetTaggedValue(); in ToBigInt()
171 JSHandle<BigInt> value(thread, ToBigInt(thread, tagged)); in ToBigInt64()
173 JSHandle<BigInt> tVal = BigInt::GetUint64MaxBigint(thread); in ToBigInt64()
175 JSHandle<BigInt> int64bitVal = BigInt::FloorMod(thread, value, tVal); in ToBigInt64()
176 JSHandle<BigInt> resValue = BigInt::GetInt64MaxBigint(thread); in ToBigInt64()
178 if (!BigInt::LessThan(int64bitVal.GetTaggedValue(), resValue.GetTaggedValue())) { in ToBigInt64()
179 return BigInt::Subtract(thread, int64bitVal, tVal).GetTaggedValue(); in ToBigInt64()
187 JSHandle<BigInt> value(thread, ToBigInt(thread, tagged)); in ToBigUint64()
[all …]
Djs_tagged_value.cpp210 return BigInt::Equal(x.GetTaggedValue(), y.GetTaggedValue()); in Equal()
217 return BigInt::Equal(x.GetTaggedValue(), yNumber.GetTaggedValue()); in Equal()
222 return BigInt::Equal(x.GetTaggedValue(), yNumber.GetTaggedValue()); in Equal()
225 JSHandle<BigInt> bigint = JSHandle<BigInt>::Cast(x); in Equal()
226 return BigInt::CompareWithNumber(bigint, y) == ComparisonResult::EQUAL; in Equal()
298 JSHandle<BigInt> bigint = JSHandle<BigInt>::Cast(primX); in Compare()
299 return BigInt::CompareWithNumber(bigint, primY); in Compare()
305 return BigInt::Compare(primX.GetTaggedValue(), bigY.GetTaggedValue()); in Compare()
309 return BigInt::Compare(primX.GetTaggedValue(), bigY.GetTaggedValue()); in Compare()
445 JSHandle<BigInt> taggedValue(tagged); in ToString()
[all …]
Djs_hclass-inl.h214 size = BigInt::ComputeSize(reinterpret_cast<BigInt *>(header)->GetLength()); in SizeFromJSHClass()
/arkcompiler/ets_runtime/ecmascript/builtins/tests/
Dbuiltins_bigint_test.cpp27 using BigInt = ecmascript::BigInt; typedef
117 JSHandle<BigInt> bigIntHandle(thread, result); in HWTEST_F_L0()
118 JSHandle<EcmaString> resultStr = BigInt::ToString(thread, bigIntHandle); in HWTEST_F_L0()
141 JSHandle<BigInt> bigIntHandle(thread, result); in HWTEST_F_L0()
142 JSHandle<EcmaString> resultStr = BigInt::ToString(thread, bigIntHandle); in HWTEST_F_L0()
165 JSHandle<BigInt> bigIntHandle(thread, result); in HWTEST_F_L0()
166 JSHandle<EcmaString> resultStr = BigInt::ToString(thread, bigIntHandle); in HWTEST_F_L0()
189 JSHandle<BigInt> bigIntHandle(thread, result); in HWTEST_F_L0()
190 JSHandle<EcmaString> resultStr = BigInt::ToString(thread, bigIntHandle); in HWTEST_F_L0()
210 JSHandle<BigInt> bigIntHandle(thread, result1); in HWTEST_F_L0()
[all …]
/arkcompiler/ets_runtime/ecmascript/builtins/
Dbuiltins_bigint.cpp33 BUILTINS_API_TRACE(thread, BigInt, Constructor); in BigIntConstructor()
45 return BigInt::NumberToBigInt(thread, Primitive); in BigIntConstructor()
55 BUILTINS_API_TRACE(thread, BigInt, AsUintN); in AsUintN()
64 JSHandle<BigInt> jsBigintVal(thread, jsBigint); in AsUintN()
66 return BigInt::AsUintN(thread, index, jsBigintVal); in AsUintN()
73 BUILTINS_API_TRACE(thread, BigInt, AsIntN); in AsIntN()
82 JSHandle<BigInt> jsBigintVal(thread, jsBigint); in AsIntN()
85 return BigInt::AsintN(thread, index, jsBigintVal); in AsIntN()
92 BUILTINS_API_TRACE(thread, BigInt, ToLocaleString); in ToLocaleString()
156 BUILTINS_API_TRACE(thread, BigInt, ToString); in ToString()
[all …]
Dbuiltins_atomics.cpp189 v = JSHandle<BigInt>::Cast(value)->ToInt64(); in Wait()
474 BigInt::BigIntToInt64(thread, value, &val, &lossless); in HandleWithBigInt64()
478 return BigInt::Int64ToBigInt(thread, result).GetTaggedValue(); in HandleWithBigInt64()
482 BigInt::BigIntToInt64(thread, newValue, &newVal, &lossless); in HandleWithBigInt64()
488 return BigInt::Int64ToBigInt(thread, result).GetTaggedValue(); in HandleWithBigInt64()
500 BigInt::BigIntToUint64(thread, value, &val, &lossless); in HandleWithBigUint64()
503 return BigInt::Uint64ToBigInt(thread, result).GetTaggedValue(); in HandleWithBigUint64()
507 BigInt::BigIntToUint64(thread, newValue, &newVal, &lossless); in HandleWithBigUint64()
512 return BigInt::Uint64ToBigInt(thread, result).GetTaggedValue(); in HandleWithBigUint64()
Dbuiltins_arraybuffer.cpp538 return BigInt::Uint64ToBigInt(thread, pTmp).GetTaggedValue(); in GetValueFromBufferForBigInt()
540 return BigInt::Int64ToBigInt(thread, pTmp).GetTaggedValue(); in GetValueFromBufferForBigInt()
634 BigInt::BigIntToUint64(thread, val, reinterpret_cast<uint64_t *>(&value), &lossless); in SetValueInBufferForBigInt()
636 BigInt::BigIntToInt64(thread, val, reinterpret_cast<int64_t *>(&value), &lossless); in SetValueInBufferForBigInt()
658 BigInt::BigIntToUint64(thread, valHandle, reinterpret_cast<uint64_t *>(&value), &lossless); in SetValueInBufferForBigInt()
660 BigInt::BigIntToInt64(thread, valHandle, reinterpret_cast<int64_t *>(&value), &lossless); in SetValueInBufferForBigInt()
/arkcompiler/toolchain/tooling/test/testcases/js/
Dvariable_first.js43 var bigint0 = BigInt(999n);
134 var bigint1 = BigInt(9007199254740991n);
135 var bigint2 = BigInt(9007199254740991);
136 var bigint3 = BigInt("9007199254740991");
137 var bigint4 = BigInt("0x1fffffffffffff");
138 var bigint5 = BigInt(0x1fffffffffffff);
139 var bigint6 = BigInt("0b11111111111111111111111111111111111111111111111111111");
148 var bigint15 = BigInt(0b11111111111111);
149 var bigint16 = BigInt(0);
151 var bigint18 = BigInt(123e45);
[all …]
Dexport_variable_second.js41 export var bigint6 = BigInt(99999n);
68 var bigint8 = BigInt(9999n);
Dmodule_variable.js117 export var bigint0 = BigInt(999n);
149 var bigint1 = BigInt(9999n);
199 var bigint2 = BigInt(9999n);
Dvariable_second.js43 var bigint0 = BigInt(999n);
/arkcompiler/ets_runtime/test/moduletest/bigint/
Dbigint.js27 BigInt.asUintN(2147483649, -1873965464n);
77 print(BigInt.asUintN(2**32, 42n));
78 print(BigInt.asIntN(2**32, 42n));
/arkcompiler/ets_frontend/test262/
Des2015_tests.txt4281 built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js
4282 built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.js
4293 built-ins/TypedArray/prototype/byteLength/BigInt/detached-buffer.js
4294 built-ins/TypedArray/prototype/byteLength/BigInt/return-bytelength.js
4304 built-ins/TypedArray/prototype/byteOffset/BigInt/detached-buffer.js
4305 built-ins/TypedArray/prototype/byteOffset/BigInt/return-byteoffset.js
4316 built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-end.js
4317 built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-start.js
4318 built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-target.js
4319 built-ins/TypedArray/prototype/copyWithin/BigInt/detached-buffer.js
[all …]
/arkcompiler/ets_runtime/test/fuzztest/builtinsarraybuffergetvaluefrombufferforbigint_fuzzer/
Dbuiltinsarraybuffergetvaluefrombufferforbigint_fuzzer.cpp50 JSHandle<BigInt> bigIntNum = BigInt::Uint32ToBigInt(thread, input); in BuiltinsArrayBufferGetValueFromBufferForBigIntFuzzTest()
/arkcompiler/ets_frontend/es2panda/test/
Dtest262skiplist.txt90 built-ins/BigInt/asIntN/arithmetic.js
91 built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js
92 built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js
93 built-ins/BigInt/asIntN/bigint-tobigint.js
94 built-ins/BigInt/asIntN/bits-toindex-errors.js
95 built-ins/BigInt/asIntN/bits-toindex-toprimitive.js
96 built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js
97 built-ins/BigInt/asIntN/bits-toindex.js
98 built-ins/BigInt/asIntN/order-of-steps.js
99 built-ins/BigInt/asUintN/arithmetic.js
[all …]
/arkcompiler/ets_runtime/ecmascript/stubs/
Druntime_stubs-inl.h52 JSHandle<BigInt> bigValue(inputVal); in RuntimeInc()
53 return BigInt::BigintAddOne(thread, bigValue).GetTaggedValue(); in RuntimeInc()
64 JSHandle<BigInt> bigValue(inputVal); in RuntimeDec()
65 return BigInt::BigintSubOne(thread, bigValue).GetTaggedValue(); in RuntimeDec()
81 JSHandle<BigInt> bigBaseVale(valBase); in RuntimeExp()
82 JSHandle<BigInt> bigExponentValue(valExponent); in RuntimeExp()
83 return BigInt::Exponentiate(thread, bigBaseVale, bigExponentValue).GetTaggedValue(); in RuntimeExp()
734 JSHandle<BigInt> bigValue(inputVal); in RuntimeNeg()
735 return BigInt::UnaryMinus(thread, bigValue).GetTaggedValue(); in RuntimeNeg()
760 JSHandle<BigInt> bigValue(inputVal); in RuntimeNot()
[all …]
/arkcompiler/ets_frontend/es2panda/lexer/token/
Dtoken.h86 const util::StringView &BigInt() const in DEFINE_BITOPS()
/arkcompiler/ets_runtime/test/moduletest/builtins/
Dexpect_output.txt40 TypeError: Cannot convert a BigInt value to a number
/arkcompiler/ets_runtime/ecmascript/base/
Dnumber_helper.cpp705 return BigInt::Int32ToBigInt(thread, 0).GetTaggedValue(); in StringToBigInt()
714 return BigInt::Int32ToBigInt(thread, 0).GetTaggedValue(); in StringToBigInt()
733 return BigInt::Int32ToBigInt(thread, 0).GetTaggedValue(); in StringToBigInt()
760 return BigInt::Int32ToBigInt(thread, 0).GetTaggedValue(); in StringToBigInt()
779 return BigInt::Uint32ToBigInt(thread, 0).GetTaggedValue(); in StringToBigInt()
/arkcompiler/ets_runtime/ecmascript/interpreter/
Dfast_runtime_stub-inl.h116 return JSTaggedValue(BigInt::Equal(left, right)); in FastEqual()
149 return BigInt::Equal(left, right) ? JSTaggedValue::True() : JSTaggedValue::False(); in FastStrictEqual()

123