2016/05/09

09:37

Actually for the exception handler generated code, I can place it anywhere which would remove a check at the start of a method. If I follow the controlled exception route (where there are no asynchronous exceptions, note that I do not have Thread.stop which is a good thing here). If I place it at the end of the method then I would not need a check at the start. However, for stuff such as array access where bounds checks need to be performed, if there is an exception then it will have to be thrown by the generated code.

09:46

However, for asynchronous exceptions if one does occur then it will just appear in the current method being called. If it propogates upwards then how exceptions are normally handled would be used instead.

16:56

To locate jump targets, I can have jump indexes which are associated with a program.

17:04

For programs I will need a kind of index so a class which can provide indices as required.

17:27

For simplicity and some speed, I do not need to strictly follow SSA. The compiler will just perform basic cached optimizations.

17:44

I know how I can implement branching without requiring knowing the exact IDs of future basic blocks.

17:46

This also means I would not need an index factory which would be a bit ugly. Jumps can only be made to the start of basic blocks anyway.

18:03

I just need to figure out the potential jump targets for all operations then setup jump targets for all of them. Then once that is done, I can have a multiple of lists which define the operations to be placed within basic blocks. Then at program generation the lists can be turned into basic blocks and then sent to the program as required.

18:13

Also some operations such as getting and setting of fields would be terminal operations potentially (provided they are not final or have a known value).

18:19

So the first thing to do then would be to go through all operations and determine the jump targets that the operations jump to then exception handlers. The mapping of logical instructions to block builders will be setup. The block handlers can also have the register states such as which ones are active and which ones are temporary for example.

19:30

Actually with this new code route, I do not need to have a mutable NRProgram.