homing in on line length 100

This commit is contained in:
Torsten Ruger
2015-05-30 12:20:39 +03:00
parent 33d464f032
commit e651b57d08
29 changed files with 159 additions and 108 deletions

View File

@ -3,14 +3,18 @@ module Virtual
# Frames and Message are very similar apart from the class name
# - All existing instances are stored in the space for both
# - Size is currently 2, ie 16 words (TODO a little flexibility here would not hurt, but the mountain is big)
# - Unused instances for a linked list with their first instance variable. This is HARD coded to avoid any lookup
# - Size is currently 2, ie 16 words
# (TODO a little flexibility here would not hurt, but the mountain is big)
# - Unused instances for a linked list with their first instance variable.
# This is HARD coded to avoid any lookup
# Just as a reminder: a message object is created before a send and holds return address/message and arguemnts + self
# frames are created upon entering a method and hold local and temporary variables
# as a result one of each is created for every single method call. A LOT, so make it fast luke
# Note: this is off course the reason for stack based implementations that just increment a known pointer/register or
# something. But i think most programs are memory bound and a few extra instructions don't hurt.
# Just as a reminder: a message object is created before a send and holds return address/message
# and arguemnts + self frames are created upon entering a method and hold local and temporary
# variables as a result one of each is created for every single method call.
# A LOT, so make it fast luke
# Note: this is off course the reason for stack based implementations that just increment
# a known pointer/register or something. But i think most programs are memory bound
# and a few extra instructions don't hurt.
# After all, we are buying a big prize:oo, otherwise known as sanity.
class FrameImplementation

View File

@ -1,7 +1,9 @@
module Virtual
# This implements instance variable get (not the opposite of Set, such a thing does not exists, their slots)
# This implements instance variable get (not the opposite of Set,
# such a thing does not exists, their slots)
# Ivar get needs to acces the layout, find the index of the name, and shuffle the data to return register
# Ivar get needs to acces the layout, find the index of the name,
# and shuffle the data to return register
# In short it's so complicated we implement it in ruby and stick the implementation here
class GetImplementation
def run block

View File

@ -4,9 +4,11 @@ module Virtual
# That off course opens up an endless loop possibility that we stop by
# implementing Class and Module methods
# Note: I find it slightly unsemetrical that the NewMessage object needs to be created before this instruction
# This is because all expressions create a (return) value and that return value is overwritten by the next
# expression unless saved. And since the message is the place to save it it needs to exist. qed
# Note: I find it slightly unsymmetrical that the NewMessage object needs to be created
# before this instruction.
# This is because all expressions create a (return) value and that return value is
# overwritten by the next expression unless saved.
# And since the message is the place to save it it needs to exist. qed
class SendImplementation
def run block
block.codes.dup.each do |code|