나는 현재 다음과 같은 문제에 붙어있다가 포함되어 있습니다. 나는 단지 1 개의 스택 블록 정수로 작업하기 때문에 잘못된 레지스터가 그 레지스터에 얼마나 많은 영향을 미치는지 궁금합니다. 아래는 내 jasmin-java-bytecode이며, 잘 컴파일되지만 실행시 오류가 발생합니다.자바 바이트 코드 (1) 등록은 잘못된 유형을
을 .class 공공하여 HelloWorld .super 자바/랭/객체
.method public static fakultaet(I)I
.limit locals 100
.limit stack 100
ldc 4
istore 0
ldc 1
istore 2
START:
iload 0
iload 2
isub
ifne ENDE
iload 0
ldc 1
imul
istore 1
iload 2
ldc 1
iadd
istore 2
goto START
ENDE:
getstatic java/lang/System/out Ljava/io/PrintStream;
iload 1
invokevirtual java/io/PrintStream/println(I)V
iload 1
ireturn
.end method
.method public static main([Ljava/lang/String;)V
.limit stack 100
.limit locals 100
ldc 1
istore 0
ldc 2.0
fstore 1
ldc 3
istore 2
ldc 3
ldc 2
iadd
istore 0
ldc 3
invokestatic HelloWorld/fakultaet(I)I
return
.end method
그리고이 오류가 생성 :
Exception in thread "main" java.lang.VerifyError: (class: HelloWorld, method: fakultaet signature: (I)I) Register 1 contains wrong type
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
at java.lang.Class.getMethod0(Class.java:2694)
at java.lang.Class.getMethod(Class.java:1622)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)