This file is indexed.

/usr/include/KF5/kjs/opcodes.h is in libkf5kjs-dev 5.28.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
// WARNING: Portions of this file are autogenerated from codes.def and /build/kjs-V74ZGI/kjs-5.28.0/src/kjs/bytecode/opcodes.h.in.
// (which is what the licensing terms apply to)
// Any changes you make here may be lost!
#line 1 "/build/kjs-V74ZGI/kjs-5.28.0/src/kjs/bytecode/opcodes.h.in"
/*
 *  Opcode data structure and selection routines for KJS/Frostbyte
 *  This file is part of the KDE libraries
 *  Copyright (C) 2008 Maksim Orlovich (maksim@kde.org)
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#include <wtf/Assertions.h>
    // be nice to our fruity overlords and their silly assert-unfriendly environment

#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
#include "value.h"
#include "identifier.h"
#include "ExecState.h"

#ifndef OPCODES_H
#define OPCODES_H

namespace KJS {

typedef unsigned Register;
class CompileState;

enum OpType {
    OpType_bool,
    OpType_int32,
    OpType_value,
    OpType_number,
    OpType_ident,
    OpType_addr,
    OpType_reg,
    OpType_string,
    OpType_node,
    OpType_cstr,
    OpType_void,
    OpType_NumValues
};
extern const char* const OpTypeVals[];

enum ConvOp {
    Conv_NoConversion,
    Conv_NoOp,
    Conv_I_R_Int32_Value,
    Conv_I_R_Number_Value,
    Conv_IBool_Int32,
    Conv_RBool_Int32,
    Conv_IBool_Value,
    Conv_RBool_Value,
    Conv_IBool_Number,
    Conv_RBool_Number,
    Conv_IValue_Bool,
    Conv_RValue_Bool,
    Conv_IValue_Int32,
    Conv_RValue_Int32,
    Conv_IValue_Number,
    Conv_RValue_Number,
    Conv_IInt32_Bool,
    Conv_RInt32_Bool,
    Conv_IInt32_Value,
    Conv_RInt32_Value,
    Conv_IInt32_Number,
    Conv_RInt32_Number,
    Conv_INumber_Bool,
    Conv_RNumber_Bool,
    Conv_INumber_Value,
    Conv_RNumber_Value,
    Conv_INumber_Int32,
    Conv_RNumber_Int32,
    Conv_NumValues
};
extern const char* const ConvOpVals[];

ALWAYS_INLINE int32_t convertIBool_Int32(ExecState* exec, bool in)
{
    (void)exec;
#line 79 "codes.def"
    return in ? 1 : 0;
}

ALWAYS_INLINE JSValue* convertIBool_Value(ExecState* exec, bool in)
{
    (void)exec;
#line 88 "codes.def"
    return jsBoolean(in);
}

ALWAYS_INLINE double convertIBool_Number(ExecState* exec, bool in)
{
    (void)exec;
#line 97 "codes.def"
    return in ? 1.0 : 0.0;
}

ALWAYS_INLINE bool convertIValue_Bool(ExecState* exec, JSValue* in)
{
    (void)exec;
#line 109 "codes.def"
    return in->toBoolean(exec);
}

ALWAYS_INLINE int32_t convertIValue_Int32(ExecState* exec, JSValue* in)
{
    (void)exec;
#line 118 "codes.def"
    return in->toInt32(exec);
}

ALWAYS_INLINE double convertIValue_Number(ExecState* exec, JSValue* in)
{
    (void)exec;
#line 127 "codes.def"
    return in->toNumber(exec);
}

ALWAYS_INLINE bool convertIInt32_Bool(ExecState* exec, int32_t in)
{
    (void)exec;
#line 139 "codes.def"
    return in ? true : false; // Expect stupid MSVC 0/1 warning
}

ALWAYS_INLINE JSValue* convertIInt32_Value(ExecState* exec, int32_t in)
{
    (void)exec;
#line 148 "codes.def"
    return jsNumber(in);
}

ALWAYS_INLINE double convertIInt32_Number(ExecState* exec, int32_t in)
{
    (void)exec;
#line 157 "codes.def"
    return in;
}

ALWAYS_INLINE bool convertINumber_Bool(ExecState* exec, double in)
{
    (void)exec;
#line 169 "codes.def"
    return in < 0.0 || in > 0.0; // false for NaN
}

ALWAYS_INLINE JSValue* convertINumber_Value(ExecState* exec, double in)
{
    (void)exec;
#line 178 "codes.def"
    return jsNumber(in);
}

ALWAYS_INLINE int32_t convertINumber_Int32(ExecState* exec, double in)
{
    (void)exec;
#line 187 "codes.def"
    return JSValue::toInt32(in);
}

enum OpName {
    Op_RBool_Int32,
    Op_RBool_Value,
    Op_RBool_Number,
    Op_RValue_Bool,
    Op_RValue_Int32,
    Op_RValue_Number,
    Op_RInt32_Bool,
    Op_RInt32_Value,
    Op_RInt32_Number,
    Op_RNumber_Bool,
    Op_RNumber_Value,
    Op_RNumber_Int32,
    Op_RInt32_Value_NonImm,
    Op_RNum_Value_NonImm,
    Op_PrintInfo,
    Op_AtStatement,
    Op_Exit,
    Op_Jump,
    Op_IfJump,
    Op_IfNotJump,
    Op_BeginForIn,
    Op_NextForInEntry,
    Op_PushScope,
    Op_UnwindStacks,
    Op_PopScope,
    Op_PopExceptionHandler,
    Op_PushExceptionHandler,
    Op_EnterCatch,
    Op_ExitCatch,
    Op_DeferCompletion,
    Op_ReactivateCompletion,
    Op_ReactivateCompletionDebug,
    Op_Throw,
    Op_ContBreakInTryFinally,
    Op_ReturnInTryFinally,
    Op_PropagateException,
    Op_Return,
    Op_RaiseError,
    Op_Preamble,
    Op_EnterDebugContext,
    Op_ExitDebugContext,
    Op_FunctionLookupAndGet,
    Op_NonLocalFunctionLookupAndGet,
    Op_ScopeLookupAndGetChecked,
    Op_ScopeLookupAndGet,
    Op_NonLocalScopeLookupAndGetChecked,
    Op_NonLocalScopeLookupAndGet,
    Op_ScopeLookup,
    Op_NonLocalScopeLookup,
    Op_VarGet,
    Op_NonLocalVarGet,
    Op_RegPutValue,
    Op_RegPutNumber,
    Op_RegPutBool,
    Op_RegPutInt32,
    Op_ToObject,
    Op_SymPutKnownObject,
    Op_SymGet,
    Op_SymGetKnownObject,
    Op_SymGetAndBind,
    Op_BracketGet,
    Op_BracketGetAndBind,
    Op_BracketPutKnownObject,
    Op_GlobalObjectGet,
    Op_SymDeleteKnownObject,
    Op_SymDelete,
    Op_BracketDelete,
    Op_OwnedString,
    Op_NewEmptyArray,
    Op_NewObject,
    Op_NewRegExp,
    Op_DefineGetter,
    Op_DefineSetter,
    Op_Add1,
    Op_Sub1,
    Op_Neg,
    Op_Mult,
    Op_Div,
    Op_Mod,
    Op_Sub,
    Op_Add,
    Op_LShift,
    Op_RShift,
    Op_URShift,
    Op_Less,
    Op_GreaterEq,
    Op_Greater,
    Op_LessEq,
    Op_EqEq,
    Op_NotEq,
    Op_StrEq,
    Op_StrNEq,
    Op_BitNot,
    Op_BitAnd,
    Op_BitXOr,
    Op_BitOr,
    Op_LogicalNot,
    Op_TypeOf,
    Op_In,
    Op_InstanceOf,
    Op_ClearArgs,
    Op_AddArg,
    Op_Add2Arg,
    Op_Add3Arg,
    Op_FunctionCall,
    Op_CtorCall,
    Op_EvalFuncExpr,
    Op_NumValues
};
extern const char* const OpNameVals[];

enum OpByteCode {
    OpByteCode_RBool_Int32_Ireg_Ibool,
    OpByteCode_RBool_Int32_Ireg_Rbool,
    OpByteCode_RBool_Value_Ireg_Ibool,
    OpByteCode_RBool_Value_Ireg_Rbool,
    OpByteCode_RBool_Number_Ireg_Ibool,
    OpByteCode_RBool_Number_Ireg_Rbool,
    OpByteCode_RValue_Bool_Ireg_Ivalue_Pad,
    OpByteCode_RValue_Bool_Ireg_Ivalue,
    OpByteCode_RValue_Bool_Ireg_Rvalue,
    OpByteCode_RValue_Int32_Ireg_Ivalue_Pad,
    OpByteCode_RValue_Int32_Ireg_Ivalue,
    OpByteCode_RValue_Int32_Ireg_Rvalue,
    OpByteCode_RValue_Number_Ireg_Ivalue_Pad,
    OpByteCode_RValue_Number_Ireg_Ivalue,
    OpByteCode_RValue_Number_Ireg_Rvalue,
    OpByteCode_RInt32_Bool_Ireg_Iint32,
    OpByteCode_RInt32_Bool_Ireg_Rint32,
    OpByteCode_RInt32_Value_Ireg_Iint32,
    OpByteCode_RInt32_Value_Ireg_Rint32,
    OpByteCode_RInt32_Number_Ireg_Iint32,
    OpByteCode_RInt32_Number_Ireg_Rint32,
    OpByteCode_RNumber_Bool_Ireg_Inumber_Pad,
    OpByteCode_RNumber_Bool_Ireg_Inumber,
    OpByteCode_RNumber_Bool_Ireg_Rnumber,
    OpByteCode_RNumber_Value_Ireg_Inumber_Pad,
    OpByteCode_RNumber_Value_Ireg_Inumber,
    OpByteCode_RNumber_Value_Ireg_Rnumber,
    OpByteCode_RNumber_Int32_Ireg_Inumber_Pad,
    OpByteCode_RNumber_Int32_Ireg_Inumber,
    OpByteCode_RNumber_Int32_Ireg_Rnumber,
    OpByteCode_RInt32_Value_NonImm_Ireg_Iint32,
    OpByteCode_RInt32_Value_NonImm_Ireg_Rint32,
    OpByteCode_RNum_Value_NonImm_Ireg_Inumber_Pad,
    OpByteCode_RNum_Value_NonImm_Ireg_Inumber,
    OpByteCode_RNum_Value_NonImm_Ireg_Rnumber,
    OpByteCode_PrintInfo_Ivalue_Pad,
    OpByteCode_PrintInfo_Ivalue,
    OpByteCode_PrintInfo_Rvalue,
    OpByteCode_AtStatement_Inode_Pad,
    OpByteCode_AtStatement_Inode,
    OpByteCode_Exit,
    OpByteCode_Jump_Iaddr,
    OpByteCode_IfJump_Ibool_Iaddr,
    OpByteCode_IfJump_Rbool_Iaddr,
    OpByteCode_IfJump_Rvalue_Iaddr,
    OpByteCode_IfNotJump_Ibool_Iaddr,
    OpByteCode_IfNotJump_Rbool_Iaddr,
    OpByteCode_IfNotJump_Rvalue_Iaddr,
    OpByteCode_BeginForIn_Ireg_Ivalue_Ireg_Pad,
    OpByteCode_BeginForIn_Ireg_Ivalue_Ireg,
    OpByteCode_BeginForIn_Ireg_Rvalue_Ireg,
    OpByteCode_NextForInEntry_Ireg_Rvalue_Rvalue_Iaddr,
    OpByteCode_PushScope_Ivalue_Pad,
    OpByteCode_PushScope_Ivalue,
    OpByteCode_PushScope_Rvalue,
    OpByteCode_UnwindStacks_Iint32,
    OpByteCode_UnwindStacks_Rint32,
    OpByteCode_PopScope,
    OpByteCode_PopExceptionHandler,
    OpByteCode_PushExceptionHandler_Iaddr,
    OpByteCode_EnterCatch_Iident_Pad,
    OpByteCode_EnterCatch_Iident,
    OpByteCode_ExitCatch,
    OpByteCode_DeferCompletion,
    OpByteCode_ReactivateCompletion_Ibool,
    OpByteCode_ReactivateCompletion_Rbool,
    OpByteCode_ReactivateCompletionDebug_Ibool_Inode_Pad,
    OpByteCode_ReactivateCompletionDebug_Ibool_Inode,
    OpByteCode_ReactivateCompletionDebug_Rbool_Inode_Pad,
    OpByteCode_ReactivateCompletionDebug_Rbool_Inode,
    OpByteCode_Throw_Ivalue_Pad,
    OpByteCode_Throw_Ivalue,
    OpByteCode_Throw_Rvalue,
    OpByteCode_ContBreakInTryFinally_Iaddr,
    OpByteCode_ReturnInTryFinally_Ivalue_Pad,
    OpByteCode_ReturnInTryFinally_Ivalue,
    OpByteCode_ReturnInTryFinally_Rvalue,
    OpByteCode_PropagateException,
    OpByteCode_Return_Ivalue_Pad,
    OpByteCode_Return_Ivalue,
    OpByteCode_Return_Rvalue,
    OpByteCode_RaiseError_Inode_Iint32_Icstr_Pad,
    OpByteCode_RaiseError_Inode_Iint32_Icstr,
    OpByteCode_RaiseError_Inode_Rint32_Icstr_Pad,
    OpByteCode_RaiseError_Inode_Rint32_Icstr,
    OpByteCode_Preamble_Ireg_Ireg_Ireg,
    OpByteCode_EnterDebugContext_Inode_Pad,
    OpByteCode_EnterDebugContext_Inode,
    OpByteCode_ExitDebugContext_Inode_Pad,
    OpByteCode_ExitDebugContext_Inode,
    OpByteCode_FunctionLookupAndGet_Ireg_Ireg_Iident_Pad,
    OpByteCode_FunctionLookupAndGet_Ireg_Ireg_Iident,
    OpByteCode_NonLocalFunctionLookupAndGet_Ireg_Ireg_Iident_Pad,
    OpByteCode_NonLocalFunctionLookupAndGet_Ireg_Ireg_Iident,
    OpByteCode_ScopeLookupAndGetChecked_Ireg_Ireg_Iident_Pad,
    OpByteCode_ScopeLookupAndGetChecked_Ireg_Ireg_Iident,
    OpByteCode_ScopeLookupAndGet_Ireg_Ireg_Iident_Pad,
    OpByteCode_ScopeLookupAndGet_Ireg_Ireg_Iident,
    OpByteCode_NonLocalScopeLookupAndGetChecked_Ireg_Ireg_Iident_Pad,
    OpByteCode_NonLocalScopeLookupAndGetChecked_Ireg_Ireg_Iident,
    OpByteCode_NonLocalScopeLookupAndGet_Ireg_Ireg_Iident_Pad,
    OpByteCode_NonLocalScopeLookupAndGet_Ireg_Ireg_Iident,
    OpByteCode_ScopeLookup_Ireg_Iident_Inode_Pad,
    OpByteCode_ScopeLookup_Ireg_Iident_Inode,
    OpByteCode_NonLocalScopeLookup_Ireg_Iident_Inode_Pad,
    OpByteCode_NonLocalScopeLookup_Ireg_Iident_Inode,
    OpByteCode_VarGet_Ireg_Iident_Pad,
    OpByteCode_VarGet_Ireg_Iident,
    OpByteCode_NonLocalVarGet_Ireg_Iident_Pad,
    OpByteCode_NonLocalVarGet_Ireg_Iident,
    OpByteCode_RegPutValue_Ireg_Ivalue_Pad,
    OpByteCode_RegPutValue_Ireg_Ivalue,
    OpByteCode_RegPutValue_Ireg_Rvalue,
    OpByteCode_RegPutValue_Ireg_Rnumber,
    OpByteCode_RegPutNumber_Ireg_Inumber_Pad,
    OpByteCode_RegPutNumber_Ireg_Inumber,
    OpByteCode_RegPutNumber_Ireg_Rnumber,
    OpByteCode_RegPutBool_Ireg_Ibool,
    OpByteCode_RegPutBool_Ireg_Rbool,
    OpByteCode_RegPutInt32_Ireg_Iint32,
    OpByteCode_RegPutInt32_Ireg_Rint32,
    OpByteCode_ToObject_Ireg_Ivalue_Pad,
    OpByteCode_ToObject_Ireg_Ivalue,
    OpByteCode_ToObject_Ireg_Rvalue,
    OpByteCode_SymPutKnownObject_Rvalue_Iident_Ivalue_Pad,
    OpByteCode_SymPutKnownObject_Rvalue_Iident_Ivalue,
    OpByteCode_SymPutKnownObject_Rvalue_Iident_Rvalue_Pad,
    OpByteCode_SymPutKnownObject_Rvalue_Iident_Rvalue,
    OpByteCode_SymPutKnownObject_Rvalue_Iident_Rnumber_Pad,
    OpByteCode_SymPutKnownObject_Rvalue_Iident_Rnumber,
    OpByteCode_SymGet_Ireg_Ivalue_Iident_Pad,
    OpByteCode_SymGet_Ireg_Ivalue_Iident,
    OpByteCode_SymGet_Ireg_Rvalue_Iident_Pad,
    OpByteCode_SymGet_Ireg_Rvalue_Iident,
    OpByteCode_SymGetKnownObject_Ireg_Ivalue_Iident_Pad,
    OpByteCode_SymGetKnownObject_Ireg_Ivalue_Iident,
    OpByteCode_SymGetKnownObject_Ireg_Rvalue_Iident_Pad,
    OpByteCode_SymGetKnownObject_Ireg_Rvalue_Iident,
    OpByteCode_SymGetAndBind_Ireg_Ireg_Rvalue_Iident_Pad,
    OpByteCode_SymGetAndBind_Ireg_Ireg_Rvalue_Iident,
    OpByteCode_BracketGet_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_BracketGet_Ireg_Rvalue_Ivalue,
    OpByteCode_BracketGet_Ireg_Rvalue_Rvalue,
    OpByteCode_BracketGet_Ireg_Rvalue_Iint32,
    OpByteCode_BracketGet_Ireg_Rvalue_Rint32,
    OpByteCode_BracketGetAndBind_Ireg_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_BracketGetAndBind_Ireg_Ireg_Rvalue_Ivalue,
    OpByteCode_BracketGetAndBind_Ireg_Ireg_Rvalue_Rvalue,
    OpByteCode_BracketGetAndBind_Ireg_Ireg_Rvalue_Iint32,
    OpByteCode_BracketGetAndBind_Ireg_Ireg_Rvalue_Rint32,
    OpByteCode_BracketPutKnownObject_Rvalue_Ivalue_Ivalue_Pad,
    OpByteCode_BracketPutKnownObject_Rvalue_Ivalue_Ivalue,
    OpByteCode_BracketPutKnownObject_Rvalue_Ivalue_Rvalue_Pad,
    OpByteCode_BracketPutKnownObject_Rvalue_Ivalue_Rvalue,
    OpByteCode_BracketPutKnownObject_Rvalue_Rvalue_Ivalue_Pad,
    OpByteCode_BracketPutKnownObject_Rvalue_Rvalue_Ivalue,
    OpByteCode_BracketPutKnownObject_Rvalue_Rvalue_Rvalue,
    OpByteCode_BracketPutKnownObject_Rvalue_Iint32_Ivalue_Pad,
    OpByteCode_BracketPutKnownObject_Rvalue_Iint32_Ivalue,
    OpByteCode_BracketPutKnownObject_Rvalue_Iint32_Rvalue,
    OpByteCode_BracketPutKnownObject_Rvalue_Rint32_Ivalue_Pad,
    OpByteCode_BracketPutKnownObject_Rvalue_Rint32_Ivalue,
    OpByteCode_BracketPutKnownObject_Rvalue_Rint32_Rvalue,
    OpByteCode_GlobalObjectGet_Ireg_Iident_Pad,
    OpByteCode_GlobalObjectGet_Ireg_Iident,
    OpByteCode_SymDeleteKnownObject_Ireg_Ivalue_Iident_Pad,
    OpByteCode_SymDeleteKnownObject_Ireg_Ivalue_Iident,
    OpByteCode_SymDeleteKnownObject_Ireg_Rvalue_Iident_Pad,
    OpByteCode_SymDeleteKnownObject_Ireg_Rvalue_Iident,
    OpByteCode_SymDelete_Ireg_Ivalue_Iident_Pad,
    OpByteCode_SymDelete_Ireg_Ivalue_Iident,
    OpByteCode_SymDelete_Ireg_Rvalue_Iident_Pad,
    OpByteCode_SymDelete_Ireg_Rvalue_Iident,
    OpByteCode_BracketDelete_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_BracketDelete_Ireg_Rvalue_Ivalue,
    OpByteCode_BracketDelete_Ireg_Rvalue_Rvalue,
    OpByteCode_BracketDelete_Ireg_Ivalue_Iint32_Pad,
    OpByteCode_BracketDelete_Ireg_Ivalue_Iint32,
    OpByteCode_BracketDelete_Ireg_Ivalue_Rint32_Pad,
    OpByteCode_BracketDelete_Ireg_Ivalue_Rint32,
    OpByteCode_BracketDelete_Ireg_Rvalue_Iint32,
    OpByteCode_BracketDelete_Ireg_Rvalue_Rint32,
    OpByteCode_OwnedString_Ireg_Istring_Pad,
    OpByteCode_OwnedString_Ireg_Istring,
    OpByteCode_NewEmptyArray_Ireg,
    OpByteCode_NewObject_Ireg,
    OpByteCode_NewRegExp_Ireg_Istring_Istring_Pad,
    OpByteCode_NewRegExp_Ireg_Istring_Istring,
    OpByteCode_DefineGetter_Rvalue_Iident_Ivalue_Pad,
    OpByteCode_DefineGetter_Rvalue_Iident_Ivalue,
    OpByteCode_DefineGetter_Rvalue_Iident_Rvalue_Pad,
    OpByteCode_DefineGetter_Rvalue_Iident_Rvalue,
    OpByteCode_DefineSetter_Rvalue_Iident_Ivalue_Pad,
    OpByteCode_DefineSetter_Rvalue_Iident_Ivalue,
    OpByteCode_DefineSetter_Rvalue_Iident_Rvalue_Pad,
    OpByteCode_DefineSetter_Rvalue_Iident_Rvalue,
    OpByteCode_Add1_Ireg_Inumber_Pad,
    OpByteCode_Add1_Ireg_Inumber,
    OpByteCode_Add1_Ireg_Rnumber,
    OpByteCode_Add1_Ireg_Rvalue,
    OpByteCode_Sub1_Ireg_Inumber_Pad,
    OpByteCode_Sub1_Ireg_Inumber,
    OpByteCode_Sub1_Ireg_Rnumber,
    OpByteCode_Neg_Ireg_Inumber_Pad,
    OpByteCode_Neg_Ireg_Inumber,
    OpByteCode_Neg_Ireg_Rnumber,
    OpByteCode_Neg_Ireg_Rvalue,
    OpByteCode_Mult_Ireg_Inumber_Inumber_Pad,
    OpByteCode_Mult_Ireg_Inumber_Inumber,
    OpByteCode_Mult_Ireg_Inumber_Rnumber_Pad,
    OpByteCode_Mult_Ireg_Inumber_Rnumber,
    OpByteCode_Mult_Ireg_Rnumber_Inumber_Pad,
    OpByteCode_Mult_Ireg_Rnumber_Inumber,
    OpByteCode_Mult_Ireg_Rnumber_Rnumber,
    OpByteCode_Mult_Ireg_Rvalue_Rvalue,
    OpByteCode_Mult_Ireg_Rvalue_Rnumber,
    OpByteCode_Mult_Ireg_Rnumber_Rvalue,
    OpByteCode_Div_Ireg_Inumber_Inumber_Pad,
    OpByteCode_Div_Ireg_Inumber_Inumber,
    OpByteCode_Div_Ireg_Inumber_Rnumber_Pad,
    OpByteCode_Div_Ireg_Inumber_Rnumber,
    OpByteCode_Div_Ireg_Rnumber_Inumber_Pad,
    OpByteCode_Div_Ireg_Rnumber_Inumber,
    OpByteCode_Div_Ireg_Rnumber_Rnumber,
    OpByteCode_Mod_Ireg_Inumber_Inumber_Pad,
    OpByteCode_Mod_Ireg_Inumber_Inumber,
    OpByteCode_Mod_Ireg_Inumber_Rnumber_Pad,
    OpByteCode_Mod_Ireg_Inumber_Rnumber,
    OpByteCode_Mod_Ireg_Rnumber_Inumber_Pad,
    OpByteCode_Mod_Ireg_Rnumber_Inumber,
    OpByteCode_Mod_Ireg_Rnumber_Rnumber,
    OpByteCode_Sub_Ireg_Inumber_Inumber_Pad,
    OpByteCode_Sub_Ireg_Inumber_Inumber,
    OpByteCode_Sub_Ireg_Inumber_Rnumber_Pad,
    OpByteCode_Sub_Ireg_Inumber_Rnumber,
    OpByteCode_Sub_Ireg_Rnumber_Inumber_Pad,
    OpByteCode_Sub_Ireg_Rnumber_Inumber,
    OpByteCode_Sub_Ireg_Rnumber_Rnumber,
    OpByteCode_Add_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_Add_Ireg_Ivalue_Ivalue,
    OpByteCode_Add_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_Add_Ireg_Ivalue_Rvalue,
    OpByteCode_Add_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_Add_Ireg_Rvalue_Ivalue,
    OpByteCode_Add_Ireg_Rvalue_Rvalue,
    OpByteCode_Add_Ireg_Inumber_Inumber_Pad,
    OpByteCode_Add_Ireg_Inumber_Inumber,
    OpByteCode_Add_Ireg_Inumber_Rnumber_Pad,
    OpByteCode_Add_Ireg_Inumber_Rnumber,
    OpByteCode_Add_Ireg_Rnumber_Inumber_Pad,
    OpByteCode_Add_Ireg_Rnumber_Inumber,
    OpByteCode_Add_Ireg_Rnumber_Rnumber,
    OpByteCode_LShift_Ireg_Iint32_Iint32,
    OpByteCode_LShift_Ireg_Iint32_Rint32,
    OpByteCode_LShift_Ireg_Rint32_Iint32,
    OpByteCode_LShift_Ireg_Rint32_Rint32,
    OpByteCode_RShift_Ireg_Iint32_Iint32,
    OpByteCode_RShift_Ireg_Iint32_Rint32,
    OpByteCode_RShift_Ireg_Rint32_Iint32,
    OpByteCode_RShift_Ireg_Rint32_Rint32,
    OpByteCode_URShift_Ireg_Iint32_Iint32,
    OpByteCode_URShift_Ireg_Iint32_Rint32,
    OpByteCode_URShift_Ireg_Rint32_Iint32,
    OpByteCode_URShift_Ireg_Rint32_Rint32,
    OpByteCode_Less_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_Less_Ireg_Ivalue_Ivalue,
    OpByteCode_Less_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_Less_Ireg_Ivalue_Rvalue,
    OpByteCode_Less_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_Less_Ireg_Rvalue_Ivalue,
    OpByteCode_Less_Ireg_Rvalue_Rvalue,
    OpByteCode_Less_Ireg_Ivalue_Inumber_Pad,
    OpByteCode_Less_Ireg_Ivalue_Inumber,
    OpByteCode_Less_Ireg_Ivalue_Rnumber_Pad,
    OpByteCode_Less_Ireg_Ivalue_Rnumber,
    OpByteCode_Less_Ireg_Rvalue_Inumber_Pad,
    OpByteCode_Less_Ireg_Rvalue_Inumber,
    OpByteCode_Less_Ireg_Rvalue_Rnumber,
    OpByteCode_Less_Ireg_Ivalue_Iint32_Pad,
    OpByteCode_Less_Ireg_Ivalue_Iint32,
    OpByteCode_Less_Ireg_Ivalue_Rint32_Pad,
    OpByteCode_Less_Ireg_Ivalue_Rint32,
    OpByteCode_Less_Ireg_Rvalue_Iint32,
    OpByteCode_Less_Ireg_Rvalue_Rint32,
    OpByteCode_GreaterEq_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_GreaterEq_Ireg_Ivalue_Ivalue,
    OpByteCode_GreaterEq_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_GreaterEq_Ireg_Ivalue_Rvalue,
    OpByteCode_GreaterEq_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_GreaterEq_Ireg_Rvalue_Ivalue,
    OpByteCode_GreaterEq_Ireg_Rvalue_Rvalue,
    OpByteCode_Greater_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_Greater_Ireg_Ivalue_Ivalue,
    OpByteCode_Greater_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_Greater_Ireg_Ivalue_Rvalue,
    OpByteCode_Greater_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_Greater_Ireg_Rvalue_Ivalue,
    OpByteCode_Greater_Ireg_Rvalue_Rvalue,
    OpByteCode_LessEq_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_LessEq_Ireg_Ivalue_Ivalue,
    OpByteCode_LessEq_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_LessEq_Ireg_Ivalue_Rvalue,
    OpByteCode_LessEq_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_LessEq_Ireg_Rvalue_Ivalue,
    OpByteCode_LessEq_Ireg_Rvalue_Rvalue,
    OpByteCode_EqEq_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_EqEq_Ireg_Ivalue_Ivalue,
    OpByteCode_EqEq_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_EqEq_Ireg_Ivalue_Rvalue,
    OpByteCode_EqEq_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_EqEq_Ireg_Rvalue_Ivalue,
    OpByteCode_EqEq_Ireg_Rvalue_Rvalue,
    OpByteCode_EqEq_Ireg_Ivalue_Iint32_Pad,
    OpByteCode_EqEq_Ireg_Ivalue_Iint32,
    OpByteCode_EqEq_Ireg_Ivalue_Rint32_Pad,
    OpByteCode_EqEq_Ireg_Ivalue_Rint32,
    OpByteCode_EqEq_Ireg_Rvalue_Iint32,
    OpByteCode_EqEq_Ireg_Rvalue_Rint32,
    OpByteCode_NotEq_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_NotEq_Ireg_Ivalue_Ivalue,
    OpByteCode_NotEq_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_NotEq_Ireg_Ivalue_Rvalue,
    OpByteCode_NotEq_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_NotEq_Ireg_Rvalue_Ivalue,
    OpByteCode_NotEq_Ireg_Rvalue_Rvalue,
    OpByteCode_NotEq_Ireg_Ivalue_Iint32_Pad,
    OpByteCode_NotEq_Ireg_Ivalue_Iint32,
    OpByteCode_NotEq_Ireg_Ivalue_Rint32_Pad,
    OpByteCode_NotEq_Ireg_Ivalue_Rint32,
    OpByteCode_NotEq_Ireg_Rvalue_Iint32,
    OpByteCode_NotEq_Ireg_Rvalue_Rint32,
    OpByteCode_StrEq_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_StrEq_Ireg_Ivalue_Ivalue,
    OpByteCode_StrEq_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_StrEq_Ireg_Ivalue_Rvalue,
    OpByteCode_StrEq_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_StrEq_Ireg_Rvalue_Ivalue,
    OpByteCode_StrEq_Ireg_Rvalue_Rvalue,
    OpByteCode_StrNEq_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_StrNEq_Ireg_Ivalue_Ivalue,
    OpByteCode_StrNEq_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_StrNEq_Ireg_Ivalue_Rvalue,
    OpByteCode_StrNEq_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_StrNEq_Ireg_Rvalue_Ivalue,
    OpByteCode_StrNEq_Ireg_Rvalue_Rvalue,
    OpByteCode_BitNot_Ireg_Iint32,
    OpByteCode_BitNot_Ireg_Rint32,
    OpByteCode_BitAnd_Ireg_Iint32_Iint32,
    OpByteCode_BitAnd_Ireg_Iint32_Rint32,
    OpByteCode_BitAnd_Ireg_Rint32_Iint32,
    OpByteCode_BitAnd_Ireg_Rint32_Rint32,
    OpByteCode_BitAnd_Ireg_Rvalue_Rvalue,
    OpByteCode_BitAnd_Ireg_Rvalue_Rint32,
    OpByteCode_BitAnd_Ireg_Rint32_Rvalue,
    OpByteCode_BitXOr_Ireg_Iint32_Iint32,
    OpByteCode_BitXOr_Ireg_Iint32_Rint32,
    OpByteCode_BitXOr_Ireg_Rint32_Iint32,
    OpByteCode_BitXOr_Ireg_Rint32_Rint32,
    OpByteCode_BitOr_Ireg_Iint32_Iint32,
    OpByteCode_BitOr_Ireg_Iint32_Rint32,
    OpByteCode_BitOr_Ireg_Rint32_Iint32,
    OpByteCode_BitOr_Ireg_Rint32_Rint32,
    OpByteCode_LogicalNot_Ireg_Ibool,
    OpByteCode_LogicalNot_Ireg_Rbool,
    OpByteCode_TypeOf_Ireg_Ivalue_Pad,
    OpByteCode_TypeOf_Ireg_Ivalue,
    OpByteCode_TypeOf_Ireg_Rvalue,
    OpByteCode_In_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_In_Ireg_Ivalue_Ivalue,
    OpByteCode_In_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_In_Ireg_Ivalue_Rvalue,
    OpByteCode_In_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_In_Ireg_Rvalue_Ivalue,
    OpByteCode_In_Ireg_Rvalue_Rvalue,
    OpByteCode_InstanceOf_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_InstanceOf_Ireg_Ivalue_Ivalue,
    OpByteCode_InstanceOf_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_InstanceOf_Ireg_Ivalue_Rvalue,
    OpByteCode_InstanceOf_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_InstanceOf_Ireg_Rvalue_Ivalue,
    OpByteCode_InstanceOf_Ireg_Rvalue_Rvalue,
    OpByteCode_ClearArgs,
    OpByteCode_AddArg_Ivalue_Pad,
    OpByteCode_AddArg_Ivalue,
    OpByteCode_AddArg_Rvalue,
    OpByteCode_Add2Arg_Ivalue_Ivalue_Pad,
    OpByteCode_Add2Arg_Ivalue_Ivalue,
    OpByteCode_Add2Arg_Ivalue_Rvalue_Pad,
    OpByteCode_Add2Arg_Ivalue_Rvalue,
    OpByteCode_Add2Arg_Rvalue_Ivalue_Pad,
    OpByteCode_Add2Arg_Rvalue_Ivalue,
    OpByteCode_Add2Arg_Rvalue_Rvalue,
    OpByteCode_Add3Arg_Ivalue_Ivalue_Ivalue_Pad,
    OpByteCode_Add3Arg_Ivalue_Ivalue_Ivalue,
    OpByteCode_Add3Arg_Ivalue_Ivalue_Rvalue_Pad,
    OpByteCode_Add3Arg_Ivalue_Ivalue_Rvalue,
    OpByteCode_Add3Arg_Ivalue_Rvalue_Ivalue_Pad,
    OpByteCode_Add3Arg_Ivalue_Rvalue_Ivalue,
    OpByteCode_Add3Arg_Ivalue_Rvalue_Rvalue_Pad,
    OpByteCode_Add3Arg_Ivalue_Rvalue_Rvalue,
    OpByteCode_Add3Arg_Rvalue_Ivalue_Ivalue_Pad,
    OpByteCode_Add3Arg_Rvalue_Ivalue_Ivalue,
    OpByteCode_Add3Arg_Rvalue_Ivalue_Rvalue_Pad,
    OpByteCode_Add3Arg_Rvalue_Ivalue_Rvalue,
    OpByteCode_Add3Arg_Rvalue_Rvalue_Ivalue_Pad,
    OpByteCode_Add3Arg_Rvalue_Rvalue_Ivalue,
    OpByteCode_Add3Arg_Rvalue_Rvalue_Rvalue,
    OpByteCode_FunctionCall_Ireg_Ivalue_Ivalue_Pad,
    OpByteCode_FunctionCall_Ireg_Ivalue_Ivalue,
    OpByteCode_FunctionCall_Ireg_Ivalue_Rvalue_Pad,
    OpByteCode_FunctionCall_Ireg_Ivalue_Rvalue,
    OpByteCode_FunctionCall_Ireg_Rvalue_Ivalue_Pad,
    OpByteCode_FunctionCall_Ireg_Rvalue_Ivalue,
    OpByteCode_FunctionCall_Ireg_Rvalue_Rvalue,
    OpByteCode_CtorCall_Ireg_Ivalue_Pad,
    OpByteCode_CtorCall_Ireg_Ivalue,
    OpByteCode_CtorCall_Ireg_Rvalue,
    OpByteCode_EvalFuncExpr_Ireg_Iident_Inode_Pad,
    OpByteCode_EvalFuncExpr_Ireg_Iident_Inode,
    OpByteCode_NumValues
};
extern const char* const OpByteCodeVals[];

#line 40 "/build/kjs-V74ZGI/kjs-5.28.0/src/kjs/bytecode/opcodes.h.in"

/**
 There are 2 levels at which instructions exist. First of all, there is
 an actual operation name, represent by the OpName enum. This is something like
 Op_IfJump. For each one of these, we have multiple bytecode instructions, such as
 OpByteCode_IfJump_Ibool_Iaddr and OpByteCode_IfJump_Rbool_Iaddr, with their
 names given in the OpByteCode_ enum.

 For each of these bytecode codes, there is an entry in the opsForOpCodes
 array, which provides an Op structure, which describes which parameters
 go where, and so on. The opSpecializations array lets one look up
 all these structures relevant for each OpName, so one can select
 the specific operation for each conceptual instruction.

 Besides parameter variants, there is also variation based on padding, with
 some bytecodes skipping 4 extra bytes after the opcode to make things 8-aligned.
 Those bytecodes are always 1 below their unaligned version
*/

struct Op {
    OpName     baseInstr;
    OpByteCode opCode;
    int        cost;

    int numParams;
    OpType paramTypes[4];
    bool   immediateParams[4];
    bool   exactParams[4]; // if true, we should not perform any
                           // (non-injective) conversions for the given parameter

    OpType retType; // type of this specialization

    int length; // Length of instruction, including opcode + args

    // This contains offsets of arguments, starting from before the instruction
    int paramOffsets[4];

    // If this is true, this version of the instruction has an
    // extra word inserted after the opcode, for alignment reasons.
    bool padAlign;

    // If this is true, this version has both padded and unpadded flavors
    bool hasPadVariant;

    // If this is true, this instruction performs a jump, and hence
    // should flush per-BB info
    bool endsBB;
};

// The main array of Op instances, mapped by OpByteCode
extern const Op opsForOpCodes[];

// Lists all the specialized versions of each Op class, mapped by OpName,
// 0 terminated.
extern const Op* const* const opSpecializations[];

// Describes whether the type is align8 or not.
extern const bool opTypeIsAlign8[];

struct OpValue;

typedef Vector<unsigned char> CodeBlock;

class CodeGen {
public:
    // All of these emit the instruction of given type, and return its base.
    // If retVal isn't 0, the return value will be placed there
    static Addr emitOp(CompileState* comp, OpName baseInstr,
                       OpValue* retOut = 0, OpValue* a0 = 0, OpValue* a1 = 0,
                                            OpValue* a2 = 0, OpValue* a3 = 0);

    static void emitConvertTo(CompileState* comp, OpValue* in,
                              OpType outType, OpValue* out);

    // Emits a register store of appropriate type
    static void emitRegStore(CompileState* comp, OpValue* regNum, OpValue* val);

    static void patchOpArgument(CodeBlock& block, Addr base, int pos, OpValue& newVal);

    // Patches op at address 'op' to jump to next instr.
    static void patchJumpToNext(CompileState* comp, Addr op, int argNum);

    // This requests the address of next instruction, for use in control flow, and
    // designates a basic block boundary, flushing everything BB-dependent;
    static Addr nextPC(CompileState* comp);

    static void disassembleBlock(CodeBlock& block);

};


} //namespace KJS

#endif

// kate: indent-width 4; replace-tabs on; tab-width 4; space-indent on; hl c++;