Skip to content

Commit

Permalink
feat: ldc classes
Browse files Browse the repository at this point in the history
  • Loading branch information
nullishamy committed Oct 28, 2023
1 parent d697490 commit 5102513
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sources/interpreter_two/src/bytecode/load_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ impl Instruction for Ldc {

ctx.operands.push(RuntimeValue::Object(obj))
}
ConstantEntry::Class(data) => {
let class_name = data.name.resolve().string();
let class = vm.class_loader.load_class(class_name)?;
ctx.operands.push(RuntimeValue::Object(class));
}
v => return Err(anyhow!("cannot load {:#?} with ldc", v)),
};

Expand Down

0 comments on commit 5102513

Please sign in to comment.