src/HOL/MicroJava/JVM/JVMExecInstr.thy
changeset 13677 5fad004bd9df
parent 12911 704713ca07ea
child 16417 9bc16273c2d4
equal deleted inserted replaced
13676:b1915d3e571d 13677:5fad004bd9df
    26 
    26 
    27  "exec_instr (New C) G hp stk vars Cl sig pc frs = 
    27  "exec_instr (New C) G hp stk vars Cl sig pc frs = 
    28   (let (oref,xp') = new_Addr hp;
    28   (let (oref,xp') = new_Addr hp;
    29        fs   = init_vars (fields(G,C));
    29        fs   = init_vars (fields(G,C));
    30        hp'  = if xp'=None then hp(oref \<mapsto> (C,fs)) else hp;
    30        hp'  = if xp'=None then hp(oref \<mapsto> (C,fs)) else hp;
    31        stk' = if xp'=None then (Addr oref)#stk else stk;
       
    32        pc'  = if xp'=None then pc+1 else pc
    31        pc'  = if xp'=None then pc+1 else pc
    33    in 
    32    in 
    34       (xp', hp', (stk', vars, Cl, sig, pc')#frs))"
    33       (xp', hp', (Addr oref#stk, vars, Cl, sig, pc')#frs))"
    35 
    34 
    36  "exec_instr (Getfield F C) G hp stk vars Cl sig pc frs = 
    35  "exec_instr (Getfield F C) G hp stk vars Cl sig pc frs = 
    37   (let oref = hd stk;
    36   (let oref = hd stk;
    38        xp'  = raise_system_xcpt (oref=Null) NullPointer;
    37        xp'  = raise_system_xcpt (oref=Null) NullPointer;
    39        (oc,fs)  = the(hp(the_Addr oref));
    38        (oc,fs)  = the(hp(the_Addr oref));
    40        stk' = if xp'=None then the(fs(F,C))#(tl stk) else tl stk;
       
    41        pc'  = if xp'=None then pc+1 else pc
    39        pc'  = if xp'=None then pc+1 else pc
    42    in
    40    in
    43       (xp', hp, (stk', vars, Cl, sig, pc')#frs))"
    41       (xp', hp, (the(fs(F,C))#(tl stk), vars, Cl, sig, pc')#frs))"
    44 
    42 
    45  "exec_instr (Putfield F C) G hp stk vars Cl sig pc frs = 
    43  "exec_instr (Putfield F C) G hp stk vars Cl sig pc frs = 
    46   (let (fval,oref)= (hd stk, hd(tl stk));
    44   (let (fval,oref)= (hd stk, hd(tl stk));
    47        xp'  = raise_system_xcpt (oref=Null) NullPointer;
    45        xp'  = raise_system_xcpt (oref=Null) NullPointer;
    48        a    = the_Addr oref;
    46        a    = the_Addr oref;