mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1147403 part 4 - Extract the printer from the serializer. r=h4writer
This commit is contained in:
parent
c3ac0db387
commit
c5d0701239
@ -67,14 +67,6 @@ C1Spewer::endFunction()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
C1Spewer::dump(Fprinter& file)
|
|
||||||
{
|
|
||||||
if (!out_.hadOutOfMemory())
|
|
||||||
out_.exportInto(file);
|
|
||||||
out_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DumpDefinition(GenericPrinter& out, MDefinition* def)
|
DumpDefinition(GenericPrinter& out, MDefinition* def)
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "NamespaceImports.h"
|
#include "NamespaceImports.h"
|
||||||
|
|
||||||
#include "jit/JitAllocPolicy.h"
|
|
||||||
#include "js/RootingAPI.h"
|
#include "js/RootingAPI.h"
|
||||||
#include "vm/Printer.h"
|
#include "vm/Printer.h"
|
||||||
|
|
||||||
@ -26,11 +25,11 @@ class LNode;
|
|||||||
class C1Spewer
|
class C1Spewer
|
||||||
{
|
{
|
||||||
MIRGraph* graph;
|
MIRGraph* graph;
|
||||||
LSprinter out_;
|
GenericPrinter& out_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit C1Spewer(TempAllocator *alloc)
|
explicit C1Spewer(GenericPrinter& out)
|
||||||
: graph(nullptr), out_(alloc->lifoAlloc())
|
: graph(nullptr), out_(out)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void beginFunction(MIRGraph* graph, JSScript* script);
|
void beginFunction(MIRGraph* graph, JSScript* script);
|
||||||
@ -38,8 +37,6 @@ class C1Spewer
|
|||||||
void spewRanges(const char* pass, BacktrackingAllocator* regalloc);
|
void spewRanges(const char* pass, BacktrackingAllocator* regalloc);
|
||||||
void endFunction();
|
void endFunction();
|
||||||
|
|
||||||
void dump(Fprinter &file);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void spewPass(GenericPrinter& out, MBasicBlock* block);
|
void spewPass(GenericPrinter& out, MBasicBlock* block);
|
||||||
void spewRanges(GenericPrinter& out, BacktrackingAllocator* regalloc, LNode* ins);
|
void spewRanges(GenericPrinter& out, BacktrackingAllocator* regalloc, LNode* ins);
|
||||||
|
@ -388,13 +388,3 @@ JSONSpewer::endFunction()
|
|||||||
endList();
|
endList();
|
||||||
endObject();
|
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 <stdio.h>
|
||||||
|
|
||||||
#include "jit/JitAllocPolicy.h"
|
|
||||||
#include "js/TypeDecls.h"
|
#include "js/TypeDecls.h"
|
||||||
#include "vm/Printer.h"
|
#include "vm/Printer.h"
|
||||||
|
|
||||||
@ -27,7 +26,7 @@ class JSONSpewer
|
|||||||
private:
|
private:
|
||||||
int indentLevel_;
|
int indentLevel_;
|
||||||
bool first_;
|
bool first_;
|
||||||
LSprinter out_;
|
GenericPrinter& out_;
|
||||||
|
|
||||||
void indent();
|
void indent();
|
||||||
|
|
||||||
@ -43,10 +42,10 @@ class JSONSpewer
|
|||||||
void endList();
|
void endList();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit JSONSpewer(TempAllocator *alloc)
|
explicit JSONSpewer(GenericPrinter& out)
|
||||||
: indentLevel_(0),
|
: indentLevel_(0),
|
||||||
first_(true),
|
first_(true),
|
||||||
out_(alloc->lifoAlloc())
|
out_(out)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void beginFunction(JSScript* script);
|
void beginFunction(JSScript* script);
|
||||||
@ -59,8 +58,6 @@ class JSONSpewer
|
|||||||
void spewRanges(BacktrackingAllocator* regalloc);
|
void spewRanges(BacktrackingAllocator* regalloc);
|
||||||
void endPass();
|
void endPass();
|
||||||
void endFunction();
|
void endFunction();
|
||||||
|
|
||||||
void dump(Fprinter& file);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace jit
|
} // namespace jit
|
||||||
|
@ -317,8 +317,15 @@ GraphSpewer::endFunction()
|
|||||||
void
|
void
|
||||||
GraphSpewer::dump(Fprinter& c1Out, Fprinter& jsonOut)
|
GraphSpewer::dump(Fprinter& c1Out, Fprinter& jsonOut)
|
||||||
{
|
{
|
||||||
c1Spewer_.dump(c1Out);
|
if (!c1Printer_.hadOutOfMemory())
|
||||||
jsonSpewer_.dump(jsonOut);
|
c1Printer_.exportInto(c1Out);
|
||||||
|
c1Printer_.clear();
|
||||||
|
|
||||||
|
if (!jsonPrinter_.hadOutOfMemory())
|
||||||
|
jsonPrinter_.exportInto(jsonOut);
|
||||||
|
else
|
||||||
|
jsonOut.put("{}");
|
||||||
|
jsonPrinter_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -108,14 +108,18 @@ class GraphSpewer
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
MIRGraph* graph_;
|
MIRGraph* graph_;
|
||||||
|
LSprinter c1Printer_;
|
||||||
|
LSprinter jsonPrinter_;
|
||||||
C1Spewer c1Spewer_;
|
C1Spewer c1Spewer_;
|
||||||
JSONSpewer jsonSpewer_;
|
JSONSpewer jsonSpewer_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GraphSpewer(TempAllocator *alloc)
|
explicit GraphSpewer(TempAllocator *alloc)
|
||||||
: graph_(nullptr),
|
: graph_(nullptr),
|
||||||
c1Spewer_(alloc),
|
c1Printer_(alloc->lifoAlloc()),
|
||||||
jsonSpewer_(alloc)
|
jsonPrinter_(alloc->lifoAlloc()),
|
||||||
|
c1Spewer_(c1Printer_),
|
||||||
|
jsonSpewer_(jsonPrinter_)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
bool isSpewing() const {
|
bool isSpewing() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user