Home
last modified time | relevance | path

Searched refs:bytes (Results 1 – 25 of 294) sorted by relevance

12345678910>>...12

/wasmtime-44.0.1/crates/wasmtime/src/runtime/
H A Dnative_debug.rs13 mut bytes: Vec<u8>, in create_gdbjit_image()
16 let e = ensure_supported_elf_format(&bytes)?; in create_gdbjit_image()
19 relocate_dwarf_sections(&mut bytes, code_region)?; in create_gdbjit_image()
31 Ok(bytes) in create_gdbjit_image()
81 let kind = match object::FileKind::parse(bytes) { in ensure_supported_elf_format()
123 bytes: &mut Vec<u8>, in convert_object_elf_to_loadable_file()
128 let header = FileHeader64::<E>::parse(&bytes[..]).unwrap(); in convert_object_elf_to_loadable_file()
129 let sections = header.sections(e, &bytes[..]).unwrap(); in convert_object_elf_to_loadable_file()
146 let ph_off = bytes.len(); in convert_object_elf_to_loadable_file()
149 bytes.resize(ph_off + e_phentsize * e_phnum, 0); in convert_object_elf_to_loadable_file()
[all …]
/wasmtime-44.0.1/crates/wasmtime/src/runtime/vm/
H A Dbyte_count.rs23 if bytes % host_page_size == 0 { in new()
24 Ok(Self(bytes)) in new()
26 Err(ByteCountNotAligned(bytes)) in new()
38 bytes % host_page_size() == 0, in new_unchecked()
42 Self(bytes) in new_unchecked()
51 match bytes.checked_add(page_size - 1) { in new_rounded_up()
62 let bytes = bytes in new_rounded_up_u64() localVariable
65 Self::new_rounded_up(bytes) in new_rounded_up_u64()
92 .checked_add(bytes.0) in checked_add()
106 .checked_sub(bytes.0) in checked_sub()
[all …]
/wasmtime-44.0.1/crates/wasi/src/p2/
H A Dtcp.rs66 return Ok(bytes::Bytes::new()); in read()
161 fn background_write(&mut self, mut bytes: bytes::Bytes) { in background_write()
171 while !bytes.is_empty() { in background_write()
173 match Self::try_write_portable(&stream, &bytes) { in background_write()
175 let _ = bytes.split_to(n); in background_write()
186 fn write(&mut self, mut bytes: bytes::Bytes) -> Result<(), StreamError> { in write()
196 while !bytes.is_empty() { in write()
199 let _ = bytes.split_to(n); in write()
205 self.background_write(bytes); in write()
316 fn write(&mut self, bytes: bytes::Bytes) -> Result<(), StreamError> { in write()
[all …]
H A Dwrite_stream.rs2 use bytes::Bytes;
75 } else if let Some(bytes) = state.items.pop_front() { in pop()
76 return Some(Job::Write(bytes)); in pop()
109 Job::Write(mut bytes) => { in work()
111 let len = bytes.len(); in work()
112 match writer.write_all_buf(&mut bytes).await { in work()
168 fn write(&mut self, bytes: Bytes) -> Result<(), StreamError> { in write()
176 match state.write_budget.checked_sub(bytes.len()) { in write()
179 state.items.push_back(bytes); in write()
/wasmtime-44.0.1/winch/codegen/src/abi/
H A Dmod.rs217 pub bytes: u32, field
225 bytes: 0, in default()
363 bytes, in from()
413 self.operands.bytes in size()
419 self.operands.bytes > 0 in on_stack()
485 stack_bytes = bytes; in from()
497 stack_bytes = bytes; in from()
510 bytes: stack_bytes, in from()
519 params.operands.bytes = bytes; in with_bytes()
630 self.params.operands.bytes in params_stack_size()
[all …]
/wasmtime-44.0.1/src/commands/
H A Dobjdump.rs51 bytes: bool, field
143 .and_then(|bytes| FrameTable::parse(bytes, text).ok()); in execute()
160 .and_then(|bytes| wasmtime_environ::iterate_address_map(bytes)) in execute()
165 .and_then(|bytes| wasmtime_environ::iterate_traps(bytes)) in execute()
170 .and_then(|bytes| StackMap::iter(bytes)) in execute()
175 .and_then(|bytes| ExceptionTable::parse(bytes).ok()) in execute()
181 .and_then(|bytes| FrameTable::parse(bytes, text).ok()) in execute()
266 bytes, in execute()
272 let mut bytes = bytes.iter().map(Some).chain(iter::repeat(None)); in execute() localVariable
476 bytes: inst.bytes().to_vec(), in disas()
[all …]
/wasmtime-44.0.1/crates/c-api/include/wasmtime/component/
H A Dcomponent.hh56 auto bytes = wasm.ok(); in compile() local
57 return compile(engine, bytes); in compile()
136 wasm_byte_vec_t bytes; in serialize() local
137 auto *error = wasmtime_component_serialize(ptr.get(), &bytes); in serialize()
142 Span<uint8_t> raw(reinterpret_cast<uint8_t *>(bytes.data), bytes.size); in serialize()
144 wasm_byte_vec_delete(&bytes); in serialize()
/wasmtime-44.0.1/crates/wasi/src/p3/wit/deps/
H A Drandom.wit36 /// Return up to `max-len` insecure pseudo-random bytes.
41 /// There are no requirements on the values of the returned bytes, however
45 /// Implementations MAY return fewer bytes than requested (a short read).
47 /// a loop until the desired number of bytes has been accumulated.
52 get-insecure-random-bytes: func(max-len: u64) -> list<u8>;
57 /// `get-insecure-random-bytes`, represented as a `u64`.
69 /// bytes.
75 /// request and on requests for numbers of bytes. The returned data must
80 /// a loop until the desired number of bytes has been accumulated.
89 get-random-bytes: func(max-len: u64) -> list<u8>;
[all …]
/wasmtime-44.0.1/crates/wasi-http/src/p3/wit/deps/
H A Drandom.wit36 /// Return up to `max-len` insecure pseudo-random bytes.
41 /// There are no requirements on the values of the returned bytes, however
45 /// Implementations MAY return fewer bytes than requested (a short read).
47 /// a loop until the desired number of bytes has been accumulated.
52 get-insecure-random-bytes: func(max-len: u64) -> list<u8>;
57 /// `get-insecure-random-bytes`, represented as a `u64`.
69 /// bytes.
75 /// request and on requests for numbers of bytes. The returned data must
80 /// a loop until the desired number of bytes has been accumulated.
89 get-random-bytes: func(max-len: u64) -> list<u8>;
[all …]
/wasmtime-44.0.1/cranelift/codegen/src/machinst/
H A Disle.rs372 Some(u128::from_le_bytes(bytes.try_into().ok()?))
395 Some(u64::from_le_bytes(bytes.try_into().ok()?))
401 Some(u128::from_le_bytes(bytes.try_into().ok()?))
683 shuffle_imm_as_le_lane_idx(8, &bytes[0..8])?,
703 shuffle_imm_as_le_lane_idx(4, &bytes[0..4])?,
730 let minus_one = if ty.bytes() == 8 {
733 (1 << (ty.bytes() * 8)) - 1
803 assert_eq!(bytes.len(), usize::from(size)); in shuffle_imm_as_le_lane_idx()
807 if bytes[0] % size != 0 { in shuffle_imm_as_le_lane_idx()
816 if bytes[idx] + 1 != bytes[idx + 1] { in shuffle_imm_as_le_lane_idx()
[all …]
/wasmtime-44.0.1/crates/c-api/include/wasmtime/
H A Dmodule.hh45 auto bytes = wasm.ok(); in compile() local
46 return compile(engine, bytes); in compile()
153 wasm_byte_vec_t bytes; in serialize() local
154 auto *error = wasmtime_module_serialize(ptr.get(), &bytes); in serialize()
160 Span<uint8_t> raw(reinterpret_cast<uint8_t *>(bytes.data), bytes.size); in serialize()
162 wasm_byte_vec_delete(&bytes); in serialize()
/wasmtime-44.0.1/crates/wasi-io/src/
H A Dimpls.rs7 use bytes::Bytes;
128 Ok(bytes as u64) in check_write()
132 self.get_mut(&stream)?.write(bytes.into())?; in write()
143 bytes: Vec<u8>, in blocking_write_and_flush()
145 if bytes.len() > 4096 { in blocking_write_and_flush()
152 .blocking_write_and_flush(bytes.into()) in blocking_write_and_flush()
257 let bytes = self.get_mut(&stream)?.read(len)?; in read() localVariable
258 debug_assert!(bytes.len() <= len); in read()
259 Ok(bytes.into()) in read()
269 debug_assert!(bytes.len() <= len); in blocking_read()
[all …]
/wasmtime-44.0.1/crates/gdbstub-component/src/
H A Dtarget.rs110 Ok(bytes) => { in read_addrs()
112 data.copy_from_slice(&bytes); in read_addrs()
153 let n = bytes.len().min(buf.len()); in read_register()
154 buf[..n].copy_from_slice(&bytes[..n]); in read_register()
390 buf[..bytes.len()].copy_from_slice(&bytes); in read_wasm_local()
391 Ok(bytes.len()) in read_wasm_local()
414 let bytes = self.value_to_bytes(val); in read_wasm_global() localVariable
415 buf[..bytes.len()].copy_from_slice(&bytes); in read_wasm_global()
416 Ok(bytes.len()) in read_wasm_global()
436 buf[..bytes.len()].copy_from_slice(&bytes); in read_wasm_stack()
[all …]
/wasmtime-44.0.1/crates/cranelift/src/translate/
H A Dtable.rs35 } else if index_ty.bytes() < ty.bytes() { in bound()
86 if addr_ty.bytes() > index_ty.bytes() { in prepare_table_addr()
88 } else if addr_ty.bytes() < index_ty.bytes() { in prepare_table_addr()
/wasmtime-44.0.1/crates/wasi-tls/src/p2/
H A Dio.rs4 use bytes::Bytes;
102 Ok(bytes) if bytes.is_empty() => { in poll_read()
114 Ok(bytes) => { in poll_read()
115 buf.put_slice(&bytes); in poll_read()
240 fn write(&mut self, bytes: bytes::Bytes) -> StreamResult<()> { in write()
241 self.try_lock()?.write(bytes) in write()
285 fn write(&mut self, mut bytes: bytes::Bytes) -> StreamResult<()> { in write()
292 if bytes.is_empty() { in write()
301 while !bytes.is_empty() { in write()
302 let n = stream.write(&bytes).await?; in write()
[all …]
/wasmtime-44.0.1/crates/wasi/src/cli/
H A Dworker_thread_stdin.rs27 use bytes::{Bytes, BytesMut};
108 let mut bytes = BytesMut::zeroed(1024); in create() localVariable
109 let (new_state, done) = match std::io::stdin().read(&mut bytes) { in create()
112 bytes.truncate(nbytes); in create()
113 (StdinState::Data(bytes), false) in create()
151 let bytes = data.split_to(size); in read() localVariable
157 Ok(bytes.freeze()) in read()
238 let bytes = data.split_to(size); in poll_read() localVariable
244 buf.put_slice(&bytes); in poll_read()
/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/func/
H A Dtyped.rs556 let bytes = cx in lift_heap_result() localVariable
914 bytes: &[u8], in linear_lift_from_memory()
1365 bytes: &[u8], in linear_lift_from_memory()
1368 match bytes[0] { in linear_lift_from_memory()
1430 bytes: &[u8], in linear_lift_from_memory()
1817 bytes: &[u8], in linear_lift_from_memory()
2102 bytes: &[u8], in linear_lift_from_memory()
2188 bytes: &[u8], in linear_lift_from_memory()
2297 bytes: &[u8], in linear_lift_from_memory()
2639 bytes: &[u8], in linear_lift_from_memory()
[all …]
/wasmtime-44.0.1/tests/misc_testsuite/custom-page-sizes/
H A Dmax-size-invalid.wast7 ;; that with 1-byte pages an allocation of 0xffff_ffff bytes is
29 (assert_trap (invoke "grow" (i32.const 1)) "disallowing growth to 0xffffffff bytes based on page si…
30 (assert_trap (invoke "grow" (i32.const 2)) "disallowing growth to 0x100000000 bytes based on page s…
31 (assert_trap (invoke "grow" (i32.const 100)) "disallowing growth to 0x100000062 bytes based on page…
32 (assert_trap (invoke "grow" (i32.const -1)) "disallowing growth to 0x1fffffffd bytes based on page …
/wasmtime-44.0.1/crates/test-programs/src/bin/
H A Dp2_random.rs8 let mut bytes: Box<[MaybeUninit<u8>]> = Box::new_uninit_slice(p1_random_size); in main() localVariable
10 wasip1::random_get(bytes.as_mut_ptr() as *mut u8, bytes.len()).unwrap(); in main()
13 assert!(bytes.iter().any(|x| unsafe { x.assume_init() } != 0)); in main()
/wasmtime-44.0.1/crates/debugger/wit/deps/
H A Drandom.wit36 /// Return `len` insecure pseudo-random bytes.
41 /// There are no requirements on the values of the returned bytes, however
45 get-insecure-random-bytes: func(len: u64) -> list<u8>;
50 /// `get-insecure-random-bytes`, represented as a `u64`.
61 /// Return `len` cryptographically-secure random or pseudo-random bytes.
67 /// request and on requests for numbers of bytes. The returned data must
74 get-random-bytes: func(len: u64) -> list<u8>;
78 /// This function returns the same type of data as `get-random-bytes`,
H A Dio.wit111 /// platforms. I/O operations always return promptly; if fewer bytes are
125 /// This function returns a list of bytes containing the read data,
126 /// when successful. The returned list will contain up to `len` bytes;
128 /// empty when no bytes are available for reading at this time. The
129 /// pollable given by `subscribe` will be ready when more bytes are
137 /// read 0 bytes. If the stream is still open, this call should
150 /// Skip bytes from a stream. Returns number of bytes skipped.
153 /// of bytes, returns the number of bytes consumed from the stream.
156 /// Skip bytes from a stream, after blocking until at least one byte
197 /// When the destination of a `write` is binary data, the bytes from
[all …]
/wasmtime-44.0.1/crates/wasi/src/p2/wit/deps/
H A Drandom.wit36 /// Return `len` insecure pseudo-random bytes.
41 /// There are no requirements on the values of the returned bytes, however
45 get-insecure-random-bytes: func(len: u64) -> list<u8>;
50 /// `get-insecure-random-bytes`, represented as a `u64`.
61 /// Return `len` cryptographically-secure random or pseudo-random bytes.
67 /// request and on requests for numbers of bytes. The returned data must
74 get-random-bytes: func(len: u64) -> list<u8>;
78 /// This function returns the same type of data as `get-random-bytes`,
H A Dio.wit111 /// platforms. I/O operations always return promptly; if fewer bytes are
125 /// This function returns a list of bytes containing the read data,
126 /// when successful. The returned list will contain up to `len` bytes;
128 /// empty when no bytes are available for reading at this time. The
129 /// pollable given by `subscribe` will be ready when more bytes are
137 /// read 0 bytes. If the stream is still open, this call should
150 /// Skip bytes from a stream. Returns number of bytes skipped.
153 /// of bytes, returns the number of bytes consumed from the stream.
156 /// Skip bytes from a stream, after blocking until at least one byte
197 /// When the destination of a `write` is binary data, the bytes from
[all …]
/wasmtime-44.0.1/crates/wasi-http/wit/deps/
H A Drandom.wit36 /// Return `len` insecure pseudo-random bytes.
41 /// There are no requirements on the values of the returned bytes, however
45 get-insecure-random-bytes: func(len: u64) -> list<u8>;
50 /// `get-insecure-random-bytes`, represented as a `u64`.
61 /// Return `len` cryptographically-secure random or pseudo-random bytes.
67 /// request and on requests for numbers of bytes. The returned data must
74 get-random-bytes: func(len: u64) -> list<u8>;
78 /// This function returns the same type of data as `get-random-bytes`,
H A Dio.wit111 /// platforms. I/O operations always return promptly; if fewer bytes are
125 /// This function returns a list of bytes containing the read data,
126 /// when successful. The returned list will contain up to `len` bytes;
128 /// empty when no bytes are available for reading at this time. The
129 /// pollable given by `subscribe` will be ready when more bytes are
137 /// read 0 bytes. If the stream is still open, this call should
150 /// Skip bytes from a stream. Returns number of bytes skipped.
153 /// of bytes, returns the number of bytes consumed from the stream.
156 /// Skip bytes from a stream, after blocking until at least one byte
197 /// When the destination of a `write` is binary data, the bytes from
[all …]

12345678910>>...12