<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Alchemy for ActionScript</title>
	<atom:link href="http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/</link>
	<description>Actionscript3, Flash, Scala, Java, C#, C++, Algorithms &#38; Imageprocessing</description>
	<lastBuildDate>Sun, 05 Feb 2012 21:26:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Philippe.me &#187; AS3 &#8211; Fast memory access without Alchemy</title>
		<link>http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/comment-page-1/#comment-191204</link>
		<dc:creator>Philippe.me &#187; AS3 &#8211; Fast memory access without Alchemy</dc:creator>
		<pubDate>Mon, 03 May 2010 15:14:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=398#comment-191204</guid>
		<description>[...] year later, Joa Ebert releases TDSI, an AS3 bytecode optimizer tool which adds a fast memory API, among other [...]</description>
		<content:encoded><![CDATA[<p>[...] year later, Joa Ebert releases TDSI, an AS3 bytecode optimizer tool which adds a fast memory API, among other [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; OMG AS3 &#187;CoderHump.com</title>
		<link>http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/comment-page-1/#comment-174084</link>
		<dc:creator>&#187; OMG AS3 &#187;CoderHump.com</dc:creator>
		<pubDate>Sat, 08 Aug 2009 23:05:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=398#comment-174084</guid>
		<description>[...] Ebert, a talented Flash hacker (AS3V, AS3C, etc.), is a little bit incensed about Adobe&#8217;s troubles with involving the community. He [...]</description>
		<content:encoded><![CDATA[<p>[...] Ebert, a talented Flash hacker (AS3V, AS3C, etc.), is a little bit incensed about Adobe&#8217;s troubles with involving the community. He [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joa</title>
		<link>http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/comment-page-1/#comment-173834</link>
		<dc:creator>joa</dc:creator>
		<pubDate>Wed, 05 Aug 2009 09:09:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=398#comment-173834</guid>
		<description>It is like AS3C a handwritten post-compile time system and has nothing to do with the ActionScript or haXe at all. Only the ActionScript APIs of course. But you can write the same APIs for haXe as well.

The same tool will be able to optimize any SWF file. It does not make a difference if you used the haXe compiler or ASC.</description>
		<content:encoded><![CDATA[<p>It is like AS3C a handwritten post-compile time system and has nothing to do with the ActionScript or haXe at all. Only the ActionScript APIs of course. But you can write the same APIs for haXe as well.</p>
<p>The same tool will be able to optimize any SWF file. It does not make a difference if you used the haXe compiler or ASC.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikecann</title>
		<link>http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/comment-page-1/#comment-173833</link>
		<dc:creator>mikecann</dc:creator>
		<pubDate>Wed, 05 Aug 2009 08:47:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=398#comment-173833</guid>
		<description>Wow this looks like it coduld be some really impressive work! 

I may be a little confused but is this all haxe based or have you written a sepparate compiler?</description>
		<content:encoded><![CDATA[<p>Wow this looks like it coduld be some really impressive work! </p>
<p>I may be a little confused but is this all haxe based or have you written a sepparate compiler?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joa</title>
		<link>http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/comment-page-1/#comment-173831</link>
		<dc:creator>joa</dc:creator>
		<pubDate>Wed, 05 Aug 2009 08:20:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=398#comment-173831</guid>
		<description>Yes absolutely. Do you know about the work of the Sable research group at McGill University? They have developed Soot which is a Java optimization framework that converts the stack based representation into three address code and furthermore converts the TAC into SSA representation.

This is exactly what TAAS is all about as well. The stack based code gets converted into a TAC representation with stack SSA for branches. I am also working on a SSA for local registers but unfortunately I am currently pretty busy since we are working on the AudioTool 1.0.

Branching into pruned SSA using liveness analysis and dominance frontiers is nearly complete. Getting out of SSA is a different story and not yet implemented as well as converting the TAAS control flow graph back into ca ontrol flow graph of bytecode vertices which might then be converted back into a linear list of operations.

The only cool thing is that the framework is very robust in terms of bytecode. This is absolutely independent of TAAS and works already very well as this example demonstrates.

You can read more about the memory API here:
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.ncannasse.fr/blog/virtual_memory_api&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.ncannasse.fr/blog/virtual_memory_api&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://llvm.org/devmtg/2008-08/Petersen_FlashCCompiler.pdf&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://llvm.org/devmtg/2008-08/Petersen_FlashCCompiler.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://code.google.com/p/hxformat/source/browse/trunk/format/abc/OpReader.hx#201&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/hxformat/source/[...]/OpReader.hx#201&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
		<content:encoded><![CDATA[<p>Yes absolutely. Do you know about the work of the Sable research group at McGill University? They have developed Soot which is a Java optimization framework that converts the stack based representation into three address code and furthermore converts the TAC into SSA representation.</p>
<p>This is exactly what TAAS is all about as well. The stack based code gets converted into a TAC representation with stack SSA for branches. I am also working on a SSA for local registers but unfortunately I am currently pretty busy since we are working on the AudioTool 1.0.</p>
<p>Branching into pruned SSA using liveness analysis and dominance frontiers is nearly complete. Getting out of SSA is a different story and not yet implemented as well as converting the TAAS control flow graph back into ca ontrol flow graph of bytecode vertices which might then be converted back into a linear list of operations.</p>
<p>The only cool thing is that the framework is very robust in terms of bytecode. This is absolutely independent of TAAS and works already very well as this example demonstrates.</p>
<p>You can read more about the memory API here:</p>
<ul>
<li><a href="http://www.ncannasse.fr/blog/virtual_memory_api" target="_blank" rel="nofollow">http://www.ncannasse.fr/blog/virtual_memory_api</a></li>
<li><a href="http://llvm.org/devmtg/2008-08/Petersen_FlashCCompiler.pdf" target="_blank" rel="nofollow">http://llvm.org/devmtg/2008-08/Petersen_FlashCCompiler.pdf</a></li>
<li><a href="http://code.google.com/p/hxformat/source/browse/trunk/format/abc/OpReader.hx#201" target="_blank" rel="nofollow">http://code.google.com/p/hxformat/source/&#8230;/OpReader.hx#201</a></li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Conrad Winchester</title>
		<link>http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/comment-page-1/#comment-173827</link>
		<dc:creator>Conrad Winchester</dc:creator>
		<pubDate>Wed, 05 Aug 2009 06:19:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=398#comment-173827</guid>
		<description>Hi Joa,

this is all incredible stuff! About 8 years ago I wrote a JVM bytecode optimiser in perl because I noticed that the java compiler tended to ignore stack based operations. Unfortunately I don&#039;t have the code anymore :-( However I can still remember some of the ideas. I&#039;ll share them with you.

Unfortunatley abc bytecode does not seem to have very good stack manipulation operands (no ROT or OVER as far as I can tell), however it does have DUP and SWAP.

Looking at you inlined byte code I am wondering whether all your fast pushbyte-getint and pushbyte-setint etc could all be done on the stack itself. (as a side note, and I am probably not understanding something because I am new to this, but couldn&#039;t you implement TAAS using the stack? Sorry if that is a stupid question)

Here is an attempt at an example

0x000000       GetLocal0
0x000001       PushScope
0x000002       PushDouble           0.5
0x000004       GetLocal1
0x000005       Multiply
0x000006       ConvertDouble
0x000007       SetLocal2
0x00000a       GetLocal1

could be (without address label as I am not sure of opcode sizes)

GetLocal0
PushScope
GetLocal1
Dup
PushDouble 0.5
Multiply
ConvertDouble
Swap

Here you end up with local1 at the top of the stack and local 2 below it. Now I don&#039;t understand how the writefloat(0) and then readint(0) works unfortunately and so I have not attempted to optimize that BUT I am certain that using the stack more will increase you optimisations further.

If you could point me at the docs for the readfloat stuff I will try to write opcodes for the above example that use the stack more.

Do you think this is a fruitful approach?</description>
		<content:encoded><![CDATA[<p>Hi Joa,</p>
<p>this is all incredible stuff! About 8 years ago I wrote a JVM bytecode optimiser in perl because I noticed that the java compiler tended to ignore stack based operations. Unfortunately I don&#8217;t have the code anymore :-( However I can still remember some of the ideas. I&#8217;ll share them with you.</p>
<p>Unfortunatley abc bytecode does not seem to have very good stack manipulation operands (no ROT or OVER as far as I can tell), however it does have DUP and SWAP.</p>
<p>Looking at you inlined byte code I am wondering whether all your fast pushbyte-getint and pushbyte-setint etc could all be done on the stack itself. (as a side note, and I am probably not understanding something because I am new to this, but couldn&#8217;t you implement TAAS using the stack? Sorry if that is a stupid question)</p>
<p>Here is an attempt at an example</p>
<p>0&#215;000000       GetLocal0<br />
0&#215;000001       PushScope<br />
0&#215;000002       PushDouble           0.5<br />
0&#215;000004       GetLocal1<br />
0&#215;000005       Multiply<br />
0&#215;000006       ConvertDouble<br />
0&#215;000007       SetLocal2<br />
0x00000a       GetLocal1</p>
<p>could be (without address label as I am not sure of opcode sizes)</p>
<p>GetLocal0<br />
PushScope<br />
GetLocal1<br />
Dup<br />
PushDouble 0.5<br />
Multiply<br />
ConvertDouble<br />
Swap</p>
<p>Here you end up with local1 at the top of the stack and local 2 below it. Now I don&#8217;t understand how the writefloat(0) and then readint(0) works unfortunately and so I have not attempted to optimize that BUT I am certain that using the stack more will increase you optimisations further.</p>
<p>If you could point me at the docs for the readfloat stuff I will try to write opcodes for the above example that use the stack more.</p>
<p>Do you think this is a fruitful approach?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Garney</title>
		<link>http://blog.joa-ebert.com/2009/08/05/alchemy-for-actionscript/comment-page-1/#comment-173808</link>
		<dc:creator>Ben Garney</dc:creator>
		<pubDate>Tue, 04 Aug 2009 23:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=398#comment-173808</guid>
		<description>Nice work. I&#039;m really excited to see this go out into the world. :)</description>
		<content:encoded><![CDATA[<p>Nice work. I&#8217;m really excited to see this go out into the world. :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

