js/src/jit/C1Spewer.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:d084a128c69f
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_C1Spewer_h
8 #define jit_C1Spewer_h
9
10 #ifdef DEBUG
11
12 #include "NamespaceImports.h"
13
14 #include "js/RootingAPI.h"
15
16 namespace js {
17 namespace jit {
18
19 class MDefinition;
20 class MInstruction;
21 class MBasicBlock;
22 class MIRGraph;
23 class LinearScanAllocator;
24 class LInstruction;
25
26 class C1Spewer
27 {
28 MIRGraph *graph;
29 HandleScript script;
30 FILE *spewout_;
31
32 public:
33 C1Spewer()
34 : graph(nullptr), script(NullPtr()), spewout_(nullptr)
35 { }
36
37 bool init(const char *path);
38 void beginFunction(MIRGraph *graph, HandleScript script);
39 void spewPass(const char *pass);
40 void spewIntervals(const char *pass, LinearScanAllocator *regalloc);
41 void endFunction();
42 void finish();
43
44 private:
45 void spewPass(FILE *fp, MBasicBlock *block);
46 void spewIntervals(FILE *fp, LinearScanAllocator *regalloc, LInstruction *ins, size_t &nextId);
47 void spewIntervals(FILE *fp, MBasicBlock *block, LinearScanAllocator *regalloc, size_t &nextId);
48 };
49
50 } // namespace jit
51 } // namespace js
52
53 #endif /* DEBUG */
54
55 #endif /* jit_C1Spewer_h */

mercurial