Coder Social home page Coder Social logo

jabyinja's Introduction

Ja(va) By(tecode) In(terpreter) (in) Ja(va)

My BSc thesis work for Eötvös Loránd University's Computer Science curriculum

Prerequisities

Building the code

Normally:

$ mvn package
$ java -jar target/jabyinja-*.jar <optional class file>

With Just:

$ just co
$ java -jar target/jabyinja-*.jar <optional class file>

Generating a PDF from the thesis

Ignore any warnings

Normally:

$ cd thesis/
$ pdflatex thesis.tex
$ bibtex thesis
$ pdflatex thesis.tex
$ pdflatex thesis.tex

With Just:

$ just t

Usage

Without specifying any files, the program will try to interpret Main.class, located in the same directory as from where you ran the program from. If you do intend to specifcy a given file, do it with a single argument, where you name the .class file (i.e. if your file is named Example.class, you write Example.class NOT Example)

Number precision

Jabyinja

BYTE SHORT INTEGER LONG FLOAT DOUBLE
MAX 127 32767 2147483647 9223372036854775807 3.4028235E38 1.7976931348623157E308
MIN -128 -32768 -2147483648 -9223372036854775808 1.4E-45 4.9E-324
0xCA -54 -54 -54 -54
0xFE -2 -2 -2 -2
0xBA -70 -70 -70 -70
0xBE -66 -66 -66 -66
0xCAFE -2 -13570 -13570 -13570
0xBABE -66 -17730 -17730 -17730
0xCAFEBABE -66 -17730 -889275714 -889275714
0xCAFEBABECAFEBABE -66 -17730 -889275714 -3819410105351357762
PI (6) 3.141592 3.141592
PI (7) 3.1415925 3.1415926
PI (6) ^ 2 9.8696 9.869600294464002
PI (6) ^ 3 31.006258 31.006257328285756
PI (15) 3.1415927 3.141592653589793
PI (16) 3.1415927 3.141592653589793
PI (15) ^ 2 9.869605 9.869604401089358
PI (15) ^ 3 31.006279 31.006276680299816

/usr/bin/java

BYTE SHORT INTEGER LONG FLOAT DOUBLE
MAX 127 32767 2147483647 9223372036854775807 3.4028235E38 1.7976931348623157E308
MIN -128 -32768 -2147483648 -9223372036854775808 1.4E-45 4.9E-324
0xCA -54 -54 -54 -54
0xFE -2 -2 -2 -2
0xBA -70 -70 -70 -70
0xBE -66 -66 -66 -66
0xCAFE -2 -13570 -13570 -13570
0xBABE -66 -17730 -17730 -17730
0xCAFEBABE -66 -17730 -889275714 -889275714
0xCAFEBABECAFEBABE -66 -17730 -889275714 -3819410105351357762
PI (6) 3.141592 3.141592
PI (7) 3.1415925 3.1415926
PI (6) ^ 2 9.8696 9.869600294464002
PI (6) ^ 3 31.006258 31.006257328285756
PI (15) 3.1415927 3.141592653589793
PI (16) 3.1415927 3.141592653589793
PI (15) ^ 2 9.869605 9.869604401089358
PI (15) ^ 3 31.006279 31.006276680299816

Thankfully, they are the exact same

JVM Instructions checklist

OPCODE IMPLEMENTED?
NOP
ACONST_NULL
ICONST_*
LCONST_*
FCONST_*
DCONST_*
BIPUSH
SIPUSH
LDC*
ILOAD*
LLOAD*
FLOAD*
DLOAD*
ALOAD*
IALOAD
LALOAD
FALOAD
DALOAD
AALOAD
BALOAD
CALOAD
SALOAD
ISTORE*
LSTORE*
FSTORE*
DSTORE*
ASTORE*
IASTORE
LASTORE
FASTORE
DASTORE
AASTORE
BASTORE
CASTORE
SASTORE
POP*
DUP*
DUP2*
SWAP
*ADD
*SUB
*MUL
*DIV
*REM
*NEG
*SHL
*SHR
*USHR
*AND
*OR
*XOR
IINC
I2*
L2*
F2*
D2*
LCMP
FCMP*
DCMP*
IF*
GOTO
JSR
RET
TABLESWITCH
LOOKUPSWITCH
*RETURN
*STATIC
*FIELD
INVOKE*
INVOKEDYNAMIC
NEW
NEWARRAY
ANEWARRAY
ARRAYLENGTH
ATHROW
CHECKCAST
INSTANCEOF
MONITOR*
WIDE
MULTIANEWARRAY
IF*NULL
GOTO_W
JSR_W

jabyinja's People

Contributors

zoltan-balazs avatar dependabot[bot] avatar

Watchers

 avatar

jabyinja's Issues

Incorrect parsing of file

The current Main.java file is being parsed incorrectly.

A BufferUnderflowException is being triggered, meaning that either readShort or readInt cannot read enough bytes from the buffer.

Implement testing for parsing

To better ensure that the Class file is parsed correctly, testing must be implemented.

  • As of the issue's opening, I have not figured out what testing library to use
  • I need reproducible cases to check validity of Class file parsing
  • Also need some sample files to parse (probably "Hello World", simple List application, etc.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.