-
Notifications
You must be signed in to change notification settings - Fork 362
Expand file tree
/
Copy pathoperations.proto
More file actions
1279 lines (982 loc) · 18.8 KB
/
operations.proto
File metadata and controls
1279 lines (982 loc) · 18.8 KB
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
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package fuzzilli.protobuf;
// Parameters used by function definitions, not an operation by itself.
message Parameters {
uint32 count = 1;
bool hasRest = 2;
}
message LoadInteger {
int64 value = 1;
}
message LoadBigInt {
int64 value = 1;
}
message LoadFloat {
double value = 1;
}
message LoadString {
string value = 1;
}
message LoadBoolean {
bool value = 1;
}
message LoadUndefined {
}
message LoadNull {
}
message LoadThis {
}
message LoadArguments {
}
message LoadDisposableVariable {
}
message LoadAsyncDisposableVariable {
}
message LoadRegExp {
string pattern = 1;
uint32 flags = 2;
}
message BeginObjectLiteral {
}
message ObjectLiteralAddProperty {
string propertyName = 1;
}
message ObjectLiteralAddElement {
int64 index = 1;
}
message ObjectLiteralAddComputedProperty {
}
message ObjectLiteralCopyProperties {
}
message ObjectLiteralSetPrototype {
}
message BeginObjectLiteralMethod {
string methodName = 1;
Parameters parameters = 2;
}
message EndObjectLiteralMethod {
}
message BeginObjectLiteralComputedMethod {
Parameters parameters = 1;
}
message EndObjectLiteralComputedMethod {
}
message BeginObjectLiteralGetter {
string propertyName = 1;
}
message EndObjectLiteralGetter {
}
message BeginObjectLiteralSetter {
string propertyName = 1;
}
message EndObjectLiteralSetter {
}
message EndObjectLiteral {
}
message BeginClassDefinition {
bool hasSuperclass = 1;
}
message BeginClassConstructor {
Parameters parameters = 1;
}
message EndClassConstructor {
}
message ClassAddInstanceProperty {
string propertyName = 1;
bool hasValue = 2;
}
message ClassAddInstanceElement {
int64 index = 1;
bool hasValue = 2;
}
message ClassAddInstanceComputedProperty {
bool hasValue = 1;
}
message BeginClassInstanceMethod {
string methodName = 1;
Parameters parameters = 2;
}
message EndClassInstanceMethod {
}
message BeginClassInstanceGetter {
string propertyName = 1;
}
message EndClassInstanceGetter {
}
message BeginClassInstanceSetter {
string propertyName = 1;
}
message EndClassInstanceSetter {
}
message ClassAddStaticProperty {
string propertyName = 1;
bool hasValue = 2;
}
message ClassAddStaticElement {
int64 index = 1;
bool hasValue = 2;
}
message ClassAddStaticComputedProperty {
bool hasValue = 1;
}
message BeginClassStaticInitializer {
}
message EndClassStaticInitializer {
}
message BeginClassStaticMethod {
string methodName = 1;
Parameters parameters = 2;
}
message EndClassStaticMethod {
}
message BeginClassStaticGetter {
string propertyName = 1;
}
message EndClassStaticGetter {
}
message BeginClassStaticSetter {
string propertyName = 1;
}
message EndClassStaticSetter {
}
message ClassAddPrivateInstanceProperty {
string propertyName = 1;
bool hasValue = 2;
}
message BeginClassPrivateInstanceMethod {
string methodName = 1;
Parameters parameters = 2;
}
message EndClassPrivateInstanceMethod {
}
message ClassAddPrivateStaticProperty {
string propertyName = 1;
bool hasValue = 2;
}
message BeginClassPrivateStaticMethod {
string methodName = 1;
Parameters parameters = 2;
}
message EndClassPrivateStaticMethod {
}
message EndClassDefinition {
}
message CreateArray {
}
message CreateIntArray {
repeated int64 values = 1;
}
message CreateFloatArray {
repeated double values = 1;
}
message CreateTemplateString {
repeated string parts = 1;
}
message CreateArrayWithSpread {
repeated bool spreads = 1;
}
message GetProperty {
string propertyName = 1;
bool isGuarded = 2;
}
message SetProperty {
string propertyName = 1;
}
message UpdateProperty {
string propertyName = 1;
BinaryOperator op = 2;
}
message DeleteProperty {
string propertyName = 1;
bool isGuarded = 2;
}
enum PropertyType {
VALUE = 0;
GETTER = 1;
SETTER = 2;
GETTERSETTER = 3;
}
message ConfigureProperty {
string propertyName = 1;
bool isWritable = 2;
bool isConfigurable = 3;
bool isEnumerable = 4;
PropertyType type = 5;
}
message GetElement {
int64 index = 1;
bool isGuarded = 2;
}
message SetElement {
int64 index = 1;
}
message UpdateElement {
int64 index = 1;
BinaryOperator op = 2;
}
message DeleteElement {
int64 index = 1;
bool isGuarded = 2;
}
message ConfigureElement {
int64 index = 1;
bool isWritable = 2;
bool isConfigurable = 3;
bool isEnumerable = 4;
PropertyType type = 5;
}
message GetComputedProperty {
bool isGuarded = 1;
}
message SetComputedProperty {
}
message UpdateComputedProperty {
BinaryOperator op = 1;
}
message DeleteComputedProperty {
bool isGuarded = 1;
}
message ConfigureComputedProperty {
bool isWritable = 1;
bool isConfigurable = 2;
bool isEnumerable = 3;
PropertyType type = 4;
}
message TypeOf {
}
message Void {
}
message TestInstanceOf {
}
message TestIn {
}
message BeginPlainFunction {
Parameters parameters = 1;
// Can be missing, in which case the name is auto-assigned.
string name = 2;
}
message EndPlainFunction {
}
message BeginArrowFunction {
Parameters parameters = 1;
}
message EndArrowFunction {
}
message BeginGeneratorFunction {
Parameters parameters = 1;
// Can be missing, in which case the name is auto-assigned.
string name = 2;
}
message EndGeneratorFunction {
}
message BeginAsyncFunction {
Parameters parameters = 1;
// Can be missing, in which case the name is auto-assigned.
string name = 2;
}
message EndAsyncFunction {
}
message BeginAsyncArrowFunction {
Parameters parameters = 1;
}
message EndAsyncArrowFunction {
}
message BeginAsyncGeneratorFunction {
Parameters parameters = 1;
// Can be missing, in which case the name is auto-assigned.
string name = 2;
}
message EndAsyncGeneratorFunction {
}
message BeginConstructor {
Parameters parameters = 1;
}
message EndConstructor {
}
message Directive {
string content = 1;
}
message Return {
}
message Yield {
}
message YieldEach {
}
message Await {
}
message CallFunction {
bool isGuarded = 1;
}
message CallFunctionWithSpread {
repeated bool spreads = 1;
bool isGuarded = 2;
}
message Construct {
bool isGuarded = 1;
}
message ConstructWithSpread {
repeated bool spreads = 1;
bool isGuarded = 2;
}
message CallMethod {
string methodName = 1;
bool isGuarded = 2;
}
message CallMethodWithSpread {
string methodName = 1;
repeated bool spreads = 2;
bool isGuarded = 3;
}
message CallComputedMethod {
bool isGuarded = 1;
}
message CallComputedMethodWithSpread {
repeated bool spreads = 1;
bool isGuarded = 2;
}
enum UnaryOperator {
PRE_INC = 0;
PRE_DEC = 1;
POST_INC = 2;
POST_DEC = 3;
LOGICAL_NOT = 4;
BITWISE_NOT = 5;
PLUS = 6;
MINUS = 7;
}
message UnaryOperation {
UnaryOperator op = 1;
}
enum BinaryOperator {
ADD = 0;
SUB = 1;
MUL = 2;
DIV = 3;
MOD = 4;
BIT_AND = 5;
BIT_OR = 6;
LOGICAL_AND = 7;
LOGICAL_OR = 8;
XOR = 9;
LSHIFT = 10;
RSHIFT = 11;
EXP = 12;
UNRSHIFT = 13;
}
enum WasmIntegerBinaryOperator {
WASMI_ADD = 0;
WASMI_SUB = 1;
WASMI_MUL = 2;
WASMI_DIV_S = 3;
WASMI_DIV_U = 4;
WASMI_REM_S = 5;
WASMI_REM_U = 6;
WASMI_AND = 7;
WASMI_OR = 8;
WASMI_XOR = 9;
WASMI_SHL = 10;
WASMI_SHR_S = 11;
WASMI_SHR_U = 12;
WASMI_ROTL = 13;
WASMI_ROTR = 14;
}
enum WasmIntegerUnaryOperator {
WASM_CLZ = 0;
WASM_CTZ = 1;
WASM_POPCNT = 2;
}
enum WasmFloatBinaryOperator {
WASMF_ADD = 0;
WASMF_SUB = 1;
WASMF_MUL = 2;
WASMF_DIV = 3;
WASMF_MIN = 4;
WASMF_MAX = 5;
WASMF_COPYSIGN = 6;
}
enum WasmFloatUnaryOperator {
ABS = 0;
NEG = 1;
CEIL = 2;
FLOOR = 3;
TRUNC = 4;
NEAREST = 5;
SQRT = 6;
}
message BinaryOperation {
BinaryOperator op = 1;
}
message TernaryOperation {
}
message Update {
BinaryOperator op = 1;
}
message Dup {
}
message Reassign {
}
message DestructArray {
repeated int32 indices = 1;
bool lastIsRest = 2;
}
message DestructArrayAndReassign {
repeated int32 indices = 1;
bool lastIsRest = 2;
}
message DestructObject {
repeated string properties = 1;
bool hasRestElement = 2;
}
message DestructObjectAndReassign {
repeated string properties = 1;
bool hasRestElement = 2;
}
enum Comparator {
EQUAL = 0;
STRICT_EQUAL = 1;
NOT_EQUAL = 2;
STRICT_NOT_EQUAL = 3;
LESS_THAN = 4;
LESS_THAN_OR_EQUAL = 5;
GREATER_THAN = 6;
GREATER_THAN_OR_EQUAL = 7;
}
message Compare {
Comparator op = 1;
}
enum NamedVariableDeclarationMode {
NONE = 0;
GLOBAL = 1;
VAR = 2;
LET = 3;
}
message CreateNamedVariable {
string variableName = 1;
NamedVariableDeclarationMode declarationMode = 2;
}
message Eval {
string code = 1;
bool hasOutput = 2;
}
message CallSuperConstructor {
repeated bool spreads = 1;
}
message CallSuperMethod {
string methodName = 1;
}
message GetPrivateProperty {
string propertyName = 1;
}
message SetPrivateProperty {
string propertyName = 1;
}
message UpdatePrivateProperty {
string propertyName = 1;
BinaryOperator op = 2;
}
message CallPrivateMethod {
string methodName = 1;
}
message GetSuperProperty {
string propertyName = 1;
}
message SetSuperProperty {
string propertyName = 1;
}
message GetComputedSuperProperty {
}
message SetComputedSuperProperty {
}
message UpdateSuperProperty {
string propertyName = 1;
BinaryOperator op = 2;
}
message LoadNewTarget {
}
message Explore {
string id = 1;
int64 rngSeed = 2;
}
message Probe {
string id = 1;
}
message Fixup {
string id = 1;
string action = 2;
string originalOperation = 3;
bool hasOutput = 4;
}
message BeginWith {
}
message EndWith {
}
message BeginIf {
bool inverted = 1;
}
message BeginElse {
}
message EndIf {
}
message BeginSwitch {
}
message BeginSwitchCase {
}
message BeginSwitchDefaultCase {
}
message SwitchBreak {
}
message EndSwitchCase {
bool fallsThrough = 1;
}
message EndSwitch {
}
message BeginWhileLoopHeader {
}
message BeginWhileLoopBody {
}
message EndWhileLoop {
}
message BeginDoWhileLoopBody {
}
message BeginDoWhileLoopHeader {
}
message EndDoWhileLoop {
}
message BeginForLoopInitializer {
}
message BeginForLoopCondition {
}
message BeginForLoopAfterthought {
}
message BeginForLoopBody {
}
message EndForLoop {
}
message BeginForInLoop {
}
message EndForInLoop {
}
message BeginForOfLoop {
}
message BeginForOfLoopWithDestruct {
repeated int32 indices = 1;
bool hasRestElement = 2;
}
message EndForOfLoop {
}
message BeginRepeatLoop {
int64 iterations = 1;
bool exposesLoopCounter = 2;
}
message EndRepeatLoop {
}
message LoopBreak {
}
message LoopContinue {
}
message BeginTry {
}
message BeginCatch {
}
message BeginFinally {
}
message EndTryCatchFinally {
}
message ThrowException {
}
message BeginCodeString {
}
message EndCodeString {
}
message BeginBlockStatement {
}
message EndBlockStatement {
}
message Nop {
}
message Print {
}
message BeginWasmModule {
}
message EndWasmModule {
}
message CreateWasmGlobal {
WasmGlobal wasmGlobal = 1;
}
message CreateWasmMemory {
WasmMemory wasmMemory = 1;
}
message CreateWasmTable {
WasmILType elementType = 1;
int64 minSize = 2;
optional int64 maxSize = 3;
}
message CreateWasmJSTag {
}
message CreateWasmTag {
repeated WasmILType parameters = 1;
}
message WrapSuspending {
}
message WrapPromising {
}
message BindMethod {
string methodName = 1;
}
// Wasm Operations
message Consti64 {
int64 value = 1;
}
message Consti32 {
int32 value = 1;
}
message Constf32 {
float value = 1;
}
message Constf64 {
double value = 1;
}
message WasmReturn {
WasmILType returnType = 1;
}
// We only serialize the wasm types as the rest would be overkill and are not needed.
enum WasmILType {
CONSTi32 = 0;
CONSTi64 = 1;
CONSTf32 = 2;
CONSTf64 = 3;
EXTERNREF = 4;
FUNCREF = 5;
SIMD128 = 6;
NOTHING = 7;
}
message BeginWasmFunction {
repeated WasmILType parameters = 1;
WasmILType returnType = 2;
}
message EndWasmFunction {
}
message WasmJsCall {
repeated WasmILType parameters = 1;
WasmILType returnType = 2;
}
message Wasmi32CompareOp {
int32 compareOperator = 1;
}
message Wasmi64CompareOp {
int32 compareOperator = 1;
}
message Wasmf32CompareOp {
int32 compareOperator = 1;
}
message Wasmf64CompareOp {
int32 compareOperator = 1;
}
message Wasmi64BinOp {
WasmIntegerBinaryOperator op = 1;
}
message Wasmi32BinOp {
WasmIntegerBinaryOperator op = 1;
}
message Wasmi64UnOp {
WasmIntegerUnaryOperator op = 1;
}
message Wasmi32UnOp {
WasmIntegerUnaryOperator op = 1;
}
message Wasmf64BinOp {
WasmFloatBinaryOperator op = 1;
}
message Wasmf32BinOp {
WasmFloatBinaryOperator op = 1;
}
message Wasmf64UnOp {
WasmFloatUnaryOperator op = 1;
}
message Wasmf32UnOp {
WasmFloatUnaryOperator op = 1;
}
message Wasmi32EqualZero {
}
message Wasmi64EqualZero {
}
// Numerical Conversion Operations
message WasmWrapi64Toi32 {
}
message WasmTruncatef32Toi32 {
bool isSigned = 1;
}
message WasmTruncatef64Toi32 {
bool isSigned = 1;
}
message WasmExtendi32Toi64 {
bool isSigned = 1;
}
message WasmTruncatef32Toi64 {
bool isSigned = 1;
}
message WasmTruncatef64Toi64 {
bool isSigned = 1;
}
message WasmConverti32Tof32 {
bool isSigned = 1;
}
message WasmTruncatei64Tof32 {
bool isSigned = 1;
}
message WasmDemotef64Tof32 {
}
message WasmConverti32Tof64 {
bool isSigned = 1;
}
message WasmConverti64Tof64 {
bool isSigned = 1;
}
message WasmConverti64Tof32 {
bool isSigned = 1;
}
message WasmPromotef32Tof64 {
}
message WasmReinterpretf32Asi32 {
}
message WasmReinterpretf64Asi64 {
}
message WasmReinterpreti32Asf32 {
}