mirror of
https://github.com/FranzHaidnor/haidnorJVM.git
synced 2026-03-13 21:43:42 +08:00
update readme
This commit is contained in:
28
README.md
28
README.md
@@ -30,8 +30,32 @@
|
|||||||
### 配置日志输出级别
|
### 配置日志输出级别
|
||||||
修改 `simplelogger.properties` 文件中的内容。配置日志输出级别,一般使用 `debug`、`info`
|
修改 `simplelogger.properties` 文件中的内容。配置日志输出级别,一般使用 `debug`、`info`
|
||||||
|
|
||||||
debug 级别下运行将会非常友好的输出 JVM 正在执行的栈信息
|
debug 级别下运行将会非常友好的输出 JVM 正在执行的栈信息
|
||||||

|
例如使用 haidnorJVM 执行以下代码
|
||||||
|
```java
|
||||||
|
public class Demo5 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String str = method1("hello world");
|
||||||
|
method1(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String method1(String s) {
|
||||||
|
return method2(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String method2(String s) {
|
||||||
|
return method3(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String method3(String s) {
|
||||||
|
System.out.println(s);
|
||||||
|
return "你好 世界";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|

|
||||||
|
|
||||||
info 级别将不会看到任何 haidnorJVM 内部运行信息
|
info 级别将不会看到任何 haidnorJVM 内部运行信息
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 169 KiB |
BIN
readme/20230721203048.png
Normal file
BIN
readme/20230721203048.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 232 KiB |
@@ -6,10 +6,7 @@ import haidnor.jvm.rtda.heap.Klass;
|
|||||||
import haidnor.jvm.rtda.heap.KlassMethod;
|
import haidnor.jvm.rtda.heap.KlassMethod;
|
||||||
import haidnor.jvm.rtda.metaspace.Metaspace;
|
import haidnor.jvm.rtda.metaspace.Metaspace;
|
||||||
import haidnor.jvm.runtime.JvmThread;
|
import haidnor.jvm.runtime.JvmThread;
|
||||||
import haidnor.jvm.test.demo.Demo1;
|
import haidnor.jvm.test.demo.*;
|
||||||
import haidnor.jvm.test.demo.Demo2;
|
|
||||||
import haidnor.jvm.test.demo.Demo3;
|
|
||||||
import haidnor.jvm.test.demo.Demo4;
|
|
||||||
import haidnor.jvm.test.instruction.Array;
|
import haidnor.jvm.test.instruction.Array;
|
||||||
import haidnor.jvm.test.instruction.DO_WHILE;
|
import haidnor.jvm.test.instruction.DO_WHILE;
|
||||||
import haidnor.jvm.test.instruction.math.ISUB;
|
import haidnor.jvm.test.instruction.math.ISUB;
|
||||||
@@ -57,6 +54,11 @@ public class TestJVM {
|
|||||||
runMainClass(Demo4.class);
|
runMainClass(Demo4.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_5() throws Exception {
|
||||||
|
runMainClass(Demo5.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test_NEW() throws Exception {
|
public void test_NEW() throws Exception {
|
||||||
runMainClass(NEW.class);
|
runMainClass(NEW.class);
|
||||||
|
|||||||
23
src/test/java/haidnor/jvm/test/demo/Demo5.java
Normal file
23
src/test/java/haidnor/jvm/test/demo/Demo5.java
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
package haidnor.jvm.test.demo;
|
||||||
|
|
||||||
|
public class Demo5 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String str = method1("hello world");
|
||||||
|
method1(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String method1(String s) {
|
||||||
|
return method2(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String method2(String s) {
|
||||||
|
return method3(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String method3(String s) {
|
||||||
|
System.out.println(s);
|
||||||
|
return "你好 世界";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user