writing-a-compiler-in-ruby
writing-a-compiler-in-ruby copied to clipboard
Method call in method body (e.g: attr_accessor) causes "nested" calls
class Foo
attr_accessor :seq
end
the attr_accessor bit turns into:
# callm :self.:attr_accessor
subl $20, %esp
movl $2, %ebx
movl Foo, %eax
movl %eax, (%esp)
movl $3481, 4(%esp)
movl (%eax), %edx
movl 12(%edx), %eax
call *%eax
addl $20, %esp
# callm self.attr_accessor END
call *%eax
(notice the second call &%eax)