raydac / j-j-jvm Goto Github PK
View Code? Open in Web Editor NEWJVM bytecode interpreter written in Java
License: Apache License 2.0
JVM bytecode interpreter written in Java
License: Apache License 2.0
Hi, nice work with your interpreter! I was having problems with some code that clones an array so I added something to your test like this:
--- a/jdwp/java/src/test/java/com/igormaznitsa/jjjvm/JJJVMInterpreterTest.java
+++ b/jdwp/java/src/test/java/com/igormaznitsa/jjjvm/JJJVMInterpreterTest.java
@@ -2583,6 +2583,7 @@ public class JJJVMInterpreterTest extends TestHelper implements JSEProviderImpl.
+ " int index = 0;"
+ " for(int x=0; x<array.length; x++){"
+ " int [] fill = array[x];"
+ + " int [] bill = (int [])fill.clone();"
+ " for(int y=0; y< fill.length; y++){"
+ " fill[y] = index++;"
+ " }"
but that causes failures:
10:02:11.986 [main] ERROR com.igormaznitsa.jjjvm.JJJVMInterpreter - caught
java.lang.IllegalAccessException: Class com.igormaznitsa.jjjvm.impl.jse.JSEProviderImpl can not access a member of class java.lang.Object with modifiers "protected native"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102) ~[?:1.8.0-internal]
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296) ~[?:1.8.0-internal]
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288) ~[?:1.8.0-internal]
at java.lang.reflect.Method.invoke(Method.java:491) ~[?:1.8.0-internal]
at com.igormaznitsa.jjjvm.impl.jse.JSEProviderImpl.invoke(JSEProviderImpl.java:217) ~[classes/:?]
at com.igormaznitsa.jjjvm.JJJVMInterpreter._invoke(JJJVMInterpreter.java:1516) [classes/:?]
at com.igormaznitsa.jjjvm.JJJVMInterpreter.invoke(JJJVMInterpreter.java:81) [classes/:?]
at com.igormaznitsa.jjjvm.utils.TestHelper.executeTestMethod(TestHelper.java:188) [test-classes/:?]
at com.igormaznitsa.jjjvm.JJJVMInterpreterTest.testIntegration_FillMultidimensionalArray_Int(JJJVMInterpreterTest.java:2594) [test-classes/:?]
and
testIntegration_FillMultidimensionalArray_Int(com.igormaznitsa.jjjvm.JJJVMInterpreterTest) Time elapsed: 0.905 sec <<< ERROR!
java.lang.IllegalAccessException: Class com.igormaznitsa.jjjvm.impl.jse.JSEProviderImpl can not access a member of class java.lang.Object with modifiers "protected native"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.igormaznitsa.jjjvm.impl.jse.JSEProviderImpl.invoke(JSEProviderImpl.java:217)
at com.igormaznitsa.jjjvm.JJJVMInterpreter._invoke(JJJVMInterpreter.java:1516)
at com.igormaznitsa.jjjvm.JJJVMInterpreter.invoke(JJJVMInterpreter.java:81)
at com.igormaznitsa.jjjvm.utils.TestHelper.executeTestMethod(TestHelper.java:188)
at com.igormaznitsa.jjjvm.JJJVMInterpreterTest.testIntegration_FillMultidimensionalArray_Int(JJJVMInterpreterTest.java:2594)
How easy do you think that is to fix?
Hi,
Enumerations are not supported. Attached test fails.
Could you please suggest how to fix?
Thank you in advance
enumeration.zip
Hi! I also developed an JVM with java, wich can run itself. Once compiled to a "java.jar" file, you can write:
java -jar java.jar -jar java.jar MainClass.
I'll look above your code, maybe i'll get some inspirations.
Here is my raw byte code interpreter:
https://gitlab.com/neoexpert/jvm/blob/master/jvm/src/main/java/com/neoexpert/jvm/executor/RawByteCodeExecutor.java
Hi,
Excellent project. Unfortunately, following code fails on the cycle:
List<String> list = Collections.EMPTY_LIST;
for (String element: list) {
}
Output:
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
at com.igormaznitsa.jjjvm.JJJVMInterpreter._invoke(JJJVMInterpreter.java:1063)
at com.igormaznitsa.jjjvm.JJJVMInterpreter.invoke(JJJVMInterpreter.java:77)
at com.igormaznitsa.jjjvm.impl.JJJVMClassMethodImpl.invoke(JJJVMClassMethodImpl.java:111)
Could you please have a look?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.