chromium/v8/src/wasm/wasm-module-builder.cc

// Copyright 2015 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/wasm/wasm-module-builder.h"

#include "src/codegen/signature.h"
#include "src/wasm/function-body-decoder.h"
#include "src/wasm/leb-helper.h"
#include "src/wasm/wasm-constants.h"
#include "src/wasm/wasm-module.h"
#include "src/zone/zone-containers.h"

namespace v8 {
namespace internal {
namespace wasm {

namespace {

// Emit a section code and the size as a padded varint that can be patched
// later.
size_t EmitSection(SectionCode code, ZoneBuffer* buffer) {}

// Patch the size of a section after it's finished.
void FixupSection(ZoneBuffer* buffer, size_t start) {}

WasmOpcode FromInitExprOperator(WasmInitExpr::Operator op) {}

void WriteInitializerExpressionWithoutEnd(ZoneBuffer* buffer,
                                          const WasmInitExpr& init) {}

void WriteInitializerExpression(ZoneBuffer* buffer, const WasmInitExpr& init) {}
}  // namespace

WasmFunctionBuilder::WasmFunctionBuilder(WasmModuleBuilder* builder)
    :{}

void WasmFunctionBuilder::EmitByte(uint8_t val) {}

void WasmFunctionBuilder::EmitI32V(int32_t val) {}

void WasmFunctionBuilder::EmitU32V(uint32_t val) {}

void WasmFunctionBuilder::EmitU64V(uint64_t val) {}

void WasmFunctionBuilder::SetSignature(const FunctionSig* sig) {}

void WasmFunctionBuilder::SetSignature(uint32_t sig_index) {}

uint32_t WasmFunctionBuilder::AddLocal(ValueType type) {}

void WasmFunctionBuilder::EmitGetLocal(uint32_t local_index) {}

void WasmFunctionBuilder::EmitSetLocal(uint32_t local_index) {}

void WasmFunctionBuilder::EmitTeeLocal(uint32_t local_index) {}

void WasmFunctionBuilder::EmitCode(const uint8_t* code, uint32_t code_size) {}

void WasmFunctionBuilder::Emit(WasmOpcode opcode) {}

void WasmFunctionBuilder::EmitWithPrefix(WasmOpcode opcode) {}

void WasmFunctionBuilder::EmitWithU8(WasmOpcode opcode,
                                     const uint8_t immediate) {}

void WasmFunctionBuilder::EmitWithU8U8(WasmOpcode opcode, const uint8_t imm1,
                                       const uint8_t imm2) {}

void WasmFunctionBuilder::EmitWithI32V(WasmOpcode opcode, int32_t immediate) {}

void WasmFunctionBuilder::EmitWithU32V(WasmOpcode opcode, uint32_t immediate) {}

namespace {
void WriteValueType(ZoneBuffer* buffer, const ValueType& type) {}
}  // namespace

void WasmFunctionBuilder::EmitValueType(ValueType type) {}

void WasmFunctionBuilder::EmitI32Const(int32_t value) {}

void WasmFunctionBuilder::EmitI64Const(int64_t value) {}

void WasmFunctionBuilder::EmitF32Const(float value) {}

void WasmFunctionBuilder::EmitF64Const(double value) {}

void WasmFunctionBuilder::EmitDirectCallIndex(uint32_t index) {}

void WasmFunctionBuilder::EmitFromInitializerExpression(
    const WasmInitExpr& init_expr) {}

void WasmFunctionBuilder::SetName(base::Vector<const char> name) {}

void WasmFunctionBuilder::AddAsmWasmOffset(size_t call_position,
                                           size_t to_number_position) {}

void WasmFunctionBuilder::SetAsmFunctionStartPosition(
    size_t function_position) {}

void WasmFunctionBuilder::SetCompilationHint(
    WasmCompilationHintStrategy strategy, WasmCompilationHintTier baseline,
    WasmCompilationHintTier top_tier) {}

void WasmFunctionBuilder::DeleteCodeAfter(size_t position) {}

void WasmFunctionBuilder::WriteSignature(ZoneBuffer* buffer) const {}

void WasmFunctionBuilder::WriteBody(ZoneBuffer* buffer) const {}

void WasmFunctionBuilder::WriteAsmWasmOffsetTable(ZoneBuffer* buffer) const {}

WasmModuleBuilder::WasmModuleBuilder(Zone* zone)
    :{}

WasmFunctionBuilder* WasmModuleBuilder::AddFunction(const FunctionSig* sig) {}

WasmFunctionBuilder* WasmModuleBuilder::AddFunction(uint32_t sig_index) {}

void WasmModuleBuilder::AddDataSegment(const uint8_t* data, uint32_t size,
                                       uint32_t dest) {}

void WasmModuleBuilder::AddPassiveDataSegment(const uint8_t* data,
                                              uint32_t size) {}

uint32_t WasmModuleBuilder::ForceAddSignature(const FunctionSig* sig,
                                              bool is_final,
                                              uint32_t supertype) {}

uint32_t WasmModuleBuilder::AddSignature(const FunctionSig* sig, bool is_final,
                                         uint32_t supertype) {}

uint32_t WasmModuleBuilder::AddTag(const FunctionSig* type) {}

uint32_t WasmModuleBuilder::AddStructType(StructType* type, bool is_final,
                                          uint32_t supertype) {}

uint32_t WasmModuleBuilder::AddArrayType(ArrayType* type, bool is_final,
                                         uint32_t supertype) {}

uint32_t WasmModuleBuilder::IncreaseTableMinSize(uint32_t table_index,
                                                 uint32_t count) {}

uint32_t WasmModuleBuilder::AddTable(ValueType type, uint32_t min_size) {}

uint32_t WasmModuleBuilder::AddTable(ValueType type, uint32_t min_size,
                                     uint32_t max_size) {}

uint32_t WasmModuleBuilder::AddTable(ValueType type, uint32_t min_size,
                                     uint32_t max_size, WasmInitExpr init) {}

uint32_t WasmModuleBuilder::AddTable64(ValueType type, uint32_t min_size,
                                       uint32_t max_size) {}

uint32_t WasmModuleBuilder::AddTable64(ValueType type, uint32_t min_size,
                                       uint32_t max_size, WasmInitExpr init) {}

uint32_t WasmModuleBuilder::AddMemory(uint32_t min_pages) {}

uint32_t WasmModuleBuilder::AddMemory(uint32_t min_pages, uint32_t max_pages) {}

uint32_t WasmModuleBuilder::AddMemory64(uint32_t min_pages,
                                        uint32_t max_pages) {}

uint32_t WasmModuleBuilder::AddElementSegment(WasmElemSegment segment) {}

void WasmModuleBuilder::SetIndirectFunction(
    uint32_t table_index, uint32_t index_in_table,
    uint32_t direct_function_index,
    WasmElemSegment::FunctionIndexingMode indexing_mode) {}

uint32_t WasmModuleBuilder::AddImport(base::Vector<const char> name,
                                      const FunctionSig* sig,
                                      base::Vector<const char> module) {}

uint32_t WasmModuleBuilder::AddGlobalImport(base::Vector<const char> name,
                                            ValueType type, bool mutability,
                                            base::Vector<const char> module) {}

void WasmModuleBuilder::MarkStartFunction(WasmFunctionBuilder* function) {}

void WasmModuleBuilder::AddExport(base::Vector<const char> name,
                                  ImportExportKindCode kind, uint32_t index) {}

uint32_t WasmModuleBuilder::AddExportedGlobal(ValueType type, bool mutability,
                                              WasmInitExpr init,
                                              base::Vector<const char> name) {}

void WasmModuleBuilder::ExportImportedFunction(base::Vector<const char> name,
                                               int import_index) {}

uint32_t WasmModuleBuilder::AddGlobal(ValueType type, bool mutability,
                                      WasmInitExpr init) {}

void WasmModuleBuilder::WriteTo(ZoneBuffer* buffer) const {}

void WasmModuleBuilder::WriteAsmJsOffsetTable(ZoneBuffer* buffer) const {}
}  // namespace wasm
}  // namespace internal
}  // namespace v8