Commit Graph
100 Commits
Author SHA1 Message Date
Torsten Ruger dc12c1d70b add the addresses from labels as constants 2018-08-29 21:06:29 +03:00
Torsten Ruger ea7f3c9653 remove the last_object from chain
also tried to keep the first around as was done in space
partially to not have to add the consrtants seperately
didn't work, as chain gets broken
also this has to be redone anyway
2018-08-29 21:05:54 +03:00
Torsten Ruger c983dcf0eb move return address generation to factory
removes the list from space
adds a ReturnAddress factory instead
and uses these throughout
2018-08-29 21:02:49 +03:00
Torsten Ruger f993ccefe3 litte bit of docs 2018-08-24 18:49:44 +03:00
Torsten Ruger 71ab369c71 use factory to generte intergers in space
start with just integer factory in space
change all the hand-out code
still #14
2018-08-24 18:49:21 +03:00
Torsten Ruger d396da16e3 start with #14 by implementing factory
page was maybe a too low level name
pages may be the unit of the syscall, but after that objects desolve (maybe later to be added on from different pages)
Factory has the job of handing out a new instance of a type
it keeps a freelist for that and a reserve
2018-08-23 19:55:06 +03:00
Torsten Ruger 9687d6611f avoid adding risc instructions twice
that causes loops in the chain
infinite loops in the code that are hard to debug
closes #11
2018-08-19 17:29:04 +03:00
Torsten Ruger f85fe8a2cb fix bug in slot_load and definition
move parfait helper for reuse
2018-08-19 15:36:51 +03:00
Torsten Ruger 253d2fead8 change all to_risc functions to add directly
still #11
test not working yet
2018-08-19 13:18:25 +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 b294208025 continue with #11
slots are the most tricky, especially testing
2018-08-19 13:06:00 +03:00
Torsten Ruger 047a36178f start with #11
by adding striaght to compiler
2018-08-19 12:56:44 +03:00
Torsten Ruger 5b2c7745fe move the methods test to mains
previous commit made the mains tests more general
this joins methods tests here
so we can run them on arm too
fix #11
2018-08-18 20:06:15 +03:00
Torsten Ruger 80264c5322 mains tests can include any code
not wrapping as main anymore
(must still include mains)
first part of #11
2018-08-18 19:42:14 +03:00
Torsten Ruger 233b83510f fixed some disabled tests 2018-08-17 22:43:17 +03:00
Torsten Ruger 176b12d896 last two to_risc converted to builder
no change of tests, good sign
2018-08-16 20:28:42 +03:00
Torsten Ruger da9dc30c20 move dynamic_call to builder
no change of test, great
also remove some duplicate code that was hanging around in method_compiler
2018-08-16 10:43:41 +03:00
Torsten Ruger ce157ffa94 change block_yield to_risc to use builder
only changes the order of two instructions
2018-08-16 08:58:49 +03:00
Torsten Ruger 1dabe0fda1 finish the idea behind #8, conditionally creating variables
by using space? , the ? makes for conditional creation of the variable
This is especially useful for constants (ie space)
2018-08-15 19:59:17 +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 43fa7ccbcc redid div10 with builder
div10 is right at the edge of what can be understood
no matter the (assmbler) syntax
2018-08-15 19:30:40 +03:00
Torsten Ruger 252ae6de72 finally get rid of the fixme in div10
create (load/reduce) the int once and transfer.
Save a cruicial 2 instructions

Also expanded the variable name possibilities with _self, __const , _1 and _2
2018-08-15 18:18:21 +03:00
Torsten Ruger 15337e10be move putstring to use builder 2018-08-15 17:52:21 +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 55bc9c5273 rewrite new_int with builder 2018-08-13 18:02:34 +03:00
Torsten Ruger 86462e238a large test changes due to change in cc
calling convention does affect
less than before, but still a LOT
2018-08-12 15:02:23 +03:00
Torsten Ruger fee9e261a5 still some names that needed changing 2018-08-12 14:48:20 +03:00
Torsten Ruger 25d7b8bd83 chaning calling convention not to add frame/arg types
these types are only needed to debug and can be gotten from the method (also in the mesage)
just saving the 6 instructions for every call
This was made possible through previous commits on fake_memory access
2018-08-12 14:47:05 +03:00
Torsten Ruger 28b4a2b373 add line numbers to array output 2018-08-12 13:58:58 +03:00
Torsten Ruger 3d113b4d83 fix more of the changed names
add a few self.
2018-08-12 13:10:44 +03:00
Torsten Ruger 66e0d4ae26 cache index resolution
resolve once and reuse
also use non checking version of get/set
as index per definition must be ok
This creates some speedup, but mostly avoids some weird hang in Thread::Queue.pop for many seconds
2018-08-12 13:09:34 +03:00
Torsten Ruger 84de400529 some test change because of renaming
next is a keyword, can't be used as instance writer
fake_memory gets the pobject for debug
2018-08-11 19:17:20 +03:00
Torsten Ruger b0aefe31fe make all instances attr read writers
unfortunately the writers have to have self.var =
otherwise it is just a local var
Also need to make the type explicit for all
Protocol included memory_length on the class for now
2018-08-11 19:15:34 +03:00
Torsten Ruger e6df473647 changing the adapter to have fake memory for every object
Before instance variables were used to store the actual data
While this worked it was a double mental loop and (more importantly) did not allow the same memory access
Ie, in the interpreter the types for args had to be set correctly
But they don't need to be until we walk the list, when we can get the types from the method.
In short, now the fake memory may be used as memory, by indexing into it

We now have to use attr reader/writers that map to the fake memory
And while this is possible, it means a lot more self. than i would like
Also the compiler whill have to undo those attr to instance acess at some point
2018-08-11 19:13:09 +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 99a95d40a6 also redid the get/set internal byte with builder
had to pimp register value to use a semblance of the dsl
using <= for bytes and << for words
2018-08-09 20:16:55 +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 0d52b620ed redid integer comparison with builder
had to add some helpers to builder
2018-08-08 20:53:06 +03:00
Torsten Ruger fc6aa4e28b rework operator with builder 2018-08-08 15:49:47 +03:00
Torsten Ruger 78466090b3 add reduce_int and fix bug
hardcoded operator, buh
reduce_int to avoid that long constant
2018-08-08 15:49:07 +03:00
Torsten Ruger f5ea51c4d0 new test to run out of ints 2018-08-08 12:03:17 +03:00
Torsten Ruger 6200a35562 add shortcut for class_name
for when type is not set
2018-08-08 12:02:59 +03:00
Torsten Ruger 71a7161200 redid div4 with builder 2018-08-08 12:02:24 +03:00
Torsten Ruger c63e55c2bc add an operator function
to be able to use the builder more
also add ability to load fixnums (for the int functions)
2018-08-07 20:48:36 +03:00
Torsten Ruger 554c2d3d73 just checking fibo 30
at just under 8000 instructions i can't wait to run real benchmarks
2018-08-06 14:13:39 +03:00
Torsten Ruger 393ac873c9 change return sequence to return messages to space
as it was before blocks
(thought blocks would make reuse of messages impossible, but was wrong, this only appilies to lambdas)
(too) many tests affected
2018-08-06 14:07:17 +03:00
Torsten Ruger 77cbc0ad6a always use fail fast (in dev)
but not for the travis run (or test_all check)
2018-08-06 13:07:06 +03:00
Torsten Ruger fd25f997ce reqrote return sequence with builder
added test _before_ , same code, just much easier to read
in preparation for returning messages
2018-08-06 13:04:47 +03:00
Torsten Ruger 595e032edf add function_return helper to risc_value
create a function_return from within builder
2018-08-06 13:03:33 +03:00
Torsten Ruger c9d8f750e5 extend type inference for dsl
and finally test it
2018-08-06 10:11:12 +03:00
Torsten Ruger 308996bf8e fix all tests accordingly to new return 2018-08-02 17:37:27 +03:00
Torsten Ruger 5346077a72 use the return jump to jump to the return sequence
thus every method only has one exit
should make multi return messages smaller
especially when we have escape analisis
(maybe will help with inlining too)
2018-08-02 17:36:39 +03:00
Torsten Ruger 4d4b691a4b adds a return jump
that will be used to jump to the return sequence
2018-08-02 17:34:44 +03:00
Torsten Ruger 050659ea12 block tests for if and while
bundle update too
2018-08-01 20:17:41 +03:00
Torsten Ruger 4f3c0d8b08 more block tests working
dynamic calls and operators on block args
(giant strides)
2018-08-01 16:31:16 +03:00
Torsten Ruger 4b4528abb2 propagate constants from block_compiler up
up to method_compiler, where they are collected by mom_compiler
(and included in binary)
2018-08-01 16:27:34 +03:00
Torsten Ruger 81cc109d1e more block tests
instance and arg access
2018-07-31 19:44:40 +03:00
Torsten Ruger 04bcfea8ce fix scoping of blockcompiler
Was accessing caller scope, but must use caller's caller as the yield itself is a call.
2018-07-31 18:00:42 +03:00
Torsten Ruger 4fe0edd1e3 first risc level block test working
assign was not executing yield
baecause it was just testing for send, instead of callable
2018-07-30 20:11:52 +03:00
Torsten Ruger 1d2ec8e8ac abstract CallStatement base class, just like in ruby
to_mom differs much more than the to_vool in ruby,
but data and base functionality still warrent unification
also we can check for CallStatement now
2018-07-30 14:45:37 +03:00
Torsten Ruger 198a43cc8d rename callable to CallStatement
Callable is the Method, whereas here we call the method
2018-07-30 14:44:14 +03:00
Torsten Ruger 9c6a099cde block test
working on return semanitcs
(still avoiding the implicit return)
2018-07-30 14:10:24 +03:00
Torsten Ruger a3059108eb compile the blocks too
method_compilers have block_compilers just like
methods have blocks
But assemblers are a flat list
2018-07-30 10:27:32 +03:00
Torsten Ruger 165036ea39 misc 2018-07-30 10:26:47 +03:00
Torsten Ruger 2dc03f8d1b push the callable into the callable compiler
thus generalizing for .callable access
keep block and method aliases for destinction in derived classes
2018-07-30 10:26:11 +03:00
Torsten Ruger 285a88b59f generalize assemblers to use callables
not just methods,  they are almost the same anyway
2018-07-30 10:23:42 +03:00
Torsten Ruger 4055709529 push the name down into callable
blocks need a name too
if just for debug, and stacks
2018-07-30 10:21:43 +03:00
Torsten Ruger 1cb07a4164 block arg access was off by one 2018-07-27 12:16:06 +03:00
Torsten Ruger e1d5592c55 fix boot to include blocks correctly 2018-07-27 10:48:45 +03:00
Torsten Ruger 4839e0d245 minor naming and spaces 2018-07-27 10:46:22 +03:00
Torsten Ruger 776050fa70 upate readme 2018-07-25 11:08:39 +03:00
Torsten Ruger 700744e6d5 block assignment ruby to vool 2018-07-25 11:06:42 +03:00
Torsten Ruger f5c284b3a0 bring the blocks down to mom level
reusing message_setup, but adding yield specific instructions
2018-07-24 11:35:49 +03:00
Torsten Ruger d80ef4bf4e store method, not name, in message
changes the calling and thus too many test
2018-07-22 22:29:32 +03:00
Torsten Ruger b6c85cd4a4 callable as base for yield and send
more yield tests
2018-07-21 14:34:39 +03:00
Torsten Ruger 84a6fb1aba more block tests 2018-07-21 12:51:20 +03:00
Torsten Ruger f620f0fd74 last test fixed, ruby layer complete 2018-07-20 21:27:55 +03:00
Torsten Ruger b00b0cf064 fixed some interpreter tests
hoisting is slightly more simple and that adds a couple insstructions
2018-07-20 21:00:47 +03:00
Torsten Ruger 6022aa4dab introduce ruby variable and remove ct_type
cleaner oo
2018-07-20 20:53:35 +03:00
Torsten Ruger 9548440949 remove old tests
those normalisation tests are now to_vool tests
2018-07-20 20:10:12 +03:00
Torsten Ruger 235853ab2d first run at ruby block to_vool
leaving the parser structure in the ruby layer,
but adopting the constant approach in vool
2018-07-20 20:07:15 +03:00
Torsten Ruger 0238874c20 fx ruby send args 2018-07-20 20:06:14 +03:00
Torsten Ruger d03592dfb1 fix ruby return 2018-07-20 20:05:32 +03:00
Torsten Ruger 172327f045 fix assignments
which was letting ruby instances through
also rename the doubious copy
2018-07-20 18:13:58 +03:00
Torsten Ruger 6a58a71c0a fix while.to_vool
sanitize normalizer on the way
- return ruby, let caller to_vool
- return single statement, not single? statements
2018-07-20 17:51:17 +03:00
Torsten Ruger 9b8bd57db4 fix if to_vool
and add (simple) hoisting tests
2018-07-20 17:30:08 +03:00
Torsten Ruger 98788b52d3 fix ruby variables 2018-07-20 14:22:26 +03:00
Torsten Ruger f4402ba30f fix local assignment
was missing a method that got lost in copy/paste
also renaming to get guard to pick up tests
2018-07-20 14:16:29 +03:00
Torsten Ruger d14eca3e70 fix assignments to_vool 2018-07-20 13:43:37 +03:00
Torsten Ruger e536a7ac88 fixing send to_vool
was hoisting unneccessarily, because not respecting basics
2018-07-20 13:15:16 +03:00
Torsten Ruger 7b02feae7a fix ruby send statement
remove ruby expression
2018-07-20 10:05:11 +03:00
Torsten Ruger 8cd9818f64 fix ruby return statement
assignment and normalizer on the way
2018-07-20 09:07:09 +03:00
Torsten Ruger a5168ef818 fix ruby class statement 2018-07-19 21:44:48 +03:00
Torsten Ruger 238f09b5ad fix method to_vool 2018-07-19 21:36:28 +03:00
Torsten Ruger 7b4a0126f7 add a helper to get the vool equivalent of a ruby class 2018-07-19 20:59:15 +03:00
Torsten Ruger 77be0d3f73 fixing the ruby creation tests 2018-07-19 16:30:36 +03:00