ThrowException .-.

This commit is contained in:
vegowotenks 2024-11-07 14:41:00 +01:00
parent 45d0aa66e5
commit 6b03cab14d
4 changed files with 14 additions and 5 deletions

View file

@ -251,6 +251,7 @@ impl Bytecode {
0xBC => (Instruction::NewPrimitiveArray(self.bytes[offset+1]), 2),
0xBD => (Instruction::NewArray((self.bytes[offset+1] as u16) << 8 | self.bytes[offset+2] as u16), 3),
0xBE => (Instruction::ArrayLength(), 1),
0xBF => (Instruction::ThrowException(), 1),
0xC0 => (Instruction::CheckCast((self.bytes[offset+1] as u16) << 8 | self.bytes[offset+2] as u16), 3),
0xC1 => (Instruction::InstanceOf((self.bytes[offset+1] as u16) << 8 | self.bytes[offset+2] as u16), 3),
@ -446,6 +447,7 @@ pub enum Instruction {
NewPrimitiveArray(u8) = 0xBC, // make a primitive array
NewArray(u16) = 0xBD, // Create a new array from a constant-pool component class reference
ArrayLength() = 0xBE, // Get length from array reference
ThrowException() = 0xBF, // throw the exception
CheckCast(u16) = 0xC0, // throw exception on fail
InstanceOf(u16) = 0xC1, // push integer result for success