9376
|
1 |
(* Title: HOL/MicroJava/JVM/JVMInstructions.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Gerwin Klein
|
|
4 |
Copyright 2000 Technische Universitaet Muenchen
|
|
5 |
|
|
6 |
Instructions of the JVM
|
|
7 |
*)
|
|
8 |
|
|
9 |
JVMInstructions = JVMState +
|
|
10 |
|
|
11 |
datatype
|
|
12 |
instr = Load nat (* load from local variable *)
|
|
13 |
| Store nat (* store into local variable *)
|
|
14 |
| Bipush int (* push int *)
|
|
15 |
| Aconst_null (* push null *)
|
|
16 |
| New cname (* create object *)
|
|
17 |
| Getfield vname cname (* Fetch field from object *)
|
|
18 |
| Putfield vname cname (* Set field in object *)
|
|
19 |
| Checkcast cname (* Check whether object is of given type *)
|
|
20 |
| Invoke mname "(ty list)" (* inv. instance meth of an object *)
|
|
21 |
| Return
|
|
22 |
| Pop
|
|
23 |
| Dup
|
|
24 |
| Dup_x1
|
|
25 |
| Dup_x2
|
|
26 |
| Swap
|
|
27 |
| IAdd
|
|
28 |
| Goto int
|
|
29 |
| Ifcmpeq int (* Branch if int/ref comparison succeeds *)
|
|
30 |
|
|
31 |
|
|
32 |
types
|
|
33 |
bytecode = "instr list"
|
|
34 |
jvm_prog = "(nat \\<times> bytecode) prog"
|
|
35 |
|
|
36 |
end
|