21static const int kMaxIdentifierCount = 0xF000000;
30 preceding_position_(0),
33 in_local_scope_(false),
37 preceded_by_newline_(false) {
38#define V(name, _junk1, _junk2, _junk3) property_names_[#name] = kToken_##name;
42#define V(name, _junk1) property_names_[#name] = kToken_##name;
45#define V(name) property_names_[#name] = kToken_##name;
48#define V(name) global_names_[#name] = kToken_##name;
74 }
else if (
Token() == kUnsigned) {
78 PrintF(
"%s ", name.c_str());
116 }
else if (ch ==
'*') {
137#define V(single_char_token) case single_char_token:
178std::string AsmJsScanner::Name(token_t token)
const {
179 if (token >= 32 && token < 127) {
180 return std::string(1,
static_cast<char>(token));
183 if (
i.second == token) {
188 if (
i.second == token) {
193 if (
i.second == token) {
198#define V(rawname, name) \
199 case kToken_##name: \
203#define V(name, value, string_name) \
276bool IsValidImplicitOctal(std::string_view number) {
278 return std::all_of(number.begin() + 1, number.end(),
IsOctalDigit);
284 number.assign(1, ch);
285 bool has_dot = ch ==
'.';
286 bool has_prefix =
false;
289 if ((ch >=
'0' && ch <=
'9') || (ch >=
'a' && ch <=
'f') ||
290 (ch >=
'A' && ch <=
'F') || ch ==
'.' || ch ==
'b' || ch ==
'o' ||
292 ((ch ==
'-' || ch ==
'+') && !has_prefix &&
293 (number[number.size() - 1] ==
'e' ||
294 number[number.size() - 1] ==
'E'))) {
299 if (ch ==
'b' || ch ==
'o' || ch ==
'x') {
302 number.push_back(ch);
309 if (number.size() == 1 && number[0] ==
'0') {
315 if (number.size() == 1 && number[0] ==
'.') {
320 if (has_prefix && number[0] ==
'0') {
322 if (number.size() <= 2) {
345 }
else if (number[0] ==
'0' && !has_prefix && IsValidImplicitOctal(number)) {
359 if (number[0] ==
'.') {
360 for (
size_t k = 1; k < number.size(); ++k) {
416 const char* expected =
"use asm";
417 for (; *expected !=
'\0'; ++expected) {
432 if (next_ch ==
'=') {
449 }
else if (ch ==
'<' && next_ch ==
'<') {
451 }
else if (ch ==
'>' && next_ch ==
'>') {
#define STDLIB_ARRAY_TYPE_LIST(V)
#define STDLIB_MATH_VALUE_LIST(V)
#define SIMPLE_SINGLE_TOKEN_LIST(V)
#define STDLIB_MATH_FUNCTION_LIST(V)
#define KEYWORD_NAME_LIST(V)
#define LONG_SYMBOL_NAME_LIST(V)
#define SPECIAL_TOKEN_LIST(V)
#define STDLIB_OTHER_LIST(V)
void ConsumeNumber(base::uc32 ch)
std::unordered_map< std::string, token_t > local_names_
void ConsumeIdentifier(base::uc32 ch)
static constexpr base::uc32 kEndOfInputU
bool preceded_by_newline_
size_t preceding_position_
std::unordered_map< std::string, token_t > property_names_
void ConsumeCompareOrShift(base::uc32 ch)
std::string identifier_string_
Utf16CharacterStream * stream_
bool IsIdentifierPart(base::uc32 ch)
std::unordered_map< std::string, token_t > global_names_
uint32_t AsUnsigned() const
bool IsNumberStart(base::uc32 ch)
void ConsumeString(base::uc32 quote)
AsmJsScanner(Utf16CharacterStream *stream)
bool IsIdentifierStart(base::uc32 ch)
constexpr bool IsInRange(T value, U lower_limit, U higher_limit)
constexpr Vector< T > VectorOf(T *start, size_t size)
double OctalStringToDouble(base::Vector< const uint8_t > str)
void PrintF(const char *format,...)
double HexStringToDouble(base::Vector< const uint8_t > str)
constexpr bool IsAsciiIdentifier(base::uc32 c)
double ImplicitOctalStringToDouble(base::Vector< const uint8_t > str)
constexpr bool IsOctalDigit(base::uc32 c)
double BinaryStringToDouble(base::Vector< const uint8_t > str)
constexpr bool IsDecimalDigit(base::uc32 c)
V8_EXPORT_PRIVATE FlagValues v8_flags
constexpr int AsciiAlphaToLower(base::uc32 c)
constexpr uint32_t kMaxUInt32
double StringToDouble(const char *str, ConversionFlag flags, double empty_string_val)
#define CHECK_LT(lhs, rhs)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)