30 lines
577 B
Rust
30 lines
577 B
Rust
mod classfile;
|
|
mod classstore;
|
|
mod bytecode;
|
|
mod jvm;
|
|
mod stackframe;
|
|
mod accessmasks;
|
|
mod constantpool;
|
|
mod heap_area;
|
|
|
|
use std::fs::File;
|
|
|
|
use crate::stackframe::Value;
|
|
use crate::classfile::JavaClassFile;
|
|
|
|
fn main() {
|
|
let mut jvm = jvm::JVM::new();
|
|
|
|
jvm.entrypoint(
|
|
&"java/Math".to_string(),
|
|
&"v".to_string(),
|
|
&[]//&[Value::Int(1), Value::Int(2)],
|
|
).expect("failed to call main() on supplied class");
|
|
|
|
match jvm.run() {
|
|
Ok(()) => (),
|
|
Err(e) => println!("{:#?}", e),
|
|
};
|
|
|
|
println!("{:#?}", jvm.stack_frames);
|
|
}
|