Char arrays
This commit is contained in:
parent
6610b09c16
commit
c6e4ecec3d
6 changed files with 407 additions and 55 deletions
|
@ -49,6 +49,7 @@ impl Bytecode {
|
|||
0x2D => (Instruction::LoadLocalReference3(), 1),
|
||||
|
||||
0x32 => (Instruction::ArrayElement(), 1),
|
||||
0x33 => (Instruction::LoadFromBArray(), 1),
|
||||
0x36 => (Instruction::StoreLocalInt(self.bytes[offset+1]), 2),
|
||||
0x3B => (Instruction::StoreLocalInt0(), 1),
|
||||
0x3C => (Instruction::StoreLocalInt1(), 1),
|
||||
|
@ -66,6 +67,7 @@ impl Bytecode {
|
|||
0x59 => (Instruction::Duplicate(), 1),
|
||||
|
||||
0x60 => (Instruction::AddInt(), 1),
|
||||
0x64 => (Instruction::SubtractInt(), 1),
|
||||
0x68 => (Instruction::MultiplyInt(), 1),
|
||||
0x6C => (Instruction::DivideInt(), 1),
|
||||
0x6D => (Instruction::DivideLong(), 1),
|
||||
|
@ -73,6 +75,7 @@ impl Bytecode {
|
|||
0x7A => (Instruction::ShiftIntRight(), 1),
|
||||
|
||||
0x80 => (Instruction::OrInt(), 1),
|
||||
0x84 => (Instruction::IncrementLocalInt(self.bytes[offset+1], i8::from_be_bytes([self.bytes[offset+2]])), 3),
|
||||
|
||||
0x95 => (Instruction::CompareFloatL(), 1),
|
||||
0x96 => (Instruction::CompareFloatG(), 1),
|
||||
|
@ -155,6 +158,7 @@ impl Bytecode {
|
|||
0xBD => (Instruction::NewArray((self.bytes[offset+1] as u16) << 8 | self.bytes[offset+2] as u16), 3),
|
||||
0xBE => (Instruction::ArrayLength(), 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),
|
||||
0xC2 => (Instruction::EnterMonitor(), 1),
|
||||
0xC3 => (Instruction::ExitMonitor(), 1),
|
||||
|
@ -238,6 +242,7 @@ pub enum Instruction {
|
|||
LoadLocalReference3() = 0x2D, // Load local reference variable reference onto stack
|
||||
|
||||
ArrayElement() = 0x32, // load element from array
|
||||
LoadFromBArray() = 0x33, // store into byte array
|
||||
StoreLocalInt(u8) = 0x36, // store into indexed local variable
|
||||
StoreLocalInt0() = 0x3B, // store int into local variable
|
||||
StoreLocalInt1() = 0x3C, // store int into local variable
|
||||
|
@ -254,6 +259,7 @@ pub enum Instruction {
|
|||
Duplicate() = 0x59, // duplicate top stack value
|
||||
|
||||
AddInt() = 0x60, // int addition
|
||||
SubtractInt() = 0x64, // int subtraction
|
||||
MultiplyInt() = 0x68, // int multiplication
|
||||
DivideInt() = 0x6C, // integer division, round toward zero and more rules
|
||||
DivideLong() = 0x6D, // long division
|
||||
|
@ -261,6 +267,7 @@ pub enum Instruction {
|
|||
ShiftIntRight() = 0x7a, // shift int
|
||||
|
||||
OrInt() = 0x80, // value, value => or
|
||||
IncrementLocalInt(u8, i8) = 0x84, // increment local variable by constant i8
|
||||
|
||||
CompareFloatL() = 0x95, // compare float, push -1 if one is NaN
|
||||
CompareFloatG() = 0x96, // compare float, push 1 if one is NaN
|
||||
|
@ -298,7 +305,8 @@ pub enum Instruction {
|
|||
NewArray(u16) = 0xBD, // Create a new array from a constant-pool component class reference
|
||||
ArrayLength() = 0xBE, // Get length from array reference
|
||||
|
||||
InstanceOf(u16) = 0xC1, // branch if Null
|
||||
CheckCast(u16) = 0xC0, // throw exception on fail
|
||||
InstanceOf(u16) = 0xC1, // push integer result for success
|
||||
EnterMonitor() = 0xC2, // enter the synchronization monitor of an object
|
||||
ExitMonitor() = 0xC3, // exit the synchronization monitor of an object
|
||||
BranchNull(i16) = 0xC6, // branch if Null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue