OSDN Git Service

wc
[happyabc/happyabc.git] / swflib / instruction.ml
1 (* CAUTION: this is a generated file.  If you edit it, all changes will be lost! *)
2 # 1 "instruction.mlp"
3 # 1 "<built-in>"
4 # 1 "<command line>"
5 # 1 "instruction.mlp"
6 open Base
7 open Bytes
8
9
10 # 1 "write_type.h" 1
11 type method_ = int
12 let write_method_= u30
13 type class_ = int
14 let write_class_= u30
15 type c_int = int
16 let write_c_int= u30
17 type c_uint = int
18 let write_c_uint= u30
19 type c_string = int
20 let write_c_string= u30
21 type c_float = int
22 let write_c_float= u30
23 type namespace = int
24 let write_namespace= u30
25 type multiname = int
26 let write_multiname= u30
27 type u30 = int
28 let write_u30= u30
29 type u8 = int
30 let write_u8= u8
31 type label = (Label.t,int) either
32 let write_label= function
33                    Left  label   -> label_ref label
34                  | Right address -> s24 address
35 # 5 "instruction.mlp" 2
36 type t = [
37
38 # 1 "type.h" 1
39 | `NewFunction of method_
40 | `NewClass of class_
41 | `Coerce
42 | `Coerce_a
43 | `Coerce_s
44 | `Convert_i
45 | `Convert_s
46 | `Convert_d
47 | `Convert_b
48 | `Convert_u
49 | `Add_i
50 | `Subtract_i
51 | `Multiply_i
52 | `Add
53 | `Subtract
54 | `Multiply
55 | `Divide
56 | `Modulo
57 | `Equals
58 | `StrictEquals
59 | `LessThan
60 | `LessEquals
61 | `GreaterThan
62 | `GreaterEquals
63 | `Label of label
64 | `IfNlt of label
65 | `IfNle of label
66 | `IfNgt of label
67 | `IfNge of label
68 | `Jump of label
69 | `IfTrue of label
70 | `IfFalse of label
71 | `IfEq of label
72 | `IfNe of label
73 | `IfLt of label
74 | `IfLe of label
75 | `IfGt of label
76 | `IfGe of label
77 | `IfStrictEq of label
78 | `IfStrictNe of label
79 | `PushNull
80 | `PushUndefined
81 | `PushByte of u8
82 | `PushShort of u30
83 | `PushTrue
84 | `PushFalse
85 | `PushNaN
86 | `PushString of c_string
87 | `PushInt of c_int
88 | `PushUInt of c_uint
89 | `PushDouble of c_float
90 | `PushNamespace of namespace
91 | `PushScope
92 | `PushWith
93 | `GetGlobalScope
94 | `GetScopeObject of u8
95 | `GetLocal_0
96 | `GetLocal_1
97 | `GetLocal_2
98 | `GetLocal_3
99 | `GetLocal of u30
100 | `SetLocal_0
101 | `SetLocal_1
102 | `SetLocal_2
103 | `SetLocal_3
104 | `SetLocal of u30
105 | `GetSlot of u30
106 | `SetSlot of u30
107 | `GetGlobalSlot of u30
108 | `SetGlobalSlot of u30
109 | `GetLex of multiname
110 | `GetProperty of multiname
111 | `SetProperty of multiname
112 | `InitProperty of multiname
113 | `ReturnVoid
114 | `ReturnValue
115 | `FindPropStrict of multiname
116 | `CallProperty of multiname*u30
117 | `CallPropLex of multiname*u30
118 | `Call of u30
119 | `Pop
120 | `Swap
121 | `PopScope
122 | `NewObject of u30
123 | `NewArray of u30
124 | `NewActivation
125 | `Dup
126 | `ConstructSuper of u30
127 | `ConstructProp of multiname*u30
128 # 7 "instruction.mlp" 2
129 ]
130
131 let to_bytes =
132   function
133
134 # 1 "write.h" 1
135 | `NewFunction (arg0) -> [u8 0x40; write_method_ arg0]
136 | `NewClass (arg0) -> [u8 0x58; write_class_ arg0]
137 | `Coerce  -> [u8 0x80; ]
138 | `Coerce_a  -> [u8 0x82; ]
139 | `Coerce_s  -> [u8 0x85; ]
140 | `Convert_i  -> [u8 0x73; ]
141 | `Convert_s  -> [u8 0x74; ]
142 | `Convert_d  -> [u8 0x75; ]
143 | `Convert_b  -> [u8 0x76; ]
144 | `Convert_u  -> [u8 0x77; ]
145 | `Add_i  -> [u8 0xc5; ]
146 | `Subtract_i  -> [u8 0xc6; ]
147 | `Multiply_i  -> [u8 0xc7; ]
148 | `Add  -> [u8 0xa0; ]
149 | `Subtract  -> [u8 0xa1; ]
150 | `Multiply  -> [u8 0xa2; ]
151 | `Divide  -> [u8 0xa3; ]
152 | `Modulo  -> [u8 0xa4; ]
153 | `Equals  -> [u8 0xab; ]
154 | `StrictEquals  -> [u8 0xac; ]
155 | `LessThan  -> [u8 0xad; ]
156 | `LessEquals  -> [u8 0xae; ]
157 | `GreaterThan  -> [u8 0xaf; ]
158 | `GreaterEquals  -> [u8 0xb0; ]
159 | `Label (arg0) -> [u8 0x9; write_label arg0]
160 | `IfNlt (arg0) -> [u8 0xc; write_label arg0]
161 | `IfNle (arg0) -> [u8 0xd; write_label arg0]
162 | `IfNgt (arg0) -> [u8 0xe; write_label arg0]
163 | `IfNge (arg0) -> [u8 0xf; write_label arg0]
164 | `Jump (arg0) -> [u8 0x10; write_label arg0]
165 | `IfTrue (arg0) -> [u8 0x11; write_label arg0]
166 | `IfFalse (arg0) -> [u8 0x12; write_label arg0]
167 | `IfEq (arg0) -> [u8 0x13; write_label arg0]
168 | `IfNe (arg0) -> [u8 0x14; write_label arg0]
169 | `IfLt (arg0) -> [u8 0x15; write_label arg0]
170 | `IfLe (arg0) -> [u8 0x16; write_label arg0]
171 | `IfGt (arg0) -> [u8 0x17; write_label arg0]
172 | `IfGe (arg0) -> [u8 0x18; write_label arg0]
173 | `IfStrictEq (arg0) -> [u8 0x19; write_label arg0]
174 | `IfStrictNe (arg0) -> [u8 0x1a; write_label arg0]
175 | `PushNull  -> [u8 0x20; ]
176 | `PushUndefined  -> [u8 0x21; ]
177 | `PushByte (arg0) -> [u8 0x24; write_u8 arg0]
178 | `PushShort (arg0) -> [u8 0x25; write_u30 arg0]
179 | `PushTrue  -> [u8 0x26; ]
180 | `PushFalse  -> [u8 0x27; ]
181 | `PushNaN  -> [u8 0x28; ]
182 | `PushString (arg0) -> [u8 0x2c; write_c_string arg0]
183 | `PushInt (arg0) -> [u8 0x2d; write_c_int arg0]
184 | `PushUInt (arg0) -> [u8 0x2e; write_c_uint arg0]
185 | `PushDouble (arg0) -> [u8 0x2f; write_c_float arg0]
186 | `PushNamespace (arg0) -> [u8 0x31; write_namespace arg0]
187 | `PushScope  -> [u8 0x30; ]
188 | `PushWith  -> [u8 0x1c; ]
189 | `GetGlobalScope  -> [u8 0x64; ]
190 | `GetScopeObject (arg0) -> [u8 0x65; write_u8 arg0]
191 | `GetLocal_0  -> [u8 0xd0; ]
192 | `GetLocal_1  -> [u8 0xd1; ]
193 | `GetLocal_2  -> [u8 0xd2; ]
194 | `GetLocal_3  -> [u8 0xd3; ]
195 | `GetLocal (arg0) -> [u8 0x62; write_u30 arg0]
196 | `SetLocal_0  -> [u8 0xd4; ]
197 | `SetLocal_1  -> [u8 0xd5; ]
198 | `SetLocal_2  -> [u8 0xd6; ]
199 | `SetLocal_3  -> [u8 0xd7; ]
200 | `SetLocal (arg0) -> [u8 0x63; write_u30 arg0]
201 | `GetSlot (arg0) -> [u8 0x6c; write_u30 arg0]
202 | `SetSlot (arg0) -> [u8 0x6d; write_u30 arg0]
203 | `GetGlobalSlot (arg0) -> [u8 0x6e; write_u30 arg0]
204 | `SetGlobalSlot (arg0) -> [u8 0x6f; write_u30 arg0]
205 | `GetLex (arg0) -> [u8 0x60; write_multiname arg0]
206 | `GetProperty (arg0) -> [u8 0x66; write_multiname arg0]
207 | `SetProperty (arg0) -> [u8 0x61; write_multiname arg0]
208 | `InitProperty (arg0) -> [u8 0x68; write_multiname arg0]
209 | `ReturnVoid  -> [u8 0x47; ]
210 | `ReturnValue  -> [u8 0x48; ]
211 | `FindPropStrict (arg0) -> [u8 0x5d; write_multiname arg0]
212 | `CallProperty (arg0,arg1) -> [u8 0x46; write_multiname arg0;write_u30 arg1]
213 | `CallPropLex (arg0,arg1) -> [u8 0x4c; write_multiname arg0;write_u30 arg1]
214 | `Call (arg0) -> [u8 0x41; write_u30 arg0]
215 | `Pop  -> [u8 0x29; ]
216 | `Swap  -> [u8 0x2b; ]
217 | `PopScope  -> [u8 0x1d; ]
218 | `NewObject (arg0) -> [u8 0x55; write_u30 arg0]
219 | `NewArray (arg0) -> [u8 0x56; write_u30 arg0]
220 | `NewActivation  -> [u8 0x57; ]
221 | `Dup  -> [u8 0x2a; ]
222 | `ConstructSuper (arg0) -> [u8 0x49; write_u30 arg0]
223 | `ConstructProp (arg0,arg1) -> [u8 0x4a; write_multiname arg0;write_u30 arg1]
224 # 12 "instruction.mlp" 2