зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1147403 part 4 - Extract the printer from the serializer. r=h4writer
This commit is contained in:
Родитель
bd088a7a01
Коммит
2b8e638ee8
|
@ -68,14 +68,6 @@ C1Spewer::endFunction()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
C1Spewer::dump(Fprinter& file)
|
||||
{
|
||||
if (!out_.hadOutOfMemory())
|
||||
out_.exportInto(file);
|
||||
out_.clear();
|
||||
}
|
||||
|
||||
static void
|
||||
DumpDefinition(GenericPrinter& out, MDefinition* def)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include "NamespaceImports.h"
|
||||
|
||||
#include "jit/JitAllocPolicy.h"
|
||||
#include "js/RootingAPI.h"
|
||||
#include "vm/Printer.h"
|
||||
|
||||
|
@ -26,11 +25,11 @@ class LNode;
|
|||
class C1Spewer
|
||||
{
|
||||
MIRGraph* graph;
|
||||
LSprinter out_;
|
||||
GenericPrinter& out_;
|
||||
|
||||
public:
|
||||
explicit C1Spewer(TempAllocator *alloc)
|
||||
: graph(nullptr), out_(alloc->lifoAlloc())
|
||||
explicit C1Spewer(GenericPrinter& out)
|
||||
: graph(nullptr), out_(out)
|
||||
{ }
|
||||
|
||||
void beginFunction(MIRGraph* graph, JSScript* script);
|
||||
|
@ -38,8 +37,6 @@ class C1Spewer
|
|||
void spewIntervals(const char* pass, BacktrackingAllocator* regalloc);
|
||||
void endFunction();
|
||||
|
||||
void dump(Fprinter &file);
|
||||
|
||||
private:
|
||||
void spewPass(GenericPrinter& out, MBasicBlock* block);
|
||||
void spewIntervals(GenericPrinter& out, BacktrackingAllocator* regalloc, LNode* ins, size_t& nextId);
|
||||
|
|
|
@ -398,13 +398,3 @@ JSONSpewer::endFunction()
|
|||
endList();
|
||||
endObject();
|
||||
}
|
||||
|
||||
void
|
||||
JSONSpewer::dump(Fprinter& file)
|
||||
{
|
||||
if (!out_.hadOutOfMemory())
|
||||
out_.exportInto(file);
|
||||
else
|
||||
file.put("{}");
|
||||
out_.clear();
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "jit/JitAllocPolicy.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "vm/Printer.h"
|
||||
|
||||
|
@ -27,7 +26,7 @@ class JSONSpewer
|
|||
private:
|
||||
int indentLevel_;
|
||||
bool first_;
|
||||
LSprinter out_;
|
||||
GenericPrinter& out_;
|
||||
|
||||
void indent();
|
||||
|
||||
|
@ -43,10 +42,10 @@ class JSONSpewer
|
|||
void endList();
|
||||
|
||||
public:
|
||||
explicit JSONSpewer(TempAllocator *alloc)
|
||||
explicit JSONSpewer(GenericPrinter& out)
|
||||
: indentLevel_(0),
|
||||
first_(true),
|
||||
out_(alloc->lifoAlloc())
|
||||
out_(out)
|
||||
{ }
|
||||
|
||||
void beginFunction(JSScript* script);
|
||||
|
@ -59,8 +58,6 @@ class JSONSpewer
|
|||
void spewIntervals(BacktrackingAllocator* regalloc);
|
||||
void endPass();
|
||||
void endFunction();
|
||||
|
||||
void dump(Fprinter& file);
|
||||
};
|
||||
|
||||
} // namespace jit
|
||||
|
|
|
@ -317,8 +317,15 @@ GraphSpewer::endFunction()
|
|||
void
|
||||
GraphSpewer::dump(Fprinter& c1Out, Fprinter& jsonOut)
|
||||
{
|
||||
c1Spewer_.dump(c1Out);
|
||||
jsonSpewer_.dump(jsonOut);
|
||||
if (!c1Printer_.hadOutOfMemory())
|
||||
c1Printer_.exportInto(c1Out);
|
||||
c1Printer_.clear();
|
||||
|
||||
if (!jsonPrinter_.hadOutOfMemory())
|
||||
jsonPrinter_.exportInto(jsonOut);
|
||||
else
|
||||
jsonOut.put("{}");
|
||||
jsonPrinter_.clear();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -108,14 +108,18 @@ class GraphSpewer
|
|||
{
|
||||
private:
|
||||
MIRGraph* graph_;
|
||||
LSprinter c1Printer_;
|
||||
LSprinter jsonPrinter_;
|
||||
C1Spewer c1Spewer_;
|
||||
JSONSpewer jsonSpewer_;
|
||||
|
||||
public:
|
||||
explicit GraphSpewer(TempAllocator *alloc)
|
||||
: graph_(nullptr),
|
||||
c1Spewer_(alloc),
|
||||
jsonSpewer_(alloc)
|
||||
c1Printer_(alloc->lifoAlloc()),
|
||||
jsonPrinter_(alloc->lifoAlloc()),
|
||||
c1Spewer_(c1Printer_),
|
||||
jsonSpewer_(jsonPrinter_)
|
||||
{ }
|
||||
|
||||
bool isSpewing() const {
|
||||
|
|
Загрузка…
Ссылка в новой задаче