jspawn's People
jspawn's Issues
Support stack reduction operations
Goals:
Reduction operations are ones, which take at least one operand from a stack and transform it in some predefined manner. A bit like a built in functions
Introduce class file reader
Goal:
- Rebuild class file (as far as it is currently supported) from an input stream.
Spawn a class with an int returning method
Goals:
- A method returning an int can be obtained from a spawned class using reflection:
Class<?> spawned = ???
Method method = spawned.getDeclaredMethod("foo", int.class);
- This method, when invoked, will return - no surprises - an int value
Non-Goals:
- Allowing any other than int return type
- Introducing any non-push and non-return stack-instruction
Spawn a class with a field
Finished when:
- One can access a field of spawned class using reflection, e.g. spawnedClass.getDeclaredField("field").
- This field's
getType
method returns 'correct' type
Allow converting primitive types to one another
Goals:
- Define instructions for conversion between primitives
Spawn a simple class
When:
- request was made to spawn a class of name pkg.Bar, extending Foo and implementing IFace.
Then
- We obtain an instance of Class named 'Bar' within package 'pkg'. It is assignable to both Foo and IFace
Allow non-int primitives be returned by a method
Goal:
- support for returning following primitives:
byte
,short
,long
,float
,double
,char
,boolean
Non-Goal:
- support for array/object to be returned
Spawn a class with a simple method
Goals:
A method can be obtained from a spawned class using reflection
Class<?> spawned = ???
spawned.getDeclaredMethod("foo");
Non-Goals:
- Having a method return anything
- Supporting methods with non-empty body
Support constructors
Goals:
Spawned class can be instantiated using default constructor:
Class<?> spawned = ???;
Object instance = spawned.getDeclaredConstructor().newInstance();
Support branching instructions
Goals:
Branching instruction consist of:
a) condition
b) target
supported conditions are:
ALWAYS,
IF_EQUAL, IF_NOT_EQUAL,
IF_SMALLER, IF_NOT_SMALLER,
IF_GREATER, IF_NOT_GREATER,
IF_ZERO, IF_NOT_ZERO,
IF_SMALLER_THAN_ZERO, IF_NOT_SMALLER_THAN_ZERO,
IF_GREATER_THAN_ZERO, IF_NOT_GREATER_THAN_ZERO,
target should be represented by a new Label type. Alongside Label, a meta-instruction DefineLabel
should be introduced. It would be interpreted during JVM instruction generation as 'assign current byte offset with given label'
Introduce formatter
Goals:
- Define project formatting for IntelliJ
Introduce ClassFile
Currently, class file is build in abstract steps defined in so called "compiler" package. But, since the process is very straightforward, we can simplify it a lot by introducing separate factories for many of these steps.
Gain:
- create class file explicitly and in a simpler manner
- define logic of creating objects (ClassFile, its pools) more closely to the actual object definitions
Use ints, not shorts, in all classfile-related classes
There is no gain in using shorts instead of integers. It only results in unnecessary conversions.
Adjust project version to 0.1.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.