Re: [jruby-dev] Compiler IR thoughts

2009-07-28 Thread Charles Oliver Nutter
On Fri, Jul 24, 2009 at 9:34 AM, Ola Bini wrote: > Subramanya Sastry wrote: >> >> >> So, the real question here boils down to the previous one: can we safely >> determine what local variables are captured by closures?  In that sense, >> this is not a new special case that we need > > No, that's not

Re: [jruby-dev] Compiler IR thoughts

2009-07-28 Thread Charles Oliver Nutter
On Wed, Jul 22, 2009 at 12:11 AM, Subramanya Sastry wrote: >> So for example, if we know we're doing a call that is likely to access >> the caller's frame, like "public" or "private", the IR could also >> include information about preparing a frame or ensuring a frame has >> already been prepared.

Re: [jruby-dev] Compiler IR thoughts

2009-07-24 Thread Subramanya Sastry
On Fri, Jul 24, 2009 at 9:34 AM, Ola Bini wrote: > Subramanya Sastry wrote: > >> >> >> So, the real question here boils down to the previous one: can we safely >> determine what local variables are captured by closures? In that sense, >> this is not a new special case that we need >> > No, that'

Re: [jruby-dev] Compiler IR thoughts

2009-07-24 Thread Ola Bini
Subramanya Sastry wrote: So, the real question here boils down to the previous one: can we safely determine what local variables are captured by closures? In that sense, this is not a new special case that we need No, that's not really possible. Seeing as you can do something like this: de

Re: [jruby-dev] Compiler IR thoughts

2009-07-23 Thread Thomas E Enebo
Thanks for the clarifications subbu...This all makes sense. More generically I consider ANY variable which a block you potentially access/manipulate as captured by the block/closure. If you eval in that block the eval can potentially access any variable it can reach from the blocks scope. Since

Re: [jruby-dev] Compiler IR thoughts

2009-07-23 Thread Subramanya Sastry
> > > > Consider this: > > > > o.m1(..) > > o.m2(..) > > > > Since type of o hasn't changed between the 2 calls, you can skip the > method > > table load for the second call.Anyway, I need to understand the call > > protocol in greater detail to comment more. > > This is an interesting use-case

Re: [jruby-dev] Compiler IR thoughts

2009-07-23 Thread Thomas E Enebo
On Wed, Jul 22, 2009 at 2:11 PM, Subramanya Sastry wrote: > > >> Obviously the IR already captures whether a closure accesses its own >> variables or captured variables, right? > > Implicitly yes.  This information will become explicit after reaching defs / > live variable analysis is done to know

Re: [jruby-dev] Compiler IR thoughts

2009-07-21 Thread Subramanya Sastry
Obviously the IR already captures whether a closure accesses its own > variables or captured variables, right? Implicitly yes. This information will become explicit after reaching defs / live variable analysis is done to know whether the variables being access live entirely within the closure bo

[jruby-dev] Compiler IR thoughts

2009-07-21 Thread Charles Oliver Nutter
Subbu: I figured I'd move IR discussions to the dev list, so others can jump in as needed. Reply to the list... I had a few more thoughts on missing IR we probably want to incorporate somehow: framing and scoping stuff. Obviously the IR already captures whether a closure accesses its own variable