faster AVM2 constant pool when adding a lot of items to it.

This commit is contained in:
honfika@gmail.com
2015-11-09 13:58:20 +01:00
parent 03e810ec67
commit f2b8b146a6
32 changed files with 478 additions and 251 deletions

View File

@@ -1,10 +1,57 @@
package {
public class Run {
public static function run():*
{
return "Test";
}
}
}
package
{
public class Run
{
public static function run():*
{
return new Run().runInstance();
}
public function runInstance():*
{
return "Test" + executeMethod("testInstance") + executeStaticMethod("testStatic");
}
public function executeMethod(methodName:String):String
{
try
{
var result = this[methodName]();
return methodName + "_Result:" + result + " Type:" + typeof(result) + "\n";
}
catch (ex)
{
return methodName + "_Error:" + ex + "\n";
}
return null;
}
public static function executeStaticMethod(methodName:String):String
{
try
{
var result = Run[methodName]();
return "Result:" + result + " Type:" + typeof(result) + "\n";
}
catch (ex)
{
return "Error:" + ex + "\n";
}
return null;
}
public function testInstance()
{
return "testInstance";
}
public static function testStatic()
{
return "testStatic";
}
}
}

View File

@@ -14,6 +14,7 @@
myTextBox = new TextField();
myTextBox.text = "";
myTextBox.width = 400;
myTextBox.multiline = true;
addChild(myTextBox);
var rectangleShape:Shape = new Shape();
@@ -21,8 +22,8 @@
rectangleShape.graphics.drawRect(0, 0, 100, 25);
rectangleShape.graphics.endFill();
var btnTextBox:TextField = new TextField();
btnTextBox.text = "EXECUTE";
var btnTextBox:TextField = new TextField();
btnTextBox.text = "EXECUTE";
var simpleButtonSprite:Sprite = new Sprite();
simpleButtonSprite.name = "simpleButtonSprite";