Class: TypeProf::Core::MethodAliasBox

Inherits:
Box
  • Object
show all
Defined in:
lib/typeprof/core/graph/box.rb

Instance Attribute Summary collapse

Attributes inherited from Box

#changes, #destroyed

Instance Method Summary collapse

Methods inherited from Box

#add_symbol_proc_call_box, #destroy_symbol_proc_call_boxes, #on_type_added, #on_type_removed, #reuse, #run, #to_s

Constructor Details

#initialize(node, genv, cpath, singleton, new_mid, old_mid) ⇒ MethodAliasBox

Returns a new instance of MethodAliasBox.



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
# File 'lib/typeprof/core/graph/box.rb', line 1045

def initialize(node, genv, cpath, singleton, new_mid, old_mid)
  super(node)
  @cpath = cpath
  @singleton = singleton
  @new_mid = new_mid
  @old_mid = old_mid
  @ret = Source.new(genv.nil_type)

  me = genv.resolve_method(@cpath, @singleton, @new_mid)
  me.add_alias(self, @old_mid)
  me.add_run_all_method_call_boxes(genv) if me.decls.empty?
  genv.add_run(self)
end

Instance Attribute Details

#cpathObject (readonly)

Returns the value of attribute cpath.



1061
1062
1063
# File 'lib/typeprof/core/graph/box.rb', line 1061

def cpath
  @cpath
end

#new_midObject (readonly)

Returns the value of attribute new_mid.



1061
1062
1063
# File 'lib/typeprof/core/graph/box.rb', line 1061

def new_mid
  @new_mid
end

#nodeObject

Returns the value of attribute node.



1059
1060
1061
# File 'lib/typeprof/core/graph/box.rb', line 1059

def node
  @node
end

#old_midObject (readonly)

Returns the value of attribute old_mid.



1061
1062
1063
# File 'lib/typeprof/core/graph/box.rb', line 1061

def old_mid
  @old_mid
end

#retObject (readonly)

Returns the value of attribute ret.



1061
1062
1063
# File 'lib/typeprof/core/graph/box.rb', line 1061

def ret
  @ret
end

#singletonObject (readonly)

Returns the value of attribute singleton.



1061
1062
1063
# File 'lib/typeprof/core/graph/box.rb', line 1061

def singleton
  @singleton
end

Instance Method Details

#destroy(genv) ⇒ Object



1063
1064
1065
1066
1067
1068
1069
# File 'lib/typeprof/core/graph/box.rb', line 1063

def destroy(genv)
  me = genv.resolve_method(@cpath, @singleton, @new_mid)
  me.remove_alias(self)
  me.add_run_all_method_call_boxes(genv) if me.decls.empty?
  genv.add_run(self)
  super(genv)
end

#run0(genv, changes) ⇒ Object



1071
1072
1073
# File 'lib/typeprof/core/graph/box.rb', line 1071

def run0(genv, changes)
  # TODO: what to do?
end