chromium/v8/src/asmjs/asm-parser.cc

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// 6.1 ValidateModule
void AsmJsParser::ValidateModule() {}

// 6.1 ValidateModule - parameters
void AsmJsParser::ValidateModuleParameters() {}

// 6.1 ValidateModule - variables
void AsmJsParser::ValidateModuleVars() {}

// 6.1 ValidateModule - one variable
void AsmJsParser::ValidateModuleVar(bool mutable_variable) {}

// 6.1 ValidateModule - global float declaration
void AsmJsParser::ValidateModuleVarFromGlobal(VarInfo* info,
                                              bool mutable_variable) {}

// 6.1 ValidateModule - foreign imports
void AsmJsParser::ValidateModuleVarImport(VarInfo* info,
                                          bool mutable_variable) {}

// 6.1 ValidateModule - one variable
// 9 - Standard Library - heap types
void AsmJsParser::ValidateModuleVarNewStdlib(VarInfo* info) {}

// 6.1 ValidateModule - one variable
// 9 - Standard Library
void AsmJsParser::ValidateModuleVarStdlib(VarInfo* info) {}

// 6.2 ValidateExport
void AsmJsParser::ValidateExport() {}

// 6.3 ValidateFunctionTable
void AsmJsParser::ValidateFunctionTable() {}

// 6.4 ValidateFunction
void AsmJsParser::ValidateFunction() {}

// 6.4 ValidateFunction
void AsmJsParser::ValidateFunctionParams(ZoneVector<AsmType*>* params) {}

// 6.4 ValidateFunction - locals
void AsmJsParser::ValidateFunctionLocals(size_t param_count,
                                         ZoneVector<ValueType>* locals) {}

// 6.5 ValidateStatement
void AsmJsParser::ValidateStatement() {}

// 6.5.1 Block
void AsmJsParser::Block() {}

// 6.5.2 ExpressionStatement
void AsmJsParser::ExpressionStatement() {}

// 6.5.3 EmptyStatement
void AsmJsParser::EmptyStatement() {}

// 6.5.4 IfStatement
void AsmJsParser::IfStatement() {}

// 6.5.5 ReturnStatement
void AsmJsParser::ReturnStatement() {}

// 6.5.6 IterationStatement
bool AsmJsParser::IterationStatement() {}

// 6.5.6 IterationStatement - while
void AsmJsParser::WhileStatement() {}

// 6.5.6 IterationStatement - do
void AsmJsParser::DoStatement() {}

// 6.5.6 IterationStatement - for
void AsmJsParser::ForStatement() {}

// 6.5.7 BreakStatement
void AsmJsParser::BreakStatement() {}

// 6.5.8 ContinueStatement
void AsmJsParser::ContinueStatement() {}

// 6.5.9 LabelledStatement
void AsmJsParser::LabelledStatement() {}

// 6.5.10 SwitchStatement
void AsmJsParser::SwitchStatement() {}

// 6.6. ValidateCase
void AsmJsParser::ValidateCase() {}

// 6.7 ValidateDefault
void AsmJsParser::ValidateDefault() {}

// 6.8 ValidateExpression
AsmType* AsmJsParser::ValidateExpression() {}

// 6.8.1 Expression
AsmType* AsmJsParser::Expression(AsmType* expected) {}

// 6.8.2 NumericLiteral
AsmType* AsmJsParser::NumericLiteral() {}

// 6.8.3 Identifier
AsmType* AsmJsParser::Identifier() {}

// 6.8.4 CallExpression
AsmType* AsmJsParser::CallExpression() {}

// 6.8.5 MemberExpression
AsmType* AsmJsParser::MemberExpression() {}

// 6.8.6 AssignmentExpression
AsmType* AsmJsParser::AssignmentExpression() {}

// 6.8.7 UnaryExpression
AsmType* AsmJsParser::UnaryExpression() {}

// 6.8.8 MultiplicativeExpression
AsmType* AsmJsParser::MultiplicativeExpression() {}

// 6.8.9 AdditiveExpression
AsmType* AsmJsParser::AdditiveExpression() {}

// 6.8.10 ShiftExpression
AsmType* AsmJsParser::ShiftExpression() {}

// 6.8.11 RelationalExpression
AsmType* AsmJsParser::RelationalExpression() {}

// 6.8.12 EqualityExpression
AsmType* AsmJsParser::EqualityExpression() {}

// 6.8.13 BitwiseANDExpression
AsmType* AsmJsParser::BitwiseANDExpression() {}

// 6.8.14 BitwiseXORExpression
AsmType* AsmJsParser::BitwiseXORExpression() {}

// 6.8.15 BitwiseORExpression
AsmType* AsmJsParser::BitwiseORExpression() {}

// 6.8.16 ConditionalExpression
AsmType* AsmJsParser::ConditionalExpression() {}

// 6.8.17 ParenthesiedExpression
AsmType* AsmJsParser::ParenthesizedExpression() {}

// 6.9 ValidateCall
AsmType* AsmJsParser::ValidateCall() {}

// 6.9 ValidateCall - helper
bool AsmJsParser::PeekCall() {}

// 6.10 ValidateHeapAccess
void AsmJsParser::ValidateHeapAccess() {}

// 6.11 ValidateFloatCoercion
void AsmJsParser::ValidateFloatCoercion() {}

void AsmJsParser::ScanToClosingParenthesis() {}

void AsmJsParser::GatherCases(ZoneVector<int32_t>* cases) {}

}  // namespace wasm
}  // namespace internal
}  // namespace v8

#undef RECURSE