2014-10-03 09:25:10 +02:00
|
|
|
module Virtual
|
|
|
|
|
|
|
|
# class for Set instructions, A set is basically a mem move.
|
|
|
|
# to and from are indexes into the known objects(frame,message,self and new_message), these are represented as slots
|
2015-05-06 07:55:14 +02:00
|
|
|
# (see there)
|
2014-10-03 09:25:10 +02:00
|
|
|
# from may be a Constant (Object,Integer,String,Class)
|
|
|
|
class Set < Instruction
|
|
|
|
def initialize to , from
|
|
|
|
@to = to
|
|
|
|
# hard to find afterwards where it came from, so ensure it doesn't happen
|
|
|
|
raise "From must be slot or constant, not symbol #{from}" if from.is_a? Symbol
|
|
|
|
@from = from
|
|
|
|
end
|
2015-05-06 14:15:33 +02:00
|
|
|
attr_reader :from , :to
|
2014-10-03 09:25:10 +02:00
|
|
|
end
|
|
|
|
end
|