michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef jit_C1Spewer_h michael@0: #define jit_C1Spewer_h michael@0: michael@0: #ifdef DEBUG michael@0: michael@0: #include "NamespaceImports.h" michael@0: michael@0: #include "js/RootingAPI.h" michael@0: michael@0: namespace js { michael@0: namespace jit { michael@0: michael@0: class MDefinition; michael@0: class MInstruction; michael@0: class MBasicBlock; michael@0: class MIRGraph; michael@0: class LinearScanAllocator; michael@0: class LInstruction; michael@0: michael@0: class C1Spewer michael@0: { michael@0: MIRGraph *graph; michael@0: HandleScript script; michael@0: FILE *spewout_; michael@0: michael@0: public: michael@0: C1Spewer() michael@0: : graph(nullptr), script(NullPtr()), spewout_(nullptr) michael@0: { } michael@0: michael@0: bool init(const char *path); michael@0: void beginFunction(MIRGraph *graph, HandleScript script); michael@0: void spewPass(const char *pass); michael@0: void spewIntervals(const char *pass, LinearScanAllocator *regalloc); michael@0: void endFunction(); michael@0: void finish(); michael@0: michael@0: private: michael@0: void spewPass(FILE *fp, MBasicBlock *block); michael@0: void spewIntervals(FILE *fp, LinearScanAllocator *regalloc, LInstruction *ins, size_t &nextId); michael@0: void spewIntervals(FILE *fp, MBasicBlock *block, LinearScanAllocator *regalloc, size_t &nextId); michael@0: }; michael@0: michael@0: } // namespace jit michael@0: } // namespace js michael@0: michael@0: #endif /* DEBUG */ michael@0: michael@0: #endif /* jit_C1Spewer_h */