Commit Graph

357 Commits

Author SHA1 Message Date
Torsten Ruger
eaeea29e38 helper erro handling 2018-07-15 12:32:02 +03:00
Torsten Ruger
648ec772ec direct index access helper for type 2018-07-15 12:30:50 +03:00
Torsten Ruger
581f457119 type helper for class name 2018-07-14 11:03:16 +03:00
Torsten Ruger
a095515b0e new get_type_by_class_name helper for space
sorely needed, with 36 occurences replaced
2018-07-13 21:50:40 +03:00
Torsten Ruger
dd544214b3 start with block_compiler
as a copy of method_compiler
re-merge later, when we know what's needed
2018-07-09 16:48:23 +03:00
Torsten Ruger
0d900de695 block creation and insertion with correct types 2018-07-07 22:42:00 +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
acd5cd8f30 rename for_type to self_type
and split a base class off TypedMethod
2018-07-06 20:01:17 +03:00
Torsten Ruger
3f80953385 passing compiler to to_mom, not method
To be able to delegate scope (block/method) things later
2018-07-05 14:02:38 +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
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
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
1a97408e22 return compiler, not generated mom
does make the tests more verbose, but the code cleaner
2018-07-01 11:57:17 +03:00
Torsten Ruger
3813de19fc finally removing instruction from parfait method
instructions are intermediate results on the way down
and as such never should have been in there
2018-07-01 11:54:44 +03:00
Torsten Ruger
05669065ca back to method_compiler
it is what it is
2018-06-30 23:26:28 +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
7377522417 fix test ripples and minor parfait naming
Parfait ruby and boot names desynced, fixed that
2018-06-29 21:03:06 +03:00
Torsten Ruger
ae35fed0ab fix list to expand
prevously fixed max length list
now expanding on demand, using next
quite like binary_code, a pattern is emerging
2018-06-29 20:58:59 +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
e6f01748ff move adapter stuff around 2018-06-29 14:26:25 +03:00
Torsten Ruger
2e086a78e2 bit of refactoring 2018-06-27 17:09:50 +03:00
Torsten Ruger
f0ba863721 remove to_mom / create_objects dichotomy
wsa supposed to be clearer, but even to me seems confusing now.
2018-06-26 20:46:58 +03:00
Torsten Ruger
ec1d38f5a6 reimplement instruction listeners with indexes
easier to understand, as indexes map to Binarycode indexes, and can thus later be used to assemble directoy into the  code
Almost no change in tests (now only multiples of 4 addresses allowed)
2018-06-09 17:41:39 +03:00
Torsten Ruger
e4b4551acf minor simplification 2018-06-09 08:13:37 +03:00
Torsten Ruger
2d218bbc48 work on jump insertion continues
Now registering CodeListener instead of PositionListener
Also instead of on the previous, in itself, which is simpler
and allows to react to insertion at end
2018-06-07 19:26:02 +03:00
Torsten Ruger
4ab6d62acf small arm fixes etc 2018-06-06 00:53:41 +03:00
Torsten Ruger
c2d450f779 fold position module and object position
simpler that way, aslo code is moving to listners
2018-06-02 21:59:41 +03:00
Torsten Ruger
e39e96f646 create return address as own class to hold return addresses
to distinguish from integer, which does not need adjusting
2018-05-30 23:49:01 +03:00
Torsten Ruger
e86ca5ae9d integer was wrong padded§ length
or rather right (2 as should be and will be)
but currently we use next AND value + type means 3, rounded 4
because we can’t swap types at compile time (as is planned at runtime,
we use next OR value)
2018-05-30 14:55:17 +03:00
Torsten Ruger
c55b41afae sort objects by class before positioning
since we don’t have pages yet, but want consistent layout
2018-05-29 20:52:58 +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
4b34546c11 fixing the binary code indexes
AGAIN, that third of all bugs, the off by one
2018-05-28 18:20:09 +03:00
Torsten Ruger
8ef1a471a4 finally change List to derive from data object
can’t derive from data16 as some lists are longer
have to get the delegation to work first
2018-05-28 15:45:29 +03:00
Torsten Ruger
f9a89db10c use fake memory
fix integer offset bug
(which only didn’t cause errors as fixnums are still an order too big
and the famous +1 error hit the empty space)
2018-05-28 15:09:59 +03:00
Torsten Ruger
6c06f61ab8 start on fake memory
get index checks on the array access of parfait
2018-05-28 14:46:26 +03:00
Torsten Ruger
be1bc63ff2 jump was written off the end of binary code, fixed 2018-05-28 11:45:04 +03:00
Torsten Ruger
6f0fad0957 dragging the extra through resets
as the binary the instruction is in may change when repositioning
2018-05-25 19:04:48 +03:00
Torsten Ruger
8d8cc4b016 more test fixing
only one bug to go
2018-05-24 21:20:56 +03:00
Torsten Ruger
8d510c2e7e getting instruction repositioning right
big bug hunt, involving complicated maths (%)
2018-05-24 14:27:53 +03:00
Torsten Ruger
0293320bb8 use a constant for the binary code offset
where the instructions start
2018-05-23 21:35:22 +03:00
Torsten Ruger
dc8afce444 use existing constant 2018-05-16 12:55:51 +03:00
Torsten Ruger
e237bc625a remove unused methods
and a whole lot more index fixes
2018-05-14 20:50:52 +03:00
Torsten Ruger
5d3c70da89 fix type api
tests were using methods that were only used in tests.
2018-05-14 16:13:50 +03:00
Torsten Ruger
3c00239f36 another million index fixes 2018-05-14 15:17:04 +03:00
Torsten Ruger
4a88f342d3 random checkin
still suffering -1 trauma
2018-05-14 12:38:44 +03:00
Torsten Ruger
ab01fa3862 switch to 0 based indexing
the world rocked for a moment (and more fixes to follow)
also the crumbling of idealism was heard
2018-05-14 11:55:01 +03:00
Torsten Ruger
4856b9891d simplify writing binary
loop as should be, fixes the problem (one problem at least)
2018-05-13 18:01:45 +03:00
Torsten Ruger
866467ee5e change binary labels 2018-05-13 17:21:48 +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
776a97986d fix instruction positioning
use at as at and only compute difference when needed (to determine if
there is a jump in binary)
Easier to understand that way
2018-05-11 18:36:45 +03:00
Torsten Ruger
1169fa7220 propagating binary code position on extend 2018-05-09 20:36:49 +03:00
Torsten Ruger
06f51da8f1 rename get_all_methods 2018-05-01 19:19:37 +03:00
Torsten Ruger
dd2c2cb975 fix init jump bug
the label for the jump was not translated correctly
call needs to go through to_cpu to create single instance
on the way init order slightly changed
2018-05-01 19:19:04 +03:00
Torsten Ruger
3a50b7dd0e fix mod4 name
really did div4
2018-04-19 10:00:55 +03:00
Torsten Ruger
df08cb78e2 adds a lot of to_ssss 2018-04-17 20:26:15 +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
Torsten Ruger
5bb3ad03cc some more safety tests 2018-04-05 12:22:40 +03:00
Torsten Ruger
ee0a1ca823 renaming methods args and frame
to arguments_type and frame_type, because that is what they are
In honour of setup bug, where the types of those types were loaded,
instead of just them types
2018-04-05 12:22:14 +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
52d389cdbf auto extend binary code
final solution will need repositioning
2018-04-03 15:07:36 +03:00
Torsten Ruger
299a130761 small cleanup 2018-04-02 18:30:03 +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
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
5c89884df9 fix binary code mixup
mixed get_word with get_internal_word
2018-04-01 12:13:14 +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
5b92b6b785 get plus (+) working
alas, new integer is not created yet
2018-03-31 19:37:24 +03:00
Torsten Ruger
696886cc94 remove Data2 in favour of Data4
as we write a Marker, type and marker make up 2
so data2 is just the type, not useful
2018-03-31 19:12:06 +03:00
Torsten Ruger
a5189570c6 fix remaining constant issues
all but integer creation
and integer builtins off course
2018-03-31 13:58:08 +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
9e9b5c7f37 move to parfait integers in risc layer
loading constants means loading parfait objects
objects have to me collected in machine
integer ok, string/true/false/nil next
2018-03-31 13:25:59 +03:00
Torsten Ruger
e012f16d7f fix positioning and the assembly works 2018-03-29 18:03:21 +03:00
Torsten Ruger
00be522419 each word for binary 2018-03-29 17:38:59 +03:00
Torsten Ruger
85ddf53429 create methods with binaries and extend them later
Binary is new jump target for function call
2018-03-28 12:49:17 +03:00
Torsten Ruger
294f4d988f automatically create binary once cpu instructions are there 2018-03-26 19:42:15 +03:00
Torsten Ruger
3fcb4b74c7 fix binary code set_char bug 2018-03-26 19:41:30 +03:00
Torsten Ruger
e61ef93943 cleanup 2018-03-26 19:17:30 +03:00
Torsten Ruger
a9d5e144ca get/set word for binary code 2018-03-26 18:14:52 +03:00
Torsten Ruger
1e21177b35 just keep binary code payload at 13 for now
there is an extra in there at the last of the last, but ok
2018-03-26 14:37:55 +03:00
Torsten Ruger
60617ca632 some binary code tests 2018-03-26 14:04:13 +03:00
Torsten Ruger
3090ccffea keep risc and cpu instructions separate in method
that overwriting was a bit of thorn
2018-03-25 19:33:50 +03:00
Torsten Ruger
a50368c3aa assembler will need redoing somewhat
with own data objects, we can assemble into them first
then write
may also store cpu instructions
2018-03-25 18:23:00 +03:00
Torsten Ruger
82ab8ac4d3 add data objects
marker class (may change) to be able to check access
2018-03-25 18:22:02 +03:00
Torsten Ruger
2c137e8c97 div10 test for interpreter 2018-03-24 12:21:46 +02:00
Torsten Ruger
b4a18bc59b mostly brackets and formatting 2018-03-23 18:55:23 +02:00
Torsten Ruger
34903829ca fix interpreter test harness and start testing
interpreter on debug for now
2018-03-22 18:54:40 +02:00
Torsten Ruger
769fd71a3d fix redefining typed methods
as happens for predefined Space.main
2018-03-22 21:06:22 +05:30
Torsten Ruger
99ced4369a adding Tue False and Nil Class to Parfait
and boot
2018-03-19 21:18:56 +05:30
Torsten Ruger
af94d40cab passing frame (locals) into method creation
so typed_method have correct frame information and
can resolve slots correctly (next step)
2018-03-18 22:09:27 +05:30
Torsten Ruger
e7b878a353 mostly finish index resolve in slot_definition
alas, it reveals error, types may not be set correctly
2018-03-18 10:51:46 +05:30
Torsten Ruger
642f16b73a adding cache entry to parfait 2018-03-17 19:03:39 +05:30
Torsten Ruger
0a9997f549 final rename remnant, green again 2018-03-14 20:29:51 +05:30
Torsten Ruger
559a797100 rename locals to frame 2018-03-14 20:24:47 +05:30
Torsten Ruger
2aa7d37a83 rename locals to frame
includes temps and tradition
2018-03-14 17:39:04 +05:30
Torsten Ruger
b297650b78 adds a mom version of basic values 2018-03-13 12:30:51 +05:30
Torsten Ruger
f7aac1d1a4 polish docs
and a bit of code style
2018-03-11 16:11:15 +05:30