Check-in [e9fe3dc205]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge heads.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e9fe3dc205fb603be0333b0e3e43ea670a3c3c05
User & Date: stephanie.gawroriski 2019-03-16 14:17:41
Context
2019-03-17
23:29
Handle the add operation. check-in: 062bd6e15e user: stephanie.gawroriski tags: trunk
2019-03-16
14:17
Merge heads. check-in: e9fe3dc205 user: stephanie.gawroriski tags: trunk
14:13
Minor work for building. check-in: c72ea7236b user: stephanie.gawroriski tags: trunk
2019-03-03
08:02
Backup developer notes. check-in: 717411c1c9 user: squirreljme tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to assets/developer-notes/index.mkd.

2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
 `--` `--`

### 03

 * `--` `--` `--` `--` `--` 
[**`01`**](stephanie-gawroriski/2019/03/01.mkd)
[**`02`**](stephanie-gawroriski/2019/03/02.mkd)
 * `03`
`04`
`05`
`06`
`07`
`08`
`09`
 * `10`
`11`
`12`
`13`
`14`
`15`
`16`
 * `17`
`18`
`19`
`20`
`21`
`22`







|


|
|

|
|
|

|
|
|







2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
 `--` `--`

### 03

 * `--` `--` `--` `--` `--` 
[**`01`**](stephanie-gawroriski/2019/03/01.mkd)
[**`02`**](stephanie-gawroriski/2019/03/02.mkd)
 * [**`03`**](stephanie-gawroriski/2019/03/03.mkd)
`04`
`05`
[**`06`**](stephanie-gawroriski/2019/03/06.mkd)
[**`07`**](stephanie-gawroriski/2019/03/07.mkd)
`08`
[**`09`**](stephanie-gawroriski/2019/03/09.mkd)
 * [**`10`**](stephanie-gawroriski/2019/03/10.mkd)
[**`11`**](stephanie-gawroriski/2019/03/11.mkd)
`12`
[**`13`**](stephanie-gawroriski/2019/03/13.mkd)
[**`14`**](stephanie-gawroriski/2019/03/14.mkd)
[**`15`**](stephanie-gawroriski/2019/03/15.mkd)
`16`
 * `17`
`18`
`19`
`20`
`21`
`22`

Added assets/developer-notes/stephanie-gawroriski/2019/03/03.mkd.



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
# 2019/03/03

## 06:27

So idea perhaps, instead of having various different locations and such, just
kinda keep it plain for instructions. Perhaps what I need is an interpretation
and interpretation types for instructions. Basically, how is said value
determined?

## 06:30

It will literally be an interpret whatever value as something, whether it be
a register or otherwise.

Added assets/developer-notes/stephanie-gawroriski/2019/03/06.mkd.





















>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
# 2019/03/06

## 12:32

I went to the local library to work on SquirrelJME, it is quite a new
environment. I was going crazy at home. So I think what I need is to have
a kind of argument builder...? Like I want an interpret as kind of thing
placed inside as well... but something safe enough to where it does not
mess up in cases where type safety or breaking Java is concerned. At
times like this, I kinda wish there were tuples easily made and such.

Added assets/developer-notes/stephanie-gawroriski/2019/03/07.mkd.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
# 2019/03/07

## 8:48

Okay so, I think what I actually need to do is keep this simplified and have
it just be a register format for Java instructions. So just map one to one
pretty much and that keeps it simpler.

Added assets/developer-notes/stephanie-gawroriski/2019/03/09.mkd.























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# 2019/03/09

## 08:19

Okay, maybe I have been complicating things a bit for SummerCoat. I think the
thing I should do in this case is do the direct stack to register translation
but that code could all exist in the `tool-classfile` project. It will be like
I planned before, literally a 1:1 mapping of a `ClassFile` to a
`RegisterClassFile`. It will be simple. I shall keep a bunch of the Java
semantics accordingly. I will use this as a stepping stone between SpringCoat
and SummerCoat. Or... I could just make it SummerCoat. This simplifies the
scope of SummerCoat and it will be executable faster. I definitely think
simplifying the scope of SummerCoat would be the simplest. Although the thing
is not all projects would need this register translated class file, so it
would be best in another project. But effectively it will be the same exact
thing. This would be the simplest, AutumnCoat can instead become the more
optimized version of the register code once I have figured everything out.
As it stands, take things simpler rather than jumping through too much
complexity.

## 08:27

Actually, it can be in the same place... Methods have code and for the most
part the only difference between class files and register class files is the
byte code. So I am just going to extend the method stuff so that there is a
`RegisterCode` that can be obtained from a method. This is the simplest and
reduces so much work that is needed.

## 08:36

Was thinking of unfolding exceptions but I think that is too complicated. I
think what I will need though is a serialization of class files and class
files in the register format.

## 09:04

Okay I just got an idea, for SummerCoat it will be a rewrite/refactor of
SpringCoat. Then once that is fully executed it will then use the register
based execution method. This way I can have a fully working virtual machine
even though it will essentially initially be a duplicate of SpringCoat. I
think this is better because I can see how much faster it will be even if
it is still stack based. Then I will add an execution engine on top which is
able to use the register code format for execution and such. I think this is
a good first step duplicating everything because then I can say optimize
everything and such. Then I can compound and build on top. Then eventually
when AutumnCoat comes around with a more optimized class and register format
I can modify SummerCoat to handle that as well.

## 13:09

I will make a caching suite manager so that class files need not be loaded
multiple times and such.

## 13:56

As an alternative I can pre-lookup references classes in the constant pool
instead of performing at run-time or similar. I think the best thing here
would be to just that if an instruction uses something like a method it
can just load cached information for that instruction point.

Added assets/developer-notes/stephanie-gawroriski/2019/03/10.mkd.



































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 2019/03/10

## 16:15

Well thinking of things, using the class file and all of the other such this
is going to really depend on many things and will not be that light where
it could easily be made into RatufaCoat. I think what I need here is a
minimizer of sorts that takes an input class file and turns it into a tinier
format for easier loading and usage. Then I just use these minimized classes
and such for running things. At least initially I do not have to go crazy in
what I am doing, literally just making a mini format. I can read the class
file although it would be a bit more complex of a format to parse especially
considering the constant pool and all the variable length data. I can keep
this in the classfile stuff, but I can have a convert to minified format which
uses the same format as the class file except with alternative constant pools.
It would be a proprietary format used for SquirrelJME. I mean all of the stuff
uses the constant pool. In this case I would really just be using an optimized
constant pool for things. I think this will be the first case, at least
something that can output a lighter format for this reason. I do not need to
go that far for things. Of course minified classes would be completely not
compatible with standard JVMs but I could just reuse the format and such. But
to signify mini classes, I can have a different major and minor version that
is not normaly class file compatible but SquirrelJME knows about it. At least
according to the version used. Of course what I think I need first is
something which can output the same input classes and such.

## 16:33

So the `ClassFile` class is great for things, but it is not something that
would result in a performant format for execution since it is expected that
the JVM will do all the optimization itself. So I think even using this
format is just going to needlessly complicate and slow things down. I
definitely do though want a pre-mapped constant pool reference thing so that
when a class is loaded those things are resolved as needed, at least after
the base class structure has been loaded.

## 16:36

I do know what I need exactly to run a virtual machine and the current
format just adds too much information for that. At least initialy for code I
do not need to perform much translation for the byte code, it will just be
for optimizing things essentially so it can be more easily used by the
VM. Of course the end result as a guess should end up being faster with most
of the cruft and checks in the format removed.

## 17:02

I should make a test for the actual class file parsing and such just to be
sure that it works properly.

Added assets/developer-notes/stephanie-gawroriski/2019/03/11.mkd.

















































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 2019/03/11

## 08:42

So now I will be having to write the minimizing code.

## 10:50

Actually I need to update the project board first so I can get a grasp of
what I have to do since I can set it all down in that moment.

## 10:52

Additionally while in the shower I thought that I should definitely use
a register based format for the minimized format. That is much simpler to
do and handle by the VM. Instead of having multiple execution engines which
would complicate the design of the VM and such. I want to make writing VMs
easier. It will still be a very 1:1 format however.

## 14:58

A simple and quick optimization I can do is sorting the fields so that they
are in primitive size order, this way when it comes to how data is packed it
is more efficient due to alignment requirements.

Added assets/developer-notes/stephanie-gawroriski/2019/03/13.mkd.











>
>
>
>
>
1
2
3
4
5
# 2019/03/13

## 11:15

I should definitely refactor my `Set` implementation.

Added assets/developer-notes/stephanie-gawroriski/2019/03/14.mkd.































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 2019/03/14

## 09:00

Okay so, back to SquirrelJME from the job search (taking a break today). So
let me think... it is time to translate methods and such. The biggest work
of course would be the register translation and then the minification of
that to something a bit more simplified. It will definitely work however and
really after that what I need to do is to translate things.

## 11:56

This register code should have stuff for reference counting and also removed
exception handlers done in normal code. I am going to have Rust style multiple
return types for method calls and such. This simplifies things a bunch.

Added assets/developer-notes/stephanie-gawroriski/2019/03/15.mkd.

















>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
# 2019/03/15

## 16:31

Okay so, I attempted to write a utility to implement the locking stuff but it
is a bit more complicated than I expected. Additionally POSIX has some really
back file locks. So I am just going to have to be careful when working on
SquirrelJME so I do not corrupt the database.

Changes to changelog.mkd.

25
26
27
28
29
30
31
32
33
34
35
36
37
38


39
40
41
42
43
44
45
     exact values.
   * Added the missing _mimemessage_ file for the MIME file decoding test.
 * Classes
   * Implemented
     * `java.io.InputStream`
     * `java.util.EventObject`
     * `java.util.LinkedList`
   * Deprecations
     * `net.multiphasicapps.classfile.ExecutableCode`, not used.
   * Additions
     * `java.util.Vector`, was missing.
     * Added proprietary `ExtendedTaskManager` interface which can be used
       to specify arguments, system properties, and console output alternatives
       to launched tasks.


 * Programs and Libraries
   * `demo-hello`
     * Made the system properties array `final`.
   * `tac`
     * Override standard output and forward to standard error while a test is
       running, so things are not kludged.
   * `tac-runner`







<
<





>
>







25
26
27
28
29
30
31


32
33
34
35
36
37
38
39
40
41
42
43
44
45
     exact values.
   * Added the missing _mimemessage_ file for the MIME file decoding test.
 * Classes
   * Implemented
     * `java.io.InputStream`
     * `java.util.EventObject`
     * `java.util.LinkedList`


   * Additions
     * `java.util.Vector`, was missing.
     * Added proprietary `ExtendedTaskManager` interface which can be used
       to specify arguments, system properties, and console output alternatives
       to launched tasks.
   * Removals
     * `net.multiphasicapps.classfile.ExecutableCode`, not used.
 * Programs and Libraries
   * `demo-hello`
     * Made the system properties array `final`.
   * `tac`
     * Override standard output and forward to standard error while a test is
       running, so things are not kludged.
   * `tac-runner`

Changes to readme.mkd.

169
170
171
172
173
174
175
176
177
178
179
180
181
ESSENTIALLY SQUIRRELJME IS A CLEAN-ROOM IMPLEMENTATION OF THE DESIGN OF JAVA
ME 8. THE IMPLEMENTATIONS OF THE JAVA ME 8
APIS AND ASSOCIATED JSRS/JEPS IS CONSIDERED BY MYSELF TO BE IN THE FAIR USE
(AND IT ALSO HELPS THE JAVA ECOSYSTEM BY PERMITTING IT TO RUN IN MORE PLACES
WHERE IT IS NOT SUPPORTED BY ORACLE).***

***THIS SOFTWARE IS INCOMPLETE AND IN ITS CURRENT STATE IS NOT CURRENTLY
100% COMPATIBLE WITH JAVA ME 8. THERE ARE CURRENTLY NO RELEASED VERSIONS OF
THIS SOFTWARE. AS SUCH THE FIRST RELEASE WILL BE WHEN IT IS COMPATIBLE SO AS TO
NOT VIOLATE POTENTIAL LICENSES, AND IF POSSIBLE BE VERIFIED WITH ANY
APPLICABLE TCKS (SO IT WOULD BE AN "OFFICIAL" IMPLEMENTATION).***









|
|
|
|


169
170
171
172
173
174
175
176
177
178
179
180
181
ESSENTIALLY SQUIRRELJME IS A CLEAN-ROOM IMPLEMENTATION OF THE DESIGN OF JAVA
ME 8. THE IMPLEMENTATIONS OF THE JAVA ME 8
APIS AND ASSOCIATED JSRS/JEPS IS CONSIDERED BY MYSELF TO BE IN THE FAIR USE
(AND IT ALSO HELPS THE JAVA ECOSYSTEM BY PERMITTING IT TO RUN IN MORE PLACES
WHERE IT IS NOT SUPPORTED BY ORACLE).***

***THIS SOFTWARE IS INCOMPLETE AND IN ITS CURRENT STATE IS NOT CURRENTLY
100% COMPATIBLE WITH JAVA ME 8. THERE ARE CURRENTLY NO STABLE RELEASED VERSIONS
OF THIS SOFTWARE. AS SUCH THE FIRST MAJOR VERSION RELEASE WILL BE WHEN IT IS
COMPATIBLE SO AS TO NOT VIOLATE POTENTIAL LICENSES, AND IF POSSIBLE BE VERIFIED
WITH ANY APPLICABLE TCKS (SO IT WOULD BE AN "OFFICIAL" IMPLEMENTATION).***


Changes to runt/apis/cldc-compact/cc/squirreljme/runtime/cldc/lang/ApiLevel.java.

24
25
26
27
28
29
30




31
32
33
34
35
36
37
 * @since 2018/12/05
 */
public final class ApiLevel
{
	/** The current API level. */
	public static final int CURRENT_LEVEL =
		SystemProperties.apiLevel();




	
	/** SquirrelJME 0.2.0 (December 25, 2018). */
	public static final int LEVEL_SQUIRRELJME_0_2_0_20181225 =
		2_0_18359;
	
	/** SquirrelJME 0.3.0 (Development). */
	public static final int LEVEL_SQUIRRELJME_0_3_0_DEV =







>
>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 * @since 2018/12/05
 */
public final class ApiLevel
{
	/** The current API level. */
	public static final int CURRENT_LEVEL =
		SystemProperties.apiLevel();
	
	/** Undefined. */
	public static final int UNDEFINED =
		0x7FFFFFFF;
	
	/** SquirrelJME 0.2.0 (December 25, 2018). */
	public static final int LEVEL_SQUIRRELJME_0_2_0_20181225 =
		2_0_18359;
	
	/** SquirrelJME 0.3.0 (Development). */
	public static final int LEVEL_SQUIRRELJME_0_3_0_DEV =

Changes to runt/apis/meep-rms.test/TestNothing.java.

6
7
8
9
10
11
12


13
14
15
16
17
18
19
..
21
22
23
24
25
26
27



28
29
30
31
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

import javax.microedition.rms.RecordStore;



/**
 * Tests that nothing is done on the record.
 *
 * @since 2018/12/13
 */
public class TestNothing
	extends __RecordTest__<Object>
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2018/12/13
	 */
	@Override
	public Object test(RecordStore __rs)
	{



		return null;
	}
}








>
>







 







>
>
>




6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

import javax.microedition.rms.RecordStore;

import cc.squirreljme.runtime.cldc.lang.ApiLevel;

/**
 * Tests that nothing is done on the record.
 *
 * @since 2018/12/13
 */
public class TestNothing
	extends __RecordTest__<Object>
................................................................................
	/**
	 * {@inheritDoc}
	 * @since 2018/12/13
	 */
	@Override
	public Object test(RecordStore __rs)
	{
		// Needs RMS support first
		this.checkApiLevel(ApiLevel.UNDEFINED);
		
		return null;
	}
}

Changes to runt/apis/midp-lcdui.test/TestDisplay.java.

23
24
25
26
27
28
29
30
31
32
33
34
35
	/**
	 * {@inheritDoc}
	 * @since 2018/11/12
	 */
	@Override
	public void test()
	{
		Display[] displays = Display.getDisplays(0);
		
		throw new todo.TODO();
	}
}








|
<
<



23
24
25
26
27
28
29
30


31
32
33
	/**
	 * {@inheritDoc}
	 * @since 2018/11/12
	 */
	@Override
	public void test()
	{
		__Utils__.getDisplay();


	}
}

Added runt/apis/midp-lcdui.test/__Utils__.java.























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

import javax.microedition.lcdui.Display;
import net.multiphasicapps.tac.InvalidTestException;

/**
 * Utilities for the LCDUI tests.
 *
 * @since 2019/03/04
 */
final class __Utils__
{
	/**
	 * Attempts to obtain the display, otherwise the test cannot be ran.
	 *
	 * @return The display to use.
	 * @throws InvalidTestException If the display could not be obtained.
	 * @since 2019/03/04
	 */
	public static final Display getDisplay()
		throws InvalidTestException
	{
		try
		{
			return Display.getDisplays(0)[0];
		}
		
		// No display possible?
		catch (Throwable e)
		{
			throw new InvalidTestException(e);
		}
	}
}

Changes to runt/libs/summercoat-vm/META-INF/MANIFEST.MF.

1
2
3
4
5
6
7
8
9
10
11
12
13
Manifest-Version: 1.0
X-SquirrelJME-UUID: 217c48ac-ed98-48ea-9f61-aceb3175baa0
X-SquirrelJME-Error: AE
X-SquirrelJME-Name: SummerCoat Virtual Machine
X-SquirrelJME-Vendor: Stephanie Gawroriski
X-SquirrelJME-Version: 0.3.0
X-SquirrelJME-Depends: tool-classfile tool-manifest-reader meep-swm 
 tool-profiler meep-midlet common-vm tool-scrf
X-SquirrelJME-Description: This is the SummerCoat VM which is a more 
 optimized register based virtual machine which should result in faster 
 code execution.
Microedition-Configuration: CLDC-1.8








|





1
2
3
4
5
6
7
8
9
10
11
12
13
Manifest-Version: 1.0
X-SquirrelJME-UUID: 217c48ac-ed98-48ea-9f61-aceb3175baa0
X-SquirrelJME-Error: AE
X-SquirrelJME-Name: SummerCoat Virtual Machine
X-SquirrelJME-Vendor: Stephanie Gawroriski
X-SquirrelJME-Version: 0.3.0
X-SquirrelJME-Depends: tool-classfile tool-manifest-reader meep-swm 
 tool-profiler meep-midlet common-vm
X-SquirrelJME-Description: This is the SummerCoat VM which is a more 
 optimized register based virtual machine which should result in faster 
 code execution.
Microedition-Configuration: CLDC-1.8

Added runt/libs/summercoat-vm/cc/squirreljme/vm/summercoat/CachingClassLibrary.java.

























































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.vm.summercoat;

import cc.squirreljme.vm.VMClassLibrary;
import cc.squirreljme.vm.VMException;
import java.io.InputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.mini.MinimizedClassFile;
import net.multiphasicapps.classfile.mini.Minimizer;

/**
 * This is a class which caches classes within class libraries, it is intended
 * to .
 *
 * @since 2019/03/09
 */
public final class CachingClassLibrary
{
	/** The library to wrap around. */
	protected final VMClassLibrary library;
	
	/** Loaded class files that have been cached. */
	protected final Map<String, MinimizedClassFile> _cache =
		new HashMap<>();
	
	/**
	 * Initializes the cached class library.
	 *
	 * @param __l The library to wrap.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/09
	 */
	public CachingClassLibrary(VMClassLibrary __l)
		throws NullPointerException
	{
		if (__l == null)
			throw new NullPointerException("NARG");
		
		this.library = __l;
	}
	
	/**
	 * Checks the cache if the given file as been loaded as a class and returns
	 * it, otherwise it is cached.
	 *
	 * @param __bn The binary name to cache as a class.
	 * @return The cached class file or {@code null} if it does not exist.
	 * @throws NullPointerException On null arguments.
	 * @throws VMException If the class could not load properly.
	 * @since 2019/03/09
	 */
	public final MinimizedClassFile cacheClass(String __bn)
		throws NullPointerException, VMException
	{
		if (__bn == null)
			throw new NullPointerException("NARG");
		
		// Check the cache
		Map<String, MinimizedClassFile> cache = this._cache;
		synchronized (this)
		{
			// Pre-cached to either exist or not exist, use that given status
			// to prevent multiple lookups of unknown classes
			MinimizedClassFile rv = cache.get(__bn);
			if (cache.containsKey(__bn))
				return rv;
			
			// Just going to look in our own library
			VMClassLibrary library = this.library;
			
			try
			{
				// Load already cached minimized class?
				if (rv == null)
					try (InputStream in = library.resourceAsStream(
						__bn + ".sjz"))
					{
						// Load it?
						if (in != null)
							rv = MinimizedClassFile.decode(in);
					}
				
				// Minimize plain class file?
				if (rv == null)
					try (InputStream in = library.resourceAsStream(
						__bn + ".class"))
					{
						if (in != null)
							rv = Minimizer.minimize(ClassFile.decode(in));
					}
			}
			catch (InvalidClassFormatException e)
			{
				// {@squirreljme.error AE05 The class is not formatted
				// correctly. (The class name)}
				throw new VMException("AE05 " + __bn, e);
			}
			catch (IOException e)
			{
				// {@squirreljme.error AE04 Read error trying to read
				// the class file. (The class)}
				throw new VMException("AE04 " + __bn, e);
			}
			
			// Cache it, even it null it will be cached as null
			cache.put(__bn, rv);
			return rv;
		}
	}
}

Added runt/libs/summercoat-vm/cc/squirreljme/vm/summercoat/CachingSuiteManager.java.























































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.vm.summercoat;

import cc.squirreljme.vm.VMClassLibrary;
import cc.squirreljme.vm.VMSuiteManager;
import java.util.HashMap;
import java.util.Map;

/**
 * This is a suite manager which.
 *
 * @since 2019/03/09
 */
public final class CachingSuiteManager
{
	/** The base suite manager. */
	protected final VMSuiteManager suites;
	
	/** Libraries which have been pre-cached. */
	protected final Map<VMClassLibrary, CachingClassLibrary> _cache =
		new HashMap<>();
	
	/**
	 * Initializes the caching suite manager.
	 *
	 * @param __s The suite manager to use.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/09
	 */
	public CachingSuiteManager(VMSuiteManager __s)
		throws NullPointerException
	{
		if (__s == null)
			throw new NullPointerException("NARG");
		
		this.suites = __s;
	}
	
	/**
	 * Caches the specified libraries.
	 *
	 * @param __l The library to parse.
	 * @return The caching class library.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/09
	 */
	public CachingClassLibrary loadLibrary(VMClassLibrary __l)
		throws NullPointerException
	{
		if (__l == null)
			throw new NullPointerException("NARG");
		
		Map<VMClassLibrary, CachingClassLibrary> cache = this._cache;
		synchronized (this)
		{
			CachingClassLibrary rv = cache.get(__l);
			if (rv != null)
				return rv;
			
			// Wrap and cache it
			cache.put(__l, (rv = new CachingClassLibrary(__l)));
			return rv;
		}
	}
}

Changes to runt/libs/summercoat-vm/cc/squirreljme/vm/summercoat/ClassLoader.java.

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
..
97
98
99
100
101
102
103




104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130


131
132
133
134



135
136

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import cc.squirreljme.vm.VMSuiteManager;
import java.io.InputStream;
import java.io.IOException;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.ClassName;
import net.multiphasicapps.scrf.SummerClass;
import net.multiphasicapps.scrf.SummerFormatException;

/**
 * This is a class loader which manages and can cache multiple classes.
 *
 * @since 2019/01/05
 */
public final class ClassLoader
{
	/** The suite manager. */
	protected final VMSuiteManager suites;
	
	/** Loaded class cache. */
	private final Map<ClassName, LoadedClass> _classes =
		new HashMap<>();
	
	/** The classes in the class path. */
	private final VMClassLibrary[] _classpath;
	
	/**
	 * Initializes the class loader.
	 *
	 * @param __sm The suite manager.
	 * @param __cp The classpath.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/01/05
	 */
	public ClassLoader(VMSuiteManager __sm, VMClassLibrary[] __cp)
		throws NullPointerException
	{
		if (__sm == null || __cp == null)
			throw new NullPointerException("NARG");
		
		this.suites = __sm;
		this._classpath = __cp.clone();
................................................................................
		synchronized (this)
		{
			// If the class has already been loaded use that one
			Map<ClassName, LoadedClass> classes = this._classes;
			LoadedClass rv = classes.get(__n);
			if (rv != null)
				return rv;




			
			// If this is a primitive type or array then it is a special thing
			// and will not be in a resource
			ClassFile cf;
			VMClassLibrary inlib;
			if (__n.isPrimitive() || __n.isArray())
			{

				cf = ClassFile.special(__n.field());
				inlib = null;
			}
			
			// Load class from resource instead
			else
			{
				// This is the class that is read, in binary form
				String fileform = __n.toString() + ".class";
				
				// Go through our classpath looking for this class in its
				// resource format
				cf = null;
				inlib = null;
				for (VMClassLibrary b : this._classpath)
					try (InputStream in = b.resourceAsStream(fileform))
					{
						// Not found
						if (in == null)
							continue;


						
						// Load it
						cf = ClassFile.decode(in);
						inlib = b;



						
						// Stop

						break;
					}
					catch (InvalidClassFormatException e)
					{
						// {@squirreljme.error AE05 The class is not formatted
						// correctly. (The class name)}
						throw new VMException("AE05 " + __n, e);
					}
					catch (IOException e)
					{
						// {@squirreljme.error AE04 Read error trying to read
						// the class file. (The class)}
						throw new VMException("AE04 " + __n, e);
					}
				
				// {@squirreljme.error AE03 Could not find the specified class.
				// (The name of the class)}
				if (cf == null || inlib == null)
					throw new VMClassNotFoundException("AE03 " + __n);
			}
			
			// Process the class and compile it to the register format
			SummerClass rc;
			try
			{
				rc = SummerClass.ofClassFile(cf);
			}
			catch (SummerFormatException e)
			{
				// {@squirreljme.error AE06 The register compiler could not
				// process the input class. (The class)}
				throw new VMException("AE06 " + __n, e);
			}
			
			throw new todo.TODO();
		}
	}
}








|
|
|
|
|









|






|









|







 







>
>
>
>



<
<


>
|






|
<
<
<
<


<
<
|
<
<
<
>
>
|
<
<
<
>
>
>
|
<
>


<
<
<
<
<
<
<
<
<
<
<
<







<
<
<
<
<
<
<
<
<
<
<
<
<





15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
..
97
98
99
100
101
102
103
104
105
106
107
108
109
110


111
112
113
114
115
116
117
118
119
120
121




122
123


124



125
126
127



128
129
130
131

132
133
134












135
136
137
138
139
140
141













142
143
144
145
146
import cc.squirreljme.vm.VMSuiteManager;
import java.io.InputStream;
import java.io.IOException;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.ClassName;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.mini.MinimizedClassFile;
import net.multiphasicapps.classfile.mini.Minimizer;

/**
 * This is a class loader which manages and can cache multiple classes.
 *
 * @since 2019/01/05
 */
public final class ClassLoader
{
	/** The suite manager. */
	protected final CachingSuiteManager suites;
	
	/** Loaded class cache. */
	private final Map<ClassName, LoadedClass> _classes =
		new HashMap<>();
	
	/** The classes in the class path. */
	private final CachingClassLibrary[] _classpath;
	
	/**
	 * Initializes the class loader.
	 *
	 * @param __sm The suite manager.
	 * @param __cp The classpath.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/01/05
	 */
	public ClassLoader(CachingSuiteManager __sm, CachingClassLibrary[] __cp)
		throws NullPointerException
	{
		if (__sm == null || __cp == null)
			throw new NullPointerException("NARG");
		
		this.suites = __sm;
		this._classpath = __cp.clone();
................................................................................
		synchronized (this)
		{
			// If the class has already been loaded use that one
			Map<ClassName, LoadedClass> classes = this._classes;
			LoadedClass rv = classes.get(__n);
			if (rv != null)
				return rv;
			
			// Resulting minimized class and the library it is within
			MinimizedClassFile cf;
			CachingClassLibrary inlib;
			
			// If this is a primitive type or array then it is a special thing
			// and will not be in a resource


			if (__n.isPrimitive() || __n.isArray())
			{
				// Just minimize these dynamically generated classes
				cf = Minimizer.minimize(ClassFile.special(__n.field()));
				inlib = null;
			}
			
			// Load class from resource instead
			else
			{
				// Nothing is found initially yet




				cf = null;
				inlib = null;


				



				// The name to check, multiple extensions will be used!
				String basename = __n.toString();
				



				// Go through each library and check cache for the class data
				for (CachingClassLibrary b : this._classpath)
					if (null != (cf = b.cacheClass(basename)))
					{

						inlib = b;
						break;
					}












				
				// {@squirreljme.error AE03 Could not find the specified class.
				// (The name of the class)}
				if (cf == null || inlib == null)
					throw new VMClassNotFoundException("AE03 " + __n);
			}
			













			throw new todo.TODO();
		}
	}
}

Changes to runt/libs/summercoat-vm/cc/squirreljme/vm/summercoat/RootMachine.java.

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
..
72
73
74
75
76
77
78
79
80

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
...
103
104
105
106
107
108
109

110
111
112
113
114
115
116
 * creation of them and such.
 *
 * @since 2019/01/01
 */
public final class RootMachine
{
	/** The manager for suites. */
	protected final VMSuiteManager suites;
	
	/** The profiler information output. */
	protected final ProfilerSnapshot profiler;
	
	/** The base depth of this virtual machine. */
	protected final int baseguestdepth;
	
................................................................................
	 */
	public RootMachine(VMSuiteManager __s, ProfilerSnapshot __p, int __gd)
		throws NullPointerException
	{
		if (__s == null)
			throw new NullPointerException("NARG");
		
		this.suites = __s;
		this.profiler = __p;
		this.baseguestdepth = __gd;
	}
	
	/**
	 * Creates a new task which runs within a new instance of the virtual
	 * machine which uses the specified parameters based on the root machine's
................................................................................
	 * @param __args Arguments to the task.
	 * @return A new running task which when ran will execute the VM code
	 * accordingly.
	 * @throws NullPointerException On null arguments.
	 * @throws VMException If the task could not be initialized.
	 * @since 2019/01/01
	 */
	public final RunningTask createTask(VMClassLibrary[] __cp, String __maincl,
		boolean __ismid, Map<String, String> __sprops, String[] __args)

		throws NullPointerException, VMException
	{
		if (__cp == null || __maincl == null)
			throw new NullPointerException("NARG");
		
		// Defensive copy so things are not changed
		__cp = __cp.clone();
		__sprops = (__sprops == null ? new HashMap<String, String>() :
			new HashMap<>(__sprops));
		__args = (__args == null ? new String[0] : __args.clone());
		
		// Check for nulls
		for (VMClassLibrary l : __cp)
			if (l == null)
				throw new NullPointerException("NARG");
		for (String s : __args)
			if (s == null)
				throw new NullPointerException("NARG");
		for (Map.Entry<String, String> e : __sprops.entrySet())
			if (e.getKey() == null || e.getValue() == null)
................................................................................
		// Normalize the main class
		__maincl = __maincl.replace('.', '/');
		
		// Create a new status for this task which contains some global
		// information that is needed, it needs our system properties and the
		// classpath since they both may be accessed
		ClassLoader cl;

		TaskStatus status = this.statuses.createNew(
			(cl = new ClassLoader(suites, __cp)),
			__sprops, this.profiler);
		
		// Setup a new base running task, which has no threads yet until the
		// first is created
		RunningTask rv = new RunningTask(status);







|







 







|







 







|
|
>












|







 







>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
 * creation of them and such.
 *
 * @since 2019/01/01
 */
public final class RootMachine
{
	/** The manager for suites. */
	protected final CachingSuiteManager suites;
	
	/** The profiler information output. */
	protected final ProfilerSnapshot profiler;
	
	/** The base depth of this virtual machine. */
	protected final int baseguestdepth;
	
................................................................................
	 */
	public RootMachine(VMSuiteManager __s, ProfilerSnapshot __p, int __gd)
		throws NullPointerException
	{
		if (__s == null)
			throw new NullPointerException("NARG");
		
		this.suites = new CachingSuiteManager(__s);
		this.profiler = __p;
		this.baseguestdepth = __gd;
	}
	
	/**
	 * Creates a new task which runs within a new instance of the virtual
	 * machine which uses the specified parameters based on the root machine's
................................................................................
	 * @param __args Arguments to the task.
	 * @return A new running task which when ran will execute the VM code
	 * accordingly.
	 * @throws NullPointerException On null arguments.
	 * @throws VMException If the task could not be initialized.
	 * @since 2019/01/01
	 */
	public final RunningTask createTask(CachingClassLibrary[] __cp,
		String __maincl, boolean __ismid, Map<String, String> __sprops,
		String[] __args)
		throws NullPointerException, VMException
	{
		if (__cp == null || __maincl == null)
			throw new NullPointerException("NARG");
		
		// Defensive copy so things are not changed
		__cp = __cp.clone();
		__sprops = (__sprops == null ? new HashMap<String, String>() :
			new HashMap<>(__sprops));
		__args = (__args == null ? new String[0] : __args.clone());
		
		// Check for nulls
		for (CachingClassLibrary l : __cp)
			if (l == null)
				throw new NullPointerException("NARG");
		for (String s : __args)
			if (s == null)
				throw new NullPointerException("NARG");
		for (Map.Entry<String, String> e : __sprops.entrySet())
			if (e.getKey() == null || e.getValue() == null)
................................................................................
		// Normalize the main class
		__maincl = __maincl.replace('.', '/');
		
		// Create a new status for this task which contains some global
		// information that is needed, it needs our system properties and the
		// classpath since they both may be accessed
		ClassLoader cl;
		CachingSuiteManager suites = this.suites;
		TaskStatus status = this.statuses.createNew(
			(cl = new ClassLoader(suites, __cp)),
			__sprops, this.profiler);
		
		// Setup a new base running task, which has no threads yet until the
		// first is created
		RunningTask rv = new RunningTask(status);

Changes to runt/libs/summercoat-vm/cc/squirreljme/vm/summercoat/SummerCoatFactory.java.

48
49
50
51
52
53
54







55
56
57
58
59
60
		boolean __ismid, int __gd, Map<String, String> __sprops,
		String[] __args)
		throws IllegalArgumentException, NullPointerException, VMException
	{
		// Setup root machine which has our base suite manager
		RootMachine rm = new RootMachine(__sm, __ps, __gd);
		







		// Now create the starting main task
		return new ExitAwaiter(rm.statuses,
			rm.createTask(__cp, __maincl, __ismid, __sprops, __args).status);
	}
}








>
>
>
>
>
>
>


|



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
		boolean __ismid, int __gd, Map<String, String> __sprops,
		String[] __args)
		throws IllegalArgumentException, NullPointerException, VMException
	{
		// Setup root machine which has our base suite manager
		RootMachine rm = new RootMachine(__sm, __ps, __gd);
		
		// Need to map to cached VMs
		CachingSuiteManager suites = rm.suites;
		int n = __cp.length;
		CachingClassLibrary[] libs = new CachingClassLibrary[n];
		for (int i = 0; i < n; i++)
			libs[i] = suites.loadLibrary(__cp[i]);
		
		// Now create the starting main task
		return new ExitAwaiter(rm.statuses,
			rm.createTask(libs, __maincl, __ismid, __sprops, __args).status);
	}
}

Added runt/libs/tool-classfile.test/ByteDeque.data.__mime.























































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
begin-base64 640 ByteDeque.class
yv66vgAAADMBPAcAzAN/////CgBaAM0KADEAzgcAzwoABQDOCQBaANAJAFoA
0QcA0ggA0woACQDUCQBaANUKAFoA1gcA1wgA2AoADgDUBwDZCADaCgARANQJ
AFoA2wcA3AgA3QoAFQDUCgAFAN4JAFoA3wkAWgDgBwDhCgAbAM4KAFoA4ggA
4wkAWgDkCQBaAOUKAAUA5goABQDnBwBlCgAFAOgLAI8A6QsAjwDqCgDrAOwK
AAUA7QgA7goABQDvBwDwCgArAM4KAAUA8QgA8goAWgDzCAD0BwD1CgABAPYK
APcA+AgA+QgA+goAWgD7CgBaAPwHAP0IAP4KADgA1AoAWgD/CAEACgEBAQIK
AFoBAwoAWgEECgBaAQUKAFoBBgoAWgEHCgBaAQgKAFoBCQoAWgEKCAELCgBa
AQwKAFoBDQgBDggBDwoAWgEQCAERCAESCAETCQBaARQKAAUBFQsAyAEWCAEX
CgABARgKAAEBGQoAAQEaCgABARsHARwIAR0KAFcA1AcBHgEAC19CTE9DS19T
SVpFAQABSQEAC19CTE9DS19NQVNLAQAMX0JMT0NLX1NISUZUAQAIY2FwYWNp
dHkBAAdfYmxvY2tzAQAWTGphdmEvdXRpbC9MaW5rZWRMaXN0OwEACVNpZ25h
dHVyZQEAGkxqYXZhL3V0aWwvTGlua2VkTGlzdDxbQj47AQAFX3NvbG8BAAJb
QgEABl90b3RhbAEABV9oZWFkAQAFX3RhaWwBAAY8aW5pdD4BAAMoKVYBAARD
b2RlAQAPTGluZU51bWJlclRhYmxlAQAS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GoAAQBrAAAAiAAHAAAAAABJEAgSUhEAgLgA
U7YAVLgAPbMAH7IAHwRkswAgsgAfuABVswBPsgAfuABWBJ8AHbsAV1kSWAS9
ADFZA7IAH7gAMlO4ADO3AFm/sQAAAAIAbAAAACIACAAAACcABwAoABMALAAb
ADAAHgAxACQAUAAuAFEASABSAHIAAAAFAAH7AEgAAQDKAAAAAgDL
====

Added runt/libs/tool-classfile.test/InflaterInputStream.data.__mime.



































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
begin-base64 640 InflaterInputStream.class
yv66vgAAADMBswcBMwMAAIAACgABATQKAAEBNQoAaQE2BwE3CgAGATYJAAEB
OAkAAQE5CQABAToHATsKAAsBPAkAAQE9CQABAT4JAAEBPwkAAQFACQABAUEH
AUIIAUMKABIBRAkAAQFFBwFGCgAWAUcJAAEBSAkAAQFJCgAGAUoKALEBSwkA
AQFMCgABAU0HAU4IAU8KAB4BRAoABgFQCQABAVEJAAEBUgkAAQFTCQABAVQK
AAEBVQsAsgFWCQABAVcKAAYBWAoAAQFZCgABAVoKAAEBWwoAAQFcBwFdCAFe
BwFfCgBGAWAKAWEBYgoALgFECgABAWMKAAEBZAoAAQFlCgABAWYKAFQBZwoA
AQFoCgABAWkKAAEBaggBawoAAQFsBwFtCAFuCgAuAW8KAAEBcAoAAQFxCAFy
CQABAXMKAAEBdAcBdQOAAAAACAF2CQABAXcDAAD//wgBeAoAAQF5CgAWAXoH
AXsIAXwIAX0IAX4JAAEBfwoBAwGABwGBBwGCCgBUATYKAFUBgwoAVAGECQAB
AYUJAAEBhgkAAQGHBwCFCQABAYgKALEBTQgBiQoARgGKCA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4ACQBXAEUAgACBAAoAXQA/AH4A
fwALAAAAqQCmAKcAAAAAAKkBKwBuAAEAAACpASwAbgACAAAAqQEOAJ0AAwAH
AKIBLQBuAAQAIACJAS4AbgAFACYAgwEvAG4ABgCwAAAANgAF/AAaAf8AQgAM
BwABAQEBAQEBBwBcAQEHAAYHABYAAPwAIgEH/wATAAcHAAEBAQEBAQEAAACp
AAAABAABAC4ACAEwALYAAQCjAAAAhgAEAAAAAABuEBO8ClkDEBBPWQQQEU9Z
BRAST1kGA09ZBxAIT1kIEAdPWRAGEAlPWRAHEAZPWRAIEApPWRAJCE9ZEAoQ
C09ZEAsHT1kQDBAMT1kQDQZPWRAOEA1PWRAPBU9ZEBAQDk9ZEBEET1kQEhAP
T7MARLEAAAABAKQAAAAGAAEAAAA5AAIBMQAAAAIBMgBrAAAAEgACAGoAAAAA
EAgACwABAGwAEg==
====

Added runt/libs/tool-classfile.test/META-INF/TEST.MF.





>
>
1
2
Manifest-Version: 1.0

Added runt/libs/tool-classfile.test/TestClassLoad.in.





>
>
1
2
result: NoResult
thrown: NoExceptionThrown

Added runt/libs/tool-classfile.test/TestClassLoad.java.















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

import java.io.InputStream;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.tac.TestRunnable;

/**
 * Tests that classes load properly.
 *
 * @since 2019/03/10
 */
public class TestClassLoad
	extends TestRunnable
{
	/**
	 * {@inheritDoc}
	 * @since 2019/03/10
	 */
	@Override
	public void test()
		throws Throwable
	{
		for (String x : new String[]{"ByteDeque.data",
			"InflaterInputStream.data"})
			try (InputStream in = TestClassLoad.class.getResourceAsStream(x))
			{
				ClassFile.decode(in);
			}
	}
}

Added runt/libs/tool-classfile.test/TestMinimizedLoad.in.





>
>
1
2
result: NoResult
thrown: NoExceptionThrown

Added runt/libs/tool-classfile.test/TestMinimizedLoad.java.





















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.mini.Minimizer;
import net.multiphasicapps.tac.TestRunnable;

/**
 * Tests that minimizing is performed properly and loading minimized classes
 * works as well.
 *
 * @since 2019/03/10
 */
public class TestMinimizedLoad
	extends TestRunnable
{
	/**
	 * {@inheritDoc}
	 * @since 2019/03/10
	 */
	@Override
	public void test()
		throws Throwable
	{
		for (String x : new String[]{"ByteDeque.data",
			"InflaterInputStream.data"})
			try (InputStream in = TestClassLoad.class.getResourceAsStream(x))
			{
				Minimizer.minimize(ClassFile.decode(in));
			}
	}
}

Added runt/libs/tool-classfile.test/TestMinimizer.in.





>
>
1
2
result: NoResult
thrown: NoExceptionThrown

Added runt/libs/tool-classfile.test/TestMinimizer.java.





















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.mini.Minimizer;
import net.multiphasicapps.tac.TestRunnable;

/**
 * Tests that minimizing is performed properly.
 *
 * @since 2019/03/10
 */
public class TestMinimizer
	extends TestRunnable
{
	/**
	 * {@inheritDoc}
	 * @since 2019/03/10
	 */
	@Override
	public void test()
		throws Throwable
	{
		for (String x : new String[]{"ByteDeque.data",
			"InflaterInputStream.data"})
			try (InputStream in = TestClassLoad.class.getResourceAsStream(x);
				ByteArrayOutputStream out = new ByteArrayOutputStream())
			{
				Minimizer.minimize(ClassFile.decode(in), out);
			}
	}
}

Changes to runt/libs/tool-classfile/net/multiphasicapps/classfile/ByteCode.java.

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

/**
 * This class represents the byte code within a method.
 *
 * @since 2017/10/09
 */
public final class ByteCode
	implements ExecutableCode, Iterable<Instruction>
{
	/** The code is always at this offset. */
	static final int _CODE_OFFSET =
		8;
	
	/** The maximum number of bytes the byte code may be. */
	private static final int _MAX_CODE_LENGTH =







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

/**
 * This class represents the byte code within a method.
 *
 * @since 2017/10/09
 */
public final class ByteCode
	implements Iterable<Instruction>
{
	/** The code is always at this offset. */
	static final int _CODE_OFFSET =
		8;
	
	/** The maximum number of bytes the byte code may be. */
	private static final int _MAX_CODE_LENGTH =

Deleted runt/libs/tool-classfile/net/multiphasicapps/classfile/ExecutableCode.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile;

/**
 * This interface represents anything that is executable and is associated
 * with method code contained within a class.
 *
 * @since 2018/05/14
 */
@Deprecated
public interface ExecutableCode
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































Changes to runt/libs/tool-classfile/net/multiphasicapps/classfile/Method.java.

14
15
16
17
18
19
20

21
22
23
24
25
26
27
..
46
47
48
49
50
51
52



53
54
55
56
57
58
59
60
61



62
63
64
65
66
67
68
..
96
97
98
99
100
101
102

103
104
105
106
107
108
109
...
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
...
235
236
237
238
239
240
241
























242
243
244
245
246
247
248
import java.io.IOException;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import net.multiphasicapps.collections.UnmodifiableArrayList;

/**
 * This represents a method which is used to execute byte code.
 *
 * @since 2017/09/30
 */
................................................................................
	
	/** The name of the method. */
	protected final MethodName methodname;
	
	/** The type of the method. */
	protected final MethodDescriptor methodtype;
	



	/** Annotated values. */
	private final AnnotationTable annotations;
	
	/** The code attribute data, which is optional. */
	private final byte[] _rawcodeattr;
	
	/** The method byte code. */
	private Reference<ByteCode> _bytecode;
	



	/** Name and type reference. */
	private Reference<MethodNameAndType> _nameandtype;
	
	/** The method index. */
	private Reference<MethodHandle> _index;
	
	/**
................................................................................
		this.classname = __tn;
		this.pool = __pool;
		this.methodflags = __mf;
		this.methodname = __mn;
		this.methodtype = __mt;
		this.annotations = __avs;
		this._rawcodeattr = __mc;

	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/03/06
	 */
	@Override
................................................................................
	 * @since 2017/10/09
	 */
	public final ByteCode byteCode()
		throws InvalidClassFormatException
	{
		// If there is no code atribute there is no byte code
		byte[] rawcodeattr = this._rawcodeattr;
		if (rawcodeattr == null)
			return null;
		
		// Otherwise load a representation of it
		Reference<ByteCode> ref = this._bytecode;
		ByteCode rv;
		
		if (ref == null || null == (rv = ref.get()))
................................................................................
	 * @return The constant pool which is used.
	 * @since 2017/10/09
	 */
	public final Pool pool()
	{
		return this.pool;
	}
























	
	/**
	 * Returns the method's type.
	 *
	 * @return The type of the method.
	 * @since 2017/10/16
	 */







>







 







>
>
>









>
>
>







 







>







 







|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
..
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
...
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
import java.io.IOException;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import net.multiphasicapps.classfile.register.RegisterCode;
import net.multiphasicapps.collections.UnmodifiableArrayList;

/**
 * This represents a method which is used to execute byte code.
 *
 * @since 2017/09/30
 */
................................................................................
	
	/** The name of the method. */
	protected final MethodName methodname;
	
	/** The type of the method. */
	protected final MethodDescriptor methodtype;
	
	/** Does this method have code? */
	protected final boolean hascode;
	
	/** Annotated values. */
	private final AnnotationTable annotations;
	
	/** The code attribute data, which is optional. */
	private final byte[] _rawcodeattr;
	
	/** The method byte code. */
	private Reference<ByteCode> _bytecode;
	
	/** Register code. */
	private Reference<RegisterCode> _regcode;
	
	/** Name and type reference. */
	private Reference<MethodNameAndType> _nameandtype;
	
	/** The method index. */
	private Reference<MethodHandle> _index;
	
	/**
................................................................................
		this.classname = __tn;
		this.pool = __pool;
		this.methodflags = __mf;
		this.methodname = __mn;
		this.methodtype = __mt;
		this.annotations = __avs;
		this._rawcodeattr = __mc;
		this.hascode = !__mf.isNative() && !__mf.isAbstract();
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/03/06
	 */
	@Override
................................................................................
	 * @since 2017/10/09
	 */
	public final ByteCode byteCode()
		throws InvalidClassFormatException
	{
		// If there is no code atribute there is no byte code
		byte[] rawcodeattr = this._rawcodeattr;
		if (!this.hascode)
			return null;
		
		// Otherwise load a representation of it
		Reference<ByteCode> ref = this._bytecode;
		ByteCode rv;
		
		if (ref == null || null == (rv = ref.get()))
................................................................................
	 * @return The constant pool which is used.
	 * @since 2017/10/09
	 */
	public final Pool pool()
	{
		return this.pool;
	}
	
	/**
	 * Returns the code of this method in a register based format that is
	 * more efficient than pure Java byte code.
	 *
	 * @return The code of this method in a register based format.
	 * @since 2019/03/09
	 */
	public final RegisterCode registerCode()
	{
		// Abstract and native methods have no code
		if (!this.hascode)
			return null;
		
		// Cache it
		Reference<RegisterCode> ref = this._regcode;
		RegisterCode rv;
		
		if (ref == null || null == (rv = ref.get()))
			this._regcode = new WeakReference<>(
				(rv = RegisterCode.of(this.byteCode())));
		
		return rv;
	}
	
	/**
	 * Returns the method's type.
	 *
	 * @return The type of the method.
	 * @since 2017/10/16
	 */

Changes to runt/libs/tool-classfile/net/multiphasicapps/classfile/PrimitiveType.java.

39
40
41
42
43
44
45























46
47
48
49
50
51
52
	SHORT,
	
	/** Boolean. */
	BOOLEAN,
	
	/** End. */
	;























	
	/**
	 * Is this a wide type?
	 *
	 * @return If this is a wide type.
	 * @since 2017/10/16
	 */







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
	SHORT,
	
	/** Boolean. */
	BOOLEAN,
	
	/** End. */
	;
	
	/**
	 * The number of bytes needed to store this type.
	 *
	 * @return The number of bytes required to store data for this type.
	 * @since 2019/03/11
	 */
	public final int bytes()
	{
		switch (this)
		{
			case BOOLEAN:
			case BYTE:		return 1;
			case SHORT:
			case CHARACTER:	return 2;
			case INTEGER:
			case FLOAT:		return 4;
			case LONG:
			case DOUBLE:	return 8;
			default:
				throw new RuntimeException("OOPS");
		}
	}
	
	/**
	 * Is this a wide type?
	 *
	 * @return If this is a wide type.
	 * @since 2017/10/16
	 */

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/MinimizedClassFile.java.





















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.mini;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import net.multiphasicapps.classfile.InvalidClassFormatException;

/**
 * This contains the minimized class file which is a smaller format of the
 * {@link net.multiphasicapps.classfile.ClassFile} that is more optimized to
 * virtual machines for usage.
 *
 * @since 2019/03/10
 */
public final class MinimizedClassFile
{
	/** The magic number for the files. */
	public static final int MAGIC_NUMBER =
		0x00586572;
	
	/**
	 * Decodes and returns the minimized representation of the class file.
	 *
	 * @param __is The stream to decode from.
	 * @return The resulting minimized class.
	 * @throws InvalidClassFormatException If the class is not formatted
	 * correctly.
	 * @throws IOException On read errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/10
	 */
	public static final MinimizedClassFile decode(InputStream __is)
		throws InvalidClassFormatException, IOException, NullPointerException
	{
		if (__is == null)
			throw new NullPointerException("NARG");
		
		// Wrap stream for reading
		DataInputStream dis = new DataInputStream(__is);
		
		// {@squirreljme.error JC2l Invalid minimized class magic number.}
		if (MAGIC_NUMBER != dis.readInt())
			throw new InvalidClassFormatException("JC2l");
		
		throw new todo.TODO();
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/MinimizedField.java.























































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.mini;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import net.multiphasicapps.classfile.FieldDescriptor;
import net.multiphasicapps.classfile.FieldName;

/**
 * This represents a field which has been minimized.
 *
 * @since 2019/03/11
 */
public final class MinimizedField
{
	/** The flags for this field. */
	public final int flags;
	
	/** Offset to the field data. */
	public final int offset;
	
	/** The size of this field. */
	public final int size;
	
	/** The field name. */
	public final FieldName name;
	
	/** The field type. */
	public final FieldDescriptor type;
	
	/** The field value. */
	public final Object value;
	
	/** String representation. */
	private Reference<String> _string;
	
	/**
	 * Initializes the minimized field.
	 *
	 * @param __f The field flags.
	 * @param __o The offset.
	 * @param __s The size.
	 * @param __n The name of the field.
	 * @param __t The type of the field.
	 * @param __v The value of this field.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/11
	 */
	public MinimizedField(int __f, int __o, int __s, FieldName __n,
		FieldDescriptor __t, Object __v)
		throws NullPointerException
	{
		if (__n == null || __t == null)
			throw new NullPointerException("NARG");
		
		this.flags = __f;
		this.offset = __o;
		this.size = __s;
		this.name = __n;
		this.type = __t;
		this.value = __v;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/03/11
	 */
	@Override
	public final String toString()
	{
		Reference<String> ref = this._string;
		String rv;
		
		if (ref == null || null == (rv = ref.get()))
			this._string = new WeakReference<>((rv = String.format(
				"Field %s:%s @ %d (%d bytes), flags=%x, value=%s", this.name,
				this.type, this.offset, this.size, this.flags, this.value)));
		
		return rv;
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/MinimizedMethod.java.



































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.mini;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import net.multiphasicapps.classfile.MethodDescriptor;
import net.multiphasicapps.classfile.MethodName;

/**
 * This represents a method which has been mimized.
 *
 * @since 2019/03/14
 */
public final class MinimizedMethod
{
	/** Flags that are used for the method. */
	public final int flags;
	
	/** The index of this method in the instance table. */
	public final int index;
	
	/** The name of the method. */
	public final MethodName name;
	
	/** The type of the method. */
	public final MethodDescriptor type;
	
	/** Translated method code. */
	private final byte[] _code;
	
	/**
	 * Initializes the minimized method.
	 *
	 * @param __f The method flags.
	 * @param __o Index in the method table for instances.
	 * @param __n The method name.
	 * @param __t The method type.
	 * @param __tc Transcoded instructions.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/14
	 */
	public MinimizedMethod(int __f, int __o,
		MethodName __n, MethodDescriptor __t, byte[] __tc)
		throws NullPointerException
	{
		if (__n == null || __t == null)
			throw new NullPointerException("NARG");
		
		this.flags = __f;
		this.index = __o;
		this.name = __n;
		this.type = __t;
		this._code = (__tc == null ? new byte[0] : __tc.clone());
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/MinimizedPoolBuilder.java.











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.mini;

/**
 * This class is used to build the constant pool for a minimized class.
 *
 * @since 2019/03/11
 */
public final class MinimizedPoolBuilder
{
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/Minimizer.java.





































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.mini;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.Field;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.Method;
import net.multiphasicapps.classfile.MethodFlags;
import net.multiphasicapps.classfile.PrimitiveType;

/**
 * This takes an input class file and translates it to the minimized format
 * which is easier to use.
 *
 * @since 2019/03/10
 */
public final class Minimizer
{
	/** The class file to minimize. */
	protected final ClassFile input;
	
	/** The constant pool builder to use. */
	protected final MinimizedPoolBuilder pool =
		new MinimizedPoolBuilder();
	
	/**
	 * Initializes the minimizer.
	 *
	 * @param __cf The class to minimize.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/10
	 */
	private Minimizer(ClassFile __cf)
		throws NullPointerException
	{
		if (__cf == null)
			throw new NullPointerException("NARG");
		
		this.input = __cf;
	}
	
	/**
	 * Performs the minimization process.
	 *
	 * @param __dos The stream to write the result to.
	 * @throws IOException On write errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/10
	 */
	private final void __run(DataOutputStream __dos)
		throws IOException, NullPointerException
	{
		if (__dos == null)
			throw new NullPointerException("NARG");
		
		// Write magic number to specify this format
		__dos.writeInt(MinimizedClassFile.MAGIC_NUMBER);
		
		// Process all fields
		__TempFields__[] fields = this.__doFields(); 
		
		// Process all methods
		__TempMethods__[] methods = this.__doMethods();
		
		throw new todo.TODO();
	}
	
	/**
	 * Process fields.
	 *
	 * @return The resulting fields, static and instance split into each.
	 * @since 2019/03/11
	 */
	private final __TempFields__[] __doFields()
	{
		// Static and instance fields are split because they are stored
		// in different places
		__TempFields__[] rv = new __TempFields__[]{
			new __TempFields__(), new __TempFields__()};
		
		// Perform some sorting to optimize slightly and make the layout a
		// bit friendlier
		List<Field> sorted = new ArrayList<>(this.input.fields());
		Collections.sort(sorted, new __MinimizerFieldSort__());
		
		// Process each field
		for (Field f : sorted)
		{
			// These are stored in their own rows
			__TempFields__ temp = rv[(f.flags().isStatic() ? 1 : 0)];
			
			// Determine the size of this entry (and its alignment)
			PrimitiveType pt = f.type().primitiveType();
			int fsz = (pt == null ? 4 : pt.bytes());
			
			// Determine the base position and check if any alignment is needed
			// assuming types of a given size are always aligned
			int basep = (temp._bytes + (fsz - 1)) & ~(fsz - 1);
			
			// Build field information
			MinimizedField q;
			temp._fields.add((q = new MinimizedField(
				f.flags().toJavaBits(),
				basep,
				fsz,
				f.name(),
				f.type(),
				f.constantValue())));
			
			// Debug
			todo.DEBUG.note("Add field %s", q);
			
			// Handle table sizes
			temp._bytes = basep + fsz;
			temp._count++;
		}
		
		// Return static and instance fields
		return rv;
	}
	
	/**
	 * Processes all methods within the class.
	 *
	 * @return The processed static and instance methods.
	 * @since 2019/03/13
	 */
	private final __TempMethods__[] __doMethods()
	{
		// Split static and instance methods to make them easier to locate
		// accordingly
		__TempMethods__[] rv = new __TempMethods__[]{
			new __TempMethods__(), new __TempMethods__()};
		
		// Process each method
		for (Method m : this.input.methods())
		{
			// These are stored in their own rows
			__TempMethods__ temp = rv[(m.flags().isStatic() ? 1 : 0)];
			
			// Need to translate and serialize the byte code into a register
			// form and remap any used references.
			MethodFlags mf = m.flags();
			byte[] transcode = null;
			if (!mf.isAbstract() && !mf.isNative())
			{
				m.registerCode();
				throw new todo.TODO();
			}
			
			// Add method
			MinimizedMethod q;
			temp._methods.add((q = new MinimizedMethod(mf.toJavaBits(),
				temp._count, m.name(), m.type(), transcode)));
			
			// Debug
			todo.DEBUG.note("Add method %s", q);
			
			// Quick count for used methods
			temp._count++;
		}
		
		return rv;
	}
	
	/**
	 * Minimizes the given class and returns the minimized version of it.
	 *
	 * @param __cf The class to minimize.
	 * @return The resulting minimized class.
	 * @throws InvalidClassFormatException If the class is not formatted
	 * correctly.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/10
	 */
	public static final MinimizedClassFile minimize(ClassFile __cf)
		throws InvalidClassFormatException, NullPointerException
	{
		if (__cf == null)
			throw new NullPointerException("NARG");
		
		// Minimization is straight to a byte format so just read that in
		// again
		try (ByteArrayOutputStream baos = new ByteArrayOutputStream(8192))
		{
			// Output minimized code to the byte array
			Minimizer.minimize(__cf, baos);
			
			// Just feed this back into the decoder for reading
			try (InputStream is = new ByteArrayInputStream(baos.toByteArray()))
			{
				return MinimizedClassFile.decode(is);
			}
		}
		
		// {@squirreljme.error JC2k Could not minimize class due to a read
		// or write error.}
		catch (IOException e)
		{
			throw new RuntimeException("JC2k", e);
		}
	}
	
	/**
	 * Minimizes the class file so that it is in a more compact format as
	 * needed.
	 *
	 * @param __cf The class file to minimize.
	 * @param __os The stream to write the minimized format to.
	 * @throws InvalidClassFormatException If the class format is not valid.
	 * @throws IOException On write errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/10
	 */
	public static final void minimize(ClassFile __cf, OutputStream __os)
		throws InvalidClassFormatException, IOException, NullPointerException
	{
		if (__cf == null || __os == null)
			throw new NullPointerException("NARG");
		
		new Minimizer(__cf).__run(new DataOutputStream(__os));
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/__MinimizerFieldSort__.java.















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.mini;

import java.util.Comparator;
import net.multiphasicapps.classfile.Field;
import net.multiphasicapps.classfile.PrimitiveType;

/**
 * This is used to sort the input fields according to their size and type so
 * that they are grouped together and aligned together.
 *
 * Name sorting is used last.
 *
 * @since 2019/03/11
 */
final class __MinimizerFieldSort__
	implements Comparator<Field>
{
	/**
	 * Compares two fields.
	 *
	 * @param __a The first.
	 * @param __b The second.
	 * @since 2019/03/11
	 */
	public int compare(Field __a, Field __b)
	{
		// Compare sizes first to force alignables to be close to each other
		PrimitiveType pa = __a.type().primitiveType(),
			pb = __b.type().primitiveType();
		int sa = (pa == null ? 4 : pa.bytes()),
			sb = (pb == null ? 4 : pb.bytes());
		int rv = sa - sb;
		if (rv != 0)
			return rv;
		
		// Then sort by the descriptor so like-types are close to each other
		rv = __a.type().compareTo(__b.type());
		if (rv != 0)
			return rv;
		
		// Then fallback to name
		return __a.name().compareTo(__b.name());
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/__TempFields__.java.



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.mini;

import java.util.ArrayList;
import java.util.List;

/**
 * Stores temporary field data as it is processed.
 *
 * @since 2019/03/11
 */
final class __TempFields__
{
	/** The fields in the table. */
	final List<MinimizedField> _fields =
		new ArrayList<>();
	
	/** The number of fields in the table. */
	int _count;
	
	/** The current byte size of the field table. */
	int _bytes;
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/__TempMethods__.java.





























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.mini;

import java.util.ArrayList;
import java.util.List;

/**
 * Contains temporary method information.
 *
 * @since 2019/03/13
 */
final class __TempMethods__
{
	/** The methods in this table. */
	final List<MinimizedMethod> _methods =
		new ArrayList<>();
	
	/** The number of methods that are available. */
	int _count;
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/mini/package-info.java.













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

/**
 * This contains the support for the creation of minitature (compressed)
 * classes which contain easy to read by computer formats and only the
 * required parts of the class that are used to execute code. It is meant to
 * be easier to use for virtual machines without needing to worry too much
 * about the class file format.
 *
 * @since 2019/03/10
 */

package net.multiphasicapps.classfile.mini;

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/register/RegisterCode.java.























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.register;

import net.multiphasicapps.classfile.ByteCode;

/**
 * This is similar to {@link ByteCode} except that it instead of using a
 * stack for intermediate Java operations, this instead uses registers. This
 * provides a more concise and easier to use format by virtual machines.
 *
 * @see ByteCode
 * @since 2019/03/09
 */
public final class RegisterCode
{
	/**
	 * This translates the input byte code and creates a register code which
	 * removes all stack operations and maps them to register operations.
	 *
	 * @param __bc The input byte code.
	 * @return The resulting register code.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/09
	 */
	public static final RegisterCode of(ByteCode __bc)
		throws NullPointerException
	{
		if (__bc == null)
			throw new NullPointerException("NARG");
		
		return new __Registerize__(__bc).convert();
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/register/__Label__.java.

























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.register;

/**
 * Label which refers to a location in code.
 *
 * @since 2019/03/16
 */
final class __Label__
{
	/** The locality. */
	public final String locality;
	
	/** The associated address. */
	public final int address;
	
	/**
	 * Initializes the lable.
	 *
	 * @param __l The locality.
	 * @param __a The address.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/16
	 */
	public __Label__(String __l, int __a)
		throws NullPointerException
	{
		if (__l == null)
			throw new NullPointerException("NARG");
		
		this.locality = __l;
		this.address = __a;
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/register/__RegisterCodeBuilder__.java.





























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.register;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * This is used to build {@link RegisterCode} and add instructions to it.
 *
 * @since 2019/03/16
 */
final class __RegisterCodeBuilder__
{
	/** Temporary instruction layout. */
	final Map<Integer, __TempInstruction__> _instructions =
		new LinkedHashMap<>();
	
	/** Next address to use. */
	int _nextaddr;
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/register/__Registerize__.java.

























































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.register;

import net.multiphasicapps.classfile.ByteCode;
import net.multiphasicapps.classfile.Instruction;
import net.multiphasicapps.classfile.InstructionIndex;
import net.multiphasicapps.classfile.JavaType;
import net.multiphasicapps.classfile.StackMapTable;
import net.multiphasicapps.classfile.StackMapTableState;

/**
 * This class is used to transform normal byte code into register code that
 * is more optimized for VMs.
 *
 * @since 2019/03/14
 */
final class __Registerize__
{
	/** The input byte code to translate. */
	protected final ByteCode bytecode;
	
	/** The state of the locals and stack. */
	protected final __StackState__ state;
	
	/** The stack map table. */
	protected final StackMapTable stackmap;
	
	/** Used to build register codes. */
	protected final __RegisterCodeBuilder__ codebuilder =
		new __RegisterCodeBuilder__();
	
	/**
	 * Converts the input byte code to a register based code.
	 *
	 * @param __bc The byte code to translate.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/14
	 */
	__Registerize__(ByteCode __bc)
		throws NullPointerException
	{
		if (__bc == null)
			throw new NullPointerException("NARG");
		
		this.bytecode = __bc;
		this.stackmap = __bc.stackMapTable();
		this.state = new __StackState__(__bc.maxLocals(), __bc.maxStack());
	}
	
	/**
	 * Converts the byte code into register code.
	 *
	 * @return The resulting register code.
	 * @since 2019/03/14
	 */
	public RegisterCode convert()
	{
		ByteCode bytecode = this.bytecode;
		StackMapTable stackmap = this.stackmap;
		__StackState__ state = this.state;
		
		// Process every instruction
		for (Instruction inst : bytecode)
		{
			// Debug
			todo.DEBUG.note("Xlate %s", inst);
			
			// If there is a defined stack map table state (this will be for
			// any kind of branch or exception handler), load that so it can
			// be worked from
			StackMapTableState smts = stackmap.get(inst.address());
			if (smts != null)
				state.fromState(smts);
			
			// Process instructions
			this.__process(inst);
		}
		
		throw new todo.TODO();
	}
	
	/**
	 * Processes a single instruction.
	 *
	 * @param __i The instruction to process.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/14
	 */
	private final void __process(Instruction __i)
		throws NullPointerException
	{
		if (__i == null)
			throw new NullPointerException("NARG");
		
		// Depends on the operation to process
		int op;
		switch ((op = __i.operation()))
		{
			case InstructionIndex.ALOAD_0:
			case InstructionIndex.ALOAD_1:
			case InstructionIndex.ALOAD_2:
			case InstructionIndex.ALOAD_3:
				__runALoad(op - InstructionIndex.ALOAD_0);
				break;
			
			default:
				throw new todo.TODO(__i.toString());
		}
		
		throw new todo.TODO();
	}
	
	/**
	 * Loads single reference from a local to the stack.
	 *
	 * @param __l The reference to load.
	 * @since 2019/03/14
	 */
	private final void __runALoad(int __l)
	{
		__StackState__ state = this.state;
		
		// Load from local and push to the stack
		__StackResult__ src = state.localGet(__l);
		__StackResult__ dest = state.stackPush(src.type);
		
		// Add instruction
		throw new todo.TODO();
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/register/__StackResult__.java.

































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.register;

import net.multiphasicapps.classfile.JavaType;

/**
 * This contains the result of the operation when a push or pop has been
 * performed. Since pushing/popping is complicated and will involve
 * information on the type and registers, this is needed to
 * simplify the design of the processor.
 *
 * @since 2019/02/23
 */
final class __StackResult__
{
	/** The Java type which is involved here. */
	public final JavaType type;
	
	/** The register used. */
	public final int register;
	
	/**
	 * Initializes the result.
	 *
	 * @param __jt The Java type.
	 * @param __rl The register location.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	__StackResult__(JavaType __jt, int __rl)
		throws NullPointerException
	{
		if (__jt == null)
			throw new NullPointerException("NARG");
		
		this.type = __jt;
		this.register = __rl;
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/register/__StackState__.java.























































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.register;

import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.JavaType;
import net.multiphasicapps.classfile.StackMapTableState;

/**
 * This class contains the state of the Java stack, it gets initialized to
 * a format which is used for conversion to SummerCoat.
 *
 * @since 2019/02/16
 */
final class __StackState__
{
	/** Local variables. */
	private final Slot[] _locals;
	
	/** Stack variables. */
	private final Slot[] _stack;
	
	/** The current top of the stack. */
	private int _stacktop;
	
	/**
	 * Initializes the base Java state.
	 *
	 * @param __nl The number of local variables.
	 * @param __ns The number of stack variables.
	 * @since 2019/02/16
	 */
	__StackState__(int __nl, int __ns)
	{
		// Virtual register index counter
		int vr = 2;
		
		// Initialize locals
		Slot[] locals = new Slot[__nl];
		for (int i = 0; i < __nl; i++)
			locals[i] = new Slot(vr++);
		this._locals = locals;
		
		// Initialize stack
		Slot[] stack = new Slot[__ns];
		for (int i = 0; i < __ns; i++)
			stack[i] = new Slot(vr++);
		this._stack = stack;
	}
	
	/**
	 * Loads the Java state from the given stack map table state.
	 *
	 * @param __smt The state to read from.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public final void fromState(StackMapTableState __smt)
		throws NullPointerException
	{
		if (__smt == null)
			throw new NullPointerException("NARG");
		
		Slot[] locals = this._locals;
		Slot[] stack = this._stack;
		
		// Copy locals
		for (int i = 0, n = locals.length; i < n; i++)
			locals[i]._type = __smt.getLocal(i).type();
		
		// Copy the stack
		int depth = __smt.depth();
		for (int i = 0; i < depth; i++)
			stack[i]._type = __smt.getStack(i).type();
		this._stacktop = depth;
	}
		
	/**
	 * Obtains the information in a local variable.
	 *
	 * @param __dx The local variable index.
	 * @return The result of the operation.
	 * @since 2019/02/16
	 */
	public final __StackResult__ localGet(int __dx)
	{
		Slot sl = this._locals[__dx];
		return new __StackResult__(sl._type, sl.register);
	}
	
	/**
	 * Sets the local variable to the given type.
	 *
	 * @param __dx The index to set.
	 * @param __t The type to store.
	 * @return The result of the operation.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public final __StackResult__ localSet(int __dx, JavaType __t)
		throws NullPointerException
	{
		if (__t == null)
			throw new NullPointerException("NARG");
		
		// Set base register
		Slot[] locals = this._locals;
		Slot sl;
		(sl = locals[__dx])._type = __t;
		
		// Set top for wide local?
		boolean wide;
		if ((wide = __t.isWide()))
			locals[__dx + 1]._type = __t.topType();
		
		// Just a narrow set
		return new __StackResult__(__t, sl.register);
	}
	
	/**
	 * Pops a single value from the stack.
	 *
	 * @return The result of the pop.
	 * @since 2019/02/16
	 */
	public final __StackResult__ stackPop()
	{
		int stacktop = this._stacktop;
		Slot[] stack = this._stack;
		
		// {@squirreljme.error AV03 Stack underflow.}
		if ((--stacktop) < 0)
			throw new InvalidClassFormatException("AV03");
		
		// Read from top of stack, also handle wide values
		Slot at = stack[stacktop];
		boolean wide;
		if ((wide = at._type.isTop()))
			at = stack[--stacktop];
		
		// Set new stack top
		this._stacktop = stacktop;
		
		return new __StackResult__(at._type, at.register);
	}
	
	/**
	 * Pushes the given type to the stack.
	 *
	 * @param __t The type to push.
	 * @return The result of the push.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public final __StackResult__ stackPush(JavaType __t)
		throws NullPointerException
	{
		if (__t == null)
			throw new NullPointerException("NARG");
		
		// {@squirreljme.error AV04 Stack overflow.}
		int stacktop = this._stacktop;
		Slot[] stack = this._stack;
		if (stacktop >= stack.length)
			throw new InvalidClassFormatException("AV04");
		
		// Just needs simple set of type
		Slot at = stack[stacktop];
		at._type = __t;
		
		// Set required top type
		boolean wide;
		if ((wide = __t.isWide()))
		{
			Slot top = stack[++stacktop];
			top._type = __t.topType();
		}
		
		// Store new top
		this._stacktop = stacktop + 1;
		
		// Build result
		return new __StackResult__(__t, at.register);
	}
	
	/**
	 * Represents a slot within Java locals or the stack.
	 *
	 * @since 2019/02/16
	 */
	public static final class Slot
	{
		/** Virtual register index. */
		protected final int register;
		
		/** The Java type stored here. */
		private JavaType _type;
		
		/**
		 * Initializes the slot.
		 *
		 * @param __vr The virtual register index.
		 * @since 2019/02/16
		 */
		private Slot(int __vr)
		{
			this.register = __vr;
		}
	}
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/register/__TempInstruction__.java.











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.classfile.register;

/**
 * Temporary instruction.
 *
 * @since 2019/03/16
 */
final class __TempInstruction__
{
}

Added runt/libs/tool-classfile/net/multiphasicapps/classfile/register/package-info.java.







































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

/**
 * This package contains all of the various classes and utilities which are
 * used to represent and manipulate register based codes.
 *
 * @since 2019/03/14
 */

package net.multiphasicapps.classfile.register;

Deleted runt/libs/tool-scrf/META-INF/MANIFEST.MF.

1
2
3
4
5
6
7
8
9
10
11
12
13
Manifest-Version: 1.0
X-SquirrelJME-UUID: a1202a0f-501e-41d3-a061-fc8015aac221
X-SquirrelJME-Error: AV
X-SquirrelJME-Name: SummerCoat Register Format
X-SquirrelJME-Vendor: Stephanie Gawroriski
X-SquirrelJME-Version: 0.3.0
X-SquirrelJME-Description: This contains the code needed to run and 
 parse files which contains a register compiled format for the 
 SummerCoat virtual machine. Class files are stored in a format which 
 may be cached for later loading of the virtual machine.
X-SquirrelJME-Depends: tool-classfile
Microedition-Configuration: CLDC-1.8-Compact

<
<
<
<
<
<
<
<
<
<
<
<
<


























Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/CodeLocation.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

/**
 * This represents a location within the IL code.
 *
 * @since 2019/02/23
 */
public final class CodeLocation
{
	/** The index of the instruction. */
	protected final int index;
	
	/** String representation. */
	private Reference<String> _string;
	
	/**
	 * Initializes the location.
	 *
	 * @param __i The index.
	 * @since 2019/02/23
	 */
	public CodeLocation(int __i)
	{
		this.index = __i;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/23
	 */
	@Override
	public final boolean equals(Object __o)
	{
		if (this == __o)
			return true;
		
		if (!(__o instanceof CodeLocation))
			return false;
		
		CodeLocation o = (CodeLocation)__o;
		return this.index == o.index;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/23
	 */
	@Override
	public final int hashCode()
	{
		return this.index;
	}
	
	/**
	 * Returns the index location.
	 *
	 * @return The index location.
	 * @since 2019/02/23
	 */
	public final int index()
	{
		return this.index;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/23
	 */
	@Override
	public final String toString()
	{
		Reference<String> ref = this._string;
		String rv;
		
		if (ref == null || null == (rv = ref.get()))
			this._string = new WeakReference<>((rv = "i@" + this.index));
		
		return rv;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/DynTableLocation.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

/**
 * This represents a position within the dynamic table of the current method.
 *
 * @since 2019/02/23
 */
public final class DynTableLocation
	implements MemoryLocation
{
	/** The index of the location. */
	protected final int index;
	
	/** String representation. */
	private Reference<String> _string;
	
	/**
	 * Initializes the location.
	 *
	 * @param __i The dynamic table address.
	 * @since 2019/02/24
	 */
	public DynTableLocation(int __i)
	{
		this.index = __i;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/24
	 */
	@Override
	public final boolean equals(Object __o)
	{
		if (this == __o)
			return true;
		
		if (!(__o instanceof DynTableLocation))
			return false;
		
		DynTableLocation o = (DynTableLocation)__o;
		return this.index == o.index;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/24
	 */
	@Override
	public final int hashCode()
	{
		return this.index;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/24
	 */
	@Override
	public final String toString()
	{
		Reference<String> ref = this._string;
		String rv;
		
		if (ref == null || null == (rv = ref.get()))
			this._string = new WeakReference<>((rv = "dt%" + this.index));
		
		return rv;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/ExportTable.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * Represents the export table that a class can provide.
 *
 * @since 2019/02/24
 */
public final class ExportTable
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/Exported.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * Interface to represent anything that is exported.
 *
 * @since 2019/02/24
 */
public interface Exported
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/ExportedMethod.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import net.multiphasicapps.classfile.MethodDescriptor;
import net.multiphasicapps.classfile.MethodFlags;
import net.multiphasicapps.classfile.MethodName;

/**
 * Represents a method which has been exported.
 *
 * @since 2019/02/24
 */
public final class ExportedMethod
	implements Exported
{
	/** Flags. */
	protected final MethodFlags flags;
	
	/** Name. */
	protected final MethodName name;
	
	/** Type. */
	protected final MethodDescriptor type;
	
	/** Code for the method. */
	protected final ILCode code;
	
	/**
	 * Initializes the exported method.
	 *
	 * @param __f The flags.
	 * @param __n The method name.
	 * @param __t The method type.
	 * @param __c The code, must be {@code null} if native/abstract.
	 * @throws NullPointerException On null arguments.
	 * @throws SummerFormatException If the native/abstract does not match
	 * {@code __c} being {@code null}.
	 * @since 2019/02/24
	 */
	public ExportedMethod(MethodFlags __f, MethodName __n,
		MethodDescriptor __t, ILCode __c)
		throws NullPointerException, SummerFormatException
	{
		if (__f == null || __n == null || __t == null)
			throw new NullPointerException("NARG");
		
		// {@squirreljme.error AV09 Abstract/native and code availability
		// mismatch. (The flags)}
		if ((__f.isAbstract() || __f.isNative()) != (__c == null))
			throw new SummerFormatException("AV09 " + __f);
		
		this.flags = __f;
		this.name = __n;
		this.type = __t;
		this.code = __c;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/FixedMemoryLocation.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

/**
 * This represents memory pointing to a fixed location.
 *
 * @since 2019/02/23
 */
public final class FixedMemoryLocation
	implements MemoryLocation
{
	/** The address of the location. */
	protected final long address;
	
	/** String representation. */
	private Reference<String> _string;
	
	/**
	 * Initializes the location.
	 *
	 * @param __p The memory address.
	 * @since 2019/02/23
	 */
	public FixedMemoryLocation(long __p)
	{
		this.address = __p;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/23
	 */
	@Override
	public final boolean equals(Object __o)
	{
		if (this == __o)
			return true;
		
		if (!(__o instanceof FixedMemoryLocation))
			return false;
		
		FixedMemoryLocation o = (FixedMemoryLocation)__o;
		return this.address == o.address;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/23
	 */
	@Override
	public final int hashCode()
	{
		long address = this.address;
		return (int)((address >>> 32) | address);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/23
	 */
	@Override
	public final String toString()
	{
		Reference<String> ref = this._string;
		String rv;
		
		if (ref == null || null == (rv = ref.get()))
			this._string = new WeakReference<>((rv =
				String.format("m@%x", this.address)));
		
		return rv;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/FixedMemoryOffset.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This is a memory offset which is at a fixed location.
 *
 * @since 2019/02/28
 */
public final class FixedMemoryOffset
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/ILCode.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This class stores the intermediate SummerCoat language.
 *
 * @since 2019/02/16
 */
public final class ILCode
{
	/** Instructions in this code. */
	private final ILInstruction[] _insts;
	
	/**
	 * Initializes the code.
	 *
	 * @param __i Input instructions.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public ILCode(ILInstruction[] __i)
		throws NullPointerException
	{
		if (__i == null)
			throw new NullPointerException("NARG");
		
		this._insts = (__i == null ? new ILInstruction[0] : __i.clone());
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/ILInstruction.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * Individual intermediate language instruction.
 *
 * @since 2019/02/23
 */
public final class ILInstruction
{
	/** The instruction type. */
	protected final ILInstructionType type;
	
	/** Arguments. */
	private final Object[] _args;
	
	/**
	 * Initializes the instruction.
	 *
	 * @param __type The instruction type.
	 * @param __args The instruction arguments.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/23
	 */
	public ILInstruction(ILInstructionType __type, Object... __args)
		throws NullPointerException
	{
		if (__type == null)
			throw new NullPointerException("NARG");
		
		this.type = __type;
		this._args = (__args == null ? new Object[0] : __args.clone());
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/ILInstructionType.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * Represents the type of instruction used.
 *
 * @since 2019/02/23
 */
public enum ILInstructionType
{
	/** No operation. */
	NOP,
	
	/** Copy. */
	COPY,
	
	/** Constant. */
	CONST,
	
	/** Invoke something. */
	INVOKE,
	
	/** Return from method. */
	RETURN,
	
	/** Goto to another instruction. */
	GOTO,
	
	/** Compare register against null. */
	IFPOINTERCONST,
	
	/** Read memory. */
	READ,
	
	/** Write memory. */
	WRITE,
	
	/** End. */
	;
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/ILPointerConstCompareType.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * Comparison type for a pointer against a constant.
 *
 * @since 2019/02/27
 */
public enum ILPointerConstCompareType
{
	/** Non-null. */
	NONNULL,
	
	/** Null. */
	NULL,
	
	/** End. */
	;
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/InvokeType.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This represents the type of invocation to perform.
 *
 * @since 2019/02/07
 */
public enum InvokeType
{
	/** Static method. */
	STATIC,
	
	/** Virtual method. */
	VIRTUAL,
	
	/** Interface method. */
	INTERFACE,
	
	/** Special invoke (private, constructor, or supermethod). */
	SPECIAL,
	
	/** End. */
	;
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/InvokedMethodReference.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import net.multiphasicapps.classfile.MethodReference;

/**
 * This represents an invoked method reference based on a reference to a
 * method.
 *
 * @since 2019/02/24
 */
public final class InvokedMethodReference
{
	/** The invocation type. */
	protected final InvokeType type;
	
	/** The method reference. */
	protected final MethodReference method;
	
	/**
	 * Initializes the reference.
	 *
	 * @param __t The invocation type.
	 * @param __m The method type.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public InvokedMethodReference(InvokeType __t, MethodReference __m)
		throws NullPointerException
	{
		if (__t == null || __m == null)
			throw new NullPointerException("NARG");
		
		this.type = __t;
		this.method = __m;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/24
	 */
	@Override
	public final boolean equals(Object __o)
	{
		if (this == __o)
			return true;
		
		if (!(__o instanceof InvokedMethodReference))
			return false;
		
		InvokedMethodReference o = (InvokedMethodReference)__o;
		return this.type == o.type &&
			this.method.equals(o.method);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/24
	 */
	@Override
	public final int hashCode()
	{
		return this.type.hashCode() ^
			this.method.hashCode();
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/Location.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This represents a location that points to some data either in a register,
 * some memory, or another kind of port.
 *
 * @since 2019/02/16
 */
public interface Location
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/MemoryLocation.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This represents a location which points to memory somewhere.
 *
 * @since 2019/02/23
 */
public interface MemoryLocation
	extends Location
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/MemoryOffset.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This interface represents a memory offset.
 *
 * @since 2019/02/28
 */
public interface MemoryOffset
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/MemoryType.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This represents a type which is used in memory which will change how
 * something be read or stored.
 *
 * @since 2019/02/03
 */
public enum MemoryType
{
	/** Byte (8-bit). */
	BYTE,
	
	/** Short (16-bit). */
	SHORT,
	
	/** Integer (32-bit). */
	INTEGER,
	
	/** Long (64-bit). */
	LONG,
	
	/** Pointer (varies in size). */
	POINTER,
	
	/** End. */
	;
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/RegisterLocation.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

/**
 * This represents a locatoin which points to a register or two registers if
 * a wide register.
 *
 * @since 2019/02/16
 */
public final class RegisterLocation
	implements Location
{
	/** The referenced register. */
	protected final int register;
	
	/** Is this a wide register (64-bit)? */
	protected final boolean iswide;
	
	/** String representation. */
	private Reference<String> _string;
	
	/**
	 * Initializes the location.
	 *
	 * @param __r The register to refer to.
	 * @since 2019/02/16
	 */
	public RegisterLocation(int __r)
	{
		this.register = __r;
		this.iswide = false;
	}
	
	/**
	 * Initializes the location which may be wide.
	 *
	 * @param __r The register to refer to.
	 * @param __w Is this a wide register?
	 * @since 2019/02/16
	 */
	public RegisterLocation(int __r, boolean __w)
	{
		this.register = __r;
		this.iswide = __w;
	}
	
	/**
	 * Returns this register as a narrow one.
	 *
	 * @return The narrow register.
	 * @since 2019/02/16
	 */
	public final RegisterLocation asNarrow()
	{
		return (this.iswide ? new RegisterLocation(this.register, false) :
			this);
	}
	
	/**
	 * Returns this register as a wide one.
	 *
	 * @return The wide register.
	 * @since 2019/02/16
	 */
	public final RegisterLocation asWide()
	{
		return (this.iswide ? this :
			new RegisterLocation(this.register, true));
	}
	
	/**
	 * Returns the wide state of this register according to the given flag.
	 *
	 * @param __w Return a wide register?
	 * @return The narrow or wide register.
	 * @since 2019/02/16
	 */
	public final RegisterLocation asWide(boolean __w)
	{
		return (__w ? this.asWide() : this.asNarrow());
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/16
	 */
	@Override
	public final boolean equals(Object __o)
	{
		if (this == __o)
			return true;
		
		if (!(__o instanceof RegisterLocation))
			return false;
		
		RegisterLocation o = (RegisterLocation)__o;
		return this.register == o.register &&
			this.iswide == o.iswide;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/16
	 */
	@Override
	public final int hashCode()
	{
		return this.register ^ (this.iswide ? -1 : 0);
	}
	
	/**
	 * Returns if this is wide or not.
	 *
	 * @return If this is wide or not.
	 * @since 2019/02/23
	 */
	public final boolean isWide()
	{
		return this.iswide;
	}
	
	/**
	 * Returns the base register.
	 *
	 * @return The base register.
	 * @since 2019/02/16
	 */
	public final int register()
	{
		return this.register;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/16
	 */
	@Override
	public final String toString()
	{
		Reference<String> ref = this._string;
		String rv;
		
		if (ref == null || null == (rv = ref.get()))
			this._string = new WeakReference<>((rv = (this.iswide ?
				"wr#" : "r#") + this.register));
		
		return rv;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































































































































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/RegisterLocationAsMemoryLocation.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This is used to treat a register as an address in memory.
 *
 * @since 2019/02/28
 */
public final class RegisterLocationAsMemoryLocation
	implements MemoryLocation
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/RegisterLocationAsMemoryOffset.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

/**
 * This treats a register location as a memory offset.
 *
 * @since 2019/02/28
 */
public final class RegisterLocationAsMemoryOffset
	implements MemoryOffset
{
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/StaticFieldReference.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import net.multiphasicapps.classfile.FieldReference;

/**
 * Reference to a static field.
 *
 * @since 2019/02/24
 */
public final class StaticFieldReference
	implements MemoryLocation
{
	/** The field this refers to. */
	protected final FieldReference fieldref;
	
	/**
	 * Initializes the field reference.
	 *
	 * @param __f The field to refer to.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public StaticFieldReference(FieldReference __f)
		throws NullPointerException
	{
		if (__f == null)
			throw new NullPointerException("NARG");
		
		this.fieldref = __f;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/24
	 */
	@Override
	public final boolean equals(Object __o)
	{
		if (this == __o)
			return true;
		
		if (!(__o instanceof StaticFieldReference))
			return false;
		
		return this.fieldref.equals(((StaticFieldReference)__o).fieldref);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/24
	 */
	@Override
	public final int hashCode()
	{
		return this.fieldref.hashCode();
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/SummerClass.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.scrf.classfile.ClassFileProcessor;

/**
 * This represents a SummerCoat class file.
 *
 * @since 2019/02/16
 */
public final class SummerClass
{
	/**
	 * Loads a SCRF class from the given normal Java class file.
	 *
	 * @param __cl The input class to convert.
	 * @return The resulting SummerCoat class.
	 * @throws NullPointerException On null arguments.
	 * @throws SummerFormatException If the input class is not correct or
	 * conversion was not possible.
	 * @since 2019/02/16
	 */
	public static final SummerClass ofClassFile(ClassFile __cl)
		throws NullPointerException, SummerFormatException
	{
		if (__cl == null)
			throw new NullPointerException("NARG");
		
		// Conversion could fail with a bad class format
		try
		{
			return new ClassFileProcessor(__cl).process();
		}
		
		// {@squirreljme.error AV02 Could not load standard Java class file
		// as a SummerCoat class due to a format error.}
		catch (InvalidClassFormatException e)
		{
			throw new SummerFormatException("AV02", e);
		}
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/SummerFormatException.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf;

import net.multiphasicapps.classfile.InvalidClassFormatException;

/**
 * This is thrown when the SummerCoat format is not correct.
 *
 * @since 2019/02/16
 */
public class SummerFormatException
	extends InvalidClassFormatException
{
	/**
	 * Initialize the exception with no message or cause.
	 *
	 * @since 2019/02/16
	 */
	public SummerFormatException()
	{
	}
	
	/**
	 * Initialize the exception with a message and no cause.
	 *
	 * @param __m The message.
	 * @since 2019/02/16
	 */
	public SummerFormatException(String __m)
	{
		super(__m);
	}
	
	/**
	 * Initialize the exception with a message and cause.
	 *
	 * @param __m The message.
	 * @param __c The cause.
	 * @since 2019/02/16
	 */
	public SummerFormatException(String __m, Throwable __c)
	{
		super(__m, __c);
	}
	
	/**
	 * Initialize the exception with no message and with a cause.
	 *
	 * @param __c The cause.
	 * @since 2019/02/16
	 */
	public SummerFormatException(Throwable __c)
	{
		super(__c);
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/building/DynTableBuilder.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.building;

import java.util.LinkedHashMap;
import java.util.Map;
import net.multiphasicapps.classfile.FieldReference;
import net.multiphasicapps.classfile.MethodReference;
import net.multiphasicapps.scrf.DynTableLocation;
import net.multiphasicapps.scrf.InvokedMethodReference;
import net.multiphasicapps.scrf.InvokeType;
import net.multiphasicapps.scrf.StaticFieldReference;

/**
 * This class is used to build the dynamic table which refers to locations
 * which are dynamically linked or determined at run-time.
 *
 * @since 2019/02/23
 */
public final class DynTableBuilder
{
	/** Dynamic table map. */
	private final Map<Object, Integer> _dyntable =
		new LinkedHashMap<>();
	
	/** The next index in the table. */
	private int _nextdx;
	
	/**
	 * Add object to the dynamic table.
	 *
	 * @param __v The value to add.
	 * @return The location of this entry.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public final DynTableLocation add(Object __v)
		throws NullPointerException
	{
		if (__v == null)
			throw new NullPointerException("NARG");
		
		// If it is already in the table, use that slot
		Map<Object, Integer> dyntable = this._dyntable;
		Integer pdx = dyntable.get(__v);
		if (pdx != null)
			return new DynTableLocation(pdx);
		
		// Push to dynamic table
		int dx = this._nextdx++;
		this._dyntable.put(__v, dx);
		
		// New location
		return new DynTableLocation(dx);
	}
	
	/**
	 * Add field reference.
	 *
	 * @param __s Refers to a static field?
	 * @param __f Reference of field.
	 * @return The location in the dynamic table.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public final DynTableLocation addField(boolean __s, FieldReference __f)
		throws NullPointerException
	{
		if (__f == null)
			throw new NullPointerException("NARG");
		
		if (__s)
			return this.add(new StaticFieldReference(__f));
		throw new todo.TODO();
	}
	
	/**
	 * Adds reference to another method based on a given invocation type.
	 *
	 * @param __t The type of invocation to perform.
	 * @param __m The reference to the method.
	 * @return The dynamic table location.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public final DynTableLocation addInvoke(InvokeType __t,
		MethodReference __m)
		throws NullPointerException
	{
		if (__t == null || __m == null)
			throw new NullPointerException("NARG");
		
		return this.add(new InvokedMethodReference(__t, __m));
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/building/ExportTableBuilder.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.building;

import java.util.LinkedHashMap;
import java.util.Map;
import net.multiphasicapps.classfile.MethodDescriptor;
import net.multiphasicapps.classfile.MethodFlags;
import net.multiphasicapps.classfile.MethodName;
import net.multiphasicapps.scrf.ILCode;
import net.multiphasicapps.scrf.Exported;
import net.multiphasicapps.scrf.ExportedMethod;
import net.multiphasicapps.scrf.SummerFormatException;

/**
 * This is used for building the export tabled.
 *
 * @since 2019/02/24
 */
public final class ExportTableBuilder
{
	/** Exported objects. */
	private final Map<Integer, Exported> _exports =
		new LinkedHashMap<>();
	
	/** Next index. */
	private int _nextdx;
	
	/**
	 * Adds a single export.
	 *
	 * @param __e The export.
	 * @return {@code __e}.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public final Exported add(Exported __e)
		throws NullPointerException
	{
		if (__e == null)
			throw new NullPointerException("NARG");
		
		// Map it
		int dx = this._nextdx++;
		this._exports.put(dx, __e);
		
		return __e;
	}
	
	/**
	 * Adds an exported method.
	 *
	 * @param __f The flags.
	 * @param __n The method name.
	 * @param __t The method type.
	 * @param __c The code, must be {@code null} if native/abstract.
	 * @throws NullPointerException On null arguments.
	 * @throws SummerFormatException If the native/abstract does not match
	 * {@code __c} being {@code null}.
	 * @since 2019/02/24
	 */
	public ExportedMethod addMethod(MethodFlags __f, MethodName __n,
		MethodDescriptor __t, ILCode __c)
		throws NullPointerException, SummerFormatException
	{
		if (__f == null || __n == null || __t == null)
			throw new NullPointerException("NARG");
		
		return (ExportedMethod)this.add(
			new ExportedMethod(__f, __n, __t, __c));
	}
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/building/ILCodeBuilder.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.building;

import java.util.LinkedHashMap;
import java.util.Map;
import net.multiphasicapps.scrf.CodeLocation;
import net.multiphasicapps.scrf.DynTableLocation;
import net.multiphasicapps.scrf.FixedMemoryLocation;
import net.multiphasicapps.scrf.ILCode;
import net.multiphasicapps.scrf.ILInstruction;
import net.multiphasicapps.scrf.ILInstructionType;
import net.multiphasicapps.scrf.ILPointerConstCompareType;
import net.multiphasicapps.scrf.MemoryLocation;
import net.multiphasicapps.scrf.RegisterLocation;
import net.multiphasicapps.scrf.SummerFormatException;

/**
 * This class is used to store the generated instructions for the intermediate
 * language code.
 *
 * @since 2019/02/17
 */
public final class ILCodeBuilder
{
	/** Added instructions. */
	private final Map<Integer, ILInstruction> _code =
		new LinkedHashMap<>();
	
	/** Next address. */
	private int _nextaddr;
	
	/**
	 * Initializes the code builder at the default address (zero).
	 *
	 * @since 2019/02/27
	 */
	public ILCodeBuilder()
	{
		this(0);
	}
	
	/**
	 * Initializes the code builder which starts at the given address.
	 *
	 * @param __start The start address.
	 * @since 2019/02/27
	 */
	public ILCodeBuilder(int __start)
	{
		this._nextaddr = __start;
	}
	
	/**
	 * Adds a single instruction.
	 *
	 * @param __type The instruction type.
	 * @param __args Arguments.
	 * @return The location in the code.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/23
	 */
	public final CodeLocation add(ILInstructionType __type, Object... __args)
		throws NullPointerException
	{
		if (__type == null)
			throw new NullPointerException("NARG");
		
		// Calculate instruction address
		int now = this._nextaddr++;
		this._code.put(now, new ILInstruction(__type, __args));
		
		// Return resulting address
		return new CodeLocation(now);
	}
	
	/**
	 * Adds constant reference.
	 *
	 * @param __dest Destination register.
	 * @param __v The value to store.
	 * @return The index of the added instruction.
	 * @throws NullPointerException On null arguments.
	 * @throws SummerFormatException If the value is not valid.
	 * @since 2019/02/23
	 */
	public final CodeLocation addConst(RegisterLocation __dest, Object __v)
		throws NullPointerException, SummerFormatException
	{
		if (__dest == null || __v == null)
			throw new NullPointerException("NARG");
		
		// {@squirreljme.error AV07 Wide value cannot be placed in a narrow
		// register. (The destination; The value)}
		if ((__v instanceof Long || __v instanceof Double) &&
			!__dest.isWide())
			throw new SummerFormatException(String.format(
				"AV07 %s %s", __dest, __v));
		
		// {@squirreljme.error AV08 Cannot set register to constant value
		// because it's value is not actually constant.}
		if (!(__v instanceof Integer ||
			__v instanceof Long ||
			__v instanceof Float ||
			__v instanceof Double ||
			__v instanceof FixedMemoryLocation))
			throw new SummerFormatException("AV08 " + __v);
		
		// Generate
		return this.add(ILInstructionType.CONST, __dest, __v);
	}
	
	/**
	 * Adds a copy from one location to another.
	 *
	 * @param __to The destination to copy to.
	 * @param __from The source to copy from.
	 * @return The location of the added instruction.
	 * @throws NullPointerException On null arguments.
	 * @throws SummerFormatException If the copy is not valid.
	 * @since 2019/02/23
	 */
	public final CodeLocation addCopy(RegisterLocation __to,
		RegisterLocation __from)
		throws NullPointerException, SummerFormatException
	{
		if (__from == null || __to == null)
			throw new NullPointerException("NARG");
		
		// {@squirreljme.error AV06 Invalid copy. (Source; Destination)}
		if (__from.isWide() != __to.isWide() ||
			__from.equals(__to))
			throw new SummerFormatException("AV06 " + __from + " " + __to);
		
		return this.add(ILInstructionType.COPY, __from, __to);
	}
	
	/**
	 * Adds unconditional jump to location.
	 *
	 * @param __l The target location.
	 * @return The generated address.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/27
	 */
	public final CodeLocation addGoto(CodeLocation __l)
		throws NullPointerException
	{
		if (__l == null)
			throw new NullPointerException("NARG");
		
		return this.add(ILInstructionType.GOTO, __l);
	}
	
	/**
	 * Adds pointer comparison to constant pointer.
	 *
	 * @param __ct The constant pointer to compare against.
	 * @param __a The register to check.
	 * @param __jt Branch target if the condition is true.
	 * @return The location of this code.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/27
	 */
	public final CodeLocation addIfPointerConst(ILPointerConstCompareType __ct,
		RegisterLocation __a, CodeLocation __jt)
		throws NullPointerException
	{
		if (__ct == null || __a == null || __jt == null)
			throw new NullPointerException("NARG");
		
		return this.add(ILInstructionType.IFPOINTERCONST, __ct, __a, __jt);
	}
	
	/**
	 * Adds invocation for adding.
	 *
	 * @param __l Location of the reference in the dynamic table.
	 * @param __rv The return register.
	 * @param __args Arguments to the method call.
	 * @return The location of the instruction in code.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public final CodeLocation addInvoke(DynTableLocation __l,
		RegisterLocation __rv, RegisterLocation... __args)
		throws NullPointerException
	{
		if (__l == null || __rv == null || __args == null)
			throw new NullPointerException("NARG");
		
		return this.add(ILInstructionType.INVOKE, __l, __rv, __args);
	}
	
	/**
	 * Adds a read from memory to the given destination.
	 *
	 * @param __dest The destination register.
	 * @param __src The source memory location.
	 * @param __off Offset from the source address.
	 * @return The code location.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public final CodeLocation addRead(RegisterLocation __dest,
		MemoryLocation __src, MemoryOffset __off)
		throws NullPointerException
	{
		if (__dest == null || __src == null || __off == null)
			throw new NullPointerException("NARG");
		
		return this.add(ILInstructionType.READ, __dest, __src, __off);
	}
	
	/**
	 * Adds return from method.
	 *
	 * @param __rv The register to return from.
	 * @return The resulting code location.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public final CodeLocation addReturn(RegisterLocation __rv)
		throws NullPointerException
	{
		if (__rv == null)
			throw new NullPointerException("NARG");
		
		return this.add(ILInstructionType.RETURN, __rv);
	}
	
	/**
	 * Adds a write from a register to a given destination.
	 *
	 * @param __dest The destination memory location.
	 * @param __off Offset from the destination.
	 * @param __src The source register.
	 * @return The code location.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	public final CodeLocation addWrite(MemoryLocation __dest,
		MemoryOffset __off, RegisterLocation __src)
		throws NullPointerException
	{
		if (__dest == null || __off == null || __src == null)
			throw new NullPointerException("NARG");
		
		return this.add(ILInstructionType.WRITE, __dest, __off, __src);
	}
	
	/**
	 * Appends all of the instructions from another code builder to this one.
	 *
	 * @param __il The other code builder to append from.
	 * @return {@code this}.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/27
	 */
	public final ILCodeBuilder append(ILCodeBuilder __il)
		throws NullPointerException
	{
		if (__il == null)
			throw new NullPointerException("NARG");
		
		throw new todo.TODO();
	}
	
	/**
	 * Appends all of the instructions from another code to this one.
	 *
	 * @param __il The other code to append from.
	 * @return {@code this}.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/27
	 */
	public final ILCodeBuilder append(ILCode __il)
		throws NullPointerException
	{
		if (__il == null)
			throw new NullPointerException("NARG");
		
		throw new todo.TODO();
	}
	
	/**
	 * Builds the resulting code.
	 *
	 * @return The resulting code.
	 * @since 2019/09/24
	 */
	public final ILCode build()
	{
		return new ILCode(this._code.values().<ILInstruction>toArray(
			new ILInstruction[this._nextaddr]));
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































































































































































































































































































































































































































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/building/package-info.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

/**
 * This package contains all of the utilities which are used to build
 * SummerCoat classes, this is used by the various loaders and such.
 *
 * @since 2019/02/16
 */

package net.multiphasicapps.scrf.building;

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/classfile/ClassFileProcessor.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.classfile;

import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.Method;
import net.multiphasicapps.classfile.MethodFlags;
import net.multiphasicapps.scrf.building.DynTableBuilder;
import net.multiphasicapps.scrf.building.ExportTableBuilder;
import net.multiphasicapps.scrf.ILCode;
import net.multiphasicapps.scrf.SummerClass;
import net.multiphasicapps.scrf.SummerFormatException;

/**
 * This is used to actually process the class file to the SummerCoat class
 * format.
 *
 * @since 2019/02/16
 */
public final class ClassFileProcessor
{
	/** The classfile to process. */
	protected final ClassFile input;
	
	/** Dynamic table builder for this class. */
	protected final DynTableBuilder dyntable =
		new DynTableBuilder();
	
	/** Builder for the export table. */
	protected final ExportTableBuilder exports =
		new ExportTableBuilder();
	
	/**
	 * Initializes the processor.
	 *
	 * @param __cl The class to convert.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public ClassFileProcessor(ClassFile __cl)
		throws NullPointerException
	{
		if (__cl == null)
			throw new NullPointerException("NARG");
		
		this.input = __cl;
	}
	
	/**
	 * Performs the processing.
	 *
	 * @return The resulting SummerCoat class.
	 * @throws SummerFormatException If the class could not be converted.
	 * @since 2019/02/16
	 */
	public final SummerClass process()
		throws SummerFormatException
	{
		DynTableBuilder dyntable = this.dyntable;
		ExportTableBuilder exports = this.exports;
		
		// Process each method
		for (Method m : input.methods())
		{
			// Intermediate code for this method
			ILCode ilc = null;
			
			// Process byte code in the method
			MethodFlags mf = m.flags();
			if (!mf.isNative() && !mf.isAbstract())
				ilc = new MethodProcessor(this, m).process();
			
			// Add method to export
			exports.addMethod(mf, m.name(), m.type(), ilc);
		}
		
		throw new todo.TODO();
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/classfile/JavaState.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.classfile;

import net.multiphasicapps.classfile.JavaType;
import net.multiphasicapps.classfile.StackMapTableState;
import net.multiphasicapps.scrf.CodeLocation;
import net.multiphasicapps.scrf.RegisterLocation;
import net.multiphasicapps.scrf.SummerFormatException;

/**
 * This class contains the state of the Java stack, it gets initialized to
 * a format which is used for conversion to SummerCoat.
 *
 * @since 2019/02/16
 */
public final class JavaState
{
	/** Local variables. */
	private final Slot[] _locals;
	
	/** Stack variables. */
	private final Slot[] _stack;
	
	/** The current top of the stack. */
	private int _stacktop;
	
	/**
	 * Initializes the base Java state.
	 *
	 * @param __nl The number of local variables.
	 * @param __ns The number of stack variables.
	 * @since 2019/02/16
	 */
	public JavaState(int __nl, int __ns)
	{
		// Virtual register index counter
		int vr = 2;
		
		// Initialize locals
		Slot[] locals = new Slot[__nl];
		for (int i = 0; i < __nl; i++)
			locals[i] = new Slot(vr++);
		this._locals = locals;
		
		// Initialize stack
		Slot[] stack = new Slot[__ns];
		for (int i = 0; i < __ns; i++)
			stack[i] = new Slot(vr++);
		this._stack = stack;
	}
	
	/**
	 * Loads the Java state from the given stack map table state.
	 *
	 * @param __smt The state to read from.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public final void fromState(StackMapTableState __smt)
		throws NullPointerException
	{
		if (__smt == null)
			throw new NullPointerException("NARG");
		
		Slot[] locals = this._locals;
		Slot[] stack = this._stack;
		
		// Copy locals
		for (int i = 0, n = locals.length; i < n; i++)
			locals[i]._type = __smt.getLocal(i).type();
		
		// Copy the stack
		int depth = __smt.depth();
		for (int i = 0; i < depth; i++)
			stack[i]._type = __smt.getStack(i).type();
		this._stacktop = depth;
	}
		
	/**
	 * Obtains the information in a local variable.
	 *
	 * @param __dx The local variable index.
	 * @return The result of the operation.
	 * @since 2019/02/16
	 */
	public final JavaStateResult localGet(int __dx)
	{
		Slot sl = this._locals[__dx];
		return new JavaStateResult(sl._type,
			sl.register.asWide(sl._type.isWide()));
	}
	
	/**
	 * Sets the local variable to the given type.
	 *
	 * @param __dx The index to set.
	 * @param __t The type to store.
	 * @return The result of the operation.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public final JavaStateResult localSet(int __dx, JavaType __t)
		throws NullPointerException
	{
		if (__t == null)
			throw new NullPointerException("NARG");
		
		// Set base register
		Slot[] locals = this._locals;
		Slot sl;
		(sl = locals[__dx])._type = __t;
		
		// Set top for wide local?
		boolean wide;
		if ((wide = __t.isWide()))
			locals[__dx + 1]._type = __t.topType();
		
		// Just a narrow set
		return new JavaStateResult(__t, sl.register.asWide(wide));
	}
	
	/**
	 * Pops a single value from the stack.
	 *
	 * @return The result of the pop.
	 * @since 2019/02/16
	 */
	public final JavaStateResult stackPop()
	{
		int stacktop = this._stacktop;
		Slot[] stack = this._stack;
		
		// {@squirreljme.error AV03 Stack underflow.}
		if ((--stacktop) < 0)
			throw new SummerFormatException("AV03");
		
		// Read from top of stack, also handle wide values
		Slot at = stack[stacktop];
		boolean wide;
		if ((wide = at._type.isTop()))
			at = stack[--stacktop];
		
		// Set new stack top
		this._stacktop = stacktop;
		
		return new JavaStateResult(at._type, at.register.asWide(wide));
	}
	
	/**
	 * Pushes the given type to the stack.
	 *
	 * @param __t The type to push.
	 * @return The result of the push.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public final JavaStateResult stackPush(JavaType __t)
		throws NullPointerException
	{
		if (__t == null)
			throw new NullPointerException("NARG");
		
		// {@squirreljme.error AV04 Stack overflow.}
		int stacktop = this._stacktop;
		Slot[] stack = this._stack;
		if (stacktop >= stack.length)
			throw new SummerFormatException("AV04");
		
		// Just needs simple set of type
		Slot at = stack[stacktop];
		at._type = __t;
		
		// Set required top type
		boolean wide;
		if ((wide = __t.isWide()))
		{
			Slot top = stack[++stacktop];
			top._type = __t.topType();
		}
		
		// Store new top
		this._stacktop = stacktop + 1;
		
		// Build result
		return new JavaStateResult(__t, at.register.asWide(wide));
	}
	
	/**
	 * Represents a slot within Java locals or the stack.
	 *
	 * @since 2019/02/16
	 */
	public static final class Slot
	{
		/** Virtual register index. */
		protected final RegisterLocation register;
		
		/** The Java type stored here. */
		private JavaType _type;
		
		/**
		 * Initializes the slot.
		 *
		 * @param __vr The virtual register index.
		 * @since 2019/02/16
		 */
		private Slot(int __vr)
		{
			this.register = new RegisterLocation(__vr);
		}
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































































































































































































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/classfile/JavaStateResult.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.classfile;

import net.multiphasicapps.classfile.JavaType;
import net.multiphasicapps.scrf.RegisterLocation;

/**
 * This contains the result of the operation when a push or pop has been
 * performed. Since pushing/popping is complicated and will involve
 * information on the type and registers, this is needed to
 * simplify the design of the processor.
 *
 * @since 2019/02/23
 */
public final class JavaStateResult
{
	/** The Java type which is involved here. */
	public final JavaType type;
	
	/** The register used. */
	public final RegisterLocation register;
	
	/**
	 * Initializes the result.
	 *
	 * @param __jt The Java type.
	 * @param __rl The register location.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public JavaStateResult(JavaType __jt, RegisterLocation __rl)
		throws NullPointerException
	{
		if (__jt == null || __rl == null)
			throw new NullPointerException("NARG");
		
		this.type = __jt;
		this.register = __rl;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/classfile/MethodProcessor.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.scrf.classfile;

import net.multiphasicapps.classfile.ByteCode;
import net.multiphasicapps.classfile.FieldDescriptor;
import net.multiphasicapps.classfile.FieldReference;
import net.multiphasicapps.classfile.Instruction;
import net.multiphasicapps.classfile.InstructionIndex;
import net.multiphasicapps.classfile.InstructionJumpTarget;
import net.multiphasicapps.classfile.JavaType;
import net.multiphasicapps.classfile.Method;
import net.multiphasicapps.classfile.MethodDescriptor;
import net.multiphasicapps.classfile.MethodReference;
import net.multiphasicapps.classfile.StackMapTable;
import net.multiphasicapps.classfile.StackMapTableState;
import net.multiphasicapps.scrf.building.DynTableBuilder;
import net.multiphasicapps.scrf.building.ILCodeBuilder;
import net.multiphasicapps.scrf.CodeLocation;
import net.multiphasicapps.scrf.FixedMemoryLocation;
import net.multiphasicapps.scrf.ILCode;
import net.multiphasicapps.scrf.ILPointerConstCompareType;
import net.multiphasicapps.scrf.InvokeType;
import net.multiphasicapps.scrf.RegisterLocation;

/**
 * This is used to process a single method within a class file.
 *
 * @since 2019/02/16
 */
public final class MethodProcessor
{
	/** The owning processor. */
	protected final ClassFileProcessor classprocessor;
	
	/** Dynamic table builder. */
	protected final DynTableBuilder dyntable;
	
	/** The method to process. */
	protected final Method input;
	
	/** The input byte code. */
	protected final ByteCode bytecode;
	
	/** Where all the code will be placed. */
	protected final ILCodeBuilder codebuilder =
		new ILCodeBuilder();
	
	/** Code builder for exceptions. */
	protected final ILCodeBuilder exceptionbuilder;
	
	/** The stack map table. */
	protected final StackMapTable stackmap;
	
	/** The Java register/stack state. */
	protected final JavaState state;
	
	/** This flag specifies whether something may cause an exception. */
	private boolean _mightexception;
	
	/**
	 * Initializes the method processor.
	 *
	 * @param __cp The class processor.
	 * @param __in The input method.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/16
	 */
	public MethodProcessor(ClassFileProcessor __cp, Method __in)
		throws NullPointerException
	{
		if (__cp == null || __in == null)
			throw new NullPointerException("NARG");
		
		this.classprocessor = __cp;
		this.input = __in;
		this.dyntable = __cp.dyntable;
		
		// Pre-load these since they are checked for every instruction
		ByteCode bc;
		this.bytecode = (bc = __in.byteCode());
		this.stackmap = bc.stackMapTable();
		this.state = new JavaState(bc.maxLocals(), bc.maxStack());
		
		// The exception handlers are built from tables to code at the end
		// of the normal instructions
		this.exceptionbuilder = new ILCodeBuilder(bc.instructionCount());
	}
	
	/**
	 * Processes the given method.
	 *
	 * @return The resulting method code.
	 * @since 2019/02/16
	 */
	public final ILCode process()
	{
		ByteCode bytecode = this.bytecode;
		StackMapTable stackmap = this.stackmap;
		JavaState state = this.state;
		
		// Process each instruction
		for (Instruction inst : bytecode)
		{
			// Debug
			todo.DEBUG.note("Instruction: %s", inst);
			
			// If there is a defined stack map table state (this will be for
			// any kind of branch or exception handler), load that so it can
			// be worked from
			StackMapTableState smts = stackmap.get(inst.address());
			if (smts != null)
				state.fromState(smts);
			
			// Process instruction
			this.__processInstruction(inst);
		}
		
		// If any instruction could generate an exception, if so append the
		// exception handler code accordingly. But if an exception is not
		// possible ever then no table will ever be appended.
		ILCodeBuilder codebuilder = this.codebuilder;
		if (this._mightexception)
			codebuilder.append(this.exceptionbuilder);
		
		// Build the code now
		return codebuilder.build();
	}
	
	/**
	 * Processes the given instruction converting into intermediate code.
	 *
	 * @param __i The instruction to process.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/17
	 */
	private final void __processInstruction(Instruction __i)
		throws NullPointerException
	{
		if (__i == null)
			throw new NullPointerException("NARG");
		
		// Needed to store instruction data
		ByteCode bytecode = this.bytecode;
		ILCodeBuilder codebuilder = this.codebuilder;
		
		// Depends on the operation to process
		int op;
		switch ((op = __i.operation()))
		{
				// Load null reference
			case InstructionIndex.ACONST_NULL:
				this.__runConst(new JavaType(
					new FieldDescriptor("Ljava/lang/Object;")),
					new FixedMemoryLocation(0));
				break;
				
				// Load reference
			case InstructionIndex.ALOAD_0:
			case InstructionIndex.ALOAD_1:
			case InstructionIndex.ALOAD_2:
			case InstructionIndex.ALOAD_3:
				this.__runLoad(op - InstructionIndex.ALOAD_0);
				break;
				
				// Read instance field
			case InstructionIndex.GETFIELD:
				this.__runGetField(false, __i.<FieldReference>argument(0,
					FieldReference.class));
				break;
				
				// Read static field
			case InstructionIndex.GETSTATIC:
				this.__runGetField(true, __i.<FieldReference>argument(0,
					FieldReference.class));
				break;
				
				// Goto address
			case InstructionIndex.GOTO:
				codebuilder.addGoto(new CodeLocation(bytecode.addressToIndex(
					__i.<InstructionJumpTarget>argument(0,
					InstructionJumpTarget.class).target())));
				break;
				
				// Integer Constant
			case InstructionIndex.ICONST_M1:
			case InstructionIndex.ICONST_0:
			case InstructionIndex.ICONST_1:
			case InstructionIndex.ICONST_2:
			case InstructionIndex.ICONST_3:
			case InstructionIndex.ICONST_4:
			case InstructionIndex.ICONST_5:
				this.__runConst(JavaType.INTEGER,
					(-1) + (op -  InstructionIndex.ICONST_M1));
				break;
				
				// If not-null, branch
			case InstructionIndex.IFNONNULL:
				this.__runIfPointerConst(ILPointerConstCompareType.NONNULL,
					__i.<InstructionJumpTarget>argument(0,
					InstructionJumpTarget.class));
				break;
				
				// If null, branch
			case InstructionIndex.IFNULL:
				this.__runIfPointerConst(ILPointerConstCompareType.NULL,
					__i.<InstructionJumpTarget>argument(0,
					InstructionJumpTarget.class));
				break;
				
				// Invoke special method
			case InstructionIndex.INVOKESPECIAL:
				this.__runInvoke(InvokeType.SPECIAL, __i.
					<MethodReference>argument(0, MethodReference.class));
				break;
				
				// Invoke static method
			case InstructionIndex.INVOKESTATIC:
				this.__runInvoke(InvokeType.STATIC, __i.
					<MethodReference>argument(0, MethodReference.class));
				break;
				
				// Put instance field
			case InstructionIndex.PUTFIELD:
				this.__runPutField(false, __i.<FieldReference>argument(0,
					FieldReference.class));
				break;
				
				// Put static field
			case InstructionIndex.PUTSTATIC:
				this.__runPutField(true, __i.<FieldReference>argument(0,
					FieldReference.class));
				break;
				
				// Return from method
			case InstructionIndex.RETURN:
				codebuilder.addReturn(new RegisterLocation(-1));
				break;
			
				// {@squirreljme.error AV05 Unhandled instruction. (The
				// instruction)}
			default:
				throw new RuntimeException("AV05 " + __i);
		}
	}
	
	/**
	 * Pushes the given constant value to the stack.
	 *
	 * @param __t The type to push.
	 * @param __v The value to push.
	 * @return The code location.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/23
	 */
	private final CodeLocation __runConst(JavaType __t, Object __v)
		throws NullPointerException
	{
		if (__t == null || __v == null)
			throw new NullPointerException("NARG");
		
		// Push and generate instruction
		return this.codebuilder.addConst(this.state.stackPush(__t).register,
			__v);
	}
	
	/**
	 * Handles get of field.
	 *
	 * @param __s Is this static?
	 * @param __f Field reference.
	 * @return The location of added code.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	private final CodeLocation __runGetField(boolean __s, FieldReference __f)
		throws NullPointerException
	{
		if (__f == null)
			throw new NullPointerException("NARG");
		
		// Always will be pushed
		RegisterLocation dest = this.state.stackPush(new JavaType(
			__f.memberType())).register;
		
		// Static field is an absolute address, while instance fields are
		// always relative
		if (__s)
			return this.codebuilder.addRead(dest,
				this.dyntable.addField(__s, __f));
		throw new todo.TODO();
	}
	
	/**
	 * Compares a pointer against a constant and potentially jumps.
	 *
	 * @param __jt Jump target.
	 * @return The location of the added instruction.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/27
	 */
	private final CodeLocation __runIfPointerConst(
		ILPointerConstCompareType __ct, InstructionJumpTarget __jt)
		throws NullPointerException
	{
		if (__ct == null || __jt == null)
			throw new NullPointerException("NARG");
		
		return this.codebuilder.addIfPointerConst(__ct,
			this.state.stackPop().register, new CodeLocation(
			this.bytecode.addressToIndex(__jt.target())));
	}
	
	/**
	 * Handles invocation of a method reference.
	 *
	 * @param __t The type of invocation to perform.
	 * @param __m The target method.
	 * @return The location of the added code.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	private final CodeLocation __runInvoke(InvokeType __t, MethodReference __m)
		throws NullPointerException
	{
		if (__t == null || __m == null)
			throw new NullPointerException("NARG");
		
		JavaState state = this.state;
		
		// Pop all method arguments from the stack to determine what to pass to
		// the method argument size
		MethodDescriptor md = __m.memberType();
		int nargs = md.argumentCount() + (__t == InvokeType.STATIC ? 0 : 1);
		RegisterLocation[] args = new RegisterLocation[nargs];
		for (int i = nargs - 1; i >= 0; i--)
			args[i] = state.stackPop().register;
		
		// If there is a return value then push an extra thing to the stack
		RegisterLocation rv = (md.hasReturnValue() ?
			state.stackPush(new JavaType(md.returnValue())).register :
			new RegisterLocation(-1));
		
		// Invoke this method
		return this.codebuilder.addInvoke(this.dyntable.addInvoke(__t, __m),
			rv, args);
	}
	
	/**
	 * Loads from local variable.
	 *
	 * @param __from The variable to load from.
	 * @return The location of the added code.
	 * @since 2019/02/17
	 */
	private final CodeLocation __runLoad(int __from)
	{
		// Need to read local variable
		JavaState state = this.state;
		JavaStateResult lf = state.localGet(__from);
		
		// And additionally push it to the stack
		JavaStateResult sp = state.stackPush(lf.type);
		
		// Add copy operation
		return this.codebuilder.addCopy(sp.register, lf.register);
	}
	
	/**
	 * Handles put of field.
	 *
	 * @param __s Is this static?
	 * @param __f Field reference.
	 * @return The location of added code.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/24
	 */
	private final CodeLocation __runPutField(boolean __s, FieldReference __f)
		throws NullPointerException
	{
		if (__f == null)
			throw new NullPointerException("NARG");
		
		// Pop something
		RegisterLocation src = this.state.stackPop().register;
		
		// Static field is an absolute address, while instance fields are
		// always relative
		if (__s)
			return this.codebuilder.addWrite(this.dyntable.addField(__s, __f),
				src);
		throw new todo.TODO();
	}
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































































































































































































































































































































































































































































































































































































































































































































































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/classfile/package-info.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

/**
 * This package contains the converters for the standard Java class file
 * format. The main purpose is to make using SummerCoat Classes seamless in
 * their usage across compilers and virtual machines.
 *
 * @since 2019/02/16
 */

package net.multiphasicapps.scrf.classfile;

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































Deleted runt/libs/tool-scrf/net/multiphasicapps/scrf/package-info.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

/**
 * This package contains the definitions and readers for the SummerCoat
 * Register Format, this is a binary and simplified class format which uses
 * registers instead of a stack. This generally should be faster than stack
 * based pure interpreters.
 *
 * @since 2019/01/10
 */

package net.multiphasicapps.scrf;

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































Changes to test/libs/tac/net/multiphasicapps/tac/TestStatus.java.

24
25
26
27
28
29
30



31
32
33
34
35
	FAILED,
	
	/** Failed due to test exception. */
	TEST_EXCEPTION,
	
	/** Test was not run yet. */
	NOT_RUN,



	
	/** End. */
	;
}








>
>
>





24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
	FAILED,
	
	/** Failed due to test exception. */
	TEST_EXCEPTION,
	
	/** Test was not run yet. */
	NOT_RUN,
	
	/** Untestable. */
	UNTESTABLE,
	
	/** End. */
	;
}

Added test/libs/tac/net/multiphasicapps/tac/UntestableException.java.



































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
//     Copyright (C) Multi-Phasic Applications <multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.tac;

/**
 * This is thrown when the test cannot be ran perhaps due to lack of support
 * or otherwise a virtual machine which does not support things.
 *
 * @since 2019/03/04
 */
public class UntestableException
	extends RuntimeException
{
	/**
	 * Initialize the exception with no message or cause.
	 *
	 * @since 2019/03/04
	 */
	public UntestableException()
	{
	}
	
	/**
	 * Initialize the exception with a message and no cause.
	 *
	 * @param __m The message.
	 * @since 2019/03/04
	 */
	public UntestableException(String __m)
	{
		super(__m);
	}
	
	/**
	 * Initialize the exception with a message and cause.
	 *
	 * @param __m The message.
	 * @param __c The cause.
	 * @since 2019/03/04
	 */
	public UntestableException(String __m, Throwable __c)
	{
		super(__m, __c);
	}
	
	/**
	 * Initialize the exception with no message and with a cause.
	 *
	 * @param __c The cause.
	 * @since 2019/03/04
	 */
	public UntestableException(Throwable __c)
	{
		super(__c);
	}
}

Changes to test/libs/tac/net/multiphasicapps/tac/__CoreTest__.java.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
..
51
52
53
54
55
56
57
















58
59
60
61
62
63
64
...
136
137
138
139
140
141
142















143
144
145
146
147
148
149
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.tac;


import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
................................................................................
	 * @param __args The arguments to the test.
	 * @return The result of the test.
	 * @throws Throwable On any thrown exception.
	 * @since 2018/10/06
	 */
	abstract Object __runTest(Object... __args)
		throws Throwable;
















	
	/**
	 * {@inheritDoc}
	 * @since 2018/10/06
	 */
	@Override
	protected final void destroyApp(boolean __u)
................................................................................
				// Ignore, oh well
			}
			
			// Run the test
			rv = this.__runTest(args);
			thrown = new __NoExceptionThrown__();
		}















		catch (Throwable t)
		{
			// The test parameter is not valid, so whoops!
			if (t instanceof InvalidTestException)
			{
				// Exception was thrown
				this._status = TestStatus.TEST_EXCEPTION;







>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package net.multiphasicapps.tac;

import cc.squirreljme.runtime.cldc.lang.ApiLevel;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
................................................................................
	 * @param __args The arguments to the test.
	 * @return The result of the test.
	 * @throws Throwable On any thrown exception.
	 * @since 2018/10/06
	 */
	abstract Object __runTest(Object... __args)
		throws Throwable;
	
	/**
	 * Tests the minimum API level.
	 *
	 * @param __lv The level to test.
	 * @throws InvalidTestException If the API level is not met.
	 * @since 2019/03/14
	 */
	public final void checkApiLevel(int __lv)
		throws InvalidTestException
	{
		// {@squirreljme.error BU0b Minimum API level has not been met.
		// (The required API level)}
		if (!ApiLevel.minimumLevel(__lv))
			throw new InvalidTestException(String.format("BU0b %x", __lv));
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2018/10/06
	 */
	@Override
	protected final void destroyApp(boolean __u)
................................................................................
				// Ignore, oh well
			}
			
			// Run the test
			rv = this.__runTest(args);
			thrown = new __NoExceptionThrown__();
		}
		
		// Cannot be tested
		catch (UntestableException e)
		{
			// {@squirreljme.error BU0d Test could not be ran.
			// (The given test)}
			System.err.printf("BU0d %s%n", classname);
			e.printStackTrace(System.err);
			
			// Cannot be tested so it shall fail
			this._status = TestStatus.UNTESTABLE;
			return;
		}
		
		// Test failure
		catch (Throwable t)
		{
			// The test parameter is not valid, so whoops!
			if (t instanceof InvalidTestException)
			{
				// Exception was thrown
				this._status = TestStatus.TEST_EXCEPTION;