move getMapIdByValue to FieldMask.h
[hiphop-php.git] / hphp / doc / printir_json_schema.ts
blob28659907d1141b09dc4128fd7f31ccf71fef4e6a
1 type BlockId = number; // unsigned int
2 type CounterName = string; // uncertain of format
3 type DisasmString = string; // uncertain of format
4 type ExtraString = string; // uncertain of format
5 type FileName = string; //uncertain of format
6 type FuncName = string; // uncertain of format
7 type FuncString = string; // uncertain of format
8 type GuardConstraintString = string; // uncertain of format
9 type InstrId = number; // uint32_t
10 type LineNum = number; // int
11 type Offset = number; // int
12 type Opcode = string; // Some sort of enum
13 type OptIndex = number; // int
14 type ProfCount = number; // uint64_t
15 type ProfileString = string; // uncertain of format
16 type SSATmpId = number; // uint32_t
17 type TCA = string;
18 type TransId = number; // int32_t
19 type TypeString = string; // uncertain of format
20 type UnitString = string; // uncertain of format
22 type Unit = {
23   blocks: [Block];
24   translation: TransContext;
25   opcodeStats: OpcodeStats;
26   inliningDecisions: [InliningDecision];
29 type Block = {
30   label: LabelInfo;
31   profCount: ProfCount;
32   preds: [BlockId];
33   next: LabelInfo | null;
34   instrs: [Instr];
35   area: Area;
38 type LabelInfo = {
39   id: BlockId;
40   isCatch: boolean;
41   hint: Hint;
44 enum Hint {
45   Unused,
46   Unlikely,
47   Neither,
48   Likely,
51 enum Area {
52   Main,
53   Cold,
54   Frozen,
57 type Instr = {
58   marker: {raw: FuncString} | null; // still not 100% sure what this does
59   phiPseudoInstrs: [PhiPseudoInstr];
60   opcodeName: Opcode;
61   typeParam: TypeString | null;
62   guard: GuardConstraintString | "unused" | null;
63   extra: ExtraString | null;
64   id: InstrId | null;
65   taken: LabelInfo | null;
66   tc_ranges: [TC_Range] | null // will be null specifically when asmInfo is null
67   dsts: [Dst];
68   srcs: {counterName: CounterName} | [Src];
69   offset: Offset;
70   profileData: [ProfileData];
73 type Src = SSATmp;
74 type Dst = SSATmp;
76 type SSATmp = {
77   id: SSATmpId;
78   type: TypeString;
81 type PhiPseudoInstr = {
82   srcs: [{
83     src: Src;
84     label: LabelInfo;
85   }];
86   dst: Dst;
89 type TC_Range = {
90   area: Area;
91   start: TCA;
92   end: TCA;
93   disasm: DisasmString;
96 type ProfileData = {
97   offset: Offset;
98   name: ProfileString;
99   data: {profileType: ProfileType};
100   // the rest of the keys in "data" will depend on the value of "profileType"
103 enum ProfileType {
104   ArrayAccessProfile,
105   ArrayKindProfile,
106   CallTargetProfile,
107   ClsCnsProfile,
108   DecRefProfile,
109   IncRefProfile,
110   MethProfile,
111   ReleaseVVProfile,
112   SwitchProfile,
113   TypeProfile,
116 enum TransKind {
117   TransAnchor,
118   TransInterp,
119   TransLive,
120   TransProfile,
121   TransOptimize,
122   TransLivePrologue,
123   TransProfPrologue,
124   TransOptPrologue,
125   TransInvalid,
128 type TransContext = {
129   kind: TransKind;
130   id: TransId;
131   optIndex: OptIndex;
132   srcKey: SrcKey;
133   funcName: FuncName;
134   sourceFile: FileName;
135   startLine: LineNum;
136   endLine: LineNum;
139 type SrcKey = {
140   func: FuncString;
141   unit: UnitString;
142   prologue: boolean;
143   offset: Offset;
144   resumeMode: ResumeMode;
145   hasThis: boolean;
148 type ResumeMode = "" | "ra" | "rg";
150 type OpcodeStats = {[x in Opcode] : number;};
152 type InliningDecision = {
153   wasInlined: boolean;
154   offset: Offset;
155   caller: FuncName;
156   callee: FuncName;
157   reason: string;