<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-14193</id>
	<title>Nabble - Squeak - Exupery</title>
	<updated>2008-06-15T12:59:50Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/Squeak---Exupery-f14193.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Squeak---Exupery-f14193.html" />
	<subtitle type="html">Discussion about Exupery a native code compiler.</subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-17854063</id>
	<title>Exupery update preparing for the 0.14 release</title>
	<published>2008-06-15T12:59:50Z</published>
	<updated>2008-06-15T12:59:50Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">&lt;br&gt;The Exupery 0.14 release is in final testing now. The major
&lt;br&gt;improvement is to register allocator performance. The register
&lt;br&gt;allocator should also produce slightly better code due to the
&lt;br&gt;changes. There's also now support for cascades, the last major missing
&lt;br&gt;language feature.
&lt;br&gt;&lt;br&gt;The main gain in this release is register allocation is much faster on
&lt;br&gt;large methods. Now it takes about 50% of the compilation time for all
&lt;br&gt;methods, it used to take almost all the time for large methods. This
&lt;br&gt;means compilation time is now roughly linear with method size.
&lt;br&gt;&lt;br&gt;The major improvements for 0.14 were done by mid April. The release
&lt;br&gt;has been delayed due to upgrading to 3.10. Exupery's testing uncovered
&lt;br&gt;two bugs in 3.10 and four tests were failing due to changes in the
&lt;br&gt;base image.
&lt;br&gt;&lt;br&gt;Two tests have been deleted as they were trying to compile methods
&lt;br&gt;that have been removed. Those methods were involved in bugs found by
&lt;br&gt;the stress test. There should be unit tests that cover any changes to
&lt;br&gt;the compiler required to fix them.
&lt;br&gt;&lt;br&gt;Two tests were failing because of cascades. Cascades have been added
&lt;br&gt;so they pass again. The other option was to either delete the tests or
&lt;br&gt;release with failing tests on 3.10.
&lt;br&gt;&lt;br&gt;All that's left to do before releasing is run the stress test again
&lt;br&gt;and do some Seaside development with Exupery running. Both were done
&lt;br&gt;successfully before upgrading to the latest squeak-dev 3.10 images.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=17854063&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Exupery-update-preparing-for-the-0.14-release-tp17854063p17854063.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-17665908</id>
	<title>Re: Problem with ColouringRegisterAllocator</title>
	<published>2008-06-05T02:32:57Z</published>
	<updated>2008-06-05T02:32:57Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">The bug was in my code
&lt;br&gt;&lt;br&gt;was
&lt;br&gt;&lt;br&gt;machine
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ^ machine ifNil: [ MachineX86 new]
&lt;br&gt;&lt;br&gt;instead of:
&lt;br&gt;&lt;br&gt;machine
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ^ machine ifNil: [ machine := MachineX86 new]
&lt;br&gt;&lt;br&gt;2008/6/2 &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=17665908&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Igor Stasenko writes:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; in method addInterferenceEdge: firstRegister to: secondRegister
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; is stumbled upon error: key not found when it does:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; secondNode := interferenceGraph at: secondRegister.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; an interferenceGraph keys &amp;nbsp;= a Set(t9 t11 t14 t10 t2 t24 t22 t19 t25
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; t3 t8 t15 eax t20 t21 t16 t11 edx t17 t6 t3 t26 t12 t2 t4 t21 ecx t16
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; t12 t9 t23 t1 t5 t20 t13 t15 t14 t5 t27 t1 t6 t19 eax t13 t4 t17 t18
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; t28 t7 t8 t18 t10 t7)
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; and secondRegister = eax.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; It looks like MedMachineRegister needs #= and #hash methods to make
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; things working correctly with dictionaries.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; I'll try add these methods, lets see if issue will disappear.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; There should only ever be one instance of each register. The bug is
&lt;br&gt;&amp;gt; creating the second one. That said, you may find it easier to
&lt;br&gt;&amp;gt; impleemnt = and hash than track it down. Using identity is a
&lt;br&gt;&amp;gt; deliberate design decision.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Having multiple versions of the same item may cause problems. I
&lt;br&gt;&amp;gt; think you may be OK with duplicate registers but am not sure.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; Btw, i don't know why or where it creates another instance of same
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; register (MedMachineRegister name: #eax), in my code i using:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; 'machine registerNamed: #eax', which should create instance only once,
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; and then return same instance for consequent calls.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Bryce
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; Exupery mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=17665908&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=17665908&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Problem-with-ColouringRegisterAllocator-tp17588538p17665908.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-17609805</id>
	<title>Problem with ColouringRegisterAllocator</title>
	<published>2008-06-02T13:11:34Z</published>
	<updated>2008-06-02T13:11:34Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; in method addInterferenceEdge: firstRegister to: secondRegister
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; is stumbled upon error: key not found when it does:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; secondNode := interferenceGraph at: secondRegister.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; an interferenceGraph keys &amp;nbsp;= a Set(t9 t11 t14 t10 t2 t24 t22 t19 t25
&lt;br&gt;&amp;nbsp;&amp;gt; t3 t8 t15 eax t20 t21 t16 t11 edx t17 t6 t3 t26 t12 t2 t4 t21 ecx t16
&lt;br&gt;&amp;nbsp;&amp;gt; t12 t9 t23 t1 t5 t20 t13 t15 t14 t5 t27 t1 t6 t19 eax t13 t4 t17 t18
&lt;br&gt;&amp;nbsp;&amp;gt; t28 t7 t8 t18 t10 t7)
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; and secondRegister = eax.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; It looks like MedMachineRegister needs #= and #hash methods to make
&lt;br&gt;&amp;nbsp;&amp;gt; things working correctly with dictionaries.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; I'll try add these methods, lets see if issue will disappear.
&lt;br&gt;&lt;br&gt;There should only ever be one instance of each register. The bug is
&lt;br&gt;creating the second one. That said, you may find it easier to
&lt;br&gt;impleemnt = and hash than track it down. Using identity is a
&lt;br&gt;deliberate design decision.
&lt;br&gt;&lt;br&gt;Having multiple versions of the same item may cause problems. I
&lt;br&gt;think you may be OK with duplicate registers but am not sure.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Btw, i don't know why or where it creates another instance of same
&lt;br&gt;&amp;nbsp;&amp;gt; register (MedMachineRegister name: #eax), in my code i using:
&lt;br&gt;&amp;nbsp;&amp;gt; 'machine registerNamed: #eax', which should create instance only once,
&lt;br&gt;&amp;nbsp;&amp;gt; and then return same instance for consequent calls.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=17609805&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Problem-with-ColouringRegisterAllocator-tp17588538p17609805.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-17588538</id>
	<title>Problem with ColouringRegisterAllocator</title>
	<published>2008-06-01T11:25:06Z</published>
	<updated>2008-06-01T11:25:06Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">in method addInterferenceEdge: firstRegister to: secondRegister
&lt;br&gt;&lt;br&gt;is stumbled upon error: key not found when it does:
&lt;br&gt;&lt;br&gt;secondNode := interferenceGraph at: secondRegister.
&lt;br&gt;&lt;br&gt;an interferenceGraph keys &amp;nbsp;= a Set(t9 t11 t14 t10 t2 t24 t22 t19 t25
&lt;br&gt;t3 t8 t15 eax t20 t21 t16 t11 edx t17 t6 t3 t26 t12 t2 t4 t21 ecx t16
&lt;br&gt;t12 t9 t23 t1 t5 t20 t13 t15 t14 t5 t27 t1 t6 t19 eax t13 t4 t17 t18
&lt;br&gt;t28 t7 t8 t18 t10 t7)
&lt;br&gt;&lt;br&gt;and secondRegister = eax.
&lt;br&gt;&lt;br&gt;It looks like MedMachineRegister needs #= and #hash methods to make
&lt;br&gt;things working correctly with dictionaries.
&lt;br&gt;&lt;br&gt;I'll try add these methods, lets see if issue will disappear.
&lt;br&gt;&lt;br&gt;Btw, i don't know why or where it creates another instance of same
&lt;br&gt;register (MedMachineRegister name: #eax), in my code i using:
&lt;br&gt;'machine registerNamed: #eax', which should create instance only once,
&lt;br&gt;and then return same instance for consequent calls.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=17588538&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Problem-with-ColouringRegisterAllocator-tp17588538p17588538.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16885302</id>
	<title>Re: Register spilling mechanism</title>
	<published>2008-04-24T13:16:37Z</published>
	<updated>2008-04-24T13:16:37Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; Don't worry about it. I'm planning to overthrow the rule of C and make
&lt;br&gt;&amp;nbsp;&amp;gt; every bit in VM be implemented as native methods
&lt;br&gt;&amp;nbsp;&amp;gt; which can be compiled at run time. :)
&lt;br&gt;&amp;nbsp;&amp;gt; So, i care little about what calling convention C or other libraries having.
&lt;br&gt;&amp;nbsp;&amp;gt; All foreign calls will be handled by FFI class(es) (compiled as
&lt;br&gt;&amp;nbsp;&amp;gt; anything else as well), while inside i'll have methods compiled to
&lt;br&gt;&amp;nbsp;&amp;gt; machine code and i'm free to choose any calling convention for them,
&lt;br&gt;&amp;nbsp;&amp;gt; as well as choose own stack layout which will be convenient for GC and
&lt;br&gt;&amp;nbsp;&amp;gt; object memory.
&lt;br&gt;&amp;nbsp;&amp;gt; That's why i asked how i can control these aspects with Exupery.
&lt;br&gt;&lt;br&gt;If an signal comes in from the OS, then the signal will be executed on
&lt;br&gt;the machine (C) stack, so the stack pointer must always be correct. If
&lt;br&gt;not you risk having your C stack trashed by the signal.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; Can be there any contracts between Exupery and caller, where i can
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; state that code should compile under certain rules, like:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; - specify a set of registers, which should be preserved after given
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; code done working
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; - specify, what registers code expects to be preserved when doing calls
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; - specify, what registers should be reverted just before ret/non-local
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; jump instructions
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;It would be possible to control what you want to, but there's no
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;published interface. The intermediate languages will change as
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;Exupery evolves.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Thank you for explanation. I will look forward for any updates
&lt;br&gt;&amp;nbsp;&amp;gt; concerning these features.
&lt;br&gt;&amp;nbsp;&amp;gt; Maybe, as temporary solution, i can patch register allocator to get
&lt;br&gt;&amp;nbsp;&amp;gt; some feedback on how many stack space i need, and then
&lt;br&gt;&amp;nbsp;&amp;gt; re-run it again.
&lt;br&gt;&amp;nbsp;&amp;gt; Or i can try to measure maximum number of live temps in code by own.
&lt;br&gt;&lt;br&gt;The best bet would be to read the final stack height from the register
&lt;br&gt;allocator. Though for now it'll always be 64 bytes big. Look
&lt;br&gt;at SpillInserter and MachineX86&amp;gt;&amp;gt;newSpillSlot. That's the code
&lt;br&gt;responsible for managing the stack.
&lt;br&gt;&lt;br&gt;Also look at the loadStack and the storeStack instructions as they
&lt;br&gt;generate the Smalltalk stack loading and storing instructions in the
&lt;br&gt;register allocator after all spills have been made. This is to avoid
&lt;br&gt;loading spilled values from the Smalltalk stack.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16885302&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Register-spilling-mechanism-tp16832040p16885302.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16867634</id>
	<title>Re: Register spilling mechanism</title>
	<published>2008-04-23T17:08:09Z</published>
	<updated>2008-04-23T17:08:09Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">2008/4/24 &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16867634&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Igor Stasenko writes:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; 2008/4/22 &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16867634&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; Igor Stasenko writes:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; More broader explanation why i need this..
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; I want to allow direct stack manipulation for native methods to some extent.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; In code, one can write:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; (object1 expression1) push.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; (object2 expression2) push.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; address call.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; Now i need to make sure that Exupery will produce correct stack frame
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; for a call, regardless what code inlined in expression1/expression2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; it should not interfere with top stack layout, which should be:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; &amp;lt;result of expression1&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; &amp;lt;result of expression2&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; &amp;lt;return address&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp; &amp;gt; when entering routine at (address call).
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;Are you talking about the C stack or the Smalltalk stack?
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;If you're talking about the Smalltalk stack then in Exupery it's only
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;dealt with in the front half of Exupery. It's handled in the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;ByteCodeReader and IntermediateSimplifier. Exupery uses exactly the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;same stack locations as the interpreter so doesn't need to check the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;stack height. It'll break for exactly the same methods that will cause
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;the interpreter to crash. Exupery does model the stack in both classes
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;so it would be fairly easy to monitor stack height if you were
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;interested.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; No, forget about Smalltalk stack, i plan to use Exupery at lower
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; levels to produce machine code fed by my own compiler.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;The C stack is maintained by Exupery, and is currently a fixed size
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;but will be dynamically sized sometime in the future. Exupery will
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;fail to compile if it uses more C stack than exists. The amount of C
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;stack used isn't known until after register allocation because that's
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt; &amp;nbsp;where registers are spilled to.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; I don't know what you mean under 'C stack'.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; Isn't Exupery compiles directly to machine code? Then why you speaking
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; about C stack at all? ;)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;The machine stack which C also uses. The stack follow's C's
&lt;br&gt;&amp;gt; &amp;nbsp;conventions for calls and returns. It's the stack that the C
&lt;br&gt;&amp;gt; &amp;nbsp;in the interpreter uses.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; As i understand (correct me if i'm wrong) by fixed size stack you
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; mean, that after done register allocation, Exupery determines the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; exact size of stack, and then it inserts an instruction in method's
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; preamble to allocate it, like:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; push %ebp
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; mod %ebp, %esp
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; sub %esp, stacksize
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; and at return point it does reverse:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; add %esp, stacksize
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; pop %ebp
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; ret
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; or, does just 'ret' , in case if caller are responsible from cleaning
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; the stack and can restore %ebp.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;It generates sequences like you suggest but they're generated
&lt;br&gt;&amp;gt; &amp;nbsp;as low level intermediate then instruction selected before
&lt;br&gt;&amp;gt; &amp;nbsp;register allocation. So the size is set before the number of
&lt;br&gt;&amp;gt; &amp;nbsp;spills is known. I've been using a fixed size stack frame as
&lt;br&gt;&amp;gt; &amp;nbsp;at temporary measure, it's been good enough for now, there isn't
&lt;br&gt;&amp;gt; &amp;nbsp;a great deal of pressure on that memory especially as Exupery
&lt;br&gt;&amp;gt; &amp;nbsp;can now spill directly into the context frame.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;If you're planning on generating C style calls in code be careful.
&lt;br&gt;&amp;gt; &amp;nbsp;If a GC happens as part of the call any object may be moved. Exupery
&lt;br&gt;&amp;gt; &amp;nbsp;doesn't really save the C (machine) stack because it doesn't have any
&lt;br&gt;&amp;gt; &amp;nbsp;state at any time it would risk making calls, it moves all the state
&lt;br&gt;&amp;gt; &amp;nbsp;back into real objects so the GC can see it.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;Don't worry about it. I'm planning to overthrow the rule of C and make
&lt;br&gt;every bit in VM be implemented as native methods
&lt;br&gt;which can be compiled at run time. :)
&lt;br&gt;So, i care little about what calling convention C or other libraries having.
&lt;br&gt;All foreign calls will be handled by FFI class(es) (compiled as
&lt;br&gt;anything else as well), while inside i'll have methods compiled to
&lt;br&gt;machine code and i'm free to choose any calling convention for them,
&lt;br&gt;as well as choose own stack layout which will be convenient for GC and
&lt;br&gt;object memory.
&lt;br&gt;That's why i asked how i can control these aspects with Exupery.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; Can be there any contracts between Exupery and caller, where i can
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; state that code should compile under certain rules, like:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; - specify a set of registers, which should be preserved after given
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; code done working
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; - specify, what registers code expects to be preserved when doing calls
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; - specify, what registers should be reverted just before ret/non-local
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; jump instructions
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;It would be possible to control what you want to, but there's no
&lt;br&gt;&amp;gt; &amp;nbsp;published interface. The intermediate languages will change as
&lt;br&gt;&amp;gt; &amp;nbsp;Exupery evolves.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;Thank you for explanation. I will look forward for any updates
&lt;br&gt;concerning these features.
&lt;br&gt;Maybe, as temporary solution, i can patch register allocator to get
&lt;br&gt;some feedback on how many stack space i need, and then
&lt;br&gt;re-run it again.
&lt;br&gt;Or i can try to measure maximum number of live temps in code by own.
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;Bryce
&lt;br&gt;&amp;gt; &amp;nbsp;_______________________________________________
&lt;br&gt;&amp;gt; &amp;nbsp;Exupery mailing list
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16867634&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16867634&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Register-spilling-mechanism-tp16832040p16867634.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16865723</id>
	<title>Re: Register spilling mechanism</title>
	<published>2008-04-23T14:34:21Z</published>
	<updated>2008-04-23T14:34:21Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; 2008/4/22 &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16865723&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; More broader explanation why i need this..
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; I want to allow direct stack manipulation for native methods to some extent.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; In code, one can write:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; (object1 expression1) push.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; (object2 expression2) push.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; address call.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; Now i need to make sure that Exupery will produce correct stack frame
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; for a call, regardless what code inlined in expression1/expression2
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; it should not interfere with top stack layout, which should be:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; &amp;lt;result of expression1&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; &amp;lt;result of expression2&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; &amp;lt;return address&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; &amp;gt; when entering routine at (address call).
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;Are you talking about the C stack or the Smalltalk stack?
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;If you're talking about the Smalltalk stack then in Exupery it's only
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;dealt with in the front half of Exupery. It's handled in the
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;ByteCodeReader and IntermediateSimplifier. Exupery uses exactly the
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;same stack locations as the interpreter so doesn't need to check the
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;stack height. It'll break for exactly the same methods that will cause
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;the interpreter to crash. Exupery does model the stack in both classes
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;so it would be fairly easy to monitor stack height if you were
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;interested.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; No, forget about Smalltalk stack, i plan to use Exupery at lower
&lt;br&gt;&amp;nbsp;&amp;gt; levels to produce machine code fed by my own compiler.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;The C stack is maintained by Exupery, and is currently a fixed size
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;but will be dynamically sized sometime in the future. Exupery will
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;fail to compile if it uses more C stack than exists. The amount of C
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;stack used isn't known until after register allocation because that's
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp;where registers are spilled to.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; I don't know what you mean under 'C stack'.
&lt;br&gt;&amp;nbsp;&amp;gt; Isn't Exupery compiles directly to machine code? Then why you speaking
&lt;br&gt;&amp;nbsp;&amp;gt; about C stack at all? ;)
&lt;br&gt;&lt;br&gt;The machine stack which C also uses. The stack follow's C's
&lt;br&gt;conventions for calls and returns. It's the stack that the C
&lt;br&gt;in the interpreter uses.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; As i understand (correct me if i'm wrong) by fixed size stack you
&lt;br&gt;&amp;nbsp;&amp;gt; mean, that after done register allocation, Exupery determines the
&lt;br&gt;&amp;nbsp;&amp;gt; exact size of stack, and then it inserts an instruction in method's
&lt;br&gt;&amp;nbsp;&amp;gt; preamble to allocate it, like:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; push %ebp
&lt;br&gt;&amp;nbsp;&amp;gt; mod %ebp, %esp
&lt;br&gt;&amp;nbsp;&amp;gt; sub %esp, stacksize
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; and at return point it does reverse:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; add %esp, stacksize
&lt;br&gt;&amp;nbsp;&amp;gt; pop %ebp
&lt;br&gt;&amp;nbsp;&amp;gt; ret
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; or, does just 'ret' , in case if caller are responsible from cleaning
&lt;br&gt;&amp;nbsp;&amp;gt; the stack and can restore %ebp.
&lt;br&gt;&lt;br&gt;It generates sequences like you suggest but they're generated
&lt;br&gt;as low level intermediate then instruction selected before
&lt;br&gt;register allocation. So the size is set before the number of
&lt;br&gt;spills is known. I've been using a fixed size stack frame as
&lt;br&gt;at temporary measure, it's been good enough for now, there isn't
&lt;br&gt;a great deal of pressure on that memory especially as Exupery
&lt;br&gt;can now spill directly into the context frame.
&lt;br&gt;&lt;br&gt;If you're planning on generating C style calls in code be careful.
&lt;br&gt;If a GC happens as part of the call any object may be moved. Exupery
&lt;br&gt;doesn't really save the C (machine) stack because it doesn't have any
&lt;br&gt;state at any time it would risk making calls, it moves all the state
&lt;br&gt;back into real objects so the GC can see it.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Can be there any contracts between Exupery and caller, where i can
&lt;br&gt;&amp;nbsp;&amp;gt; state that code should compile under certain rules, like:
&lt;br&gt;&amp;nbsp;&amp;gt; - specify a set of registers, which should be preserved after given
&lt;br&gt;&amp;nbsp;&amp;gt; code done working
&lt;br&gt;&amp;nbsp;&amp;gt; - specify, what registers code expects to be preserved when doing calls
&lt;br&gt;&amp;nbsp;&amp;gt; - specify, what registers should be reverted just before ret/non-local
&lt;br&gt;&amp;nbsp;&amp;gt; jump instructions
&lt;br&gt;&lt;br&gt;It would be possible to control what you want to, but there's no
&lt;br&gt;published interface. The intermediate languages will change as
&lt;br&gt;Exupery evolves.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16865723&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Register-spilling-mechanism-tp16832040p16865723.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16844898</id>
	<title>Re: Register spilling mechanism</title>
	<published>2008-04-22T15:56:53Z</published>
	<updated>2008-04-22T15:56:53Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">2008/4/22 &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16844898&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Igor Stasenko writes:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; More broader explanation why i need this..
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; I want to allow direct stack manipulation for native methods to some extent.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; In code, one can write:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; (object1 expression1) push.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; (object2 expression2) push.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; address call.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; Now i need to make sure that Exupery will produce correct stack frame
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; for a call, regardless what code inlined in expression1/expression2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; it should not interfere with top stack layout, which should be:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;lt;result of expression1&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;lt;result of expression2&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; &amp;lt;return address&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; when entering routine at (address call).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;Are you talking about the C stack or the Smalltalk stack?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;If you're talking about the Smalltalk stack then in Exupery it's only
&lt;br&gt;&amp;gt; &amp;nbsp;dealt with in the front half of Exupery. It's handled in the
&lt;br&gt;&amp;gt; &amp;nbsp;ByteCodeReader and IntermediateSimplifier. Exupery uses exactly the
&lt;br&gt;&amp;gt; &amp;nbsp;same stack locations as the interpreter so doesn't need to check the
&lt;br&gt;&amp;gt; &amp;nbsp;stack height. It'll break for exactly the same methods that will cause
&lt;br&gt;&amp;gt; &amp;nbsp;the interpreter to crash. Exupery does model the stack in both classes
&lt;br&gt;&amp;gt; &amp;nbsp;so it would be fairly easy to monitor stack height if you were
&lt;br&gt;&amp;gt; &amp;nbsp;interested.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;No, forget about Smalltalk stack, i plan to use Exupery at lower
&lt;br&gt;levels to produce machine code fed by my own compiler.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;The C stack is maintained by Exupery, and is currently a fixed size
&lt;br&gt;&amp;gt; &amp;nbsp;but will be dynamically sized sometime in the future. Exupery will
&lt;br&gt;&amp;gt; &amp;nbsp;fail to compile if it uses more C stack than exists. The amount of C
&lt;br&gt;&amp;gt; &amp;nbsp;stack used isn't known until after register allocation because that's
&lt;br&gt;&amp;gt; &amp;nbsp;where registers are spilled to.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;I don't know what you mean under 'C stack'.
&lt;br&gt;Isn't Exupery compiles directly to machine code? Then why you speaking
&lt;br&gt;about C stack at all? ;)
&lt;br&gt;&lt;br&gt;As i understand (correct me if i'm wrong) by fixed size stack you
&lt;br&gt;mean, that after done register allocation, Exupery determines the
&lt;br&gt;exact size of stack, and then it inserts an instruction in method's
&lt;br&gt;preamble to allocate it, like:
&lt;br&gt;&lt;br&gt;push %ebp
&lt;br&gt;mod %ebp, %esp
&lt;br&gt;sub %esp, stacksize
&lt;br&gt;&lt;br&gt;and at return point it does reverse:
&lt;br&gt;&lt;br&gt;add %esp, stacksize
&lt;br&gt;pop %ebp
&lt;br&gt;ret
&lt;br&gt;&lt;br&gt;or, does just 'ret' , in case if caller are responsible from cleaning
&lt;br&gt;the stack and can restore %ebp.
&lt;br&gt;&lt;br&gt;And by dynamic stack size, you mean that instead of preallocating
&lt;br&gt;fixed amount of bytes on stack, in future, it can use pushes/pops in
&lt;br&gt;code based on demand?
&lt;br&gt;&lt;br&gt;I having nothing against both models, just need a safe way how i can
&lt;br&gt;manipulate stack directly without being endangered by register
&lt;br&gt;allocator to corrupt stack layout which developer expecting to have.
&lt;br&gt;&lt;br&gt;Let me elaborate the problem in the way how i see it.
&lt;br&gt;Suppose my compiler generates the code in form, what we call 'Exupery
&lt;br&gt;low-level intermediate'.
&lt;br&gt;So, there are a 'virtual' machine instructions arranged in blocks and
&lt;br&gt;using N temporary registers.
&lt;br&gt;Now, after register allocator did its job, we are know, that we need
&lt;br&gt;extra K bytes on stack to hold temporary values which is not fit in
&lt;br&gt;CPU registers at some points of code.
&lt;br&gt;And now, an instruction selector for particular temps should use
&lt;br&gt;instructions to store/read values on stack.
&lt;br&gt;But also there are need to generate instructions to preallocate the
&lt;br&gt;stack space to hold these values and deallocate it at some point,
&lt;br&gt;where they no longer needed.
&lt;br&gt;Now, who is controlling these actions? And can outer subsystem
&lt;br&gt;influence where to put stack allocation instruction, for instance?
&lt;br&gt;&lt;br&gt;Can be there any contracts between Exupery and caller, where i can
&lt;br&gt;state that code should compile under certain rules, like:
&lt;br&gt;- specify a set of registers, which should be preserved after given
&lt;br&gt;code done working
&lt;br&gt;- specify, what registers code expects to be preserved when doing calls
&lt;br&gt;- specify, what registers should be reverted just before ret/non-local
&lt;br&gt;jump instructions
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp;It's also possible to spill directly into the context (into the
&lt;br&gt;&amp;gt; &amp;nbsp;Smalltalk stack) which is done for stack registers. That's new in
&lt;br&gt;&amp;gt; &amp;nbsp;0.14 and will be extended to temporaries as well.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;Bryce
&lt;br&gt;&amp;gt; &amp;nbsp;_______________________________________________
&lt;br&gt;&amp;gt; &amp;nbsp;Exupery mailing list
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16844898&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16844898&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Register-spilling-mechanism-tp16832040p16844898.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16842400</id>
	<title>Re: Register spilling mechanism</title>
	<published>2008-04-22T13:39:13Z</published>
	<updated>2008-04-22T13:39:13Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; More broader explanation why i need this..
&lt;br&gt;&amp;nbsp;&amp;gt; I want to allow direct stack manipulation for native methods to some extent.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; In code, one can write:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; (object1 expression1) push.
&lt;br&gt;&amp;nbsp;&amp;gt; (object2 expression2) push.
&lt;br&gt;&amp;nbsp;&amp;gt; address call.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Now i need to make sure that Exupery will produce correct stack frame
&lt;br&gt;&amp;nbsp;&amp;gt; for a call, regardless what code inlined in expression1/expression2
&lt;br&gt;&amp;nbsp;&amp;gt; it should not interfere with top stack layout, which should be:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;lt;result of expression1&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;lt;result of expression2&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;lt;return address&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; when entering routine at (address call).
&lt;br&gt;&lt;br&gt;Are you talking about the C stack or the Smalltalk stack?
&lt;br&gt;&lt;br&gt;If you're talking about the Smalltalk stack then in Exupery it's only
&lt;br&gt;dealt with in the front half of Exupery. It's handled in the
&lt;br&gt;ByteCodeReader and IntermediateSimplifier. Exupery uses exactly the
&lt;br&gt;same stack locations as the interpreter so doesn't need to check the
&lt;br&gt;stack height. It'll break for exactly the same methods that will cause
&lt;br&gt;the interpreter to crash. Exupery does model the stack in both classes
&lt;br&gt;so it would be fairly easy to monitor stack height if you were
&lt;br&gt;interested.
&lt;br&gt;&lt;br&gt;The C stack is maintained by Exupery, and is currently a fixed size
&lt;br&gt;but will be dynamically sized sometime in the future. Exupery will
&lt;br&gt;fail to compile if it uses more C stack than exists. The amount of C
&lt;br&gt;stack used isn't known until after register allocation because that's
&lt;br&gt;where registers are spilled to.
&lt;br&gt;&lt;br&gt;It's also possible to spill directly into the context (into the
&lt;br&gt;Smalltalk stack) which is done for stack registers. That's new in
&lt;br&gt;0.14 and will be extended to temporaries as well.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16842400&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Register-spilling-mechanism-tp16832040p16842400.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16841010</id>
	<title>Re: Debugging a bug that wasn't.</title>
	<published>2008-04-22T12:19:07Z</published>
	<updated>2008-04-22T12:19:07Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes: 
&lt;br&gt;&amp;nbsp;&amp;gt; Okay. So, the problem that forcing to collect garbage after single
&lt;br&gt;&amp;nbsp;&amp;gt; allocation seem too stressing for your tests.
&lt;br&gt;&amp;nbsp;&amp;gt; Then why not divide test on parts - one for testing GC, another one
&lt;br&gt;&amp;nbsp;&amp;gt; for testing interrupts which causing active process switching?
&lt;br&gt;&lt;br&gt;There's no bug hence the title of this thread. For a week I thought
&lt;br&gt;there was a bug because with one instance it was appearing and
&lt;br&gt;disappearing based on whether I compiled the code or not. That was
&lt;br&gt;just a consequence of a very close race.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16841010&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Debugging-a-bug-that-wasn%27t.-tp16791956p16841010.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16832360</id>
	<title>Re: Register spilling mechanism</title>
	<published>2008-04-22T06:01:16Z</published>
	<updated>2008-04-22T06:01:16Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">More broader explanation why i need this..
&lt;br&gt;I want to allow direct stack manipulation for native methods to some extent.
&lt;br&gt;&lt;br&gt;In code, one can write:
&lt;br&gt;&lt;br&gt;(object1 expression1) push.
&lt;br&gt;(object2 expression2) push.
&lt;br&gt;address call.
&lt;br&gt;&lt;br&gt;Now i need to make sure that Exupery will produce correct stack frame
&lt;br&gt;for a call, regardless what code inlined in expression1/expression2
&lt;br&gt;it should not interfere with top stack layout, which should be:
&lt;br&gt;&lt;br&gt;&amp;lt;result of expression1&amp;gt;
&lt;br&gt;&amp;lt;result of expression2&amp;gt;
&lt;br&gt;&amp;lt;return address&amp;gt;
&lt;br&gt;&lt;br&gt;when entering routine at (address call).
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16832360&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Register-spilling-mechanism-tp16832040p16832360.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16832040</id>
	<title>Register spilling mechanism</title>
	<published>2008-04-22T05:44:08Z</published>
	<updated>2008-04-22T05:44:08Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">I'm currently want to make an inlining for methods of specific format
&lt;br&gt;(lets call them 'native' methods),
&lt;br&gt;these methods should work as ST methods (same calling convention &amp;
&lt;br&gt;stack layout when you entering method), but
&lt;br&gt;these methods don't do polymorphic sends unless specified exclusively,
&lt;br&gt;instead all sends are inlined statically with compiler.
&lt;br&gt;I don't want to describe much details here, just want you to help me
&lt;br&gt;how to deal with register spilling when inlining.
&lt;br&gt;&lt;br&gt;Suppose i inlining a send like:
&lt;br&gt;&lt;br&gt;object message: a+b with: c+d with: a+d with: ....
&lt;br&gt;&lt;br&gt;so, all arguments to method now should use machine temporary registers
&lt;br&gt;instead of stack, because it's more effective.
&lt;br&gt;&lt;br&gt;What i fear of that if register allocator sees that there is not
&lt;br&gt;enough registers in CPU to fit them all it starts using stack for
&lt;br&gt;storing temp values
&lt;br&gt;and there is some situations where i need to know exact stack depth
&lt;br&gt;for a method.
&lt;br&gt;Is there any way in Exupery to get know, how many registers will be
&lt;br&gt;spilled on stack, so this information can be used by my compiler?
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16832040&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Register-spilling-mechanism-tp16832040p16832040.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16821457</id>
	<title>Re: Debugging a bug that wasn't.</title>
	<published>2008-04-21T15:18:01Z</published>
	<updated>2008-04-21T15:18:01Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">2008/4/20 &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16821457&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Igor Stasenko writes:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; GC signals a semaphore after finishing (don't remember - is weak
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; finalization process using it or different one).
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; I'm not sure, can it somehow interfere with given case?
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; If weak finalization loop creates new objects, it can lead to
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; exclusive looping in it, because user processes running with lower
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt; priority.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;The problem has nothing to do with finalisation. The issue is running
&lt;br&gt;&amp;gt; &amp;nbsp;a GC for every allocation slows down execution a lot. Enough that
&lt;br&gt;&amp;gt; &amp;nbsp;there's a race to get through the test code before all 10 profiling
&lt;br&gt;&amp;gt; &amp;nbsp;threads start profiling. If they all start profiling then they can
&lt;br&gt;&amp;gt; &amp;nbsp;consume all available CPU.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;Okay. So, the problem that forcing to collect garbage after single
&lt;br&gt;allocation seem too stressing for your tests.
&lt;br&gt;Then why not divide test on parts - one for testing GC, another one
&lt;br&gt;for testing interrupts which causing active process switching?
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;Bryce
&lt;br&gt;&amp;gt; &amp;nbsp;_______________________________________________
&lt;br&gt;&amp;gt; &amp;nbsp;Exupery mailing list
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16821457&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16821457&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Debugging-a-bug-that-wasn%27t.-tp16791956p16821457.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16798548</id>
	<title>Re: Debugging a bug that wasn't.</title>
	<published>2008-04-20T13:51:08Z</published>
	<updated>2008-04-20T13:51:08Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; GC signals a semaphore after finishing (don't remember - is weak
&lt;br&gt;&amp;nbsp;&amp;gt; finalization process using it or different one).
&lt;br&gt;&amp;nbsp;&amp;gt; I'm not sure, can it somehow interfere with given case?
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; If weak finalization loop creates new objects, it can lead to
&lt;br&gt;&amp;nbsp;&amp;gt; exclusive looping in it, because user processes running with lower
&lt;br&gt;&amp;nbsp;&amp;gt; priority.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&lt;br&gt;The problem has nothing to do with finalisation. The issue is running
&lt;br&gt;a GC for every allocation slows down execution a lot. Enough that
&lt;br&gt;there's a race to get through the test code before all 10 profiling
&lt;br&gt;threads start profiling. If they all start profiling then they can
&lt;br&gt;consume all available CPU.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16798548&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Debugging-a-bug-that-wasn%27t.-tp16791956p16798548.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16793704</id>
	<title>Re: Debugging a bug that wasn't.</title>
	<published>2008-04-20T06:25:45Z</published>
	<updated>2008-04-20T06:25:45Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">2008/4/20 &amp;nbsp;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16793704&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;I'm testing and debugging before the 0.14 release. The major benefit
&lt;br&gt;&amp;gt; &amp;nbsp;is faster compile times and better generated code. There's around a
&lt;br&gt;&amp;gt; &amp;nbsp;10% gain or loss for the macro benchmarks depending on what's
&lt;br&gt;&amp;gt; &amp;nbsp;compiled.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;The bug was triggered by the below code. Originally it was compiling
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;quot;^[42] value&amp;quot;. The set-up shown below is what generates the fault
&lt;br&gt;&amp;gt; &amp;nbsp;without needing to compile the code. The fault was odd because it
&lt;br&gt;&amp;gt; &amp;nbsp;wasn't crashing, and wasn't stuck in an infinite loop but the image
&lt;br&gt;&amp;gt; &amp;nbsp;had locked up.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;I was investigating by interrupting execution with gdb and looking at
&lt;br&gt;&amp;gt; &amp;nbsp;both the Smalltalk stack using &amp;quot;p printCallStack()&amp;quot; and the C stack
&lt;br&gt;&amp;gt; &amp;nbsp;using &amp;quot;where&amp;quot;. Normally, if compiled code was corrupting the object
&lt;br&gt;&amp;gt; &amp;nbsp;memory it would crash fairly quickly. That it kept executing, which
&lt;br&gt;&amp;gt; &amp;nbsp;could be seen because the Smalltalk stack kept changing was weird. &amp;nbsp;If
&lt;br&gt;&amp;gt; &amp;nbsp;the GC's got a corrupt view of the object memory then normally it'll
&lt;br&gt;&amp;gt; &amp;nbsp;end up really corrupting it when it decides to try to interpret the
&lt;br&gt;&amp;gt; &amp;nbsp;middle of an object as an object header.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;The &amp;quot;Error signal.&amp;quot; at the front of the test is because running the
&lt;br&gt;&amp;gt; &amp;nbsp;test will lock up the image. This allows the rest of the suite to
&lt;br&gt;&amp;gt; &amp;nbsp;be run.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; testInterruptCausesCrashes
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;Crashing is a failure&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | processes |
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error signal.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self compileExpression: 'self createPoint'.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processes := (1 to: 10) collect:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [:each| [[(ExuperyProfiler
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;spyOn: [(Delay forMilliseconds: 500) wait])
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;queueCompilationCommandsOn: SharedQueue2 new] repeat] fork.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;Force a garbage collect on every allocation&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SmalltalkImage current vmParameterAt: 5 put: 1.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10000 timesRepeat: [self example].
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exupery log: 'after running example'.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;Reset garbage collects to a sensible value&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SmalltalkImage current vmParameterAt: 5 put: 4000.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processes do: [:each| each terminate].
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; createPoint
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;^ 10 @ 20&amp;quot;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;What I think is happening is the 10 profiling processes end up
&lt;br&gt;&amp;gt; &amp;nbsp;consuming all the time and starving the user level process so it
&lt;br&gt;&amp;gt; &amp;nbsp;never completes and never resets the garbage collector's collection
&lt;br&gt;&amp;gt; &amp;nbsp;rate to a sane value. Having produced the lockup twice without any
&lt;br&gt;&amp;gt; &amp;nbsp;compiled code, I'm reasonably happy that this is the case.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;GC signals a semaphore after finishing (don't remember - is weak
&lt;br&gt;finalization process using it or different one).
&lt;br&gt;I'm not sure, can it somehow interfere with given case?
&lt;br&gt;&lt;br&gt;If weak finalization loop creates new objects, it can lead to
&lt;br&gt;exclusive looping in it, because user processes running with lower
&lt;br&gt;priority.
&lt;br&gt;&lt;br&gt;finalizationProcess
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [true] whileTrue:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [FinalizationSemaphore wait.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FinalizationLock critical:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [FinalizationDependents do:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [:weakDependent |
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; weakDependent ifNotNil:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [weakDependent finalizeValues.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;***Following statement is required to keep weakDependent
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from holding onto its value as garbage.***&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; weakDependent := nil]]]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ifError:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [:msg :rcvr | rcvr error: msg].
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ].
&lt;br&gt;&lt;br&gt;see, if FinalizationSemaphore having excess signals after executing
&lt;br&gt;cycle once, it continues with execution.
&lt;br&gt;I think better to place FinalizationSemaphore initSignals at the end
&lt;br&gt;of weak finalization, so it wouldn't be triggered by garbage
&lt;br&gt;collection which may be happen in weak finalization routines.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;Bryce
&lt;br&gt;&amp;gt; &amp;nbsp;_______________________________________________
&lt;br&gt;&amp;gt; &amp;nbsp;Exupery mailing list
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16793704&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16793704&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Debugging-a-bug-that-wasn%27t.-tp16791956p16793704.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16791956</id>
	<title>Debugging a bug that wasn't.</title>
	<published>2008-04-20T02:38:45Z</published>
	<updated>2008-04-20T02:38:45Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">&lt;br&gt;I'm testing and debugging before the 0.14 release. The major benefit
&lt;br&gt;is faster compile times and better generated code. There's around a
&lt;br&gt;10% gain or loss for the macro benchmarks depending on what's
&lt;br&gt;compiled.
&lt;br&gt;&lt;br&gt;The bug was triggered by the below code. Originally it was compiling
&lt;br&gt;&amp;quot;^[42] value&amp;quot;. The set-up shown below is what generates the fault
&lt;br&gt;without needing to compile the code. The fault was odd because it
&lt;br&gt;wasn't crashing, and wasn't stuck in an infinite loop but the image
&lt;br&gt;had locked up. 
&lt;br&gt;&lt;br&gt;I was investigating by interrupting execution with gdb and looking at
&lt;br&gt;both the Smalltalk stack using &amp;quot;p printCallStack()&amp;quot; and the C stack
&lt;br&gt;using &amp;quot;where&amp;quot;. Normally, if compiled code was corrupting the object
&lt;br&gt;memory it would crash fairly quickly. That it kept executing, which
&lt;br&gt;could be seen because the Smalltalk stack kept changing was weird. &amp;nbsp;If
&lt;br&gt;the GC's got a corrupt view of the object memory then normally it'll
&lt;br&gt;end up really corrupting it when it decides to try to interpret the
&lt;br&gt;middle of an object as an object header.
&lt;br&gt;&lt;br&gt;The &amp;quot;Error signal.&amp;quot; at the front of the test is because running the
&lt;br&gt;test will lock up the image. This allows the rest of the suite to
&lt;br&gt;be run.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; testInterruptCausesCrashes
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;Crashing is a failure&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | processes |
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Error signal.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; self compileExpression: 'self createPoint'.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processes := (1 to: 10) collect: 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [:each| [[(ExuperyProfiler
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;spyOn: [(Delay forMilliseconds: 500) wait])
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;queueCompilationCommandsOn: SharedQueue2 new] repeat] fork.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;Force a garbage collect on every allocation&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SmalltalkImage current vmParameterAt: 5 put: 1.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10000 timesRepeat: [self example].
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exupery log: 'after running example'.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;Reset garbage collects to a sensible value&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SmalltalkImage current vmParameterAt: 5 put: 4000.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processes do: [:each| each terminate].
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; createPoint
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;^ 10 @ 20&amp;quot;
&lt;br&gt;&lt;br&gt;What I think is happening is the 10 profiling processes end up
&lt;br&gt;consuming all the time and starving the user level process so it
&lt;br&gt;never completes and never resets the garbage collector's collection
&lt;br&gt;rate to a sane value. Having produced the lockup twice without any
&lt;br&gt;compiled code, I'm reasonably happy that this is the case.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16791956&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Debugging-a-bug-that-wasn%27t.-tp16791956p16791956.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16657427</id>
	<title>Deciding how to fix a bug.</title>
	<published>2008-04-12T14:40:47Z</published>
	<updated>2008-04-12T14:40:47Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">&lt;br&gt;I've started the final release testing for Exupery 0.14. There are two
&lt;br&gt;bugs captured with tests so far. The first has something to do with
&lt;br&gt;interrupts, it needs a few running profilers to cause the bug to
&lt;br&gt;happen. I'm hoping this one is the source of the unrepeatable bugs
&lt;br&gt;that were in the the previous release, if so solving it may allow
&lt;br&gt;Exupery to run for much longer as a background compiler.
&lt;br&gt;&lt;br&gt;The second bug is caused by the current work. What's happening is the
&lt;br&gt;currentContext register is being spilled but is being used by code
&lt;br&gt;generated in the register allocator to load the stack. It may also be
&lt;br&gt;needed by spill code to spill back into the stack.
&lt;br&gt;&lt;br&gt;The simplest fix is to avoid spilling the currentContext. I doubt that
&lt;br&gt;spilling the currentContext is a good idea as it'll make spills of
&lt;br&gt;stack registers much more complex. Not spilling currentContext is
&lt;br&gt;probably the right thing to do unless the spill heuristics are
&lt;br&gt;improved to avoid spilling currentContext then spilling many stack
&lt;br&gt;registers that will use it to load themselves from the stack.
&lt;br&gt;&lt;br&gt;A theoretically better fix would be to get the register allocator to
&lt;br&gt;reload the currentContext if required when generating spill code that
&lt;br&gt;needs it. This is nicer as it doesn't require making another register
&lt;br&gt;special. There are a few practical problems to make sure that this
&lt;br&gt;doesn't lead to very bad code when we decide to spill currentContext
&lt;br&gt;then spill other registers. Also, the only gain to handling
&lt;br&gt;currentContext as a real register is allowing it to be spilled when
&lt;br&gt;appropriate which could be very nice if it was a special register that
&lt;br&gt;would be loaded from it's real location rather than spilled from the
&lt;br&gt;stack.
&lt;br&gt;&lt;br&gt;My feeling is the right solution for now is to avoid spilling
&lt;br&gt;currentContext and leave the better solution until a time when it's
&lt;br&gt;appropriate to develop a more complete solution including both proper
&lt;br&gt;spill heuristics and reloading spilled registers from the
&lt;br&gt;interpreter's variables.
&lt;br&gt;&lt;br&gt;The background compiler compiled over 1200 methods before running into
&lt;br&gt;one where the currentContext was spilled. So at worst, forcing it into
&lt;br&gt;a register will only make 1 method in a thousand worse, and may make
&lt;br&gt;it better.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16657427&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Deciding-how-to-fix-a-bug.-tp16657427p16657427.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16084437</id>
	<title>Floating point support</title>
	<published>2008-03-16T14:37:00Z</published>
	<updated>2008-03-16T14:37:00Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; Hello Bryce,
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; i'd like to ask you, how do you envision adding floating point support
&lt;br&gt;&amp;nbsp;&amp;gt; to Exupery
&lt;br&gt;&amp;nbsp;&amp;gt; to make it able to use FPU.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; The problem i see, is that it would require adding a type to registers
&lt;br&gt;&amp;nbsp;&amp;gt; to be able to use float-type values in intermediate code
&lt;br&gt;&amp;nbsp;&amp;gt; representation.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Or else, how it would look like, when i need to encode floating point
&lt;br&gt;&amp;nbsp;&amp;gt; operations like:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; temp1 := floatValue1.
&lt;br&gt;&amp;nbsp;&amp;gt; temp2 := floatValue2.
&lt;br&gt;&amp;nbsp;&amp;gt; temp3 := temp1 + temp2. &amp;quot;here compiler should generate FPU
&lt;br&gt;&amp;nbsp;&amp;gt; instructions instead of integer addition&amp;quot;
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Or maybe i'm looking at problem at wrong angle?
&lt;br&gt;&amp;nbsp;&amp;gt; Maybe easier to make intermediate in format like:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; unaryFloatOp(argmunentAddress, resultAddress)
&lt;br&gt;&amp;nbsp;&amp;gt; binaryFloatOp(argmunent1Address, argument2Address, resultAddress)
&lt;br&gt;&amp;nbsp;&amp;gt; compareFloatsOp(arg1address, arg2address)
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; then compiler don't have to deal with float registers (in register
&lt;br&gt;&amp;nbsp;&amp;gt; spilling code and other optimization patterns).
&lt;br&gt;&lt;br&gt;I'll probably create floating point operations and have floating point
&lt;br&gt;registers. The operations will be to make instruction selection easy,
&lt;br&gt;the registers to play nicely with the register allocator. Floating
&lt;br&gt;point registers are a separate register bank independent from the
&lt;br&gt;integer registers.
&lt;br&gt;&lt;br&gt;I'm planning on supporting SSE2 first. It should be widely enough
&lt;br&gt;deployed, and it's easier to deal with than the legacy x87 stack based
&lt;br&gt;floating point instruction set. SSE2 is also the default in 64 bit
&lt;br&gt;mode as the number of SSE2 registers was doubled from 8 to 16 but the
&lt;br&gt;x87 register set left unchanged.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Another thing, is support of byte-wide operations, like
&lt;br&gt;&amp;nbsp;&amp;gt; loading/storing byte at specific address. And of course being able to
&lt;br&gt;&amp;nbsp;&amp;gt; do some operations with byte-sized values.
&lt;br&gt;&amp;nbsp;&amp;gt; How do you plan to support this?
&lt;br&gt;&lt;br&gt;With an 8 bit mem operation. Make operations that make it easy to load
&lt;br&gt;and store a 8 bit quantity. Operate on it in 32 bit registers.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; The reason, why i'm asking about this, is that i'm currently busy with
&lt;br&gt;&amp;nbsp;&amp;gt; this: &lt;a href=&quot;http://wiki.squeak.org/squeak/6041&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.squeak.org/squeak/6041&lt;/a&gt;&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; As you maybe remember i had plans to do such system before. And now i
&lt;br&gt;&amp;nbsp;&amp;gt; spent some time to push it to the point, where it can become a reality
&lt;br&gt;&amp;nbsp;&amp;gt; :)
&lt;br&gt;&lt;br&gt;I remember.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16084437&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Floating-point-support-tp16078818p16084437.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-16078818</id>
	<title>Floating point support</title>
	<published>2008-03-16T06:05:06Z</published>
	<updated>2008-03-16T06:05:06Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">Hello Bryce,
&lt;br&gt;&lt;br&gt;i'd like to ask you, how do you envision adding floating point support
&lt;br&gt;to Exupery
&lt;br&gt;to make it able to use FPU.
&lt;br&gt;&lt;br&gt;The problem i see, is that it would require adding a type to registers
&lt;br&gt;to be able to use float-type values in intermediate code
&lt;br&gt;representation.
&lt;br&gt;&lt;br&gt;Or else, how it would look like, when i need to encode floating point
&lt;br&gt;operations like:
&lt;br&gt;&lt;br&gt;temp1 := floatValue1.
&lt;br&gt;temp2 := floatValue2.
&lt;br&gt;temp3 := temp1 + temp2. &amp;quot;here compiler should generate FPU
&lt;br&gt;instructions instead of integer addition&amp;quot;
&lt;br&gt;&lt;br&gt;Or maybe i'm looking at problem at wrong angle?
&lt;br&gt;Maybe easier to make intermediate in format like:
&lt;br&gt;&lt;br&gt;unaryFloatOp(argmunentAddress, resultAddress)
&lt;br&gt;binaryFloatOp(argmunent1Address, argument2Address, resultAddress)
&lt;br&gt;compareFloatsOp(arg1address, arg2address)
&lt;br&gt;&lt;br&gt;then compiler don't have to deal with float registers (in register
&lt;br&gt;spilling code and other optimization patterns).
&lt;br&gt;&lt;br&gt;Another thing, is support of byte-wide operations, like
&lt;br&gt;loading/storing byte at specific address. And of course being able to
&lt;br&gt;do some operations with byte-sized values.
&lt;br&gt;How do you plan to support this?
&lt;br&gt;&lt;br&gt;The reason, why i'm asking about this, is that i'm currently busy with
&lt;br&gt;this: &lt;a href=&quot;http://wiki.squeak.org/squeak/6041&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://wiki.squeak.org/squeak/6041&lt;/a&gt;&lt;br&gt;&lt;br&gt;As you maybe remember i had plans to do such system before. And now i
&lt;br&gt;spent some time to push it to the point, where it can become a reality
&lt;br&gt;:)
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=16078818&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Floating-point-support-tp16078818p16078818.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14697662</id>
	<title>The next step towards Exupery 0.14</title>
	<published>2008-01-08T12:02:26Z</published>
	<updated>2008-01-08T12:02:26Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">&lt;br&gt;The next step after improving the spill heuristics is likely
&lt;br&gt;to be one of the following:
&lt;br&gt;&amp;nbsp;* Spilling context registers directly to the context
&lt;br&gt;&amp;nbsp;* Adding a few more primitives (String&amp;gt;&amp;gt;at: and return true, false, or
&lt;br&gt;&amp;nbsp; &amp;nbsp;nil)
&lt;br&gt;&amp;nbsp;* More work on speeding up compilation
&lt;br&gt;&amp;nbsp;* More bug chasing.
&lt;br&gt;&lt;br&gt;There's two reasons to want to spill context registers directly
&lt;br&gt;into the context rather than onto the C stack. First it'll reduce
&lt;br&gt;memory traffic for sends with many arguments or a deep stack. At
&lt;br&gt;the moment the entire stack is copied from the context into registers
&lt;br&gt;when the method is entered (and possibly spilled on the C stack)
&lt;br&gt;then copied back onto the context on exit. For send heavy code this
&lt;br&gt;can lead to code that reads the stack into registers to immediately 
&lt;br&gt;write it back out again. This is especially wasteful if that section
&lt;br&gt;of code doesn't use any of the stack variables copied. The second
&lt;br&gt;reason is to allow temporaries and arguments to be held in registers,
&lt;br&gt;if they're moved into registers then it's likely there will be more
&lt;br&gt;spilling as the x86 only has 6 registers available for general use.
&lt;br&gt;&lt;br&gt;The compiler benchmark can try to inline String&amp;gt;&amp;gt;at: and the large
&lt;br&gt;explorers benchmark can try to inline return true and false. Not
&lt;br&gt;having these primitives may be causing Exupery to be slower for some
&lt;br&gt;parts of both benchmarks than the interpreter. These primitives are
&lt;br&gt;inlined into the main interpretation function so are especially
&lt;br&gt;efficient to interpret.
&lt;br&gt;&lt;br&gt;Compilation of large methods has been sped up significantly but medium
&lt;br&gt;and small methods have only smaller gains. Further performance gains
&lt;br&gt;would be nice, if only to make it faster to run larger acceptance
&lt;br&gt;tests.
&lt;br&gt;&lt;br&gt;Exupery is currently reliable just enough to develop with. I saw
&lt;br&gt;a crash after a few hours of Seaside development. This is barely
&lt;br&gt;good enough as it's easy to recover using the changes file. I don't
&lt;br&gt;know how to reproduce that crash so haven't tried to debug it.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14697662&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/The-next-step-towards-Exupery-0.14-tp14697662p14697662.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14527607</id>
	<title>Re: Compiler heuristics</title>
	<published>2007-12-28T08:02:03Z</published>
	<updated>2007-12-28T08:02:03Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; On 26/12/2007, &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14527607&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14527607&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; What you're talking about sounds very much like specialisation which
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; was done by Craig Chambers in a Self VM before they started using
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; dynamic type feedback.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; The harder part in your case is figuring out what = should mean.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; There are 126 implementers of = in my image. That said, you could
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; look in the PICs to see what classes have been used previously then
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; just deal with those cases allowing for an un-optimised fall-back
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; position. If we could guarantee that = was side effect free then
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; specialisation would be a lot easier.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Suppose, code provided is a code generated by compiler (to deal with oops)
&lt;br&gt;&amp;nbsp;&amp;gt; As for smallintegers, you can check a tag bit only once and then skip
&lt;br&gt;&amp;nbsp;&amp;gt; check in later code, because you already know that it's a
&lt;br&gt;&amp;nbsp;&amp;gt; smallinteger.
&lt;br&gt;&amp;nbsp;&amp;gt; It's also, can be possible for objects (if we know what = doing).
&lt;br&gt;&amp;nbsp;&amp;gt; In general, we can reduce the problem to proving that, if we got
&lt;br&gt;&amp;nbsp;&amp;gt; result from #= message and receiver is not changed, then we should
&lt;br&gt;&amp;nbsp;&amp;gt; expect to have similar result when we call #= later.
&lt;br&gt;&amp;nbsp;&amp;gt; So, we are free to replace send of #= by result of previous invocation.
&lt;br&gt;&lt;br&gt;If we're talking about type checking (e.g. the SmallInteger tag bit) 
&lt;br&gt;then the optimisation is specialisation.
&lt;br&gt;&lt;br&gt;For Exupery, I'll probably only look to optimise such cases after
&lt;br&gt;inlining. And the more general optimisation will be left until after
&lt;br&gt;specialisation to remove type checking.
&lt;br&gt;&lt;br&gt;A common case could be doing arithmatic on floats from a float array,
&lt;br&gt;we'd want to specialise the code for the float array case then remove
&lt;br&gt;all but one checks to make sure it is a float array.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14527607&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Compiler-heuristics-tp14492886p14527607.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14508861</id>
	<title>Re: Compiler heuristics</title>
	<published>2007-12-26T18:27:29Z</published>
	<updated>2007-12-26T18:27:29Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">On 26/12/2007, &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14508861&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14508861&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; What you're talking about sounds very much like specialisation which
&lt;br&gt;&amp;gt; was done by Craig Chambers in a Self VM before they started using
&lt;br&gt;&amp;gt; dynamic type feedback.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The harder part in your case is figuring out what = should mean.
&lt;br&gt;&amp;gt; There are 126 implementers of = in my image. That said, you could
&lt;br&gt;&amp;gt; look in the PICs to see what classes have been used previously then
&lt;br&gt;&amp;gt; just deal with those cases allowing for an un-optimised fall-back
&lt;br&gt;&amp;gt; position. If we could guarantee that = was side effect free then
&lt;br&gt;&amp;gt; specialisation would be a lot easier.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;Suppose, code provided is a code generated by compiler (to deal with oops)
&lt;br&gt;As for smallintegers, you can check a tag bit only once and then skip
&lt;br&gt;check in later code, because you already know that it's a
&lt;br&gt;smallinteger.
&lt;br&gt;It's also, can be possible for objects (if we know what = doing).
&lt;br&gt;In general, we can reduce the problem to proving that, if we got
&lt;br&gt;result from #= message and receiver is not changed, then we should
&lt;br&gt;expect to have similar result when we call #= later.
&lt;br&gt;So, we are free to replace send of #= by result of previous invocation.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14508861&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Compiler-heuristics-tp14492886p14508861.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14502634</id>
	<title>Compiler heuristics</title>
	<published>2007-12-26T06:23:08Z</published>
	<updated>2007-12-26T06:23:08Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; It's a theoretical question, rather than practical concerning Exupery,
&lt;br&gt;&amp;nbsp;&amp;gt; but i'd like to know, what you know/thinking about special compiler
&lt;br&gt;&amp;nbsp;&amp;gt; heuristics concerning simplifying expressions, when do inlining.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; The problem, in basic can be demonstrated by following example.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Suppose you having a code:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; mainMethod
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp;object = 0 ifTrue: [ object method1 ] ifFalse: [ object method2]
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; and now method bodies:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; method1
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp;object = 0 ifTrue: [ do something] ifFalse: [ do something else ]
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; method2
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp;object ~= 0 ifTrue: [ do something] ifFalse: [ do something else ]
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Now, the question is, when you inlining method1/2 into mainMethod
&lt;br&gt;&amp;nbsp;&amp;gt; you can see, that tests in inlined methods become redundant.
&lt;br&gt;&amp;nbsp;&amp;gt; If we inline both methods, code will look like:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; mainMethod
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp;object = 0 ifTrue: [
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;object = 0 ifTrue: [ do something]
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ifFalse: [ do something else ] &amp;nbsp;]
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp;ifFalse: [
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;object ~= 0 ifTrue: [ do something]
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ifFalse: [ do something else ] ]
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Is there any techniques, which can help in removing such redundancy,
&lt;br&gt;&amp;nbsp;&amp;gt; when analyzing code by compiler?
&lt;br&gt;&lt;br&gt;What you're talking about sounds very much like specialisation which
&lt;br&gt;was done by Craig Chambers in a Self VM before they started using
&lt;br&gt;dynamic type feedback.
&lt;br&gt;&lt;br&gt;The harder part in your case is figuring out what = should mean.
&lt;br&gt;There are 126 implementers of = in my image. That said, you could
&lt;br&gt;look in the PICs to see what classes have been used previously then
&lt;br&gt;just deal with those cases allowing for an un-optimised fall-back
&lt;br&gt;position. If we could guarantee that = was side effect free then
&lt;br&gt;specialisation would be a lot easier.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14502634&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Compiler-heuristics-tp14492886p14502634.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14492900</id>
	<title>Re: Compiler heuristics</title>
	<published>2007-12-24T19:14:12Z</published>
	<updated>2007-12-24T19:14:12Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">&amp;gt; and now method bodies:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; method1
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;object = 0 ifTrue: [ do something] ifFalse: [ do something else ]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; method2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;object ~= 0 ifTrue: [ do something] ifFalse: [ do something else ]
&lt;br&gt;&amp;gt;
&lt;br&gt;oops, i mistaken, obviously method bodies should use self:
&lt;br&gt;&lt;br&gt;&amp;nbsp;method1
&lt;br&gt;&amp;nbsp; &amp;nbsp; self = 0 ifTrue: [ do something] ifFalse: [ do something else ]
&lt;br&gt;&lt;br&gt;&amp;nbsp;method2
&lt;br&gt;&amp;nbsp; &amp;nbsp; self ~= 0 ifTrue: [ do something] ifFalse: [ do something else ]
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14492900&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Compiler-heuristics-tp14492886p14492900.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14492886</id>
	<title>Compiler heuristics</title>
	<published>2007-12-24T19:11:00Z</published>
	<updated>2007-12-24T19:11:00Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">It's a theoretical question, rather than practical concerning Exupery,
&lt;br&gt;but i'd like to know, what you know/thinking about special compiler
&lt;br&gt;heuristics concerning simplifying expressions, when do inlining.
&lt;br&gt;&lt;br&gt;The problem, in basic can be demonstrated by following example.
&lt;br&gt;&lt;br&gt;Suppose you having a code:
&lt;br&gt;&lt;br&gt;mainMethod
&lt;br&gt;&amp;nbsp; &amp;nbsp;object = 0 ifTrue: [ object method1 ] ifFalse: [ object method2]
&lt;br&gt;&lt;br&gt;and now method bodies:
&lt;br&gt;&lt;br&gt;method1
&lt;br&gt;&amp;nbsp; &amp;nbsp;object = 0 ifTrue: [ do something] ifFalse: [ do something else ]
&lt;br&gt;&lt;br&gt;method2
&lt;br&gt;&amp;nbsp; &amp;nbsp;object ~= 0 ifTrue: [ do something] ifFalse: [ do something else ]
&lt;br&gt;&lt;br&gt;Now, the question is, when you inlining method1/2 into mainMethod
&lt;br&gt;you can see, that tests in inlined methods become redundant.
&lt;br&gt;If we inline both methods, code will look like:
&lt;br&gt;&lt;br&gt;mainMethod
&lt;br&gt;&amp;nbsp; &amp;nbsp;object = 0 ifTrue: [
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;object = 0 ifTrue: [ do something]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ifFalse: [ do something else ] &amp;nbsp;]
&lt;br&gt;&amp;nbsp; &amp;nbsp;ifFalse: [
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;object ~= 0 ifTrue: [ do something]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ifFalse: [ do something else ] ]
&lt;br&gt;&lt;br&gt;Is there any techniques, which can help in removing such redundancy,
&lt;br&gt;when analyzing code by compiler?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14492886&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Compiler-heuristics-tp14492886p14492886.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14462330</id>
	<title>Re: Thinking about Exupery 0.14</title>
	<published>2007-12-21T13:00:46Z</published>
	<updated>2007-12-21T13:00:46Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; I suspect that main bottleneck in largeExplorers is not
&lt;br&gt;&amp;nbsp;&amp;gt; compiled/bytecode code, but memory allocations and GC.
&lt;br&gt;&amp;nbsp;&amp;gt; So, i doubt that you can gain any performance increase here.
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&lt;br&gt;Below's the raw numbers, this is from largeExplorers but with the
&lt;br&gt;profiling compiler turned up to compile a bit more code. About 60% of
&lt;br&gt;the time is going into the interpreter, compiled code, and primitives
&lt;br&gt;that should be natively compiled. That's enough time to provide a
&lt;br&gt;decent speed improvement. 70% is the normal amount spent in the
&lt;br&gt;interpreter. The GC is probably only consuming about 5% of the time.
&lt;br&gt;&lt;br&gt;CPU: AMD64 processors, speed 1000 MHz (estimated)
&lt;br&gt;Counted CPU_CLK_UNHALTED events (Cycles outside of halt state) with a unit mask of 0x00 (No unit mask) count 1000000
&lt;br&gt;Counted LS_BUFFER_FULL events (LS Buffer 2 Full) with a unit mask of 0x00 (No unit mask) count 100000
&lt;br&gt;Counted RETIRED_BRANCHES_MISPREDICTED events (Retired branches mispredicted) with a unit mask of 0x00 (No unit mask) count 100000
&lt;br&gt;Counted RETIRED_INSNS events (Retired instructions (includes exceptions, interrupts, re-syncs)) with a unit mask of 0x00 (No unit mask) count 1000000
&lt;br&gt;samples &amp;nbsp;% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;samples &amp;nbsp;% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;samples &amp;nbsp;% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;samples &amp;nbsp;% &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;image name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; app name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; symbol name
&lt;br&gt;1792637 &amp;nbsp;57.4476 &amp;nbsp;65779 &amp;nbsp; &amp;nbsp;12.9048 &amp;nbsp;391686 &amp;nbsp; 84.8932 &amp;nbsp;1970781 &amp;nbsp;58.4824 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; interpret
&lt;br&gt;223739 &amp;nbsp; &amp;nbsp;7.1700 &amp;nbsp;150 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0294 &amp;nbsp;211 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0457 &amp;nbsp;376848 &amp;nbsp; 11.1829 &amp;nbsp;BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alphaBlendwith
&lt;br&gt;110588 &amp;nbsp; &amp;nbsp;3.5439 &amp;nbsp;48505 &amp;nbsp; &amp;nbsp; 9.5159 &amp;nbsp;1302 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.2822 &amp;nbsp;104008 &amp;nbsp; &amp;nbsp;3.0864 &amp;nbsp;BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; copyBits
&lt;br&gt;76361 &amp;nbsp; &amp;nbsp; 2.4471 &amp;nbsp;124873 &amp;nbsp; 24.4982 &amp;nbsp;3679 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.7974 &amp;nbsp;64529 &amp;nbsp; &amp;nbsp; 1.9149 &amp;nbsp;libc-2.4.so &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;libc-2.4.so &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(no symbols)
&lt;br&gt;65089 &amp;nbsp; &amp;nbsp; 2.0859 &amp;nbsp;91160 &amp;nbsp; &amp;nbsp;17.8842 &amp;nbsp;2155 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.4671 &amp;nbsp;12648 &amp;nbsp; &amp;nbsp; 0.3753 &amp;nbsp;no-vmlinux &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; no-vmlinux &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (no symbols)
&lt;br&gt;60351 &amp;nbsp; &amp;nbsp; 1.9340 &amp;nbsp;51072 &amp;nbsp; &amp;nbsp;10.0195 &amp;nbsp;2297 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.4978 &amp;nbsp;31543 &amp;nbsp; &amp;nbsp; 0.9360 &amp;nbsp;anon (tgid:6681 range:0xb1c0d000-0xb7b6c000) squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (no symbols)
&lt;br&gt;52940 &amp;nbsp; &amp;nbsp; 1.6965 &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9.8e-04 &amp;nbsp;1632 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.3537 &amp;nbsp;82896 &amp;nbsp; &amp;nbsp; 2.4599 &amp;nbsp;B2DPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B2DPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;fillSpanfromto
&lt;br&gt;45634 &amp;nbsp; &amp;nbsp; 1.4624 &amp;nbsp;12633 &amp;nbsp; &amp;nbsp; 2.4784 &amp;nbsp;2849 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.6175 &amp;nbsp;59950 &amp;nbsp; &amp;nbsp; 1.7790 &amp;nbsp;BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; copyLoopPixMap
&lt;br&gt;39297 &amp;nbsp; &amp;nbsp; 1.2593 &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.0e-04 &amp;nbsp;161 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0349 &amp;nbsp;12604 &amp;nbsp; &amp;nbsp; 0.3740 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sweepPhase
&lt;br&gt;34504 &amp;nbsp; &amp;nbsp; 1.1057 &amp;nbsp;31 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0061 &amp;nbsp;3079 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.6673 &amp;nbsp;10196 &amp;nbsp; &amp;nbsp; 0.3026 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lookupMethodInClass
&lt;br&gt;31797 &amp;nbsp; &amp;nbsp; 1.0190 &amp;nbsp;19 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0037 &amp;nbsp;3408 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.7386 &amp;nbsp;39560 &amp;nbsp; &amp;nbsp; 1.1739 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; markAndTrace
&lt;br&gt;28467 &amp;nbsp; &amp;nbsp; 0.9123 &amp;nbsp;11 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0022 &amp;nbsp;1757 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.3808 &amp;nbsp;15187 &amp;nbsp; &amp;nbsp; 0.4507 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; updatePointersInRangeFromto
&lt;br&gt;28316 &amp;nbsp; &amp;nbsp; 0.9074 &amp;nbsp;197 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0386 &amp;nbsp;2484 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.5384 &amp;nbsp;22647 &amp;nbsp; &amp;nbsp; 0.6720 &amp;nbsp;BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; loadBitBltFromwarping
&lt;br&gt;26469 &amp;nbsp; &amp;nbsp; 0.8482 &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0014 &amp;nbsp;739 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.1602 &amp;nbsp;39972 &amp;nbsp; &amp;nbsp; 1.1862 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finalizeReference
&lt;br&gt;26380 &amp;nbsp; &amp;nbsp; 0.8454 &amp;nbsp;15 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0029 &amp;nbsp;342 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0741 &amp;nbsp;38994 &amp;nbsp; &amp;nbsp; 1.1571 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; updatePointersInRootObjectsFromto
&lt;br&gt;24235 &amp;nbsp; &amp;nbsp; 0.7766 &amp;nbsp;727 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.1426 &amp;nbsp;522 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.1131 &amp;nbsp;29049 &amp;nbsp; &amp;nbsp; 0.8620 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exuperyIsNativeContext
&lt;br&gt;17343 &amp;nbsp; &amp;nbsp; 0.5558 &amp;nbsp;7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0014 &amp;nbsp;790 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.1712 &amp;nbsp;9012 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.2674 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; positive32BitValueOf
&lt;br&gt;15935 &amp;nbsp; &amp;nbsp; 0.5107 &amp;nbsp;5546 &amp;nbsp; &amp;nbsp; &amp;nbsp;1.0880 &amp;nbsp;336 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0728 &amp;nbsp;22525 &amp;nbsp; &amp;nbsp; 0.6684 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; allocateheaderSizeh1h2h3doFillwith
&lt;br&gt;15559 &amp;nbsp; &amp;nbsp; 0.4986 &amp;nbsp;2712 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.5321 &amp;nbsp;1191 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.2581 &amp;nbsp;25552 &amp;nbsp; &amp;nbsp; 0.7582 &amp;nbsp;BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BitBltPlugin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pixPaintwith
&lt;br&gt;14371 &amp;nbsp; &amp;nbsp; 0.4605 &amp;nbsp;11 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.0022 &amp;nbsp;3301 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.7155 &amp;nbsp;19116 &amp;nbsp; &amp;nbsp; 0.5673 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; commonAt
&lt;br&gt;13348 &amp;nbsp; &amp;nbsp; 0.4278 &amp;nbsp;466 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0914 &amp;nbsp;383 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0830 &amp;nbsp;6048 &amp;nbsp; &amp;nbsp; &amp;nbsp;0.1795 &amp;nbsp;squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; squeak &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lookupSelectorclass
&lt;br&gt;&lt;br&gt;The anon block is the native code. What's interesting is the
&lt;br&gt;instructions per clock is about 0.5 while the intepreter's
&lt;br&gt;instructions per clock is a little over one. The native code has less
&lt;br&gt;branch mispredicts but much more memory traffic. &amp;nbsp;About 8% of the time
&lt;br&gt;the native code has the load store unit's buffer full and is probably
&lt;br&gt;stalled waiting for a memory request to finish.
&lt;br&gt;&lt;br&gt;Based on the profiling I've done I'm fairly confident that one of the
&lt;br&gt;reasons why the macro benchmarks are not often showing a performance
&lt;br&gt;improvement on an Athon 64 is due to excess spill code causing too
&lt;br&gt;much memory traffic. The register allocator is not handling heavy
&lt;br&gt;register pressure well and I doubt the spill heuristics are ideal for
&lt;br&gt;larger methods.
&lt;br&gt;&lt;br&gt;Bryce
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14462330&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Thinking-about-Exupery-0.14-tp14385965p14462330.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14406067</id>
	<title>Re: Thinking about Exupery 0.14</title>
	<published>2007-12-18T13:23:50Z</published>
	<updated>2007-12-18T13:23:50Z</updated>
	<author>
		<name>Igor Stasenko</name>
	</author>
	<content type="html">On 18/12/2007, &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14406067&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14406067&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Igor Stasenko writes:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; On 17/12/2007, &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14406067&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14406067&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; arithmaticLoopBenchmark 1396 compiled &amp;nbsp;128 ratio: 10.906
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; bytecodeBenchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; 2111 compiled &amp;nbsp;460 ratio: &amp;nbsp;4.589
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; sendBenchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1637 compiled &amp;nbsp;668 ratio: &amp;nbsp;2.451
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; doLoopsBenchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1081 compiled &amp;nbsp;715 ratio: &amp;nbsp;1.512
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; pointCreation &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1245 compiled 1317 ratio: &amp;nbsp;0.945
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; largeExplorers &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 728 compiled &amp;nbsp;715 ratio: &amp;nbsp;1.018
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; compilerBenchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;483 compiled &amp;nbsp;489 ratio: &amp;nbsp;0.988
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; Cumulative Time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1125 compiled &amp;nbsp;537 ratio &amp;nbsp; 2.093
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; ExuperyBenchmarks&amp;gt;&amp;gt;arithmeticLoop &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;249ms
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; SmallInteger&amp;gt;&amp;gt;benchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1112ms
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; InstructionStream&amp;gt;&amp;gt;interpretExtension:in:for: 113460ms
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; Average &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3155.360
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; First, from the numbers above, I'd say that having a method that takes
&lt;br&gt;&amp;gt; 2 minutes to compile is currently the biggest practical problem. The
&lt;br&gt;&amp;gt; second set of numbers is a compilation time benchmark. The second
&lt;br&gt;&amp;gt; biggest problem is that a 2.4 times increase in send speed is not
&lt;br&gt;&amp;gt; transferring through to the two macro-benchmarks (largeExplorers and
&lt;br&gt;&amp;gt; compilerBenchmark).
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;I suspect that main bottleneck in largeExplorers is not
&lt;br&gt;compiled/bytecode code, but memory allocations and GC.
&lt;br&gt;So, i doubt that you can gain any performance increase here.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; Do you make any difference between calling compiling method and , for
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; instance, a primitive function?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The sender doesn't know if it's sending to a primitive or to a full
&lt;br&gt;&amp;gt; method. If Exupery compiles a primitive then it executes in the
&lt;br&gt;&amp;gt; senders context, just like the interpreter,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; As i remember, you compiling methods to some form of a routine, which
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; can be called using cdecl convention.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; But on top of that, knowing the fact that you calling a compiled
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; method you can use some register optimizations like passing arguments
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; in it, and in general by knowing where you changing registers, you can
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; predict what of them are changing after call, and what will stay
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; unchanged.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; And, of course, nothing stops you from using own calling convention to
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; make code working faster. There's also a MMX/SSE registers which can
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; be used for different purposes.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; All of the above, depending on choices, can greatly improve sends speed.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; Just want to know, what you thinking about it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Currently Exupery uses C's calling conventions combined with the
&lt;br&gt;&amp;gt; interpreters handling of contexts, there's plenty of room to improve
&lt;br&gt;&amp;gt; this but I doubt that raw send speed is why the macro benchmarks
&lt;br&gt;&amp;gt; aren't performing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Also full method inlining will change the value of other send
&lt;br&gt;&amp;gt; optimisations by removing most of the common sends. It's the best
&lt;br&gt;&amp;gt; optimisation for common sends. 1.0 is a base to add full method
&lt;br&gt;&amp;gt; inlining too.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; And small trick when compiling SmallInteger methods: you already know
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; that receiver is a smallinteger. So, by using that knowledge, some
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; tests can be omitted.
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; In same manner you can deal with compiling methods for classes which
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; have byte/reference indexed instances.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Exupery compiles a method for each receiver so this is possible but
&lt;br&gt;&amp;gt; not done yet. It'll get even more interesting when combined with full
&lt;br&gt;&amp;gt; method inlining, then common self sends will become completely free.
&lt;br&gt;&amp;gt;
&lt;/div&gt;Yes, and for such matter i started coding some classes to translate ST
&lt;br&gt;method source to set of lambda-sends.
&lt;br&gt;Lambdas are very simple and yet powerful way to represent abstract algorithm.
&lt;br&gt;By having only few rules - substitution and reduction, i can transform
&lt;br&gt;method code to any form.
&lt;br&gt;And it's very helpful in case of full method inlining.
&lt;br&gt;Method can be represented as a labmda having single free variable &amp;lt;context&amp;gt;:
&lt;br&gt;&lt;br&gt;lambda method(context),
&lt;br&gt;&lt;br&gt;where any contextual parts/actions represented as messages to context, like:
&lt;br&gt;&lt;br&gt;receiver: Lambda context receiver.
&lt;br&gt;receiver class: Lambda context receiver class.
&lt;br&gt;argument1 : Lambda context argumentAt: 1
&lt;br&gt;push: Lambda context push: arg
&lt;br&gt;return: Lambda context return: expression.
&lt;br&gt;e.t.c.
&lt;br&gt;&lt;br&gt;But now, when you going to inline method, things become interesting,
&lt;br&gt;because, if you know the receiver's class, then you can reduce some
&lt;br&gt;labmdas at compile stage, like any accesses to receiver's class,
&lt;br&gt;results of receiver method lookups e.t.c.
&lt;br&gt;&lt;br&gt;And even more, if you have a way how to determine if method(s) are
&lt;br&gt;referentially transparent, then you can reduce some of methods to
&lt;br&gt;returned results at compile time.
&lt;br&gt;&lt;br&gt;Like having:
&lt;br&gt;&lt;br&gt;isInteger
&lt;br&gt;&amp;nbsp; ^ true
&lt;br&gt;&lt;br&gt;and then, in some method, when you encounter
&lt;br&gt;&amp;nbsp; self isInteger ifTrue: [ codeA ] ifFalse: [ codeB ]
&lt;br&gt;&lt;br&gt;you can reduce the whole expression to codeA, or codeB , depending on
&lt;br&gt;class of receiver.
&lt;br&gt;So, in given example, knowing the class of receiver, you can eliminate
&lt;br&gt;two sends: #isInteger and #ifTrue:ifFalse:.
&lt;br&gt;I think, that making compiler be able to detect and do such reductions
&lt;br&gt;will render any other kinds of optimizations much less important.
&lt;br&gt;&lt;br&gt;As i know, you are translating methods by taking their bytecode.
&lt;br&gt;I'm not sure, if the above is possible by compiling from bytecode. I
&lt;br&gt;think it would be much easier to operate with abstract parse trees
&lt;br&gt;(with lambda-sends as nodes).
&lt;br&gt;&lt;br&gt;&amp;gt; Bryce
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; Exupery mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14406067&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Igor Stasenko AKA sig.
&lt;br&gt;_______________________________________________
&lt;br&gt;Exupery mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14406067&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Exupery@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/exupery&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Thinking-about-Exupery-0.14-tp14385965p14406067.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-14404780</id>
	<title>Re: Thinking about Exupery 0.14</title>
	<published>2007-12-18T12:11:57Z</published>
	<updated>2007-12-18T12:11:57Z</updated>
	<author>
		<name>Bryce Kampjes</name>
	</author>
	<content type="html">Igor Stasenko writes:
&lt;br&gt;&amp;nbsp;&amp;gt; On 17/12/2007, &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14404780&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=14404780&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bryce@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; arithmaticLoopBenchmark 1396 compiled &amp;nbsp;128 ratio: 10.906
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; bytecodeBenchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; 2111 compiled &amp;nbsp;460 ratio: &amp;nbsp;4.589
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; sendBenchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1637 compiled &amp;nbsp;668 ratio: &amp;nbsp;2.451
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; doLoopsBenchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1081 compiled &amp;nbsp;715 ratio: &amp;nbsp;1.512
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; pointCreation &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1245 compiled 1317 ratio: &amp;nbsp;0.945
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; largeExplorers &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 728 compiled &amp;nbsp;715 ratio: &amp;nbsp;1.018
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; compilerBenchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;483 compiled &amp;nbsp;489 ratio: &amp;nbsp;0.988
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; Cumulative Time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1125 compiled &amp;nbsp;537 ratio &amp;nbsp; 2.093
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; ExuperyBenchmarks&amp;gt;&amp;gt;arithmeticLoop &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;249ms
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; SmallInteger&amp;gt;&amp;gt;benchmark &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1112ms
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; InstructionStream&amp;gt;&amp;gt;interpretExtension:in:for: 113460ms
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; &amp;nbsp; Average &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3155.360
&lt;br&gt;&lt;br&gt;First, from the numbers above, I'd say that having a method that takes
&lt;br&gt;2 minutes to compile is currently the biggest practical problem. The
&lt;br&gt;second set of numbers is a compilation time benchmark. The second
&lt;br&gt;biggest problem is that a 2.4 times increase in send speed is not
&lt;br&gt;transferring through to the two macro-benchmarks (largeExplorers and
&lt;br&gt;compilerBenchmark).
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Do you make any difference between calling compiling method and , for
&lt;br&gt;&amp;nbsp;&amp;gt; instance, a primitive function?
&lt;br&gt;&lt;br&gt;The sender doesn't know if it's sending to a primitive or to a full
&lt;br&gt;method. If Exupery compiles a primitive then it executes in the
&lt;br&gt;senders context, just like the interpreter, 
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; As i remember, you compiling methods to some form of a routine, which
&lt;br&gt;&amp;nbsp;&amp;gt; can be called using cdecl convention.
&lt;br&gt;&amp;nbsp;&amp;gt; But on top of that, knowing the fact that you calling a compiled
&lt;br&gt;&amp;nbsp;&amp;gt; method you can use some register optimizations like passing arguments
&lt;br&gt;&amp;nbsp;&amp;gt; in it, and in general by knowing where you changing registers, you can
&lt;br&gt;&amp;nbsp;&amp;gt; predict what of them are changing after call, and what will stay
&lt;br&gt;&amp;nbsp;&amp;gt; unchanged.
&lt;br&gt;&amp;nbsp;&amp;gt; And, of course, nothing stops you from using own calling convention to
&lt;br&gt;&amp;nbsp;&amp;gt; make code working faster. There's also a MMX/SSE registers which can
&lt;br&gt;&amp;nbsp;&amp;gt; be used for different purposes.
&lt;br&gt;&amp;nbsp;&amp;gt; All of the above, depending on choices, can greatly improve sends speed.
&lt;br&gt;&amp;nbsp;&amp;gt; Just want to know, what you thinking about it.
&lt;br&gt;&lt;br&gt;Currently Exupery uses C's calling conventions combined with the
&lt;br&gt;interpreters handling of contexts, there's plenty of room to improve
&lt;br&gt;this but I doubt that raw send speed is why the macro benchmarks
&lt;br&gt;aren't performing.
&lt;br&gt;&lt;br&gt;Also full method inlining will change the value of other send
&lt;br&gt;optimisations by removing most of the common sends. It's the best
&lt;br&gt;optimisation for common sends. 1.0 is a base to add full method
&lt;br&gt;inlining too.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; And small trick when compiling SmallInteger methods: you already know
&lt;br&gt;&amp;nbsp;&amp;gt; that receiver is a smallinteger. So, by using that knowledge, some
&lt;br&gt