The Artima Developer Community
Sponsored Link

Agile Buzz Forum
One more register please

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
One more register please Posted: Jan 9, 2004 5:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: One more register please
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

Woops. I forgot that I'm dealing with an OO language here. There is an inplicit parameter in every call - the 'self' object!. So to shuffle everything up by one argument, we find that there is still only 0.82% of methods that will spill. If we have three free registers for arguments, then it's at 2.29%. If we have two free registers for arguments, then it's at 6.66%. It's not until we reach one free register for arguments that we start to really notice, at 22.18%.

To answer Patrick Logan's question about intermediates - there aren't that many and where they are required, assuming we don't leave any registers free from arguments in our method (ie: we're always calling methods that have 4 arguments), then we still have the continuation register that we can use effeciently, by pushing it in to the stack at the start of our method.

But given the numbers, I'd be happy to leave one register free the continuation register for intermediates - but only if the method needs it. Most methods will not be only calling methods with lots of arguments. Fascinating.

It gets better. If we have a method that requires register spills and we create an object to call with, then we can re-use the slots in that object from then on for intermediates, since those slots effectively, at that point, become fake registers (we've already spent the cost to make them, why not re-use them?). If possible, the next call may re-use that object too. In fact, I'd wager most calls modify one argument to the next call, meaning most methods would be very effecient in or not in registers.

Read: One more register please

Topic: More stupid referer spam Previous Topic   Next Topic Topic: Throwing away business

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use