#include "src/numbers/conversions.h"
#include <limits.h>
#include <stdarg.h>
#include <cmath>
#include <optional>
#include "src/base/numbers/dtoa.h"
#include "src/base/numbers/strtod.h"
#include "src/base/small-vector.h"
#include "src/bigint/bigint.h"
#include "src/common/assert-scope.h"
#include "src/handles/handles.h"
#include "src/heap/factory.h"
#include "src/objects/bigint.h"
#include "src/objects/objects-inl.h"
#include "src/objects/string-inl.h"
#include "src/strings/char-predicates-inl.h"
#include "src/utils/allocation.h"
#define FASTFLOAT_ALLOWS_LEADING_PLUS
#include "third_party/fast_float/src/include/fast_float/fast_float.h"
#include "third_party/fast_float/src/include/fast_float/float_common.h"
#if defined(_STLP_VENDOR_CSTD)
#define FPCLASSIFY_NAMESPACE
#else
#define FPCLASSIFY_NAMESPACE …
#endif
namespace v8 {
namespace internal {
class SimpleStringBuilder { … };
inline double JunkStringValue() { … }
inline double SignedZero(bool negative) { … }
inline bool isDigit(int x, int radix) { … }
inline bool isBinaryDigit(int x) { … }
template <class Char>
bool SubStringEquals(const Char** current, const Char* end,
const char* substring) { … }
template <class Char>
inline bool AdvanceToNonspace(const Char** current, const Char* end) { … }
template <int radix_log_2, class Char>
double InternalStringToIntDouble(const Char* start, const Char* end,
bool negative, bool allow_trailing_junk) { … }
namespace {
enum class State { … };
enum class Sign { … };
}
class StringToIntHelper { … };
void StringToIntHelper::ParseInt() { … }
template <class Char>
void StringToIntHelper::DetectRadixInternal(const Char* current, int length) { … }
class NumberParseIntHelper : public StringToIntHelper { … };
template <class Char>
void NumberParseIntHelper::HandleGenericCase(const Char* current,
const Char* end) { … }
template <class Char>
double InternalStringToDouble(const Char* current, const Char* end,
ConversionFlag flag, double empty_string_val) { … }
double StringToDouble(const char* str, ConversionFlag flags,
double empty_string_val) { … }
double StringToDouble(base::Vector<const uint8_t> str, ConversionFlag flags,
double empty_string_val) { … }
double StringToDouble(base::Vector<const base::uc16> str, ConversionFlag flags,
double empty_string_val) { … }
double BinaryStringToDouble(base::Vector<const uint8_t> str) { … }
double OctalStringToDouble(base::Vector<const uint8_t> str) { … }
double HexStringToDouble(base::Vector<const uint8_t> str) { … }
double ImplicitOctalStringToDouble(base::Vector<const uint8_t> str) { … }
double StringToInt(Isolate* isolate, Handle<String> string, int radix) { … }
template <typename IsolateT>
class StringToBigIntHelper : public StringToIntHelper { … };
MaybeHandle<BigInt> StringToBigInt(Isolate* isolate, Handle<String> string) { … }
template <typename IsolateT>
MaybeHandle<BigInt> BigIntLiteral(IsolateT* isolate, const char* string) { … }
template EXPORT_TEMPLATE_DEFINE(…)
MaybeHandle<BigInt> BigIntLiteral(Isolate* isolate, const char* string);
template EXPORT_TEMPLATE_DEFINE(…)
MaybeHandle<BigInt> BigIntLiteral(LocalIsolate* isolate,
const char* string);
std::unique_ptr<char[]> BigIntLiteralToDecimal(
LocalIsolate* isolate, base::Vector<const uint8_t> literal) { … }
const char* DoubleToCString(double v, base::Vector<char> buffer) { … }
const char* IntToCString(int n, base::Vector<char> buffer) { … }
char* DoubleToFixedCString(double value, int f) { … }
static char* CreateExponentialRepresentation(char* decimal_rep, int exponent,
bool negative,
int significant_digits) { … }
char* DoubleToExponentialCString(double value, int f) { … }
char* DoubleToPrecisionCString(double value, int p) { … }
char* DoubleToRadixCString(double value, int radix) { … }
double StringToDouble(Isolate* isolate, Handle<String> string,
ConversionFlag flag, double empty_string_val) { … }
double FlatStringToDouble(Tagged<String> string, ConversionFlag flag,
double empty_string_val) { … }
std::optional<double> TryStringToDouble(LocalIsolate* isolate,
DirectHandle<String> object,
int max_length_for_conversion) { … }
std::optional<double> TryStringToInt(LocalIsolate* isolate,
DirectHandle<String> object, int radix) { … }
bool IsSpecialIndex(Tagged<String> string) { … }
bool IsSpecialIndex(Tagged<String> string,
SharedStringAccessGuardIfNeeded& access_guard) { … }
float DoubleToFloat32_NoInline(double x) { … }
int32_t DoubleToInt32_NoInline(double x) { … }
}
}
#undef FPCLASSIFY_NAMESPACE