1 ; -*- Mode: Jasmin; indent-tabs-mode: t; tab-width: 4 -*-
2 ; ---------------------------------------------------------------------------
4 ; Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 ; ---------------------------------------------------------------------------
6 ; SquirrelJME is under the Mozilla Public License Version 2.0.
7 ; See license.mkd for licensing and copyright information.
8 ; ---------------------------------------------------------------------------
9 ; Same as TestInvokeInterfaceAB except it invokes the interface methods via
10 ; InterfaceAB and not InterfaceA+InterfaceB.
12 .
class public lang
/interfaces
/TestInvokeInterfaceABViaAB
13 .
super net
/multiphasicapps
/tac
/TestInteger
15 .
method public <init
>()V
17 invokenonvirtual net
/multiphasicapps
/tac
/TestInteger
/<init
>()V
21 .
method public test
()I
23 ; Allocate and initialize an implementation
24 new lang
/interfaces
/ImplementsAB
26 invokespecial lang
/interfaces
/ImplementsAB
/<init
>()V
28 ; Duplicate for the second call
31 ; Call the first, the result is on the stack
32 invokeinterface lang
/interfaces
/InterfaceAB
/methodA
()I
1
34 ; Swap the two so the object is at the top then call again
36 invokeinterface lang
/interfaces
/InterfaceAB
/methodB
()I
1
38 ; Add both values together which becomes the result