avoid thunking trivial values
This commit is contained in:
@@ -112,6 +112,10 @@ impl<'a> BytecodeReader<'a> {
|
||||
let idx = self.read_u32();
|
||||
OperandData::Local { layer, idx }
|
||||
}
|
||||
OperandType::BuiltinConst => {
|
||||
let id = self.read_string_id();
|
||||
OperandData::BuiltinConst(id)
|
||||
}
|
||||
OperandType::Builtins => OperandData::Builtins,
|
||||
OperandType::ReplBinding => {
|
||||
let id = self.read_string_id();
|
||||
|
||||
@@ -229,6 +229,7 @@ pub(crate) enum OperandData {
|
||||
Const(StaticValue),
|
||||
BigInt(i64),
|
||||
Local { layer: u8, idx: u32 },
|
||||
BuiltinConst(StringId),
|
||||
Builtins,
|
||||
ReplBinding(StringId),
|
||||
ScopedImportBinding(StringId),
|
||||
@@ -249,6 +250,13 @@ impl OperandData {
|
||||
}
|
||||
cur.borrow().locals[idx as usize]
|
||||
}
|
||||
#[allow(clippy::unwrap_used)]
|
||||
BuiltinConst(id) => root
|
||||
.builtins
|
||||
.as_gc::<AttrSet>()
|
||||
.unwrap()
|
||||
.lookup(id)
|
||||
.unwrap(),
|
||||
Builtins => root.builtins,
|
||||
ReplBinding(_id) => todo!(),
|
||||
ScopedImportBinding(_id) => todo!(),
|
||||
|
||||
Reference in New Issue
Block a user