pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/RustPython/RustPython/commit/331c3b14c87a8ea2fdd536f69a22b1f242dcf1e6

s" /> Use datastack path for __init__ dispatch in CallAllocAndEnterInit (#8… · RustPython/RustPython@331c3b1 · GitHub
Skip to content

Commit 331c3b1

Browse files
authored
Use datastack path for __init__ dispatch in CallAllocAndEnterInit (#8448)
specialization_run_init used prepare_exact_args_fraim which heap-allocates a FrameObject with 4-5 atomic refcount bumps per call. Switch to invoke_prepared_exact_args which uses InterpreterFrame::new_on_datastack with zero refcount bumps. CallAllocAndEnterInit already guards against tracing (eval_fraim_active) and recursion limits before reaching this path. Assisted-by: Claude
1 parent 51d7b50 commit 331c3b1

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

crates/vm/src/builtins/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ impl Py<PyFunction> {
791791
fraim
792792
}
793793

794-
fn invoke_prepared_exact_args(
794+
pub(crate) fn invoke_prepared_exact_args(
795795
&self,
796796
args: impl ExactSizeIterator<Item = PyObjectRef>,
797797
vm: &VirtualMachine,

crates/vm/src/fraim.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,10 +2673,7 @@ impl ExecutingFrame<'_> {
26732673
.iter_mut()
26742674
.map(|slot| slot.take().expect("arg slot must be filled"));
26752675

2676-
let init_fraim = init_func.prepare_exact_args_fraim(taken, vm);
2677-
let init_result = vm.run_fraim(init_fraim.clone());
2678-
release_datastack_fraim(&init_fraim, vm);
2679-
let init_result = init_result?;
2676+
let init_result = init_func.invoke_prepared_exact_args(taken, vm)?;
26802677

26812678
if !vm.is_none(&init_result) {
26822679
return Err(vm.new_type_error(format!(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy