renamed method definition to compiled method
This commit is contained in:
parent
e09d3c2f65
commit
7d35732923
@ -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.
|
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 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
|
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.
|
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
|
#### 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
|
The first argument to the compile method is the CompiledMethod. 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
|
CompiledMethod. In fact Instructions are a linked list and so the CompiledMethod only hold the head, and the current
|
||||||
insertion point.
|
insertion point.
|
||||||
|
|
||||||
Code is added to the method (using add()), rather than working with the actual instructions. This is so each compile method
|
Code is added to the method (using add()), rather than working with the actual instructions. This is so each compile method
|
||||||
|
@ -7,7 +7,7 @@ module Ast
|
|||||||
p.name
|
p.name
|
||||||
end
|
end
|
||||||
r = receiver ? receiver.compile(method,message) : Virtual::Self.new()
|
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
|
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 = Virtual::BootSpace.space.get_or_create_class(new_method.class_name)
|
||||||
clazz.add_instance_method new_method
|
clazz.add_instance_method new_method
|
||||||
|
@ -7,7 +7,7 @@ module Salama
|
|||||||
# As we write before we recurse (save a push) we write the number backwards
|
# As we write before we recurse (save a push) we write the number backwards
|
||||||
# arguments: string address , integer
|
# arguments: string address , integer
|
||||||
def self.utoa context
|
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
|
return utoa_function
|
||||||
str_addr = utoa_function.receiver
|
str_addr = utoa_function.receiver
|
||||||
number = utoa_function.args.first
|
number = utoa_function.args.first
|
||||||
@ -25,7 +25,7 @@ module Salama
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.putint context
|
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
|
return putint_function
|
||||||
buffer = Virtual::StringConstant.new(" ") # create a buffer
|
buffer = Virtual::StringConstant.new(" ") # create a buffer
|
||||||
context.object_space.add_object buffer # and save it (function local variable: a no no)
|
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
|
# 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
|
# not my hand off course, found in the net http://www.peter-cockerell.net/aalp/html/ch-5.html
|
||||||
def self.fibo context
|
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
|
return fibo_function
|
||||||
result = fibo_function.return_type
|
result = fibo_function.return_type
|
||||||
int = fibo_function.receiver
|
int = fibo_function.receiver
|
||||||
|
@ -6,7 +6,7 @@ module Salama
|
|||||||
# set/get instance variable use it.
|
# 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.
|
# 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
|
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
|
return index_function
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ module Salama
|
|||||||
# end
|
# 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
|
# 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
|
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
|
return get_function
|
||||||
me = get_function.receiver
|
me = get_function.receiver
|
||||||
var_name = get_function.args.first
|
var_name = get_function.args.first
|
||||||
@ -44,7 +44,7 @@ module Salama
|
|||||||
end
|
end
|
||||||
|
|
||||||
def _set_instance_variable(context , name = Virtual::Integer , value = Virtual::Integer )
|
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
|
return set_function
|
||||||
receiver set_function
|
receiver set_function
|
||||||
me = set_function.receiver
|
me = set_function.receiver
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module Salama
|
module Salama
|
||||||
module Kernel
|
module Kernel
|
||||||
def self.putstring context
|
def self.putstring context
|
||||||
function = Virtual::MethodDefinition.new(:putstring , [] )
|
function = Virtual::CompiledMethod.new(:putstring , [] )
|
||||||
return function
|
return function
|
||||||
ret = Virtual::RegisterMachine.instance.write_stdout(function)
|
ret = Virtual::RegisterMachine.instance.write_stdout(function)
|
||||||
function.set_return ret
|
function.set_return ret
|
||||||
@ -11,15 +11,15 @@ module Salama
|
|||||||
class String
|
class String
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
def get context , index = Virtual::Integer
|
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
|
return get_function
|
||||||
end
|
end
|
||||||
def set context , index = Virtual::Integer , char = Virtual::Integer
|
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
|
return set_function
|
||||||
end
|
end
|
||||||
def puts context
|
def puts context
|
||||||
puts_function = Virtual::MethodDefinition.new(:puts , [] )
|
puts_function = Virtual::CompiledMethod.new(:puts , [] )
|
||||||
return puts_function
|
return puts_function
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module Salama
|
module Salama
|
||||||
module Kernel
|
module Kernel
|
||||||
def self.exit context
|
def self.exit context
|
||||||
function = Virtual::MethodDefinition.new(:exit , [] , Virtual::Integer)
|
function = Virtual::CompiledMethod.new(:exit , [] , Virtual::Integer)
|
||||||
return function
|
return function
|
||||||
ret = Virtual::RegisterMachine.instance.exit(function)
|
ret = Virtual::RegisterMachine.instance.exit(function)
|
||||||
function.set_return ret
|
function.set_return ret
|
||||||
|
@ -13,7 +13,7 @@ require "virtual/meta_class"
|
|||||||
end
|
end
|
||||||
attr_reader :name , :instance_methods , :meta_class , :context , :super_class_name
|
attr_reader :name , :instance_methods , :meta_class , :context , :super_class_name
|
||||||
def add_instance_method method
|
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
|
raise "syserr " unless method.name.is_a? Symbol
|
||||||
@instance_methods << method
|
@instance_methods << method
|
||||||
end
|
end
|
||||||
|
@ -52,7 +52,7 @@ module Register
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def assemble_MethodDefinition(method)
|
def assemble_CompiledMethod(method)
|
||||||
assemble_object(method.name)
|
assemble_object(method.name)
|
||||||
method.blocks.each do |block|
|
method.blocks.each do |block|
|
||||||
assemble_object(block)
|
assemble_object(block)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module Register
|
module Register
|
||||||
# This implements call logic, which is simply like a c call (not send, that involves lookup and all sorts)
|
# 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.
|
# and call it.
|
||||||
#
|
#
|
||||||
# The only slight snag is that we would need to assemble before getting the address, but to assemble
|
# The only slight snag is that we would need to assemble before getting the address, but to assemble
|
||||||
|
@ -53,7 +53,7 @@ module Register
|
|||||||
length + link_Array(clazz.instance_methods , at + length)
|
length + link_Array(clazz.instance_methods , at + length)
|
||||||
end
|
end
|
||||||
|
|
||||||
def link_MethodDefinition(method , at)
|
def link_CompiledMethod(method , at)
|
||||||
length = members(2)
|
length = members(2)
|
||||||
length += link_object(method.name ,at + length)
|
length += link_object(method.name ,at + length)
|
||||||
# NOT an ARRAY, just a bag of bytes
|
# NOT an ARRAY, just a bag of bytes
|
||||||
|
@ -2,7 +2,7 @@ module Sof
|
|||||||
class Volotile
|
class Volotile
|
||||||
@@mapping = {
|
@@mapping = {
|
||||||
Virtual::Block => [:method],
|
Virtual::Block => [:method],
|
||||||
Virtual::MethodDefinition => [:current]
|
Virtual::CompiledMethod => [:current]
|
||||||
}
|
}
|
||||||
def self.attributes clazz
|
def self.attributes clazz
|
||||||
@@mapping[clazz] || []
|
@@mapping[clazz] || []
|
||||||
|
@ -18,7 +18,7 @@ module Virtual
|
|||||||
def initialize machine = nil
|
def initialize machine = nil
|
||||||
super()
|
super()
|
||||||
@classes = {}
|
@classes = {}
|
||||||
@main = Virtual::MethodDefinition.new("main" , [] )
|
@main = Virtual::CompiledMethod.new("main" , [] )
|
||||||
#global objects (data)
|
#global objects (data)
|
||||||
@objects = []
|
@objects = []
|
||||||
boot_classes! # boot is a verb here
|
boot_classes! # boot is a verb here
|
||||||
@ -63,7 +63,7 @@ module Virtual
|
|||||||
end
|
end
|
||||||
# boot the classes, ie create a minimal set of classes with a minimal set of functions
|
# 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
|
# 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)
|
# implementation of the method (ie a method object), not actually try to implement it (as that's impossible in ruby)
|
||||||
def boot_classes!
|
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
|
# very fiddly chicken 'n egg problem. Functions need to be in the right order, and in fact we have to define some
|
||||||
|
@ -29,10 +29,10 @@ module Virtual
|
|||||||
# These (eg if/while) blocks may themselves have linear blocks ,but the last of these
|
# 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.
|
# 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
|
#return the main function (the top level) into which code is compiled
|
||||||
def MethodDefinition.main
|
def CompiledMethod.main
|
||||||
MethodDefinition.new(:main , [] )
|
CompiledMethod.new(:main , [] )
|
||||||
end
|
end
|
||||||
def initialize name , args , receiver = Virtual::Self.new , return_type = Virtual::Mystery
|
def initialize name , args , receiver = Virtual::Self.new , return_type = Virtual::Mystery
|
||||||
@name = name.to_sym
|
@name = name.to_sym
|
@ -57,7 +57,7 @@ module Virtual
|
|||||||
def compile_main bytes
|
def compile_main bytes
|
||||||
syntax = @parser.parse_with_debug(bytes)
|
syntax = @parser.parse_with_debug(bytes)
|
||||||
parts = Parser::Transform.new.apply(syntax)
|
parts = Parser::Transform.new.apply(syntax)
|
||||||
main = Virtual::MethodDefinition.main
|
main = Virtual::CompiledMethod.main
|
||||||
expressions = parts.compile( main , self.message )
|
expressions = parts.compile( main , self.message )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ end
|
|||||||
|
|
||||||
#require_relative "list"
|
#require_relative "list"
|
||||||
require_relative "instruction"
|
require_relative "instruction"
|
||||||
require_relative "method_definition"
|
require_relative "compiled_method"
|
||||||
require_relative "frame"
|
require_relative "frame"
|
||||||
require_relative "message"
|
require_relative "message"
|
||||||
require_relative "value"
|
require_relative "value"
|
||||||
|
@ -9,7 +9,7 @@ def foo(x)
|
|||||||
5
|
5
|
||||||
end
|
end
|
||||||
HERE
|
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
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ def foo()
|
|||||||
end
|
end
|
||||||
foo()
|
foo()
|
||||||
HERE
|
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
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ def String.length(x)
|
|||||||
@length
|
@length
|
||||||
end
|
end
|
||||||
HERE
|
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
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ def ofthen(n)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
HERE
|
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
|
check
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user