MCPcopy Create free account
hub / github.com/nodejs/node / emit_leb_u

Method emit_leb_u

deps/v8/test/mjsunit/wasm/wasm-module-builder.js:1161–1173  ·  view source on GitHub ↗
(val, max_len)

Source from the content-addressed store, hash-verified

1159 }
1160
1161 emit_leb_u(val, max_len) {
1162 this.ensure_space(max_len);
1163 for (let i = 0; i < max_len; ++i) {
1164 let v = val & 0xff;
1165 val = val >>> 7;
1166 if (val == 0) {
1167 this.buffer[this.length++] = v;
1168 return;
1169 }
1170 this.buffer[this.length++] = v | 0x80;
1171 }
1172 throw new Error('Leb value exceeds maximum length of ' + max_len);
1173 }
1174
1175 emit_u32v(val) {
1176 this.emit_leb_u(val, kMaxVarInt32Size);

Callers 2

emit_u32vMethod · 0.95
emit_u64vMethod · 0.95

Calls 1

ensure_spaceMethod · 0.95

Tested by

no test coverage detected