5#ifndef V8_ASMJS_ASM_PARSER_H_
6#define V8_ASMJS_ASM_PARSER_H_
20class Utf16CharacterStream;
39#define V(_unused1, name, _unused2, _unused3) kMath##name,
42#define V(name, _unused1) kMath##name,
45#define V(name, _unused1, _unused2, _unused3) k##name,
71#define V(_unused0, Name, _unused1, _unused2) kMath##Name,
74#define V(Name, _unused1) kMath##Name,
131 template <
typename T>
153 template <
typename T>
319 ValueType vtype,
bool mutable_variable, VarInfo* info);
#define STDLIB_ARRAY_TYPE_LIST(V)
#define STDLIB_MATH_VALUE_LIST(V)
#define STDLIB_MATH_FUNCTION_LIST(V)
uint32_t AsUnsigned() const
CachedVectors< T > * cache_
CachedVector(CachedVectors< T > *cache)
ZoneVector< ZoneVector< T > > reusable_vectors_
void fill(ZoneVector< T > *vec)
CachedVectors(Zone *zone)
void reuse(ZoneVector< T > *vec)
ZoneVector< BlockInfo > block_stack_
int failure_location() const
int function_temp_locals_depth_
AsmType * NumericLiteral()
bool CheckForUnsigned(uint32_t *value)
AsmJsScanner::token_t Consume()
void InitializeStdlibTypes()
CachedVectors< AsmJsScanner::token_t > cached_token_t_vectors_
bool Peek(AsmJsScanner::token_t token)
void ValidateFunctionTable()
AsmType * AdditiveExpression()
void ValidateModuleVar(bool mutable_variable)
void ValidateFunctionLocals(size_t param_count, ZoneVector< ValueType > *locals)
void ValidateModuleVarNewStdlib(VarInfo *info)
void Begin(AsmJsScanner::token_t label=0)
AsmType * BitwiseANDExpression()
void GatherCases(ZoneVector< int32_t > *cases)
void ValidateModuleVarImport(VarInfo *info, bool mutable_variable)
base::Vector< VarInfo > local_var_info_
AsmJsScanner::token_t foreign_name_
AsmType * CallExpression()
int function_temp_locals_offset_
WasmModuleBuilder * module_builder_
size_t call_coercion_deferred_position_
int FindBreakLabelDepth(AsmJsScanner::token_t label)
AsmType * ParenthesizedExpression()
AsmType * MultiplicativeExpression()
AsmJsScanner::token_t stdlib_name_
void ValidateModuleVarStdlib(VarInfo *info)
CachedVectors< int32_t > cached_int_vectors_
size_t call_coercion_position_
int function_temp_locals_used_
AsmJsScanner::token_t pending_label_
const StdlibSet * stdlib_uses() const
AsmType * RelationalExpression()
bool CheckForUnsignedBelow(uint32_t limit, uint32_t *value)
void DeclareStdlibFunc(VarInfo *info, VarKind kind, AsmType *type)
static const AsmJsScanner::token_t kTokenNone
uint32_t heap_access_shift_value_
AsmType * call_coercion_deferred_
size_t heap_access_shift_position_
void ValidateModuleVarFromGlobal(VarInfo *info, bool mutable_variable)
const char * failure_message() const
AsmType * Expression(AsmType *expect)
AsmType * MemberExpression()
AsmJsScanner::token_t heap_name_
AsmType * BitwiseXORExpression()
base::Vector< VarInfo > global_var_info_
AsmType * ConditionalExpression()
AsmType * UnaryExpression()
bool Check(AsmJsScanner::token_t token)
AsmType * EqualityExpression()
bool CheckForDouble(double *value)
void ValidateFloatCoercion()
const char * failure_message_
WasmFunctionBuilder * current_function_builder_
uint32_t VarIndex(VarInfo *info)
void BareBegin(BlockKind kind, AsmJsScanner::token_t label=0)
AsmType * BitwiseORExpression()
CachedVectors< AsmType * > cached_asm_type_p_vectors_
AsmJsParser(Zone *zone, uintptr_t stack_limit, Utf16CharacterStream *stream)
ZoneLinkedList< GlobalImport > global_imports_
void ValidateHeapAccess()
V(_unused0, Name, _unused1, _unused2)
void ValidateFunctionParams(ZoneVector< AsmType * > *params)
CachedVectors< ValueType > cached_valuetype_vectors_
int FindContinueLabelDepth(AsmJsScanner::token_t label)
base::Vector< const char > CopyCurrentIdentifierString()
void ScanToClosingParenthesis()
bool IterationStatement()
void AddGlobalImport(base::Vector< const char > name, AsmType *type, ValueType vtype, bool mutable_variable, VarInfo *info)
static const size_t kNoHeapAccessShift
AsmType * stdlib_ceil_like_
WasmModuleBuilder * module_builder()
void ExpressionStatement()
void DeclareGlobal(VarInfo *info, bool mutable_variable, AsmType *type, ValueType vtype, WasmInitExpr init)
AsmType * AssignmentExpression()
void Loop(AsmJsScanner::token_t label=0)
FunctionSig * ConvertSignature(AsmType *return_type, const ZoneVector< AsmType * > ¶ms)
void ValidateModuleParameters()
bool inside_heap_assignment_
void ValidateModuleVars()
VarInfo * GetVarInfo(AsmJsScanner::token_t token)
AsmType * ShiftExpression()
AsmType * ValidateExpression()
AsmType * heap_access_type_
uint32_t TempVariable(int index)
constexpr int kNoSourcePosition
AsmJsScanner::token_t label
base::Vector< const char > function_name
ZoneUnorderedMap< FunctionSig, uint32_t > cache
FunctionImportInfo(base::Vector< const char > name, Zone *zone)
base::Vector< const char > import_name
WasmFunctionBuilder * function_builder
FunctionImportInfo *uint32_t mask