MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / island_needed

Method island_needed

cranelift/codegen/src/machinst/buffer.rs:1311–1325  ·  view source on GitHub ↗

Is an island needed within the next N bytes?

(&self, distance: CodeOffset)

Source from the content-addressed store, hash-verified

1309
1310 /// Is an island needed within the next N bytes?
1311 pub fn island_needed(&self, distance: CodeOffset) -> bool {
1312 let deadline = match self.fixup_records.peek() {
1313 Some(fixup) => fixup.deadline().min(self.pending_fixup_deadline),
1314 None => self.pending_fixup_deadline,
1315 };
1316 trace!(
1317 "checking island_needed: cur_offset = {} deadline = {} worst_case_end_of_island = {}",
1318 self.cur_offset(),
1319 deadline,
1320 self.worst_case_end_of_island(distance)
1321 );
1322 let needed = deadline < u32::MAX && self.worst_case_end_of_island(distance) > deadline;
1323 trace!(" -> needed = {needed}");
1324 needed
1325 }
1326
1327 /// Returns the maximal offset that islands can reach if `distance` more
1328 /// bytes are appended.

Callers 10

appendMethod · 0.80
test_islandFunction · 0.80
emit_with_island_checkFunction · 0.80
emitMethod · 0.80
emit_uncompressedMethod · 0.80
emitMethod · 0.80
pulley_emitFunction · 0.80
emit_with_islandMethod · 0.80

Calls 4

deadlineMethod · 0.80
peekMethod · 0.45
minMethod · 0.45

Tested by 1

test_islandFunction · 0.64