Bug 1147403 part 6 - Remove GetJitContext from serializing functions. r=h4writer

This commit is contained in:
Nicolas B. Pierron 2015-05-28 19:26:56 +02:00
parent dda73b218b
commit 9e776b5f01
3 changed files with 23 additions and 11 deletions

View File

@ -65,16 +65,28 @@ JSONSpewer::beginListProperty(const char* name)
first_ = true;
}
void
JSONSpewer::beginStringProperty(const char* name)
{
property(name);
out_.printf("\"");
}
void
JSONSpewer::endStringProperty()
{
out_.printf("\"");
}
void
JSONSpewer::stringProperty(const char* name, const char* format, ...)
{
va_list ap;
va_start(ap, format);
property(name);
out_.printf("\"");
beginStringProperty(name);
out_.vprintf(format, ap);
out_.printf("\"");
endStringProperty();
va_end(ap);
}
@ -221,10 +233,10 @@ JSONSpewer::spewMDef(MDefinition* def)
isTruncated = static_cast<MBinaryArithInstruction*>(def)->isTruncated();
if (def->type() != MIRType_None && def->range()) {
Sprinter sp(GetJitContext()->cx);
sp.init();
def->range()->dump(sp);
stringProperty("type", "%s : %s%s", sp.string(), StringFromMIRType(def->type()), (isTruncated ? " (t)" : ""));
beginStringProperty("type");
def->range()->dump(out_);
out_.printf(" : %s%s", StringFromMIRType(def->type()), (isTruncated ? " (t)" : ""));
endStringProperty();
} else {
stringProperty("type", "%s%s", StringFromMIRType(def->type()), (isTruncated ? " (t)" : ""));
}

View File

@ -36,6 +36,8 @@ class JSONSpewer
void beginListProperty(const char* name);
void stringValue(const char* format, ...);
void stringProperty(const char* name, const char* format, ...);
void beginStringProperty(const char* name);
void endStringProperty();
void integerValue(int value);
void integerProperty(const char* name, int value);
void endObject();

View File

@ -1083,10 +1083,8 @@ void
MAssertRange::printOpcode(GenericPrinter& out) const
{
MDefinition::printOpcode(out);
Sprinter sp(GetJitContext()->cx);
sp.init();
assertedRange()->dump(sp);
out.printf(" %s", sp.string());
out.put(" ");
assertedRange()->dump(out);
}
const char*