class Orbacle::Worklist

Constants

BlockLambda
BlockNode
MessageSend
SuperSend

Attributes

handled_message_sends[R]
message_sends[R]
nodes[RW]

Public Class Methods

new() click to toggle source
# File lib/orbacle/worklist.rb, line 12
def initialize
  @message_sends = Set.new
  @nodes = FastContainers::PriorityQueue.new(:max)
  @handled_message_sends = Hash.new {|h,k| h[k] = [] }
  @nodes_counter = {}
  @nodes_mapping = {}
end

Public Instance Methods

add_message_send(message_send) click to toggle source
# File lib/orbacle/worklist.rb, line 23
def add_message_send(message_send)
  @message_sends << message_send
end
count_node(node) click to toggle source
# File lib/orbacle/worklist.rb, line 40
def count_node(node)
  @nodes_counter[node] = @nodes_counter.fetch(node, 0) + 1
end
enqueue_node(v) click to toggle source
# File lib/orbacle/worklist.rb, line 27
def enqueue_node(v)
  if !@nodes_mapping[v]
    @nodes.push(v, 1)
    @nodes_mapping[v] = true
  end
end
limit_exceeded?(node) click to toggle source
# File lib/orbacle/worklist.rb, line 44
def limit_exceeded?(node)
  # @nodes_counter.fetch(node, 0) > 100
  false
end
mark_message_send_as_handled(message_send, handled_type) click to toggle source
# File lib/orbacle/worklist.rb, line 53
def mark_message_send_as_handled(message_send, handled_type)
  handled_message_sends[message_send] << handled_type
end
message_send_handled?(message_send) click to toggle source
# File lib/orbacle/worklist.rb, line 49
def message_send_handled?(message_send)
  !handled_message_sends[message_send].empty?
end
message_send_handled_by_type?(message_send, handled_type) click to toggle source
# File lib/orbacle/worklist.rb, line 57
def message_send_handled_by_type?(message_send, handled_type)
  handled_message_sends[message_send].include?(handled_type)
end
pop_node() click to toggle source
# File lib/orbacle/worklist.rb, line 34
def pop_node
  e = @nodes.pop
  @nodes_mapping[e] = false
  e
end