Torsten Ruger
9005513368
rename typed_method to callable_method
...
seems to make the essence clearer
also extracted base class
2018-07-07 09:11:09 +03:00
Torsten Ruger
d8b58d8da6
fix inital main (again)
...
stop even compiling a fake main if a real exists (in builtin)
previous version was still buggy: using builting methods types (especially locals) even comiled version had different
2018-07-04 09:17:30 +03:00
Torsten Ruger
6f936f190d
misc to_s and small fixes
2018-07-04 08:28:29 +03:00
Torsten Ruger
8b9fd29ce9
Only add Builtin methods that are not in the current compilation
...
Current bug looks like the original main is used in parts
(not the compiled one, but the builtin on)
2018-07-04 08:28:05 +03:00
Torsten Ruger
e099014d63
fix dunamic jump in interpreter and misc
2018-07-03 19:15:36 +03:00
Torsten Ruger
bb1d1495db
fix constant propagation through the layers
...
so they can end up in the binary
2018-07-03 10:12:22 +03:00
Torsten Ruger
63dfee0978
move some tests around (and fix them)
2018-07-02 23:20:54 +03:00
Torsten Ruger
9bd8eab999
remove class attribute that was left dangling
...
not used, which prompted rename. just forgot to delete it
2018-07-02 15:50:54 +03:00
Torsten Ruger
1132309f6a
unify space collection attribute naming
...
currently space is still acting as a sort of memory manager.
For proper linking, all objects must be reachable from space, hence the plural versions like messages and addresses (even they are instances, it is the list that is important)
To dish out instance to use, the head must be kept, ie next_XXX for intergers, return addresses and messages
2018-07-02 15:49:51 +03:00
Torsten Ruger
22408b86c6
return the linker from mom_compiler
...
linker holds assemblers
assemblers come from method compilation
and so the layers come into focus
2018-07-01 21:51:48 +03:00
Torsten Ruger
bb49f1be78
rename ClassCompiler to MomComplier
...
ended up not even using the class, it just came from there
It actually compiles methods, and it turns out is the point where builtin comes into the picture as it's boot process also returns method compilers
2018-07-01 21:26:45 +03:00
Torsten Ruger
e75aef933d
have to pass constants around now
...
as they are not global anymore
2018-07-01 14:11:29 +03:00
Torsten Ruger
f7dfa1c45e
return assemblers from translation
...
result of translate is cpu instructions, our equivalent of assembly.
So return Assemblers for next stage
2018-07-01 11:56:09 +03:00
Torsten Ruger
05669065ca
back to method_compiler
...
it is what it is
2018-06-30 23:26:28 +03:00
Torsten Ruger
208b98d709
start to move translate code
2018-06-30 22:53:32 +03:00
Torsten Ruger
daf1b56062
start on class compiler
...
idea is to get cleaner layer seperation
reduce machine and rework builtin boot
2018-06-30 19:20:17 +03:00
Torsten Ruger
6bd01fd55f
rename method_compiler
...
in line with other compiler XX_Compiler being the compiler for that layer
remove type from compiler as it is in method available
2018-06-29 14:48:52 +03:00
Torsten Ruger
86b1edb40c
add seperate builders
...
remove if with polymorphism for different builders
(easier to understand by naming)
2018-06-29 13:27:57 +03:00
Torsten Ruger
53107d3ef8
reducing the label's int for return
...
placing the raw address in the register to jump to
puts the extra instruction at the risc level (not arm), thus changing a
lot of (brittle?) tests
2018-05-30 12:54:40 +03:00
Torsten Ruger
0dc89c772a
get the label int to work consistently
...
still need to use it in the return
2018-05-30 10:54:18 +03:00
Torsten Ruger
074ec34659
wip, fixed some label, need more fixing
2018-05-30 10:29:38 +03:00
Torsten Ruger
8322fca7b3
give labels an integer that will end up being the position at runtime
...
Since integers are first class objects, we need to use an integer object
as the return address. The actual address can not be stored in an
instance variable since it is not an object.
The address is unique to the label and never changes after positioning
(using the int is next up)
2018-05-29 20:26:00 +03:00
Torsten Ruger
7847420d49
make ints compile time mutable
...
to change the label value and use the allocated stubs
2018-05-29 17:03:55 +03:00
Torsten Ruger
a350325b6b
fix function call and simple call logic
...
Before creating DynamicJump, the FunctionCall got a register for a
possible jump address. Now that is handled by DynamicJump and
FunctionCall just needs the method, from which it determines the
binaryCode address
2018-05-19 12:21:20 +03:00
Torsten Ruger
dc8afce444
use existing constant
2018-05-16 12:55:51 +03:00
Torsten Ruger
000bf0a9b3
separate SlotDefinition into own file
...
what started as three lines has grown up to demand it’s own file and
tests
2018-05-15 19:29:06 +03:00
Torsten Ruger
020bce740a
more complex while test
...
that works, but does leave one wondering what is tested apart from the
result (1)
2018-04-20 19:38:33 +03:00
Torsten Ruger
1849522a54
fix TruthCheck
...
mixing up the false and true, such a basic human mistake
2018-04-19 10:34:15 +03:00
Torsten Ruger
3a50b7dd0e
fix mod4 name
...
really did div4
2018-04-19 10:00:55 +03:00
Torsten Ruger
059ff4a868
pass a source into the builder
...
for debugging
2018-04-18 19:12:30 +03:00
Torsten Ruger
df08cb78e2
adds a lot of to_ssss
2018-04-17 20:26:15 +03:00
Torsten Ruger
d19bd5f98d
fix dynamic jump
...
which gets dynamic resolve and call to work.
FIRST DYNAMIC CALL working
2018-04-09 15:06:46 +03:00
Torsten Ruger
59e6298879
first resolved call running though
...
and returning an int, as it should
just the value . . .
2018-04-08 23:45:23 +03:00
Torsten Ruger
fabe4db4f6
fix logic error in vool dynamic send
...
using receiver of current method
instead of receiver of next message
2018-04-08 22:59:42 +03:00
Torsten Ruger
580c53cdae
fix the resolve
...
without return and not being a function
2018-04-08 22:30:18 +03:00
Torsten Ruger
33ffcf1d88
move resolve_method code from word to mom
...
rather make resolve an instruction.
Since it was coded in risc anyway, we not only save the setup and call
But also makes the mom instruction flow clearer
The method really came from not wanting to code it in risc, but with
the Builder, that is now surprisingly painless
2018-04-08 18:55:17 +03:00
Torsten Ruger
9867234c38
move most code from method_compiler to builder
...
rather use builder in two ways, than sometimes compiler and sometimes
builder
Also makes it possible to reuse builtin code in mom’s to_risc, as both
use builder. The builtin code by directly adding to compiler, the mom
code not.
2018-04-08 18:51:20 +03:00
Torsten Ruger
6958fc31ab
rework resolve_method, using builder
2018-04-07 23:07:44 +03:00
Torsten Ruger
26cf911a5c
change build names a little and document
2018-04-07 22:35:40 +03:00
Torsten Ruger
db55ec3fd6
slightly changing built return logic
...
very tempted to add immediately, but bigger change
2018-04-07 00:35:54 +03:00
Torsten Ruger
dd0d162ebf
fix the init also, was using first message twice
...
not advancing after first load
2018-04-07 00:14:02 +03:00
Torsten Ruger
eea92399ee
concludes static message setup
2018-04-06 23:11:08 +03:00
Torsten Ruger
1ddbde1191
return single message for "message" ie r0
...
other names, like next_message allocate a new register
2018-04-06 22:54:54 +03:00
Torsten Ruger
22409c93ee
remove >>, consistent use of <<
...
makes code easier to read, like assignments
does remind of Passengers
2018-04-06 22:40:58 +03:00
Torsten Ruger
c042dd9faa
allow reverse syntax for >> (ie <<)
...
slot >> reg makes sense, being a slot_to_reg
but . . .
consistently use of << (as meaning assignment , =) also makes sense
allow both and let time tell which makes more sense
2018-04-06 21:05:26 +03:00
Torsten Ruger
41d573d571
wrought one more instruction for message setup
...
now with dsl ready, should be faster
2018-04-06 20:58:58 +03:00
Torsten Ruger
cae5e323ec
add reg to slot
2018-04-06 20:21:14 +03:00
Torsten Ruger
c233bd82d6
implement [] for RiscValue for the dsl
2018-04-06 16:08:35 +03:00
Torsten Ruger
e396807ee5
start work on dsl
...
so i can read my own code
2018-04-06 14:21:38 +03:00
Torsten Ruger
d52e14d201
continue to rewrite message_setup
...
message come from space already.
next types
2018-04-05 20:37:03 +03:00