Commit Graph

66 Commits

Author SHA1 Message Date
e61c5d4a55 Simplify Parfait booting
Since some weeks, Parfait uses instance variables instead of generated attribute getters (that needed type)
This makes it possible to simplify the boot process, getting rid of separate boot Space and class versions.
It is still quite order dependent, but all "normal" ruby code, (less magic) so easier to understand.

Also moved all code that can never run at runtime into the adapter. This included Space and Object new, space as the space will only ever be created at compile time and object, since that is quite different at run-time (which is where i am working towards)
2019-09-22 19:10:47 +03:00
a496ea7e4b Derive Class and MetaClass from Behaviour
Finally! If i remember the module was from before i had any non Object superclasses
unified code, unified bugs :-) just makes sense
2019-09-21 18:50:33 +03:00
38491d120b removed unused NamedList
args and locals got inlined into message, forgot to delete then
ripples out due to type creation
small type class api change, more ripples, but also more consistent
2019-09-18 22:07:05 +03:00
7ee57f2b08 generalize get_main and get_init to get_method
to get at those know methods that really
__must__ exists, hence the bang, raise if don't
about to add method missing and raise to the list
2019-09-15 12:58:43 +03:00
d82cedf4c0 Quite small amount of parfait tests needed changing after that
But something is amiss anyway, especially dynamic jumps
2019-09-09 20:29:18 +03:00
02261ad79d changing factory size per factory
Before it was one class variable, but ints and messages are not created in equal amounts.
2019-08-24 09:46:33 +03:00
5e44e9caaf fix mom and vool after cc changes 2019-08-23 10:21:22 +03:00
0a1b05b2ee Inline arguments into message
thus removing indirection for access
does affect rather much, several commits
2019-08-22 17:55:19 +03:00
Torsten Ruger
e430701645 Using MetaClass to compile class methods into
still #24, still wip
2019-02-17 14:37:50 +02:00
Torsten Ruger
3db7707614 Get a basic MetaClass going
Does get created in new, but not in boot.
Also not yet used in compiling
2019-02-16 23:24:16 +02:00
Torsten Ruger
a89301d623 finally creating less objects in the test
basic still #23 , now applied
Basic size of 20, interpreter gets 50 and the full set is 1024

Tests run more than twice as fast!!
2019-02-09 12:44:35 +02:00
Torsten Ruger
8d3a1954fa close #21
Mostly replaced Fixnum with integer
also in the rx-file dependency
all travis and testing with 2.4+
2019-02-07 18:24:35 +02:00
Torsten Ruger
d964e9ea9d let spce keep the messages in a factory #14
Like Integers and addresses before, messages are now in a factory
Factories keep allocated (uninitialised) objects, had to make init public to call it
2018-09-01 11:24:16 +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
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
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
308996bf8e fix all tests accordingly to new return 2018-08-02 17:37:27 +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
69385c863f some more addresses 2018-07-15 15:13:25 +03:00
Torsten Ruger
eaeea29e38 helper erro handling 2018-07-15 12:32:02 +03:00
Torsten Ruger
21009b0e9b delegate resolve to compiler when needed
and forgotten space test
2018-07-13 21:55:27 +03:00
Torsten Ruger
2f07cc34f3 add parfait block 2018-07-07 15:50:43 +03:00
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
474cd4b348 linker and collector test work again
had to give space a fixed number of addresses
2018-07-02 16:19:01 +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
c947c27a14 clean up booting
many machine boot became obsolete
or just neede parfait to boot
actual linker functionality pending
2018-07-01 14:12:42 +03:00
Torsten Ruger
57fc67ddf6 move address list to object_space
where i guess it should have been from the start
2018-07-01 13:43:53 +03:00
Torsten Ruger
46d8f5002f hoist parfait boot out of the machine boot 2018-06-30 00:39:23 +03:00
Torsten Ruger
606c7bf906 remove booted flag
just boot if needed
2018-06-29 11:36:14 +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
7ad36380c2 add next_value for dictionary
also next for list
and add types attributes to space
2018-05-13 13:03:04 +03:00
Torsten Ruger
06f51da8f1 rename get_all_methods 2018-05-01 19:19:37 +03:00
Torsten Ruger
a7207a9984 wrap parfait tests in module and boot 2018-04-26 12:31:37 +03:00
Torsten Ruger
30ba626cf9 fix knock ons 2018-04-24 20:16:50 +03:00
Torsten Ruger
04359546b7 implement greater than 2018-04-19 22:57:31 +03:00
Torsten Ruger
9e21719aeb generalise the operator handling
ie passing them through
implementing more
2018-04-19 22:13:52 +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
b9f85f9d2e use instance_variable_set/get instead of eval
opal doesn’t like eval anymore
2018-04-03 19:33:36 +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
fb29fb6431 linked list of methods instead of list of methods
api changes slightly, especially for each, but mostly sama sama
2018-04-02 16:36:43 +03:00
Torsten Ruger
3a9539a071 adds multiplication
without overflow testing, like the others
2018-04-01 21:18:08 +03:00
Torsten Ruger
b1376e83bd add integer minus
rework plus to make that easy
2018-04-01 15:26:53 +03:00
Torsten Ruger
15d2b585e6 fix integer and data object get/set word
instance variables first, then raw data
keep value reader for now
2018-04-01 11:56:04 +03:00
Torsten Ruger
4725b81270 get those integers crated and used 2018-03-31 20:21:27 +03:00
Torsten Ruger
cb9f6973d9 fix true false and nil constant
going from mom to parfait
basics in place, more ripples to fix
2018-03-31 13:47:02 +03:00
Torsten Ruger
1956f18faa add an integer plus
not correctly handling integer objects yet
2018-03-30 17:09:02 +03:00
Torsten Ruger
2aa7d37a83 rename locals to frame
includes temps and tradition
2018-03-14 17:39:04 +05:30
Torsten Ruger
d6a2ea4cfc fix dynamic resolve
patch more like, real resolve method will have to be written
and put in there
2018-03-10 19:01:38 +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