0137056b89
change platform to return register names
...
not just the number of them
also adds protocol to map registers
(like message to r0 , or syscalls)
2020-03-22 14:31:43 +02:00
f13e6dcf57
fix releasing in allocator
...
fell into hash new trap, which reuses the object you give it. not good for mutable objects like the array.
also previous logic was broken in terms of machine vs ssa names
2020-03-22 14:31:43 +02:00
3f131a4018
start with register assigning
...
have to find a way to set them next
2020-03-22 14:31:43 +02:00
4f290ee246
basic liveliness for allocator
2020-03-22 14:31:43 +02:00
d0b734c57c
adding register_names to instruction protocol
2020-03-22 14:31:43 +02:00
8df1b8126f
add register names to allocator
...
make platform instantiate it
basic plumbing
2020-03-22 14:31:43 +02:00
500df01425
rename allocator to standard_allocator
...
planning to have platform dish it out
2020-03-22 14:31:43 +02:00
2e109a16dc
starting on risc allocation
...
inserting allocator stage in method translation
2020-03-22 14:31:43 +02:00
d5411c7727
Last risc fixes that are not binary, move binary tests
...
move test that translate or create binary to own directory,
for semantic distance (they are the only ones still failing)
2020-03-22 14:31:43 +02:00
fea98979e8
Fix comparison bug
...
Unchanged high level test, ohh how great is testing
2020-03-22 14:31:43 +02:00
f03f445652
passing values to macros
...
conceptually still a bit open, leaving the hack in for now
passing values to the macro instead of sol instances
2020-03-22 14:31:43 +02:00
6366ede8ee
check for correct operator
...
was getting passed sol constants
2020-03-22 14:31:43 +02:00
e4a79aac50
reset flags in interpreter
...
fix at least part of the problem why comparisons dont work
2020-03-22 14:31:43 +02:00
0ed5e74748
Fixing ripples from previous
2020-03-22 14:31:43 +02:00
3ce6ed5263
fix putstring and puts
...
using syscall regs
2020-03-22 14:31:43 +02:00
17a7f29b0c
define and use syscall_XX registers
...
rather than use hardcoded r0 etc use syscall_X
change the syscalls and interpreter to use them
later use platform to map from syscall_X to actually used register (like r0 in arm)
2020-03-22 14:31:43 +02:00
3b50fee158
fix stray misc in slot
2020-03-22 14:31:43 +02:00
9f609bdb06
fix mod and tests
2020-03-22 14:31:43 +02:00
7232c28ecd
operator also fell into ssa trap
...
relying on register identity
in fact the whole operator concept was geared towards this, using 2 regs instead of one to avoid the whole issue
better now
2020-03-22 14:31:43 +02:00
3145547315
init fell into the ssa tap, fixed
...
reducing and assuming the same register, buuh
adds a transfer instruction that can hopefully be removed by analysis
2020-03-22 14:31:43 +02:00
5b0c1195e4
Fix interpreter and resolve method
...
Interpreter was not handling ssa correctly (ie overwriting)
Resolve was assuming wrong registers (also non ssa)
return value still broken
2020-03-22 14:31:43 +02:00
4db71c1c03
fix all uses of operators now they are ssa
2020-03-22 14:31:43 +02:00
0cde7c1d0a
debugging to find operator not being ssa
2020-03-22 14:31:43 +02:00
61fc8a3991
make operator_instruction single ass
...
create result register automatically
usually not used, but register allocation will sort that
2020-03-22 14:31:43 +02:00
1378745907
first interpreter tests
2020-03-22 14:31:43 +02:00
c16ed5ab3a
fix interpreter
...
by currently not checking for old register pattern
feels like wip, but passes (all but one)
2020-03-22 14:31:43 +02:00
f2250bc206
fix resolve and introduce method to chop strings to max
...
strings are 20 bytes. I want to implement the extension idea, just not now
2020-03-22 14:31:43 +02:00
504fc3509e
fix set_internal_word register
2020-03-22 14:31:43 +02:00
5c13ea1433
fix naming mistakes fo Word.get/set macros
2020-03-22 14:31:43 +02:00
d125a1528a
Fix set_internal_byte registers
2020-03-22 14:31:43 +02:00
2656bfacb2
create a reduce_int on RegisterSlot
...
that just passes through to RegisterValue by calling to_reg
2020-03-22 14:31:43 +02:00
17a1121408
fix putstring registers
2020-03-22 14:31:43 +02:00
3a3a9277b3
fix operators registers
2020-03-22 14:31:43 +02:00
8867d60c13
fix method_missing register
...
logic is still wrong, even it is slightly less (at least loading the method name)
2020-03-22 14:31:43 +02:00
cf5a3c0102
fix inits registers
...
surprisingly easy. shorter code and more readable tests
2020-03-22 14:31:43 +02:00
8abcaa330b
fix allocate in builder
...
which accessed unknown types.
also moved assert_allocate to support
2020-03-22 14:31:43 +02:00
c9fedec230
add a way to bend the type for register_value
...
specifically for factories, where we know the type of next_object even it is not specified
2020-03-22 14:31:43 +02:00
05ddc70fd6
fix get_internal word register names
...
seems previous commits broke the return
2020-03-22 14:31:43 +02:00
6267bf3ad0
fix slot_to_reg to allow register indexes
...
we mostly use pre-calculated indexes, ie integers
but registers are allowed (in arm/risc), so we try to check the registers type at least is right.
The return is really a machine word, but we call it Object (yes, more work that way)
2020-03-22 14:31:43 +02:00
62d8d92b50
restrict list index to integer
2020-03-22 14:31:43 +02:00
a70e510548
fix test_exit registers
2020-03-22 14:31:43 +02:00
fb4fa598f2
fix get_internal_byte
...
improved operators and tests
some logic errors still
2020-03-22 14:31:43 +02:00
c1cfc12a1c
converted resolve_method
...
Big, left till last, but surprisingly painless
2020-03-22 14:31:43 +02:00
12fe0b9a10
add constants automatically
2020-03-22 14:31:43 +02:00
e6729b8b60
fixing instruction tests
2020-03-22 14:31:43 +02:00
22d513d895
fix div4 and tests
...
also bug in reduce_int, compiler not carried through
2020-03-22 14:31:43 +02:00
eed9ba082f
Fix div10 and test
...
fix and use load_data (similar to load_constant)
and integrate into load_object when appropriate (ie for integers)
2020-03-22 14:31:43 +02:00
bd02f69824
reduce_int was overwriting register
...
No more. But the type question is open, ie what type does the resulting register have
2020-03-22 14:31:43 +02:00
53eb28fff4
load constant to create register names with class
...
Just the id_ did give no clue to the contents, just took care of the uniqueness.
Better for debugging
2020-03-22 14:31:43 +02:00
3ec5557ddb
fix builder logic error
...
and tests
2020-03-22 14:31:43 +02:00