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

#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.



673
674
675
676
677
678
679
680
681
682
683
684
685
# File 'lib/typeprof/core/graph/box.rb', line 673

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.



689
690
691
# File 'lib/typeprof/core/graph/box.rb', line 689

def cpath
  @cpath
end

#new_midObject (readonly)

Returns the value of attribute new_mid.



689
690
691
# File 'lib/typeprof/core/graph/box.rb', line 689

def new_mid
  @new_mid
end

#nodeObject

Returns the value of attribute node.



687
688
689
# File 'lib/typeprof/core/graph/box.rb', line 687

def node
  @node
end

#old_midObject (readonly)

Returns the value of attribute old_mid.



689
690
691
# File 'lib/typeprof/core/graph/box.rb', line 689

def old_mid
  @old_mid
end

#retObject (readonly)

Returns the value of attribute ret.



689
690
691
# File 'lib/typeprof/core/graph/box.rb', line 689

def ret
  @ret
end

#singletonObject (readonly)

Returns the value of attribute singleton.



689
690
691
# File 'lib/typeprof/core/graph/box.rb', line 689

def singleton
  @singleton
end

Instance Method Details

#destroy(genv) ⇒ Object



691
692
693
694
695
696
697
# File 'lib/typeprof/core/graph/box.rb', line 691

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



699
700
701
# File 'lib/typeprof/core/graph/box.rb', line 699

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