[−][src]Enum jvm_class_file_parser::Bytecode
A JVM bytecode instruction.
For more detailed information on the different types of bytecode instructions, see the following section of the Java Virtual Machine Specification.
https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-6.html
Variants
Aconst_null
Iconst_0
Iconst_1
Ldc(u8)
Iload_1
Aload_0
Astore_1
Dup
Ifeq(u16)
Ifne(u16)
Goto(u16)
Ireturn
Return
Getstatic(u16)
Putstatic(u16)
Getfield(u16)
Putfield(u16)
Invokevirtual(u16)
Invokespecial(u16)
New(u16)
Athrow
Checkcast(u16)
Methods
impl Bytecode
[src]
pub fn from_bytes(bytes: &[u8]) -> Vec<(usize, Bytecode)>
[src]
Converts the given slice of bytes into the bytecode instructions that they represent.
let bytes = vec![ 42, 183, 0, 1, 177, ]; let bytecodes = vec![ (0, Aload_0), (1, Invokespecial(1)), (4, Return), ]; assert_eq!(bytecodes, Bytecode::from_bytes(&bytes));
pub fn to_string(&self, index: u16) -> String
[src]
Converts the bytecode into a String representation.
Takes in the index of the instruction so that it can be used to display bytecode instructions that contain an instruction offset.
assert_eq!("aconst_null", Aconst_null.to_string(2)); assert_eq!("ifeq 15", Ifeq(5).to_string(10));
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,