MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / with_limits

Method with_limits

compiler/src/modules/vm/mod.rs:166–352  ·  view source on GitHub ↗
(chunk: &'a SSAChunk, limits: Limits)

Source from the content-addressed store, hash-verified

164 pub fn new(chunk: &'a SSAChunk) -> Self { Self::with_limits(chunk, Limits::none()) }
165
166 pub fn with_limits(chunk: &'a SSAChunk, limits: Limits) -> Self {
167 let sandbox_off = limits.ops == usize::MAX;
168 let mut vm = Self {
169 stack: Vec::with_capacity(256),
170 iter_stack: Vec::with_capacity(16),
171 yields: Vec::new(),
172 chunk,
173 heap: HeapPool::new(limits.heap),
174 globals: HashMap::default(),
175 module_state: HashMap::default(),
176 live_slots: Vec::new(),
177 templates: Templates::new(),
178 budget: limits.ops,
179 depth: 0,
180 max_calls: limits.calls,
181 with_stack: Vec::new(),
182 temp_roots: Vec::new(),
183 pending: Pending::new(),
184 next_host_call_id: 0,
185 pending_sync_frames: Vec::new(),
186 pending_exec_exc_base: None,
187 yielded: false,
188 yield_from_value: Val::none(),
189 resume_ip: 0,
190 strict_input: false,
191 output: Vec::new(),
192 output_open: false,
193 print_hook: None,
194 input_buffer: Vec::new(),
195 event_queue: Vec::new(),
196 observed_impure: Vec::new(),
197 mro_cache: HashMap::default(),
198 exception_stack: Vec::new(),
199 unwind_stack: Vec::new(),
200 handling_exc: None,
201 error_byte_pos: None,
202 module_table: HashMap::default(),
203 fn_module: Vec::new(),
204 function_names: Vec::new(),
205 call_stack: Vec::new(),
206 scheduler: Vec::new(),
207 waiting_for_children_count: 0,
208 time_hook: None,
209 virtual_clock_ns: 0,
210 functions: Vec::new(),
211 fn_index: Vec::new(),
212 function_parents: Vec::new(),
213 body_to_fi: HashMap::default(),
214 body_maps: Vec::new(),
215 param_slots: Vec::new(),
216 slot_templates: Vec::new(),
217 nonlocal_tables: Vec::new(),
218 needs_caller_slots: Vec::new(),
219 is_param_slot: Vec::new(),
220 body_free_loads: Vec::new(),
221 is_async: Vec::new(),
222 default_slots: Vec::new(),
223 self_ref_slot: Vec::new(),

Callers

nothing calls this directly

Calls 15

param_base_nameFunction · 0.85
ssa_stripFunction · 0.85
build_function_tableMethod · 0.80
collectMethod · 0.80
contains_keyMethod · 0.80
insertMethod · 0.80
fill_builtinsMethod · 0.80
parseFunction · 0.50
iterMethod · 0.45
lenMethod · 0.45
getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected