From 8effcda91a1a229a345ef290a6e385431e95bfe9 Mon Sep 17 00:00:00 2001 From: Sander Hautvast Date: Sat, 30 Sep 2023 18:20:00 +0200 Subject: [PATCH] readme --- README.md | 23 ++++++++++++++++++++++- src/vm.rs | 4 +++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8151b30..5c146c9 100644 --- a/README.md +++ b/README.md @@ -1 +1,22 @@ -`System.out.println("Hello World")` would actually be a major achievement. It's nowhere near that level... \ No newline at end of file +**So you wanted to build a JVM** + +_as in why not???_ + +actually: +`System.out.println("Hello World")` would actually be a major achievement. It's nowhere near that level... + +**so far** +* starts a main class (TODO cmdline args) +* loads classes from a classpath, including jar/jmod files +* instantiates classes (TODO implement superclass instantiation) +* runs bytecode (TODO more opcodes) +* has INVOKEVIRTUAL and INVOKESPECIAL, including stackframes (TODO more invokes) + +**more TODO's** +* native methods +* stacktraces +* check visibility +* IO + +**Ultimate goal** +* Hello world domination \ No newline at end of file diff --git a/src/vm.rs b/src/vm.rs index 9e0037f..09157a5 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -73,6 +73,7 @@ impl Vm { } pub fn new_instance(&self, class: Arc) -> Object { + //TODO add fields from superclasses let mut data = HashMap::new(); for f in &class.fields { let value = match f.type_of().as_str() { @@ -263,11 +264,12 @@ impl Vm { //TODO implement all opcodes _ => { panic!("opcode not implemented {:?}", self.stack) + //TODO implement proper stacktraces } } } } - Err(anyhow!("should not happen")) + panic!("should not happen") } }