Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Truffle] Recursive inline error #3122

Closed
chrisseaton opened this issue Jul 9, 2015 · 1 comment
Closed

[Truffle] Recursive inline error #3122

chrisseaton opened this issue Jul 9, 2015 · 1 comment
Assignees
Milestone

Comments

@chrisseaton
Copy link
Contributor

Program causes recursive inline errors in Graal on truffle-head but not master. -J-G:TruffleMaximumRecursiveInlining=1 or -J-G:-TruffleFunctionInlining works around.

#copy of observer.rb from ruby core library
#removed code which is not necessary for the example
module Observable

  def add_observer(observer)
  @observer_peers = [] unless defined? @observer_peers
  @observer_peers.push observer
  end

  def changed(state=true)
  @observer_state = state
  end

def notify_observers(*arg)
  if @observer_state
    for i in @observer_peers.dup
      i.update(*arg)
    end

    @observer_state = false
  end
  end
end


class Source
   include Observable

    def emit(v)
    changed(true)
    notify_observers(v)
    end
end


class Node         
  include Observable

  def initialize(ob)
    ob.add_observer(self)
  end

  def update(v) 
    changed(true)
    notify_observers(v)
  end
end

class Sink
  def initialize(ob)
    ob.add_observer(self)
  end

  def update(v) 
    @res = v
  end

  def res
    return @res
  end
end


#we create a chain of source -> node -> ... -> sink
s = Source.new
cur = s
for num in 1 .. 8
  cur = Node.new(cur)
end
sink = Sink.new(cur)

for i in 1 .. 15000
  s.emit(i)
end

puts sink.res
@chrisseaton chrisseaton self-assigned this Jul 9, 2015
@chrisseaton chrisseaton added this to the truffle-dev milestone Jul 9, 2015
@chrisseaton
Copy link
Contributor Author

Seems to have fixed itself.

@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants