Lines Matching defs:function

18 #include "src/wasm/function-body-decoder-impl.h"
47 return "function";
260 // As a side effect, the above function will forward the decoder to after
447 // first occurrence after function section and before code section are
454 // first occurrence after function section and before code section are
797 // ===== Imported function ===========================================
808 WasmFunction* function = &module_->functions.back();
809 function->sig_index =
810 consume_sig_index(module_.get(), &function->sig);
899 WasmFunction* function = &module_->functions.back();
900 function->sig_index = consume_sig_index(module_.get(), &function->sig);
916 "Currently, only externref and function references are allowed "
986 consume_func_index(module_.get(), &func, "export function index");
1070 consume_func_index(module_.get(), &func, "start function index");
1073 error(pos, "invalid start function: non-zero parameter or return count");
1111 errorf(pos, "size %u > maximum function size %zu", size,
1116 consume_bytes(size, "function body");
1127 // function compilation.
1134 errorf(error_offset, "function body count %u mismatch (%u expected)",
1143 WasmFunction* function =
1145 function->code = {offset, length};
1150 module_.get(), function);
1270 // All except first occurrence after function section and before code
1287 // Ensure exactly one compilation hint per function.
1371 // Keep track of the previous function index to validate the ordering
1374 uint32_t func_idx = inner.consume_u32v("function index");
1376 inner.errorf("Invalid function index: %d", func_idx);
1455 // The declared vs. defined function count is normally checked when
1461 // non-imported function has its code set.
1463 errorf(pc(), "function count is %u, but code section is absent",
1536 // Decodes a single anonymous function starting at {start_}.
1540 std::unique_ptr<WasmFunction> function) {
1544 function->sig = consume_sig(zone);
1545 function->code = {off(pc_), static_cast<uint32_t>(end_ - pc_)};
1549 function.get());
1555 return FunctionResult(std::move(function));
1558 // Decodes a single function signature at {start}.
1629 // function should be called after all globals have been defined, which is
1631 // offsets are accessed, e.g. by the function compilers. The moment when this
1632 // function should be called is not well-defined, as the global section may
1633 // not exist. Therefore this function is called multiple times.
1637 // This function has already been executed before, so we don't have to
1662 // Verifies the body (code) of a given function.
1665 const WasmModule* module, WasmFunction* function) {
1666 WasmFunctionName func_name(function,
1667 wire_bytes.GetNameOrNull(function, module));
1669 StdoutStream{} << "Verifying wasm function " << func_name << std::endl;
1672 function->sig, function->code.offset(),
1673 start_ + GetBufferRelativeOffset(function->code.offset()),
1674 start_ + GetBufferRelativeOffset(function->code.end_offset())};
1683 // Wrap the error message from the function decoder.
1685 error_msg << "in function " << func_name << ": "
1898 errorf(pc() + 1, "function index %u out of bounds", index);
2075 // segment are defined as function indices (0) or init. expressions (1).
2147 // Active segments with function indices must reference a function
2151 "An active element segment with function indices as elements "
2206 consume_func_index(module_.get(), &func, "element function index");
2360 "size > maximum function size (%zu): %zu",
2388 int function_start_position = decoder.consume_u32v("function start pos");
2406 // The last entry is the function end marker.
2503 uint32_t function_index = decoder.consume_u32v("function index");
2504 WireBytesRef name = consume_string(&decoder, false, "function name");
2507 // You can even assign to the same function multiple times (last valid