Debian Codegraph @

js/src/jit/JSONSpewer.h

raw
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #ifndef jit_JSONSpewer_h
8 #define jit_JSONSpewer_h
9
10 #ifdef JS_JITSPEW
11
12 # include <stdio.h>
13
14 # include "js/TypeDecls.h"
15 # include "vm/JSONPrinter.h"
16 # include "wasm/WasmTypeDef.h"
17
18 namespace js {
19 namespace jit {
20
21 class BacktrackingAllocator;
22 class MDefinition;
23 class MIRGraph;
24 class MResumePoint;
25 class LNode;
26
27 class JSONSpewer : JSONPrinter {
28 private:
29 // Optional; wasm type information to be used when dumping MIR nodes.
30 const wasm::CodeMetadata* wasmCodeMeta_;
31
32 public:
33 explicit JSONSpewer(GenericPrinter& out,
34 const wasm::CodeMetadata* wasmCodeMeta = nullptr)
35 : JSONPrinter(out), wasmCodeMeta_(wasmCodeMeta) {}
36
37 void beginFunction(JSScript* script);
38 void beginWasmFunction(unsigned funcIndex);
39 void beginPass(const char* pass);
40 void spewMDef(MDefinition* def);
41 void spewMResumePoint(MResumePoint* rp);
42 void spewMIR(MIRGraph* mir);
43 void spewLIns(LNode* ins);
44 void spewLIR(MIRGraph* mir);
45 void spewRanges(BacktrackingAllocator* regalloc);
46 void endPass();
47 void endFunction();
48 };
49
50 } // namespace jit
51 } // namespace js
52
53 #endif /* JS_JITSPEW */
54
55 #endif /* jit_JSONSpewer_h */