Entrypoint call entry methodgit add .

This commit is contained in:
VegOwOtenks 2024-09-02 11:28:00 +02:00
parent ea3666aad3
commit 2042007242
9 changed files with 573 additions and 119 deletions

View file

@ -1,4 +1,3 @@
mod classfile;
mod classstore;
mod bytecode;
@ -6,12 +5,23 @@ 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();
let loaded_name = jvm.load_class(&"class/Main".to_string()).expect("Could not load class");
jvm.invoke_static(&loaded_name, &"main".to_string()).expect("failed to call main() on supplied class");
jvm.entrypoint(
&"java/Math".to_string(),
&"v".to_string(),
&[]//&[Value::Int(1), Value::Int(2)],
).expect("failed to call main() on supplied class");
jvm.run().unwrap();
println!("{:#?}", jvm);
}