diff --git a/lib/ast/README.md b/lib/ast/README.md index d74c0a96..b8c5230c 100644 --- a/lib/ast/README.md +++ b/lib/ast/README.md @@ -14,7 +14,7 @@ When compiling we deal with two times, compile-time and run-time. All the headac Similarly, the result of compiling is two-fold: a static and a dynamic part. - the static part are objects like the constants, but also defined classes and their methods -- the dynamic part is the code, which is stored as streams of instructions in the MethodDefinition +- the dynamic part is the code, which is stored as streams of instructions in the CompiledMethod Too make things a little simpler, we create a very high level instruction stream at first and then run transformation and optimisation passes on the stream to improve it. @@ -23,8 +23,8 @@ Each ast class gets a compile method that does the compilation. #### Method Definition and Instructions -The first argument to the compile method is the MethodDefinition. All code is encoded as a stream of Instructions in the -MethodDefinition. In fact Instructions are a linked list and so the MethodDefinition only hold the head, and the current +The first argument to the compile method is the CompiledMethod. All code is encoded as a stream of Instructions in the +CompiledMethod. In fact Instructions are a linked list and so the CompiledMethod only hold the head, and the current insertion point. Code is added to the method (using add()), rather than working with the actual instructions. This is so each compile method diff --git a/lib/ast/function_expression.rb b/lib/ast/function_expression.rb index 78666771..3307f29c 100644 --- a/lib/ast/function_expression.rb +++ b/lib/ast/function_expression.rb @@ -7,7 +7,7 @@ module Ast p.name end r = receiver ? receiver.compile(method,message) : Virtual::Self.new() - new_method = Virtual::MethodDefinition.new(name , args , r ) + new_method = Virtual::CompiledMethod.new(name , args , r ) new_method.class_name = r.is_a?(BootClass) ? r.name : method.class_name clazz = Virtual::BootSpace.space.get_or_create_class(new_method.class_name) clazz.add_instance_method new_method diff --git a/lib/kernel/integer.rb b/lib/kernel/integer.rb index 25d12f30..bcd3a3e3 100644 --- a/lib/kernel/integer.rb +++ b/lib/kernel/integer.rb @@ -7,7 +7,7 @@ module Salama # As we write before we recurse (save a push) we write the number backwards # arguments: string address , integer def self.utoa context - utoa_function = Virtual::MethodDefinition.new(:utoa , [ Virtual::Integer ] , Virtual::Integer ,Virtual::Integer ) + utoa_function = Virtual::CompiledMethod.new(:utoa , [ Virtual::Integer ] , Virtual::Integer ,Virtual::Integer ) return utoa_function str_addr = utoa_function.receiver number = utoa_function.args.first @@ -25,7 +25,7 @@ module Salama end def self.putint context - putint_function = Virtual::MethodDefinition.new(:putint , [] , Virtual::Integer ,Virtual::Integer ) + putint_function = Virtual::CompiledMethod.new(:putint , [] , Virtual::Integer ,Virtual::Integer ) return putint_function buffer = Virtual::StringConstant.new(" ") # create a buffer context.object_space.add_object buffer # and save it (function local variable: a no no) @@ -52,7 +52,7 @@ module Salama # a hand coded version of the fibonachi numbers # not my hand off course, found in the net http://www.peter-cockerell.net/aalp/html/ch-5.html def self.fibo context - fibo_function = Virtual::MethodDefinition.new(:fibo , [] , Virtual::Integer ,Virtual::Integer ) + fibo_function = Virtual::CompiledMethod.new(:fibo , [] , Virtual::Integer ,Virtual::Integer ) return fibo_function result = fibo_function.return_type int = fibo_function.receiver diff --git a/lib/kernel/object.rb b/lib/kernel/object.rb index d558633a..423a30ba 100644 --- a/lib/kernel/object.rb +++ b/lib/kernel/object.rb @@ -6,7 +6,7 @@ module Salama # set/get instance variable use it. # This is just a placeholder, as we code this in ruby, but the instance methods need the definition before. def index_of context , name = Virtual::Integer - index_function = Virtual::MethodDefinition.new(:index_of , Virtual::Reference , [Virtual::Reference] , Virtual::Integer ) + index_function = Virtual::CompiledMethod.new(:index_of , Virtual::Reference , [Virtual::Reference] , Virtual::Integer ) return index_function end @@ -23,7 +23,7 @@ module Salama # end # The at_index is just "below" the api, something we need but don't want to expose, so we can't code the above in ruby def _get_instance_variable context , name = Virtual::Integer - get_function = Virtual::MethodDefinition.new(:_get_instance_variable , [ Virtual::Reference ] , Virtual::Reference ,Virtual::Mystery ) + get_function = Virtual::CompiledMethod.new(:_get_instance_variable , [ Virtual::Reference ] , Virtual::Reference ,Virtual::Mystery ) return get_function me = get_function.receiver var_name = get_function.args.first @@ -44,7 +44,7 @@ module Salama end def _set_instance_variable(context , name = Virtual::Integer , value = Virtual::Integer ) - set_function = Virtual::MethodDefinition.new(:_set_instance_variable ,[Virtual::Reference ,Virtual::Reference], Virtual::Reference ,Virtual::Mystery ) + set_function = Virtual::CompiledMethod.new(:_set_instance_variable ,[Virtual::Reference ,Virtual::Reference], Virtual::Reference ,Virtual::Mystery ) return set_function receiver set_function me = set_function.receiver diff --git a/lib/kernel/string.rb b/lib/kernel/string.rb index bacfd729..e93a2f74 100644 --- a/lib/kernel/string.rb +++ b/lib/kernel/string.rb @@ -1,7 +1,7 @@ module Salama module Kernel def self.putstring context - function = Virtual::MethodDefinition.new(:putstring , [] ) + function = Virtual::CompiledMethod.new(:putstring , [] ) return function ret = Virtual::RegisterMachine.instance.write_stdout(function) function.set_return ret @@ -11,15 +11,15 @@ module Salama class String module ClassMethods def get context , index = Virtual::Integer - get_function = Virtual::MethodDefinition.new(:get , [ Virtual::Integer] , Virtual::Integer , Virtual::Integer ) + get_function = Virtual::CompiledMethod.new(:get , [ Virtual::Integer] , Virtual::Integer , Virtual::Integer ) return get_function end def set context , index = Virtual::Integer , char = Virtual::Integer - set_function = Virtual::MethodDefinition.new(:set , [Virtual::Integer, Virtual::Integer] , Virtual::Integer ,Virtual::Integer ) + set_function = Virtual::CompiledMethod.new(:set , [Virtual::Integer, Virtual::Integer] , Virtual::Integer ,Virtual::Integer ) return set_function end def puts context - puts_function = Virtual::MethodDefinition.new(:puts , [] ) + puts_function = Virtual::CompiledMethod.new(:puts , [] ) return puts_function end end diff --git a/lib/kernel/system.rb b/lib/kernel/system.rb index 3fa8d8bf..a70c9681 100644 --- a/lib/kernel/system.rb +++ b/lib/kernel/system.rb @@ -1,7 +1,7 @@ module Salama module Kernel def self.exit context - function = Virtual::MethodDefinition.new(:exit , [] , Virtual::Integer) + function = Virtual::CompiledMethod.new(:exit , [] , Virtual::Integer) return function ret = Virtual::RegisterMachine.instance.exit(function) function.set_return ret diff --git a/lib/parfait/boot_class.rb b/lib/parfait/boot_class.rb index 24cd3813..ce0fb841 100644 --- a/lib/parfait/boot_class.rb +++ b/lib/parfait/boot_class.rb @@ -13,7 +13,7 @@ require "virtual/meta_class" end attr_reader :name , :instance_methods , :meta_class , :context , :super_class_name def add_instance_method method - raise "not a method #{method.class} #{method.inspect}" unless method.is_a? Virtual::MethodDefinition + raise "not a method #{method.class} #{method.inspect}" unless method.is_a? Virtual::CompiledMethod raise "syserr " unless method.name.is_a? Symbol @instance_methods << method end diff --git a/lib/register/assembler.rb b/lib/register/assembler.rb index 965e53fc..051f8ad3 100644 --- a/lib/register/assembler.rb +++ b/lib/register/assembler.rb @@ -52,7 +52,7 @@ module Register end end - def assemble_MethodDefinition(method) + def assemble_CompiledMethod(method) assemble_object(method.name) method.blocks.each do |block| assemble_object(block) diff --git a/lib/register/call_implementation.rb b/lib/register/call_implementation.rb index 0b60a482..bc002bc1 100644 --- a/lib/register/call_implementation.rb +++ b/lib/register/call_implementation.rb @@ -1,7 +1,7 @@ module Register # This implements call logic, which is simply like a c call (not send, that involves lookup and all sorts) # - # The only target for a call is a MethodDefinition, so we just need to get the address for the code + # The only target for a call is a CompiledMethod, so we just need to get the address for the code # and call it. # # The only slight snag is that we would need to assemble before getting the address, but to assemble diff --git a/lib/register/linker.rb b/lib/register/linker.rb index bf19a453..4af38b1d 100644 --- a/lib/register/linker.rb +++ b/lib/register/linker.rb @@ -53,7 +53,7 @@ module Register length + link_Array(clazz.instance_methods , at + length) end - def link_MethodDefinition(method , at) + def link_CompiledMethod(method , at) length = members(2) length += link_object(method.name ,at + length) # NOT an ARRAY, just a bag of bytes diff --git a/lib/sof/volotile.rb b/lib/sof/volotile.rb index cf18a8f1..45a0cef3 100644 --- a/lib/sof/volotile.rb +++ b/lib/sof/volotile.rb @@ -2,7 +2,7 @@ module Sof class Volotile @@mapping = { Virtual::Block => [:method], - Virtual::MethodDefinition => [:current] + Virtual::CompiledMethod => [:current] } def self.attributes clazz @@mapping[clazz] || [] diff --git a/lib/virtual/boot_space.rb b/lib/virtual/boot_space.rb index 32ad4d25..092aa4fd 100644 --- a/lib/virtual/boot_space.rb +++ b/lib/virtual/boot_space.rb @@ -18,7 +18,7 @@ module Virtual def initialize machine = nil super() @classes = {} - @main = Virtual::MethodDefinition.new("main" , [] ) + @main = Virtual::CompiledMethod.new("main" , [] ) #global objects (data) @objects = [] boot_classes! # boot is a verb here @@ -63,7 +63,7 @@ module Virtual end # boot the classes, ie create a minimal set of classes with a minimal set of functions # minimal means only that which can not be coded in ruby - # MethodDefinitions are grabbed from respective modules by sending the method name. This should return the + # CompiledMethods are grabbed from respective modules by sending the method name. This should return the # implementation of the method (ie a method object), not actually try to implement it (as that's impossible in ruby) def boot_classes! # very fiddly chicken 'n egg problem. Functions need to be in the right order, and in fact we have to define some diff --git a/lib/virtual/method_definition.rb b/lib/virtual/compiled_method.rb similarity index 98% rename from lib/virtual/method_definition.rb rename to lib/virtual/compiled_method.rb index 948d8196..3f2d7967 100644 --- a/lib/virtual/method_definition.rb +++ b/lib/virtual/compiled_method.rb @@ -29,10 +29,10 @@ module Virtual # These (eg if/while) blocks may themselves have linear blocks ,but the last of these # MUST have an uncoditional branch. And remember, all roads lead to return. - class MethodDefinition < Virtual::Object + class CompiledMethod < Virtual::Object #return the main function (the top level) into which code is compiled - def MethodDefinition.main - MethodDefinition.new(:main , [] ) + def CompiledMethod.main + CompiledMethod.new(:main , [] ) end def initialize name , args , receiver = Virtual::Self.new , return_type = Virtual::Mystery @name = name.to_sym diff --git a/lib/virtual/machine.rb b/lib/virtual/machine.rb index 5273dfe7..cd9bb730 100644 --- a/lib/virtual/machine.rb +++ b/lib/virtual/machine.rb @@ -57,7 +57,7 @@ module Virtual def compile_main bytes syntax = @parser.parse_with_debug(bytes) parts = Parser::Transform.new.apply(syntax) - main = Virtual::MethodDefinition.main + main = Virtual::CompiledMethod.main expressions = parts.compile( main , self.message ) end @@ -76,7 +76,7 @@ end #require_relative "list" require_relative "instruction" -require_relative "method_definition" +require_relative "compiled_method" require_relative "frame" require_relative "message" require_relative "value" diff --git a/test/virtual/test_methods.rb b/test/virtual/test_methods.rb index f0ecb9e2..34724792 100644 --- a/test/virtual/test_methods.rb +++ b/test/virtual/test_methods.rb @@ -9,7 +9,7 @@ def foo(x) 5 end HERE - @output = "---RETURN_MARKER- &1 !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :fooRETURN_MARKER args:RETURN_MARKER - :xRETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfRETURN_MARKER index: 1RETURN_MARKER type: !ruby/class 'Virtual::Mystery'RETURN_MARKER return_type: &2 !ruby/object:Virtual::ReturnRETURN_MARKER index: 0RETURN_MARKER type: !ruby/class 'Virtual::Integer'RETURN_MARKER blocks:RETURN_MARKER - &3 !ruby/object:Virtual::BlockRETURN_MARKER method: *1RETURN_MARKER name: :fooRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::SetRETURN_MARKER to: *2RETURN_MARKER from: !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 5RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *1RETURN_MARKER name: :foo_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *3RETURN_MARKER" + @output = "---RETURN_MARKER- &1 !ruby/object:Virtual::CompiledMethodRETURN_MARKER name: :fooRETURN_MARKER args:RETURN_MARKER - :xRETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfRETURN_MARKER index: 1RETURN_MARKER type: !ruby/class 'Virtual::Mystery'RETURN_MARKER return_type: &2 !ruby/object:Virtual::ReturnRETURN_MARKER index: 0RETURN_MARKER type: !ruby/class 'Virtual::Integer'RETURN_MARKER blocks:RETURN_MARKER - &3 !ruby/object:Virtual::BlockRETURN_MARKER method: *1RETURN_MARKER name: :fooRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::SetRETURN_MARKER to: *2RETURN_MARKER from: !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 5RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *1RETURN_MARKER name: :foo_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *3RETURN_MARKER" check end @@ -20,7 +20,7 @@ def foo() end foo() HERE - @output = "---RETURN_MARKER- &2 !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :fooRETURN_MARKER args: []RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfRETURN_MARKER index: 1RETURN_MARKER type: &1 !ruby/class 'Virtual::Mystery'RETURN_MARKER return_type: !ruby/object:Virtual::ReturnRETURN_MARKER index: 0RETURN_MARKER type: *1RETURN_MARKER blocks:RETURN_MARKER - &5 !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :fooRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::SetRETURN_MARKER to: !ruby/object:Virtual::NewSelfRETURN_MARKER index: 1RETURN_MARKER type: *1RETURN_MARKER from: &3 !ruby/object:Virtual::SelfRETURN_MARKER index: 1RETURN_MARKER type: *1RETURN_MARKER - !ruby/object:Virtual::SetRETURN_MARKER to: !ruby/object:Virtual::NewNameRETURN_MARKER index: 3RETURN_MARKER type: *1RETURN_MARKER from: :putsRETURN_MARKER - !ruby/object:Virtual::SetRETURN_MARKER to: !ruby/object:Virtual::NewMessageSlotRETURN_MARKER index: 4RETURN_MARKER type: !ruby/class 'Virtual::Reference'RETURN_MARKER from: &4 !ruby/object:Virtual::StringConstantRETURN_MARKER string: HelloRETURN_MARKER - !ruby/object:Virtual::MessageSendRETURN_MARKER name: :putsRETURN_MARKER me: *3RETURN_MARKER args:RETURN_MARKER - *4RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :foo_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *5RETURN_MARKER- !ruby/object:Virtual::ReturnRETURN_MARKER index: 0RETURN_MARKER type: *1RETURN_MARKER" + @output = "---RETURN_MARKER- &2 !ruby/object:Virtual::CompiledMethodRETURN_MARKER name: :fooRETURN_MARKER args: []RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfRETURN_MARKER index: 1RETURN_MARKER type: &1 !ruby/class 'Virtual::Mystery'RETURN_MARKER return_type: !ruby/object:Virtual::ReturnRETURN_MARKER index: 0RETURN_MARKER type: *1RETURN_MARKER blocks:RETURN_MARKER - &5 !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :fooRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::SetRETURN_MARKER to: !ruby/object:Virtual::NewSelfRETURN_MARKER index: 1RETURN_MARKER type: *1RETURN_MARKER from: &3 !ruby/object:Virtual::SelfRETURN_MARKER index: 1RETURN_MARKER type: *1RETURN_MARKER - !ruby/object:Virtual::SetRETURN_MARKER to: !ruby/object:Virtual::NewNameRETURN_MARKER index: 3RETURN_MARKER type: *1RETURN_MARKER from: :putsRETURN_MARKER - !ruby/object:Virtual::SetRETURN_MARKER to: !ruby/object:Virtual::NewMessageSlotRETURN_MARKER index: 4RETURN_MARKER type: !ruby/class 'Virtual::Reference'RETURN_MARKER from: &4 !ruby/object:Virtual::StringConstantRETURN_MARKER string: HelloRETURN_MARKER - !ruby/object:Virtual::MessageSendRETURN_MARKER name: :putsRETURN_MARKER me: *3RETURN_MARKER args:RETURN_MARKER - *4RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :foo_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *5RETURN_MARKER- !ruby/object:Virtual::ReturnRETURN_MARKER index: 0RETURN_MARKER type: *1RETURN_MARKER" check end @@ -30,7 +30,7 @@ def String.length(x) @length end HERE - @output = "---RETURN_MARKER- &7 !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :lengthRETURN_MARKER args:RETURN_MARKER - :xRETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: &6 !ruby/object:Boot::BootClassRETURN_MARKER instance_methods:RETURN_MARKER - &2 !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :getRETURN_MARKER args:RETURN_MARKER - &1 !ruby/class 'Virtual::Integer'RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: *1RETURN_MARKER return_type: *1RETURN_MARKER blocks:RETURN_MARKER - &3 !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :getRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :get_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *3RETURN_MARKER - &4 !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :setRETURN_MARKER args:RETURN_MARKER - *1RETURN_MARKER - *1RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: *1RETURN_MARKER return_type: *1RETURN_MARKER blocks:RETURN_MARKER - &5 !ruby/object:Virtual::BlockRETURN_MARKER method: *4RETURN_MARKER name: :setRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *4RETURN_MARKER name: :set_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *5RETURN_MARKER name: :StringRETURN_MARKER super_class_name: :ObjectRETURN_MARKER meta_class: !ruby/object:Boot::MetaClassRETURN_MARKER functions: []RETURN_MARKER me_self: *6RETURN_MARKER return_type: !ruby/object:Virtual::ReturnRETURN_MARKER index: 0RETURN_MARKER type: !ruby/class 'Virtual::Mystery'RETURN_MARKER blocks:RETURN_MARKER - &8 !ruby/object:Virtual::BlockRETURN_MARKER method: *7RETURN_MARKER name: :lengthRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::InstanceGetRETURN_MARKER name: :lengthRETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *7RETURN_MARKER name: :length_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *8RETURN_MARKER" + @output = "---RETURN_MARKER- &7 !ruby/object:Virtual::CompiledMethodRETURN_MARKER name: :lengthRETURN_MARKER args:RETURN_MARKER - :xRETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: &6 !ruby/object:Boot::BootClassRETURN_MARKER instance_methods:RETURN_MARKER - &2 !ruby/object:Virtual::CompiledMethodRETURN_MARKER name: :getRETURN_MARKER args:RETURN_MARKER - &1 !ruby/class 'Virtual::Integer'RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: *1RETURN_MARKER return_type: *1RETURN_MARKER blocks:RETURN_MARKER - &3 !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :getRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :get_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *3RETURN_MARKER - &4 !ruby/object:Virtual::CompiledMethodRETURN_MARKER name: :setRETURN_MARKER args:RETURN_MARKER - *1RETURN_MARKER - *1RETURN_MARKER locals: []RETURN_MARKER tmps: []RETURN_MARKER receiver: *1RETURN_MARKER return_type: *1RETURN_MARKER blocks:RETURN_MARKER - &5 !ruby/object:Virtual::BlockRETURN_MARKER method: *4RETURN_MARKER name: :setRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *4RETURN_MARKER name: :set_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *5RETURN_MARKER name: :StringRETURN_MARKER super_class_name: :ObjectRETURN_MARKER meta_class: !ruby/object:Boot::MetaClassRETURN_MARKER functions: []RETURN_MARKER me_self: *6RETURN_MARKER return_type: !ruby/object:Virtual::ReturnRETURN_MARKER index: 0RETURN_MARKER type: !ruby/class 'Virtual::Mystery'RETURN_MARKER blocks:RETURN_MARKER - &8 !ruby/object:Virtual::BlockRETURN_MARKER method: *7RETURN_MARKER name: :lengthRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::InstanceGetRETURN_MARKER name: :lengthRETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *7RETURN_MARKER name: :length_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *8RETURN_MARKER" check end @@ -65,7 +65,7 @@ def ofthen(n) end end HERE - @output = "---RETURN_MARKER- &2 !ruby/object:Virtual::MethodDefinitionRETURN_MARKER name: :ofthenRETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::ArgumentRETURN_MARKER name: :nRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER locals:RETURN_MARKER - !ruby/object:Virtual::LocalRETURN_MARKER name: :isitRETURN_MARKER type: &3 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 42RETURN_MARKER - &1 !ruby/object:Virtual::LocalRETURN_MARKER name: :maybenotRETURN_MARKER type: &4 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 667RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfReferenceRETURN_MARKER clazz: RETURN_MARKER return_type: *1RETURN_MARKER blocks:RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthenRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::ImplicitBranchRETURN_MARKER to: &5 !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthen_if_trueRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::FrameSetRETURN_MARKER name: :isitRETURN_MARKER value: *3RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthen_if_falseRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::FrameSetRETURN_MARKER name: :maybenotRETURN_MARKER value: *4RETURN_MARKER - !ruby/object:Virtual::UnconditionalBranchRETURN_MARKER to: &6 !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthen_if_mergeRETURN_MARKER branch: RETURN_MARKER codes: []RETURN_MARKER - *5RETURN_MARKER - *6RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthen_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *6RETURN_MARKER" + @output = "---RETURN_MARKER- &2 !ruby/object:Virtual::CompiledMethodRETURN_MARKER name: :ofthenRETURN_MARKER args:RETURN_MARKER - !ruby/object:Virtual::ArgumentRETURN_MARKER name: :nRETURN_MARKER type: !ruby/object:Virtual::Mystery {}RETURN_MARKER locals:RETURN_MARKER - !ruby/object:Virtual::LocalRETURN_MARKER name: :isitRETURN_MARKER type: &3 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 42RETURN_MARKER - &1 !ruby/object:Virtual::LocalRETURN_MARKER name: :maybenotRETURN_MARKER type: &4 !ruby/object:Virtual::IntegerConstantRETURN_MARKER integer: 667RETURN_MARKER tmps: []RETURN_MARKER receiver: !ruby/object:Virtual::SelfReferenceRETURN_MARKER clazz: RETURN_MARKER return_type: *1RETURN_MARKER blocks:RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthenRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodEnter {}RETURN_MARKER - !ruby/object:Virtual::ImplicitBranchRETURN_MARKER to: &5 !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthen_if_trueRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::FrameSetRETURN_MARKER name: :isitRETURN_MARKER value: *3RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthen_if_falseRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::FrameSetRETURN_MARKER name: :maybenotRETURN_MARKER value: *4RETURN_MARKER - !ruby/object:Virtual::UnconditionalBranchRETURN_MARKER to: &6 !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthen_if_mergeRETURN_MARKER branch: RETURN_MARKER codes: []RETURN_MARKER - *5RETURN_MARKER - *6RETURN_MARKER - !ruby/object:Virtual::BlockRETURN_MARKER method: *2RETURN_MARKER name: :ofthen_returnRETURN_MARKER branch: RETURN_MARKER codes:RETURN_MARKER - !ruby/object:Virtual::MethodReturn {}RETURN_MARKER current: *6RETURN_MARKER" check end