3282e0ae06
transformed object builtins
2019-08-11 20:36:10 +03:00
0725f02e9a
starting to fix builtin
...
start at Object get_interna_word
using the pattern to replace the whole risc method with a single mom instruction. Copying the original risc code into the instrucitons to_risc
also adding some very basic tests
2019-08-11 14:31:00 +03:00
Torsten Ruger
4d30727811
test and last fixes for previous commits (allocalte ints)
...
mostly just fixing the additional instructions
close #20
2018-11-24 22:40:22 +02:00
Torsten Ruger
e6615d0a6a
remove the old add_new_int and calls
...
last orrurences in syscalls replaced, 2 variants
- exit does not actually need the int
- all else, preallocate the int beforehand and in syscall assume the reg name (integer_tmp)
test missing
2018-11-22 09:16:56 +02:00
Torsten Ruger
a8d1f070f1
replace add_new_int in most builtins
...
in integer and word mainly, replaced with allocate_int
(tests pending as syscalls are undone)
2018-11-21 20:29:22 +02:00
Torsten Ruger
f798173a09
change to_risc and builtin code according to last commit
...
Wherever space was loaded to get to the next_message
we now load the Message factory.
Otherwise much the same, only the attribute is next_object, not next_message
The binary is growing with 1k objects per factory, so i had to fix (hack) arm to handle bigger constants
close #14
2018-09-01 11:28:53 +03:00
Torsten Ruger
57dc6c45bb
remove the code_builder
...
this is core of #11
rename compiler_builder to just builder
and change all builder uses to use that
some test change as code is not returned anymore
2018-08-19 13:16:07 +03:00
Torsten Ruger
01752aab05
remove the last use of an add_xx function, closing #9
2018-08-15 19:37:03 +03:00
Torsten Ruger
e953cc90d5
remove some more add_xx functions
...
also load labels by dsl now
2018-08-14 20:24:48 +03:00
Torsten Ruger
520dc7b41f
remove ad_transfer in save_message
...
towards removing all add_
change to set_builder and chaining in reg values
2018-08-14 20:08:58 +03:00
Torsten Ruger
37461a1727
add the ! syntax to create variables in builder, fix #8
...
now a variable has to be created before being used
thus it is save to develop contracts where a certain name
must exist in the scope
Maybe the syntax starts getting a bit weird, but at least the ! is a common symbol in ruby
2018-08-14 19:39:46 +03:00
Torsten Ruger
0bf008b351
bit of documentation
2018-08-14 11:23:19 +03:00
Torsten Ruger
fb54d68020
redo restore after syscall with builder
2018-08-13 18:48:54 +03:00
Torsten Ruger
d74e9c2c40
removed some obsolete builder helpers
...
cleaner code with dsl,
just div10 undone
2018-08-09 21:10:05 +03:00
Torsten Ruger
7002956e81
redid get_set internal byte with builder
...
trying to change style, get rid of some of builders functions
2018-08-09 20:15:52 +03:00
Torsten Ruger
29363e7f72
split compilers resolve_type into the three possibilities
...
cleaner code, though temporary it shifts some dirt
into the index method. up next
2018-07-16 12:03:40 +03:00
Torsten Ruger
a71a6d34fb
use message reg not message
...
for upcoming change
2018-07-15 15:14:38 +03:00
Torsten Ruger
edea9ac080
makeing the method of the compiler more or less private
...
in preparation for using the same code for bocks
2018-07-09 19:32:17 +03:00
Torsten Ruger
acd5cd8f30
rename for_type to self_type
...
and split a base class off TypedMethod
2018-07-06 20:01:17 +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
05669065ca
back to method_compiler
...
it is what it is
2018-06-30 23:26:28 +03:00
Torsten Ruger
91a99b1239
let boot_functions return the compilers
...
methods are still added, but this is a good step to removing the risc/cpu level from the methods
2018-06-30 23:16: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
3dffebed3f
rename a bit
2018-06-29 13:03:19 +03:00
Torsten Ruger
d50893bb0f
rename risc_value to register_value
...
almost to register, but it still carries that value
2018-06-29 11:39:07 +03:00
Torsten Ruger
ce79617875
fix the exit sequence
...
was returning wrong register (1, not 0)
also saving the message for test, which changes order as the return value destroys the message
2018-06-19 19:52:06 +03:00
Torsten Ruger
5f7683efcf
pass return integer back out through exit
...
for testing of binaries later (and off course general correctness)
Some tests were using the fact that the interpreter was used, changed those to return ints rather than strings
2018-06-19 18:55:47 +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
3c00239f36
another million index fixes
2018-05-14 15:17:04 +03:00
Torsten Ruger
8e1efa3993
fix source for exit label
2018-04-18 20:10:07 +03:00
Torsten Ruger
059ff4a868
pass a source into the builder
...
for debugging
2018-04-18 19:12:30 +03:00
Torsten Ruger
e5d014b936
bit more regs, bit more resets
2018-04-08 22:29:08 +03:00
Torsten Ruger
8c322329fb
fix builtin methods according to last commit
2018-04-08 18:52:17 +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
f09086e524
unite the two resolve_to_index functions
2018-04-05 20:10:00 +03:00
Torsten Ruger
ec31bde33a
fix use of messagesetup
...
which does setup for the method being called
not the one we’re in. duh
2018-04-05 12:23:43 +03:00
Torsten Ruger
c304ad67c6
load space twice in init , messagesetup overwrites first
...
lots of interpreter test changes, brittle, must factor __initi out
2018-04-02 23:25:52 +03:00
Torsten Ruger
9fafbe4e96
remove Kernel class for clarification
...
since it was a class it was fake anyway
moved methods to object
2018-04-02 17:06:31 +03:00
Torsten Ruger
87eee0b66e
add object method missing as sys exit
...
functions get added twice and thus removed once
remove restriction for now
2018-04-02 16:49:30 +03:00
Torsten Ruger
972cf47c8b
adding returns to all builtins
2018-04-01 15:17:16 +03:00
Torsten Ruger
5a861d4ed5
move some compiler helpers to the compiler itself
2018-04-01 14:09:30 +03:00
Torsten Ruger
0813312ddc
using compiler_for to create all building compilers
...
unify api, create defaults and especially pass the right types into the
typed method creation
2018-03-18 22:08:35 +05:30
Torsten Ruger
aa79e41d1c
rename register to risc
...
seems to fit the layer much better as we really have a very reduced
instruction set
2017-01-19 09:02:29 +02:00