#include "src/asmjs/asm-parser.h"
#include <math.h>
#include <string.h>
#include <algorithm>
#include <optional>
#include "src/asmjs/asm-js.h"
#include "src/asmjs/asm-types.h"
#include "src/base/overflowing-math.h"
#include "src/flags/flags.h"
#include "src/numbers/conversions-inl.h"
#include "src/parsing/scanner.h"
#include "src/wasm/wasm-limits.h"
#include "src/wasm/wasm-opcodes.h"
namespace v8 {
namespace internal {
namespace wasm {
#ifdef DEBUG
#define FAIL_AND_RETURN(ret, msg) …
#else
#define FAIL_AND_RETURN …
#endif
#define FAIL(msg) …
#define FAILn(msg) …
#define EXPECT_TOKEN_OR_RETURN(ret, token) …
#define EXPECT_TOKEN(token) …
#define EXPECT_TOKENn(token) …
#define RECURSE_OR_RETURN(ret, call) …
#define RECURSE …
#define RECURSEn(call) …
#define TOK(name) …
AsmJsParser::AsmJsParser(Zone* zone, uintptr_t stack_limit,
Utf16CharacterStream* stream)
: … { … }
void AsmJsParser::InitializeStdlibTypes() { … }
FunctionSig* AsmJsParser::ConvertSignature(AsmType* return_type,
const ZoneVector<AsmType*>& params) { … }
bool AsmJsParser::Run() { … }
class V8_NODISCARD AsmJsParser::TemporaryVariableScope { … };
wasm::AsmJsParser::VarInfo* AsmJsParser::GetVarInfo(
AsmJsScanner::token_t token) { … }
uint32_t AsmJsParser::VarIndex(VarInfo* info) { … }
void AsmJsParser::AddGlobalImport(base::Vector<const char> name, AsmType* type,
ValueType vtype, bool mutable_variable,
VarInfo* info) { … }
void AsmJsParser::DeclareGlobal(VarInfo* info, bool mutable_variable,
AsmType* type, ValueType vtype,
WasmInitExpr init) { … }
void AsmJsParser::DeclareStdlibFunc(VarInfo* info, VarKind kind,
AsmType* type) { … }
uint32_t AsmJsParser::TempVariable(int index) { … }
base::Vector<const char> AsmJsParser::CopyCurrentIdentifierString() { … }
void AsmJsParser::SkipSemicolon() { … }
void AsmJsParser::Begin(AsmJsScanner::token_t label) { … }
void AsmJsParser::Loop(AsmJsScanner::token_t label) { … }
void AsmJsParser::End() { … }
void AsmJsParser::BareBegin(BlockKind kind, AsmJsScanner::token_t label) { … }
void AsmJsParser::BareEnd() { … }
int AsmJsParser::FindContinueLabelDepth(AsmJsScanner::token_t label) { … }
int AsmJsParser::FindBreakLabelDepth(AsmJsScanner::token_t label) { … }
void AsmJsParser::ValidateModule() { … }
void AsmJsParser::ValidateModuleParameters() { … }
void AsmJsParser::ValidateModuleVars() { … }
void AsmJsParser::ValidateModuleVar(bool mutable_variable) { … }
void AsmJsParser::ValidateModuleVarFromGlobal(VarInfo* info,
bool mutable_variable) { … }
void AsmJsParser::ValidateModuleVarImport(VarInfo* info,
bool mutable_variable) { … }
void AsmJsParser::ValidateModuleVarNewStdlib(VarInfo* info) { … }
void AsmJsParser::ValidateModuleVarStdlib(VarInfo* info) { … }
void AsmJsParser::ValidateExport() { … }
void AsmJsParser::ValidateFunctionTable() { … }
void AsmJsParser::ValidateFunction() { … }
void AsmJsParser::ValidateFunctionParams(ZoneVector<AsmType*>* params) { … }
void AsmJsParser::ValidateFunctionLocals(size_t param_count,
ZoneVector<ValueType>* locals) { … }
void AsmJsParser::ValidateStatement() { … }
void AsmJsParser::Block() { … }
void AsmJsParser::ExpressionStatement() { … }
void AsmJsParser::EmptyStatement() { … }
void AsmJsParser::IfStatement() { … }
void AsmJsParser::ReturnStatement() { … }
bool AsmJsParser::IterationStatement() { … }
void AsmJsParser::WhileStatement() { … }
void AsmJsParser::DoStatement() { … }
void AsmJsParser::ForStatement() { … }
void AsmJsParser::BreakStatement() { … }
void AsmJsParser::ContinueStatement() { … }
void AsmJsParser::LabelledStatement() { … }
void AsmJsParser::SwitchStatement() { … }
void AsmJsParser::ValidateCase() { … }
void AsmJsParser::ValidateDefault() { … }
AsmType* AsmJsParser::ValidateExpression() { … }
AsmType* AsmJsParser::Expression(AsmType* expected) { … }
AsmType* AsmJsParser::NumericLiteral() { … }
AsmType* AsmJsParser::Identifier() { … }
AsmType* AsmJsParser::CallExpression() { … }
AsmType* AsmJsParser::MemberExpression() { … }
AsmType* AsmJsParser::AssignmentExpression() { … }
AsmType* AsmJsParser::UnaryExpression() { … }
AsmType* AsmJsParser::MultiplicativeExpression() { … }
AsmType* AsmJsParser::AdditiveExpression() { … }
AsmType* AsmJsParser::ShiftExpression() { … }
AsmType* AsmJsParser::RelationalExpression() { … }
AsmType* AsmJsParser::EqualityExpression() { … }
AsmType* AsmJsParser::BitwiseANDExpression() { … }
AsmType* AsmJsParser::BitwiseXORExpression() { … }
AsmType* AsmJsParser::BitwiseORExpression() { … }
AsmType* AsmJsParser::ConditionalExpression() { … }
AsmType* AsmJsParser::ParenthesizedExpression() { … }
AsmType* AsmJsParser::ValidateCall() { … }
bool AsmJsParser::PeekCall() { … }
void AsmJsParser::ValidateHeapAccess() { … }
void AsmJsParser::ValidateFloatCoercion() { … }
void AsmJsParser::ScanToClosingParenthesis() { … }
void AsmJsParser::GatherCases(ZoneVector<int32_t>* cases) { … }
}
}
}
#undef RECURSE