Re: [jruby-dev] JRuby IR: First thoughts

2009-05-09 Thread Charles Oliver Nutter
Thomas E Enebo wrote: This makes me wonder if we cannot actually ascertain the cost of various locking/volatile/active/inactive scenarios. Of course in a pet micro bench of these it may give an unrealistic answer, but it would still be cool to get some understanding of cost. Yeah, we need to

Re: [jruby-dev] JRuby IR: First thoughts

2009-05-09 Thread Thomas E Enebo
On Sat, May 9, 2009 at 11:06 AM, Thomas E Enebo wrote: > On Fri, May 8, 2009 at 10:47 PM, Charles Oliver Nutter > wrote: >> Subramanya Sastry wrote: >>> >>> I may have been wrong.   I had a chance to think through this a little bit >>> more. >>> >>> Consider this ruby code: >>> >>> i = 5 >>> v1 =

Re: [jruby-dev] JRuby IR: First thoughts

2009-05-09 Thread Thomas E Enebo
On Fri, May 8, 2009 at 10:47 PM, Charles Oliver Nutter wrote: > Subramanya Sastry wrote: >> >> I may have been wrong.   I had a chance to think through this a little bit >> more. >> >> Consider this ruby code: >> >> i = 5 >> v1 = i + 1 >> some_random_method_call() >> v2 = i + 1 >> >> In this code

Re: [jruby-dev] JRuby IR: First thoughts

2009-05-08 Thread Charles Oliver Nutter
Subramanya Sastry wrote: I may have been wrong. I had a chance to think through this a little bit more. Consider this ruby code: i = 5 v1 = i + 1 some_random_method_call() v2 = i + 1 In this code snippet, the second '+' might not get optimized because 'some_random_method_call' could monkey

Re: [jruby-dev] JRuby IR: First thoughts

2009-05-04 Thread Subramanya Sastry
> Here 'call' could be a regular C call for all you care. So, what would >> happen in the compiler is that you would first transform the code into >> a higher-level IR (with virtual calls as above), and at some point in the >> optimization, you will ratchet down the IR one level lower that might >

Re: [jruby-dev] JRuby IR: First thoughts

2009-05-01 Thread Charles Oliver Nutter
Subramanya Sastry wrote: This note interweaves code optimization with discussion about IR because the IR choice will be influenced by what you want to do with it. I am going to use examples below to guide this discussion. A lot of it is somewhat 'stream-of-thought' writing -- this is not a tigh

[jruby-dev] JRuby IR: First thoughts

2009-04-30 Thread Subramanya Sastry
This note interweaves code optimization with discussion about IR because the IR choice will be influenced by what you want to do with it. I am going to use examples below to guide this discussion. A lot of it is somewhat 'stream-of-thought' writing -- this is not a tight spec. Since we let HotSp