MCPcopy Index your code
hub / github.com/RustPython/RustPython / store_variable

Method store_variable

crates/jit/src/instructions.rs:111–127  ·  view source on GitHub ↗
(&mut self, idx: oparg::VarNum, val: JitValue)

Source from the content-addressed store, hash-verified

109 }
110
111 fn store_variable(&mut self, idx: oparg::VarNum, val: JitValue) -> Result<(), JitCompileError> {
112 let builder = &mut self.builder;
113 let ty = val.to_jit_type().ok_or(JitCompileError::NotSupported)?;
114 let local = self.variables[idx].get_or_insert_with(|| {
115 let var = builder.declare_var(ty.to_cranelift());
116 Local {
117 var,
118 ty: ty.clone(),
119 }
120 });
121 if ty != local.ty {
122 Err(JitCompileError::NotSupported)
123 } else {
124 self.builder.def_var(local.var, val.into_value().unwrap());
125 Ok(())
126 }
127 }
128
129 fn boolean_val(&mut self, val: JitValue) -> Result<Value, JitCompileError> {
130 match val {

Callers 2

newMethod · 0.80
add_instructionMethod · 0.80

Calls 6

to_jit_typeMethod · 0.80
to_craneliftMethod · 0.80
into_valueMethod · 0.80
ErrClass · 0.50
cloneMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected