Lines Matching defs:module

5 #include "src/wasm/module-decoder.h"
170 // An iterator over the sections in a wasm binary module.
243 // Get the limit of the section within the module.
246 // The section would extend beyond the end of the module.
281 // The main logic for decoding the bytes of a module.
414 // the module.
434 // in the module. In case of multiple sourceMappingURL sections, all
680 TRACE("DecodeSignature[%d] module+%d\n", i,
699 // In a nominal module, all types belong in the same recursive group. We
704 TRACE("DecodeType[%d] module+%d\n", i,
715 TRACE("DecodeType[%d] module+%d\n", i,
751 const WasmModule* module = module_.get();
756 int depth = GetSubtypingDepth(module, i);
767 if (!ValidSubtypeDefinition(i, explicit_super, module, module)) {
780 TRACE("DecodeImportTable[%d] module+%d\n", i,
791 import->module_name = consume_string(this, true, "module name");
882 SELECT_WASM_COUNTER(GetCounters(), origin_, wasm_functions_per, module);
953 TRACE("DecodeGlobal[%d] module+%d\n", i, static_cast<int>(pc_ - start_));
968 TRACE("DecodeExportTable[%d] module+%d\n", i,
1172 TRACE("DecodeDataSegment[%d] module+%d\n", i,
1226 // Decode module name, ignore the rest.
1229 WireBytesRef name = consume_string(&inner, false, "module name");
1244 WireBytesRef url = wasm::consume_string(&inner, true, "module name");
1267 TRACE("DecodeCompilationHints module+%d\n", static_cast<int>(pc_ - start_));
1299 TRACE("DecodeCompilationHints[%d] module+%d\n", i,
1363 TRACE("DecodeBranchHints module+%d\n", static_cast<int>(pc_ - start_));
1382 TRACE("DecodeBranchHints[%d] module+%d\n", func_idx,
1399 TRACE("DecodeBranchHints[%d][%d] module+%d\n", func_idx, br_off,
1429 // If everything went well, accept the hints for the module.
1446 TRACE("DecodeTag[%d] module+%d\n", i, static_cast<int>(pc_ - start_));
1498 // Decodes an entire module.
1508 // Size of the module header.
1539 const WasmModule* module,
1548 VerifyFunctionBody(zone->allocator(), 0, wire_bytes, module,
1588 // The type section is the first section in a module.
1618 bool AddMemory(WasmModule* module) {
1619 if (module->has_memory) {
1623 module->has_memory = true;
1634 void CalculateGlobalOffsets(WasmModule* module) {
1635 if (module->globals.empty() || module->untagged_globals_buffer_size != 0 ||
1636 module->tagged_globals_buffer_size != 0) {
1644 for (WasmGlobal& global : module->globals) {
1658 module->untagged_globals_buffer_size = untagged_offset;
1659 module->tagged_globals_buffer_size = tagged_offset;
1665 const WasmModule* module, WasmFunction* function) {
1667 wire_bytes.GetNameOrNull(function, module));
1677 DecodeResult result = VerifyWasmCode(allocator, enabled_features_, module,
1691 uint32_t consume_sig_index(WasmModule* module, const FunctionSig** sig) {
1694 if (!module->has_signature(sig_index)) {
1696 static_cast<int>(module->types.size()));
1700 *sig = module->signature(sig_index);
1704 uint32_t consume_tag_sig_index(WasmModule* module, const FunctionSig** sig) {
1706 uint32_t sig_index = consume_sig_index(module, sig);
1725 uint32_t consume_func_index(WasmModule* module, WasmFunction** func,
1727 return consume_index(name, &module->functions, func);
1730 uint32_t consume_global_index(WasmModule* module, WasmGlobal** global) {
1731 return consume_index("global index", &module->globals, global);
1734 uint32_t consume_table_index(WasmModule* module, WasmTable** table) {
1735 return consume_index("table index", &module->tables, table);
1738 uint32_t consume_tag_index(WasmModule* module, WasmTag** tag) {
1739 return consume_index("tag index", &module->tags, tag);
1858 ConstantExpression consume_init_expr(WasmModule* module, ValueType expected) {
1934 decoder(&init_expr_zone_, module, enabled_features_, &detected, body,
1935 module);
2233 WasmError{0, "size > maximum module size (%zu): %zu", max_size, size}};
2240 // as the {module}.
2265 } else if (auto&& module = decoder.shared_module()) {
2266 metrics_event.function_count = module->num_declared_functions;
2354 const WasmModule* module, const byte* function_start,
2365 return decoder.DecodeSingleFunction(zone, wire_bytes, module,
2465 decoder->consume_bytes(kModuleHeaderSize, "module header");