| /arkcompiler/ets_runtime/ecmascript/mem/ |
| D | mem_controller.h | 28 using BytesAndDuration = std::pair<uint64_t, double>; 30 inline BytesAndDuration MakeBytesAndDuration(uint64_t bytes, double duration) in MakeBytesAndDuration() 43 static double GetSystemTimeInMs() in GetSystemTimeInMs() 45 double currentTime = in GetSystemTimeInMs() 46 …std::chrono::duration<double>(std::chrono::high_resolution_clock::now().time_since_epoch()).count(… in GetSystemTimeInMs() 51 double factor) const; 53 double CalculateGrowingFactor(double gcSpeed, double mutatorSpeed); 60 double CalculateMarkCompactSpeedPerMS(); 61 …double GetCurrentOldSpaceAllocationThroughputPerMS(double timeMs = THROUGHPUT_TIME_FRAME_MS) const; 62 double GetNewSpaceAllocationThroughputPerMS() const; [all …]
|
| D | mem_controller.cpp | 29 double factor) const in CalculateAllocLimit() 42 double MemController::CalculateGrowingFactor(double gcSpeed, double mutatorSpeed) in CalculateGrowingFactor() 44 double maxGrowingFactor = 4.0; in CalculateGrowingFactor() 45 double halfMaxGrowingFactor = 2.0; in CalculateGrowingFactor() 46 double minGrowingFactor = 1.3; in CalculateGrowingFactor() 47 double minimumFactor = 1.1; in CalculateGrowingFactor() 61 static constexpr double targetMutatorUtilization = 0.97; in CalculateGrowingFactor() 66 const double speedRatio = gcSpeed / mutatorSpeed; in CalculateGrowingFactor() 68 const double a = speedRatio * (1 - targetMutatorUtilization); in CalculateGrowingFactor() 69 const double b = speedRatio * (1 - targetMutatorUtilization) - targetMutatorUtilization; in CalculateGrowingFactor() [all …]
|
| D | incremental_marker.h | 52 void UpdateMarkingSpeed(uint32_t visitAddrNum, double costTime) in UpdateMarkingSpeed() 55 … markingSpeed_ = static_cast<uint32_t>((double)visitAddrNum / costTime + markingSpeed_) >> 1; in UpdateMarkingSpeed() 79 double GetCurrentTimeInMs(); 86 void RecordIdleTime(int64_t idleMicroSec, double startTime, bool needInitialize = false); 89 void UpdateIncrementalMarkingSpeed(double duration) in UpdateIncrementalMarkingSpeed() 93 (double)startObjectSize_ / duration + incrementalMarkingSpeed_) >> 1; in UpdateIncrementalMarkingSpeed() 101 double startTime_ {0.0}; 112 double totalUsedIdleTime_ {0.0}; 113 double exceedIdleTime_ {0.0};
|
| /arkcompiler/ets_runtime/ecmascript/base/ |
| D | number_helper.h | 25 constexpr double MIN_RADIX = 2; 26 constexpr double MAX_RADIX = 36; 27 constexpr double MIN_FRACTION = 0; 28 constexpr double MAX_FRACTION = 100; 42 static constexpr double HALF = 0.5; 43 static constexpr double EPSILON = std::numeric_limits<double>::epsilon(); 45 static constexpr double MAX_VALUE = std::numeric_limits<double>::max(); 46 static constexpr double MIN_VALUE = std::numeric_limits<double>::min(); 47 static constexpr double POSITIVE_INFINITY = std::numeric_limits<double>::infinity(); 48 static constexpr double NAN_VALUE = std::numeric_limits<double>::quiet_NaN(); [all …]
|
| D | math_helper.h | 38 static double Asinh(double input) in Asinh() 42 … // +0.0(double) is the special case for std::asinh() function compiled in linux for windows. in Asinh() 49 static inline double Atanh(double input) in Atanh() 53 … // -0.0(double) is the special case for std::atanh() function compiled in linux for windows. in Atanh()
|
| /arkcompiler/ets_runtime/test/typeinfer/div2dyn/ |
| D | div2dyn.ts | 21 AssertType(ans1, "double"); 29 AssertType(ans2, "double"); 30 AssertType(ans3, "double"); 31 AssertType(ans4, "double"); 32 AssertType(ans5, "double"); 37 AssertType(ans6, "double"); 38 AssertType(ans7, "double"); 53 AssertType(ans8, "double"); 54 AssertType(ans9, "double"); 55 AssertType(ans10, "double"); [all …]
|
| /arkcompiler/ets_runtime/ecmascript/ |
| D | js_date.h | 94 static double MakeDay(double year, double month, double date); 95 static double MakeTime(double hour, double min, double sec, double ms); 96 static double MakeDate(double day, double time); 97 static double TimeClip(double time); 108 double LocalTime(double timeMs) const; 111 double UTCTime(double timeMs) const; 130 static CString ToDateString(double timeMs); 148 double GetDateValue(double timeMs, uint8_t code, bool isLocal) const; 151 static constexpr double MAX_DOUBLE = std::numeric_limits<double>::max(); 152 static constexpr double MAX_INT = std::numeric_limits<int>::max(); [all …]
|
| D | js_date.cpp | 134 double JSDate::MakeTime(double hour, double min, double sec, double ms) in MakeTime() 137 double hourInteger = NumberHelper::TruncateDouble(hour); in MakeTime() 138 double minInteger = NumberHelper::TruncateDouble(min); in MakeTime() 139 double secInteger = NumberHelper::TruncateDouble(sec); in MakeTime() 140 double msInteger = NumberHelper::TruncateDouble(ms); in MakeTime() 148 double JSDate::MakeDay(double year, double month, double date) in MakeDay() 151 double yearInteger = NumberHelper::TruncateDouble(year); in MakeDay() 152 double monthInteger = NumberHelper::TruncateDouble(month); in MakeDay() 163 return static_cast<double>(days - 1) + NumberHelper::TruncateDouble(date); in MakeDay() 170 double JSDate::MakeDate(double day, double time) in MakeDate() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/builtins/tests/ |
| D | builtins_date_test.cpp | 78 ecmaRuntimeCallInfo->SetCallArg(0, JSTaggedValue(static_cast<double>(2))); in HWTEST_F_L0() 83 ASSERT_EQ(result2.GetRawData(), JSTaggedValue(static_cast<double>(2)).GetRawData()); in HWTEST_F_L0() 93 ecmaRuntimeCallInfo->SetCallArg(0, JSTaggedValue(static_cast<double>(2))); in HWTEST_F_L0() 98 ASSERT_EQ(result4.GetRawData(), JSTaggedValue(static_cast<double>(2)).GetRawData()); in HWTEST_F_L0() 108 ecmaRuntimeCallInfo->SetCallArg(0, JSTaggedValue(static_cast<double>(-2))); in HWTEST_F_L0() 113 ASSERT_EQ(result4.GetRawData(), JSTaggedValue(static_cast<double>(29)).GetRawData()); in HWTEST_F_L0() 124 ecmaRuntimeCallInfo->SetCallArg(0, JSTaggedValue(static_cast<double>(2018))); in HWTEST_F_L0() 126 ecmaRuntimeCallInfo->SetCallArg(1, JSTaggedValue(static_cast<double>(10))); in HWTEST_F_L0() 128 ecmaRuntimeCallInfo->SetCallArg(2, JSTaggedValue(static_cast<double>(6))); in HWTEST_F_L0() 134 ASSERT_EQ(result1.GetRawData(), JSTaggedValue(static_cast<double>(2018)).GetRawData()); in HWTEST_F_L0() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/tests/ |
| D | js_tagged_number_test.cpp | 63 EXPECT_EQ(result, JSTaggedNumber(static_cast<double>(4294967294))); in HWTEST_F_L0() 64 // number is double in HWTEST_F_L0() 65 JSTaggedNumber number3(static_cast<double>(123.456)); in HWTEST_F_L0() 66 JSTaggedNumber number4(static_cast<double>(-123.456)); in HWTEST_F_L0() 68 EXPECT_EQ(result, JSTaggedNumber(static_cast<double>(246.912))); in HWTEST_F_L0() 81 // one numer is int,one number is double in HWTEST_F_L0() 83 JSTaggedNumber number4(static_cast<double>(12.1)); in HWTEST_F_L0() 86 // number is double in HWTEST_F_L0() 87 JSTaggedNumber number5(static_cast<double>(12.12)); in HWTEST_F_L0() 88 JSTaggedNumber number6(static_cast<double>(12.12)); in HWTEST_F_L0() [all …]
|
| /arkcompiler/ets_frontend/es2panda/ir/ts/ |
| D | tsEnumDeclaration.cpp | 49 int32_t ToInt(double num) in ToInt() 60 uint32_t ToUInt(double num) in ToUInt() 78 return std::numeric_limits<double>::infinity(); in EvaluateIdentifier() 108 if (!std::holds_alternative<double>(value)) { in EvaluateUnaryExpression() 114 return std::get<double>(value); in EvaluateUnaryExpression() 117 return -std::get<double>(value); in EvaluateUnaryExpression() 120 return static_cast<double>(~ToInt(std::get<double>(value))); in EvaluateUnaryExpression() 158 if (std::holds_alternative<double>(left) && std::holds_alternative<double>(right)) { in EvaluateBinaryExpression() 161 … return static_cast<double>(ToUInt(std::get<double>(left)) | ToUInt(std::get<double>(right))); in EvaluateBinaryExpression() 164 … return static_cast<double>(ToUInt(std::get<double>(left)) & ToUInt(std::get<double>(right))); in EvaluateBinaryExpression() [all …]
|
| /arkcompiler/ets_runtime/test/typeinfer/mul2dyn/ |
| D | mul2dyn.ts | 28 AssertType(ans2, "double"); 29 AssertType(ans3, "double"); 30 AssertType(ans4, "double"); 31 AssertType(ans5, "double"); 35 AssertType(ans6, "double"); 57 AssertType(ans14, "double"); 58 AssertType(ans15, "double"); 59 AssertType(ans16, "double"); 60 AssertType(ans17, "double");
|
| /arkcompiler/ets_runtime/ecmascript/builtins/ |
| D | builtins_math.cpp | 39 // if number_value is double,NaN,Undefine, deal in this case in Abs() 40 // if number_value is a String ,which can change to double. e.g."100",deal in this case in Abs() 57 double value = numberValue.GetNumber(); in Acos() 58 double result = base::NAN_VALUE; in Acos() 76 double value = numberValue.GetNumber(); in Acosh() 77 double result = base::NAN_VALUE; in Acosh() 94 double value = numberValue.GetNumber(); in Asin() 95 double result = base::NAN_VALUE; in Asin() 112 double value = numberValue.GetNumber(); in Asinh() 113 double result = base::NAN_VALUE; in Asinh() [all …]
|
| D | builtins_math.h | 25 static constexpr double E = 2.718281828459045; 27 static constexpr double LN10 = 2.302585092994046; 29 static constexpr double LN2 = 0.6931471805599453; 31 static constexpr double LOG10E = 0.4342944819032518; 33 static constexpr double LOG2E = 1.4426950408889634; 35 static constexpr double PI = 3.141592653589793; 37 static constexpr double SQRT1_2 = 0.7071067811865476; 39 static constexpr double SQRT2 = 1.4142135623730951;
|
| D | builtins_arraybuffer.h | 24 static constexpr double NUMBER_HALF = 0.5; 37 double value; 75 DataViewType type, double val, bool littleEndian); 77 DataViewType type, double val, bool littleEndian); 100 static void SetValueInBufferForByte(double val, uint8_t *block, uint32_t byteIndex); 102 static void SetValueInBufferForUint8Clamped(double val, uint8_t *block, uint32_t byteIndex); 105 …static void SetValueInBufferForInteger(double val, uint8_t *block, uint32_t byteIndex, bool little… 108 …static void SetValueInBufferForFloat(double val, uint8_t *block, uint32_t byteIndex, bool littleEn… 115 static void SetValueInBufferForBigInt(JSThread *thread, double val,
|
| /arkcompiler/ets_runtime/test/typeinfer/sub2dyn/ |
| D | sub2dyn.ts | 28 AssertType(ans2, "double"); 29 AssertType(ans3, "double"); 33 AssertType(ans4, "double"); 34 AssertType(ans5, "double"); 56 AssertType(ans13, "double"); 57 AssertType(ans14, "double"); 58 AssertType(ans15, "double"); 59 AssertType(ans16, "double");
|
| /arkcompiler/ets_runtime/test/typeinfer/add2dyn/ |
| D | add2dyn.ts | 46 AssertType(ans6, "double"); 47 AssertType(ans7, "double"); 50 AssertType(ans8, "double"); 53 AssertType(ans9, "double"); 75 AssertType(ans17, "double"); 76 AssertType(ans18, "double"); 77 AssertType(ans19, "double"); 78 AssertType(ans20, "double");
|
| /arkcompiler/runtime_core/bytecode_optimizer/ |
| D | tagged_value.h | 27 // Every double with all of its exponent bits set and its highest mantissa bit set is a quiet NaN. 30 … so we use a special quietNaN as TaggedInt tag(highest 16bits as 0xFFFF), and need to encode double 50 inline TaggedType ReinterpretDoubleToTaggedType(double value) in ReinterpretDoubleToTaggedType() 54 inline double ReinterpretTaggedTypeToDouble(TaggedType value) in ReinterpretTaggedTypeToDouble() 56 return bit_cast<double>(value); in ReinterpretTaggedTypeToDouble() 101 value_ = TaggedValue(static_cast<double>(v)).GetRawData(); in TaggedValue() 110 value_ = TaggedValue(static_cast<double>(v)).GetRawData(); in TaggedValue() 121 explicit TaggedValue(double v) in TaggedValue() 123 ASSERT_PRINT(!IsImpureNaN(v), "pureNaN will break the encoding of tagged double: " in TaggedValue() 147 static inline bool IsImpureNaN(double value) in IsImpureNaN() [all …]
|
| /arkcompiler/ets_frontend/es2panda/ir/expressions/literals/ |
| D | numberLiteral.h | 35 explicit NumberLiteral(double num) : Literal(AstNodeType::NUMBER_LITERAL), number_(num) {} in NumberLiteral() 36 explicit NumberLiteral(double num, util::StringView str) in NumberLiteral() 41 template <typename T = double> 54 return IsInteger() ? LiteralTag::INTEGER : LiteralTag::DOUBLE; in Tag() 71 double number_; 77 explicit UserTypeIndexLiteral(double num, util::StringView str) : NumberLiteral(num, str) {} in UserTypeIndexLiteral() 87 explicit BuiltinTypeIndexLiteral(double num) : NumberLiteral(num) {} in BuiltinTypeIndexLiteral()
|
| /arkcompiler/runtime_core/libpandabase/utils/ |
| D | type_converter.h | 35 * @param value_ - double number of value 43 ValueUnit(double value, std::string_view literal); 51 std::variant<double, uint64_t> GetValue() const; 53 double GetDoubleValue() const; 67 std::variant<double, uint64_t> value_; 85 constexpr std::array<double, 4> COEFFS_MEMORY = {1024, 1024, 1024, 1024}; 86 constexpr std::array<double, 6> COEFFS_TIME = {1000, 1000, 1000, 60, 60, 24};
|
| D | type_converter.cpp | 31 ValueUnit::ValueUnit(double value, std::string_view literal) : value_(value), literal_(literal) {} in ValueUnit() 38 std::variant<double, uint64_t> ValueUnit::GetValue() const in GetValue() 43 double ValueUnit::GetDoubleValue() const in GetDoubleValue() 45 return std::get<double>(value_); in GetDoubleValue() 99 ValueUnit TypeConverter(const std::array<double, SIZE> &coeffs, const std::array<std::string_view, … in TypeConverter() argument 102 constexpr double LIMIT = 1.0; in TypeConverter() 103 double division_ratio = 1; in TypeConverter()
|
| /arkcompiler/ets_frontend/es2panda/util/ |
| D | helpers.h | 66 static bool IsInteger(double number); 67 static bool IsIndex(double number); 72 static std::string DoubleToString(double number); 73 …static int32_t GetIntegerSignificandBitCount(double number, int32_t &numberBitCount, char *signifi… 74 …static void GetScientificNotationForDouble(double number, uint32_t significandBitCount, int32_t &n… 76 static std::string ToString(double number); 77 static util::StringView ToStringView(ArenaAllocator *allocator, double number); 127 bool Helpers::IsInteger(double number) in IsInteger() 129 if (std::fabs(number) <= static_cast<double>(std::numeric_limits<T>::max())) { in IsInteger() 132 if (static_cast<double>(intNum) == number) { in IsInteger()
|
| /arkcompiler/toolchain/tooling/base/ |
| D | pt_json.cpp | 81 return Add(key, static_cast<double>(value)); in Add() 86 return Add(key, static_cast<double>(value)); in Add() 91 return Add(key, static_cast<double>(value)); in Add() 94 bool PtJson::Add(const char *key, double value) const in Add() 165 return Push(static_cast<double>(value)); in Push() 170 return Push(static_cast<double>(value)); in Push() 175 return Push(static_cast<double>(value)); in Push() 178 bool PtJson::Push(double value) const in Push() 323 double PtJson::GetDouble(double defaultValue) const in GetDouble() 367 double result; in GetInt() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/ic/ |
| D | ic_binary_op.h | 42 // Support cases, such as: int + double, int + int, double + double in AddWithTSType() 44 double a0Double = left.IsInt() ? left.GetInt() : left.GetDouble(); in AddWithTSType() 45 double a1Double = right.IsInt() ? right.GetInt() : right.GetDouble(); in AddWithTSType() 46 double ret = a0Double + a1Double; in AddWithTSType() 62 double a0Double = taggedValueA0.GetNumber(); in AddWithTSType() 63 double a1Double = taggedValueA1.GetNumber(); in AddWithTSType() 114 double a0Double = left.IsInt() ? left.GetInt() : left.GetDouble(); in SubWithTSType() 115 double a1Double = right.IsInt() ? right.GetInt() : right.GetDouble(); in SubWithTSType() 116 double ret = a0Double - a1Double; in SubWithTSType() 182 double dLeft = left.IsInt() ? left.GetInt() : left.GetDouble(); in DivWithTSType() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/base/tests/ |
| D | number_helper_test.cpp | 76 …* @tc.desc: This function Convert the double type data into a string.first convert it into the cor… 109 NumberHelper::DoubleToString(thread, static_cast<double>(-9223372036854775807), radix)); in HWTEST_F_L0() 206 …* @tc.desc:This function takes the integer part of double type.When it is positive,it is rounded d… 229 …* @tc.desc: This function takes the double of integer type.When the decimal part is eight and the … 248 double nanDouble = 0.0f / 0.0f; in HWTEST_F_L0() 250 double infDouble = POSITIVE_INFINITY; in HWTEST_F_L0() 266 double nanDouble = 0.0f / 0.0f; in HWTEST_F_L0() 268 double infDouble = POSITIVE_INFINITY; in HWTEST_F_L0() 283 double nanDouble = 0.0f / 0.0f; in HWTEST_F_L0() 285 double infDouble = POSITIVE_INFINITY; in HWTEST_F_L0() [all …]
|