1 (* Title: HOL/MicroJava/JVM/Method.thy
4 Copyright 1999 Technische Universitaet Muenchen
11 (** method invocation and return instructions **)
15 Invokevirtual mname (ty list) (** inv. instance meth of an object **)
18 exec_mi :: "[meth_inv,(nat \\<times> 'c)prog,aheap,opstack,p_count]
19 \\<Rightarrow> (xcpt option \\<times> frame list \\<times> opstack \\<times> p_count)"
21 "exec_mi (Invokevirtual mn ps) G hp stk pc =
23 argsoref = take (n+1) stk;
25 xp' = raise_xcpt (oref=Null) NullPointer;
26 dynT = fst(hp \\<And> (the_Addr oref));
27 (dc,mh,mxl,c)= the (cmethd (G,dynT) (mn,ps));
28 frs' = xcpt_update xp' [([],rev argsoref@replicate mxl arbitrary,dc,(mn,ps),0)] []
30 (xp' , frs' , drop (n+1) stk , pc+1))"
34 exec_mr :: "[opstack,frame list] \\<Rightarrow> frame list"
35 "exec_mr stk0 frs \\<equiv>
37 (stk,loc,cn,met,pc) = hd frs
39 (val#stk,loc,cn,met,pc)#tl frs)"