1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2  * vim: set ts=8 sts=4 et sw=4 tw=99:
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 
17 namespace js {
18 namespace jit {
19 
20 class BacktrackingAllocator;
21 class MDefinition;
22 class MIRGraph;
23 class MResumePoint;
24 class LNode;
25 
26 class JSONSpewer : JSONPrinter {
27  public:
JSONSpewer(GenericPrinter & out)28   explicit JSONSpewer(GenericPrinter& out) : JSONPrinter(out) {}
29 
30   void beginFunction(JSScript* script);
31   void beginPass(const char* pass);
32   void spewMDef(MDefinition* def);
33   void spewMResumePoint(MResumePoint* rp);
34   void spewMIR(MIRGraph* mir);
35   void spewLIns(LNode* ins);
36   void spewLIR(MIRGraph* mir);
37   void spewRanges(BacktrackingAllocator* regalloc);
38   void endPass();
39   void endFunction();
40 };
41 
42 }  // namespace jit
43 }  // namespace js
44 
45 #endif /* JS_JITSPEW */
46 
47 #endif /* jit_JSONSpewer_h */
48