1# Duktape opcode metadata for debugger.
2# - See duk_debug.js for the argument formats (A_R etc).
3# - Flag bits are for the whole instruction as a 32-bit integer,
4#   they are not field shifted
5#
6# NOTE: Use YAML comments only on comment-only lines (not trailing content):
7# Node.js 'yamljs' seems to refuse parsing trailing comments in some cases.
8
9opcodes:
10  - name: LDREG
11    args:
12      - A_R
13      - BC_R
14  - name: STREG
15    args:
16      - A_R
17      - BC_R
18  - name: LDCONST
19    args:
20      - A_R
21      - BC_C
22  - name: LDINT
23    args:
24      - A_R
25      - BC_LDINT
26  - name: LDINTX
27    args:
28      - A_R
29      - BC_LDINTX
30  - name: MPUTOBJ
31    args:
32      - A_R
33      - B_R
34      - C_I
35  - name: MPUTOBJI
36    args:
37      - A_R
38      - B_RI
39      - C_I
40  - name: MPUTARR
41    args:
42      - A_R
43      - B_R
44      - C_I
45  - name: MPUTARRI
46    args:
47      - A_R
48      - B_RI
49      - C_I
50  - name: NEW
51    args:
52      - B_R
53      - C_I
54  - name: NEWI
55    args:
56      - B_RI
57      - C_I
58  - name: REGEXP
59    args:
60      - A_R
61      - B_RC
62      - C_RC
63  - name: CSREG
64    args:
65      - A_R
66      - B_R
67  - name: CSREGI
68    args:
69      - A_RI
70      - B_R
71  - name: GETVAR
72    args:
73      - A_R
74      - BC_C
75  - name: PUTVAR
76    args:
77      - A_R
78      - BC_C
79  - name: DECLVAR
80    args:
81      - A_H
82      - B_RC
83      - C_RC
84    flags:
85      - mask: 0x40
86        name: writable
87      - mask: 0x80
88        name: enumerable
89      - mask: 0x100
90        name: configurable
91      - mask: 0x200
92        name: accessor
93      - mask: 0x400
94        name: undef_value
95      - mask: 0x800
96        name: func_decl
97  - name: DELVAR
98    args:
99      - A_R
100      - B_RC
101  - name: CSVAR
102    args:
103      - A_R
104      - B_RC
105  - name: CSVARI
106    args:
107      - A_RI
108      - B_RC
109  - name: CLOSURE
110    args:
111      - A_R
112      - BC_I
113  - name: GETPROP
114    args:
115      - A_R
116      - B_RC
117      - C_RC
118  - name: PUTPROP
119    args:
120      - A_R
121      - B_RC
122      - C_RC
123  - name: DELPROP
124    args:
125      - A_R
126      - B_R
127      - C_RC
128  - name: CSPROP
129    args:
130      - A_R
131      - B_R
132      - C_RC
133  - name: CSPROPI
134    args:
135      - A_RI
136      - B_R
137      - C_RC
138  - name: ADD
139    args:
140      - A_R
141      - B_RC
142      - C_RC
143  - name: SUB
144    args:
145      - A_R
146      - B_RC
147      - C_RC
148  - name: MUL
149    args:
150      - A_R
151      - B_RC
152      - C_RC
153  - name: DIV
154    args:
155      - A_R
156      - B_RC
157      - C_RC
158  - name: MOD
159    args:
160      - A_R
161      - B_RC
162      - C_RC
163  - name: BAND
164    args:
165      - A_R
166      - B_RC
167      - C_RC
168  - name: BOR
169    args:
170      - A_R
171      - B_RC
172      - C_RC
173  - name: BXOR
174    args:
175      - A_R
176      - B_RC
177      - C_RC
178  - name: BASL
179    args:
180      - A_R
181      - B_RC
182      - C_RC
183  - name: BLSR
184    args:
185      - A_R
186      - B_RC
187      - C_RC
188  - name: BASR
189    args:
190      - A_R
191      - B_RC
192      - C_RC
193  - name: EQ
194    args:
195      - A_R
196      - B_RC
197      - C_RC
198  - name: NEQ
199    args:
200      - A_R
201      - B_RC
202      - C_RC
203  - name: SEQ
204    args:
205      - A_R
206      - B_RC
207      - C_RC
208  - name: SNEQ
209    args:
210      - A_R
211      - B_RC
212      - C_RC
213  - name: GT
214    args:
215      - A_R
216      - B_RC
217      - C_RC
218  - name: GE
219    args:
220      - A_R
221      - B_RC
222      - C_RC
223  - name: LT
224    args:
225      - A_R
226      - B_RC
227      - C_RC
228  - name: LE
229    args:
230      - A_R
231      - B_RC
232      - C_RC
233  - name: IF
234    args:
235      - A_B
236      - B_RC
237  - name: JUMP
238    args:
239      - ABC_JUMP
240  - name: RETURN
241    args:
242      - A_H
243      - B_RC
244    flags:
245      - mask: 0x40
246        name: have_retval
247  - name: CALL
248    args:
249      - A_H
250      - B_R
251      - C_I
252    flags:
253      - mask: 0x40
254        name: tailcall
255      - mask: 0x80
256        name: evalcall
257  - name: CALLI
258    args:
259      - A_H
260      - B_RI
261      - C_I
262  - name: TRYCATCH
263    args:
264      - A_H
265      # base register for two consecutive regs (base_reg + 0, base_reg + 1) used for two things:
266      # - input: either 'with' target register or catch varname constant (base_reg + 0), depending on flags
267      # - output: when caught, catch value (base_reg + 0) and type (base_reg + 1)
268      - BC_R
269    flags:
270      - mask: 0x40
271        name: have_catch
272      - mask: 0x80
273        name: have_finally
274      - mask: 0x100
275        name: catch_binding
276      - mask: 0x200
277        name: with_binding
278  - name: EXTRA
279    extra: true
280  - name: PREINCR
281    args:
282      - A_R
283      - BC_R
284  - name: PREDECR
285    args:
286      - A_R
287      - BC_R
288  - name: POSTINCR
289    args:
290      - A_R
291      - BC_R
292  - name: POSTDECR
293    args:
294      - A_R
295      - BC_R
296  - name: PREINCV
297    args:
298      - A_R
299      - BC_C
300  - name: PREDECV
301    args:
302      - A_R
303      - BC_C
304  - name: POSTINCV
305    args:
306      - A_R
307      - BC_C
308  - name: POSTDECV
309    args:
310      - A_R
311      - BC_C
312  - name: PREINCP
313    args:
314      - A_R
315      - B_RC
316      - C_RC
317  - name: PREDECP
318    args:
319      - A_R
320      - B_RC
321      - C_RC
322  - name: POSTINCP
323    args:
324      - A_R
325      - B_RC
326      - C_RC
327  - name: POSTDECP
328    args:
329      - A_R
330      - B_RC
331      - C_RC
332
333extra:
334  - name: NOP
335  - name: INVALID
336    args:
337      - BC_I
338  - name: LDTHIS
339    args:
340      - BC_R
341  - name: LDUNDEF
342    args:
343      - BC_R
344  - name: LDNULL
345    args:
346      - BC_R
347  - name: LDTRUE
348    args:
349      - BC_R
350  - name: LDFALSE
351    args:
352      - BC_R
353  - name: NEWOBJ
354    args:
355      # XXX: extend to BC?
356      - B_R
357  - name: NEWARR
358    args:
359      # XXX: extend to BC?
360      - B_R
361  - name: SETALEN
362    args:
363      - B_R
364      - C_R
365  - name: TYPEOF
366    args:
367      - BC_R
368  - name: TYPEOFID
369    args:
370      - B_R
371      # maybe changed to C_C later
372      - C_RC
373  - name: INITENUM
374    args:
375      - B_R
376      - C_R
377  - name: NEXTENUM
378    args:
379      - B_R
380      - C_R
381  - name: INITSET
382    args:
383      - B_R
384      - C_R
385  - name: INITSETI
386    args:
387      - B_R
388      - C_RI
389  - name: INITGET
390    args:
391      - B_R
392      - C_RI
393  - name: INITGETI
394    args:
395      - B_R
396      - C_RI
397  - name: ENDTRY
398  - name: ENDCATCH
399  - name: ENDFIN
400  - name: THROW
401    args:
402      - BC_R
403  - name: INVLHS
404  - name: UNM
405    args:
406      - BC_R
407  - name: UNP
408    args:
409      - BC_R
410  - name: DEBUGGER
411  - name: BREAK
412    args:
413      - BC_I
414  - name: CONTINUE
415    args:
416      - BC_I
417  - name: BNOT
418    args:
419      - BC_R
420  - name: LNOT
421    args:
422      - BC_R
423  - name: INSTOF
424    args:
425      - B_R
426      - C_RC
427  - name: IN
428    args:
429      - B_R
430      - C_RC
431  - name: LABEL
432    args:
433      - BC_I
434  - name: ENDLABEL
435    args:
436      - BC_I
437  - name: EXTRA34
438  - name: EXTRA35
439  - name: EXTRA36
440  - name: EXTRA37
441  - name: EXTRA38
442  - name: EXTRA39
443  - name: EXTRA40
444  - name: EXTRA41
445  - name: EXTRA42
446  - name: EXTRA43
447  - name: EXTRA44
448  - name: EXTRA45
449  - name: EXTRA46
450  - name: EXTRA47
451  - name: EXTRA48
452  - name: EXTRA49
453  - name: EXTRA50
454  - name: EXTRA51
455  - name: EXTRA52
456  - name: EXTRA53
457  - name: EXTRA54
458  - name: EXTRA55
459  - name: EXTRA56
460  - name: EXTRA57
461  - name: EXTRA58
462  - name: EXTRA59
463  - name: EXTRA60
464  - name: EXTRA61
465  - name: EXTRA62
466  - name: EXTRA63
467  - name: EXTRA64
468  - name: EXTRA65
469  - name: EXTRA66
470  - name: EXTRA67
471  - name: EXTRA68
472  - name: EXTRA69
473  - name: EXTRA70
474  - name: EXTRA71
475  - name: EXTRA72
476  - name: EXTRA73
477  - name: EXTRA74
478  - name: EXTRA75
479  - name: EXTRA76
480  - name: EXTRA77
481  - name: EXTRA78
482  - name: EXTRA79
483  - name: EXTRA80
484  - name: EXTRA81
485  - name: EXTRA82
486  - name: EXTRA83
487  - name: EXTRA84
488  - name: EXTRA85
489  - name: EXTRA86
490  - name: EXTRA87
491  - name: EXTRA88
492  - name: EXTRA89
493  - name: EXTRA90
494  - name: EXTRA91
495  - name: EXTRA92
496  - name: EXTRA93
497  - name: EXTRA94
498  - name: EXTRA95
499  - name: EXTRA96
500  - name: EXTRA97
501  - name: EXTRA98
502  - name: EXTRA99
503  - name: EXTRA100
504  - name: EXTRA101
505  - name: EXTRA102
506  - name: EXTRA103
507  - name: EXTRA104
508  - name: EXTRA105
509  - name: EXTRA106
510  - name: EXTRA107
511  - name: EXTRA108
512  - name: EXTRA109
513  - name: EXTRA110
514  - name: EXTRA111
515  - name: EXTRA112
516  - name: EXTRA113
517  - name: EXTRA114
518  - name: EXTRA115
519  - name: EXTRA116
520  - name: EXTRA117
521  - name: EXTRA118
522  - name: EXTRA119
523  - name: EXTRA120
524  - name: EXTRA121
525  - name: EXTRA122
526  - name: EXTRA123
527  - name: EXTRA124
528  - name: EXTRA125
529  - name: EXTRA126
530  - name: EXTRA127
531  - name: EXTRA128
532  - name: EXTRA129
533  - name: EXTRA130
534  - name: EXTRA131
535  - name: EXTRA132
536  - name: EXTRA133
537  - name: EXTRA134
538  - name: EXTRA135
539  - name: EXTRA136
540  - name: EXTRA137
541  - name: EXTRA138
542  - name: EXTRA139
543  - name: EXTRA140
544  - name: EXTRA141
545  - name: EXTRA142
546  - name: EXTRA143
547  - name: EXTRA144
548  - name: EXTRA145
549  - name: EXTRA146
550  - name: EXTRA147
551  - name: EXTRA148
552  - name: EXTRA149
553  - name: EXTRA150
554  - name: EXTRA151
555  - name: EXTRA152
556  - name: EXTRA153
557  - name: EXTRA154
558  - name: EXTRA155
559  - name: EXTRA156
560  - name: EXTRA157
561  - name: EXTRA158
562  - name: EXTRA159
563  - name: EXTRA160
564  - name: EXTRA161
565  - name: EXTRA162
566  - name: EXTRA163
567  - name: EXTRA164
568  - name: EXTRA165
569  - name: EXTRA166
570  - name: EXTRA167
571  - name: EXTRA168
572  - name: EXTRA169
573  - name: EXTRA170
574  - name: EXTRA171
575  - name: EXTRA172
576  - name: EXTRA173
577  - name: EXTRA174
578  - name: EXTRA175
579  - name: EXTRA176
580  - name: EXTRA177
581  - name: EXTRA178
582  - name: EXTRA179
583  - name: EXTRA180
584  - name: EXTRA181
585  - name: EXTRA182
586  - name: EXTRA183
587  - name: EXTRA184
588  - name: EXTRA185
589  - name: EXTRA186
590  - name: EXTRA187
591  - name: EXTRA188
592  - name: EXTRA189
593  - name: EXTRA190
594  - name: EXTRA191
595  - name: EXTRA192
596  - name: EXTRA193
597  - name: EXTRA194
598  - name: EXTRA195
599  - name: EXTRA196
600  - name: EXTRA197
601  - name: EXTRA198
602  - name: EXTRA199
603  - name: EXTRA200
604  - name: EXTRA201
605  - name: EXTRA202
606  - name: EXTRA203
607  - name: EXTRA204
608  - name: EXTRA205
609  - name: EXTRA206
610  - name: EXTRA207
611  - name: EXTRA208
612  - name: EXTRA209
613  - name: EXTRA210
614  - name: EXTRA211
615  - name: EXTRA212
616  - name: EXTRA213
617  - name: EXTRA214
618  - name: EXTRA215
619  - name: EXTRA216
620  - name: EXTRA217
621  - name: EXTRA218
622  - name: EXTRA219
623  - name: EXTRA220
624  - name: EXTRA221
625  - name: EXTRA222
626  - name: EXTRA223
627  - name: EXTRA224
628  - name: EXTRA225
629  - name: EXTRA226
630  - name: EXTRA227
631  - name: EXTRA228
632  - name: EXTRA229
633  - name: EXTRA230
634  - name: EXTRA231
635  - name: EXTRA232
636  - name: EXTRA233
637  - name: EXTRA234
638  - name: EXTRA235
639  - name: EXTRA236
640  - name: EXTRA237
641  - name: EXTRA238
642  - name: EXTRA239
643  - name: EXTRA240
644  - name: EXTRA241
645  - name: EXTRA242
646  - name: EXTRA243
647  - name: EXTRA244
648  - name: EXTRA245
649  - name: EXTRA246
650  - name: EXTRA247
651  - name: EXTRA248
652  - name: EXTRA249
653  - name: EXTRA250
654  - name: EXTRA251
655  - name: EXTRA252
656  - name: EXTRA253
657  - name: EXTRA254
658  - name: EXTRA255
659