moving string to parfait

using parfait::word
also rename builtins string to word
This commit is contained in:
Torsten Ruger
2015-05-13 16:17:10 +03:00
parent baca6eb4c6
commit 9d711e7766
16 changed files with 50 additions and 60 deletions

View File

@@ -1,5 +1,5 @@
module Virtual
class Constant < ::Virtual::Object
end
class TrueConstant < Constant
@@ -10,7 +10,7 @@ module Virtual
end
# another abstract "marker" class (so we can check for it)
# derived classes are Boot/Meta Class and StringConstant
# derived classes are Boot/Meta Class and StringConstant
class ObjectConstant < Constant
def type
Virtual::Reference
@@ -32,36 +32,5 @@ module Virtual
integer >= 0 and integer <= 255
end
end
# The name really says it all.
# The only interesting thing is storage.
# Currently string are stored "inline" , ie in the code segment.
# Mainly because that works an i aint no elf expert.
class StringConstant < ObjectConstant
def initialize str
@string = str
end
attr_reader :string
def result= value
raise "called"
class_for(MoveInstruction).new(value , self , :opcode => :mov)
end
def clazz
Space.space.get_or_create_class(:String)
end
def layout
Virtual::Object.layout
end
def mem_length
padded(1 + string.length)
end
def position
return @position if @position
return @string.position if @string.position
super
end
end
end
end