smaller clean-ups

This commit is contained in:
Torsten Ruger
2015-05-25 18:48:35 +03:00
parent 4d0773ebae
commit 8413f6b470
6 changed files with 18 additions and 16 deletions

View File

@ -59,7 +59,7 @@ module Virtual
begin
code.set_position( at)
rescue => e
puts "BLOCK #{self}"
puts "BLOCK #{self.to_s[0..5000]}"
raise e
end
raise code.inspect unless code.mem_length

View File

@ -11,10 +11,7 @@ module FakeMem
@length = -1
if Parfait::Space.object_space and Parfait::Space.object_space.objects
Parfait::Space.object_space.add_object self
else
#TODO, must go through spce instance variables "by hand"
puts "fixme, no layout for #{self.class.name}"
end
end #Note: the else is handled in boot, by ading the space "by hand", as it slips though
init_layout if Virtual::Machine.instance.class_mappings
end
def init_layout
@ -31,7 +28,7 @@ module FakeMem
# resetting of position used to be error, but since relink and dynamic instruction size it is ok.
# in measures (of 32)
if @position != nil and ((@position - pos).abs > 32)
raise "position set again #{pos}!=#{@position} for #{self}"
raise "position set again #{pos}!=#{@position} for #{self.class}"
end
@position = pos
end
@ -95,7 +92,7 @@ module Parfait
end
class List
def mem_length
Virtual::Object.new.padded_words(length())
padded_words(get_length())
end
def to_sof_node(writer , level , ref )
Sof.array_to_sof_node(self , writer , level , ref )
@ -122,7 +119,7 @@ module Parfait
class Word
def mem_length
Virtual::Object.new.padded(1 + length())
padded(1 + length())
end
def == other