MCPcopy Create free account
hub / github.com/WebAssembly/wabt / WriteLoadStoreExpr

Method WriteLoadStoreExpr

src/binary-writer.cc:695–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693// TODO(binji): Rename this, it is used for more than loads/stores now.
694template <typename T>
695void BinaryWriter::WriteLoadStoreExpr(const Func* func,
696 const Expr* expr,
697 const char* desc) {
698 auto* typed_expr = cast<T>(expr);
699 WriteOpcode(stream_, typed_expr->opcode);
700 Address align = typed_expr->opcode.GetAlignment(typed_expr->align);
701 Index memidx = module_->GetMemoryIndex(typed_expr->memidx);
702 if (memidx != 0) {
703 stream_->WriteU8(log2_u32(align) | (1 << 6), "alignment");
704 WriteU32Leb128(stream_, memidx, "memidx");
705 } else {
706 stream_->WriteU8(log2_u32(align), "alignment");
707 }
708 WriteU64Leb128(stream_, typed_expr->offset, desc);
709}
710
711template <typename T>
712void BinaryWriter::WriteSimdLoadStoreLaneExpr(const Func* func,

Callers

nothing calls this directly

Calls 7

WriteOpcodeFunction · 0.85
log2_u32Function · 0.85
WriteU64Leb128Function · 0.85
GetAlignmentMethod · 0.80
GetMemoryIndexMethod · 0.80
WriteU8Method · 0.80
WriteU32Leb128Function · 0.70

Tested by

no test coverage detected