privatefunction simpleTryCatchFinally():void
{
try
{
trace("trying");
}
catch(e:Error)
{
trace("caught");
}
finally
{
trace("finally")
}
}
It creates:
67 operations
2 exceptions, one of which is Error, one of which is 'null'
9 labels
No 'finally' block, but two 'try-catch', as they would be nested somehow
Bytecode:
operandStack: 7
scopeStack: 7
localCount: 4
2 exception(s):
(L0, L1) => L2, AbcQName('Error,AbcNamespace(22,')), AbcQName('e,AbcNamespace(22,'))
(L3, L4) => L5, AbcQName('null,AbcNamespace(0,'null)), AbcQName('null,AbcNamespace(0,'null))
67 operation(s):
+0|-0 DebugFile('/Users/alenbalja/Projects/BBC/code2/ActionScriptTestCases/src;;EmptyFunction.as)
+0|-0 DebugLine(38)
+1|-0 GetLocal(0)
+0|-1 PushScope()
+1|-0 NewActivation()
+2|-1 Dup()
+0|-1 SetLocal(1)
+0|-1 PushScope()
+0|-0 Debug(1,'simpleTryCatchFinally$0,0,38)
try {
L3: +0|-0 DebugLine(44)
try {
L0: +1|-0 FindPropStrict(AbcQName('trace,AbcNamespace(22,')))
+1|-0 PushString('trying)
+1|-2 CallProperty(AbcQName('trace,AbcNamespace(22,')),1)
+0|-1 Pop()
} catch {
(AbcQName('e,AbcNamespace(22,')), AbcQName('Error,AbcNamespace(22,'))) => L2
}
L1: +0|-0 DebugLine(47)
+0|-0 Jump(L6)
L2: +1|-0 GetLocal(0)
+0|-1 PushScope()
+1|-0 GetLocal(1)
+0|-1 PushScope()
+1|-0 NewCatch((L0, L1) => L2, AbcQName('Error,AbcNamespace(22,')), AbcQName('e,AbcNamespace(22,')))
+2|-1 Dup()
+0|-1 SetLocal(2)
+2|-1 Dup()
+0|-1 PushScope()
+2|-2 Swap()
+0|-2 SetSlot(1)
+0|-0 DebugLine(49)
+1|-0 FindPropStrict(AbcQName('trace,AbcNamespace(22,')))
+1|-0 PushString('caought)
+1|-2 CallProperty(AbcQName('trace,AbcNamespace(22,')),1)
+0|-1 Pop()
+0|-0 PopScope()
+0|-0 Kill(2)
L6: +1|-0 PushByte(-1)
} catch {
(AbcQName('null,AbcNamespace(0,'null)), AbcQName('null,AbcNamespace(0,'null))) => L5
}
L4: +0|-0 Jump(L7)
L5: +1|-0 GetLocal(0)
+0|-1 PushScope()
+1|-0 GetLocal(1)
+0|-1 PushScope()
+1|-0 NewCatch((L3, L4) => L5, AbcQName('null,AbcNamespace(0,'null)), AbcQName('null,AbcNamespace(0,'null)))
+2|-1 Dup()
+0|-1 SetLocal(2)
+0|-1 PushScope()
+0|-0 PopScope()
+0|-0 Kill(2)
+1|-1 CoerceAny()
+0|-1 SetLocal(3)
+1|-0 PushByte(0)
+0|-0 Jump(L7)
+0|-0 Label()
+0|-1 Pop()
L9: +0|-0 Label()
+1|-0 GetLocal(3)
+0|-0 Kill(3)
+0|-1 Throw()
+1|-0 PushByte(-1)
+0|-0 PopScope()
+0|-0 Kill(2)
L7: +0|-0 DebugLine(55)
+1|-0 FindPropStrict(AbcQName('trace,AbcNamespace(22,')))
+1|-0 PushString('<finaly<)
+1|-2 CallProperty(AbcQName('trace,AbcNamespace(22,')),1)
+0|-1 Pop()
+0|-1 LookupSwitch(L8,[L9])
L8: +0|-0 DebugLine(57)
+0|-0 ReturnVoid()
cat graph.dot | grep graph
digraph G {
graph[
digraph G {
graph[
digraph G {
graph[
digraph G {
graph[
digraph G {
graph[
digraph G {
graph[
digraph G {
graph[
digraph G {
graph[
digraph G {
graph[
digraph G {
graph[
Best,
Joa