Algorithm 5.2 Call-Resolution-Of-CHA

Input: Call site cscs.

Output: Possible target methods of cscs resolved by CHA.

1:procedure Resolve(cscs)

2:T:={}T := \{\}

3:m:=m := method signature at cscs

4:if cscs is a static call then

5:T={m}T = \{m\}

6:end if

7:if cscs is a special call then

8:cm=c^{m} = class type of mm

9:T={T = \{ Dispatch(cm,mc^m, m) }\}

10:end if

11:if cscs is a virtual call then

12:c:=c := declared type of receiver variable at cscs

13:for each cc' that is a subclass of cc or cc itself do

14:add Dispatch(c,mc', m) to TT

15:end for

16:end if

17:return TT

18:end procedure