MCPcopy Create free account
hub / github.com/argumentcomputer/ix / clone

Method clone

crates/ixon/src/env.rs:345–379  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

343 /// The Lean compiler mirror applies the same rule.
344 #[cfg(not(target_arch = "riscv64"))]
345 pub fn register_hint(&self, addr: Address, hints: ReducibilityHints) {
346 fn rank(h: &ReducibilityHints) -> (u8, u32) {
347 match h {
348 ReducibilityHints::Opaque => (0, 0),
349 ReducibilityHints::Abbrev => (1, 0),
350 ReducibilityHints::Regular(x) => (2, *x),
351 }
352 }
353 match self.anon_hints.entry(addr) {
354 dashmap::mapref::entry::Entry::Occupied(mut e) => {
355 if rank(&hints) < rank(e.get()) {
356 e.insert(hints);
357 }
358 },
359 dashmap::mapref::entry::Entry::Vacant(e) => {
360 e.insert(hints);
361 },
362 }
363 }
364
365 /// Store a structured constant under `addr`.
366 ///
367 /// Serializes the constant once. With demotion disabled,
368 /// the [`LazyConstant`] cache is pre-populated so `get_const` is
369 /// free; under [`DEMOTE`] (the default) the structured value is
370 /// dropped and the entry costs only its bytes (`get_const` re-parses
371 /// per access). Compilation never reads stored constants back, so the
372 /// modes differ only in memory footprint and later readers' CPU cost.
373 ///
374 /// Host-only — see `store_blob`.
375 #[cfg(not(target_arch = "riscv64"))]
376 pub fn store_const(&self, addr: Address, constant: Constant) {
377 self.store_const_demoted(addr, constant, *DEMOTE);
378 }
379
380 /// `store_const` with an explicit demotion choice, bypassing
381 /// `IX_COMPILE_DEMOTE`. Exists so tests can drive both reprs without
382 /// process-global env-var races.

Callers 15

closure_fromFunction · 0.45
add_entries_parallelFunction · 0.45
from_bytesMethod · 0.45
analyze_blockFunction · 0.45
rewrite_exprFunction · 0.45
test_early_break_bugFunction · 0.45
test_analyze_simpleFunction · 0.45
test_build_sharing_vecFunction · 0.45
getMethod · 0.45

Calls 4

keyMethod · 0.80
valueMethod · 0.80
iterMethod · 0.45
insertMethod · 0.45