def dumpContext(self, context): url = self.contextURL(context) o = XMLOutput(open(url, 'w')) o.url = url with o.scope('html'): with o.scope('head'): with o.scope('title'): o << context.signature.code o << ' - ' o << id(context) with o.scope('body'): with o.scope('p'): o << '[' with o.scope('a', href='index.html'): o << "Index" o << ']' o.endl() with o.scope('p'): self.displayContext(context, o, link=False) self.fold(context, o) self.code(context, o) self.criticalOps(context, o) self.invokesIn(context, o) self.invokesOut(context, o) self.locals(context, o) self.objects(context, o) self.constraints(context.constraints, o)
def debugDump(self, name): # Dump output directory = 'summaries\\dataflow' # Dump information about ops f = filesystem.fileOutput(directory, name + '-ops', 'html') out = XMLOutput(f) with out.scope('html'): with out.scope('head'): with out.scope('title'): out.write(name) out.endl() with out.scope('body'): for op in self.order: if isinstance(op, (graph.Merge, graph.Split)): continue out.tag('hr') out.endl() out.write(op) out.endl() mask = self.opMask(op) if mask is not self.bool.true: with out.scope('p'): out.write(mask) if self.opReads[op] is not self.set.empty: self.dumpTitle(out, 'Read') self.dumpMasked(out, self.opReads[op], mask) if self.opModifies[op] is not self.set.empty: self.dumpTitle(out, 'Modify') self.dumpMasked(out, self.opModifies[op], mask) if self.opAllocates[op] is not self.set.empty: self.dumpTitle(out, 'Allocates') self.dumpMasked(out, self.opAllocates[op], mask) self.dumpNodes(out, 'Inputs', op.reverse(), mask) self.dumpNodes(out, 'Outputs', op.forward(), mask) out.endl() f.close() # Dump information about memory f = filesystem.fileOutput(directory, name + '-memory', 'html') out = XMLOutput(f) with out.scope('html'): with out.scope('head'): with out.scope('title'): out.write(name) out.endl() with out.scope('body'): for key, mask in self.objectExistanceMask.iteritems(): with out.scope('p'): assert isinstance(key, tuple), key obj, index = key out.write(obj) out.write(' - ') out.write(index) out.tag('br') out.write('preexisting' if self.objectIsPreexisting( obj, index) else 'allocated') out.tag('br') out.write(mask) out.endl() f.close()
def debugDump(self, name): # Dump output directory = 'summaries\\dataflow' # Dump information about ops f = filesystem.fileOutput(directory, name+'-ops', 'html') out = XMLOutput(f) with out.scope('html'): with out.scope('head'): with out.scope('title'): out.write(name) out.endl() with out.scope('body'): for op in self.order: if isinstance(op, (graph.Merge, graph.Split)): continue out.tag('hr') out.endl() out.write(op) out.endl() mask = self.opMask(op) if mask is not self.bool.true: with out.scope('p'): out.write(mask) if self.opReads[op] is not self.set.empty: self.dumpTitle(out, 'Read') self.dumpMasked(out, self.opReads[op], mask) if self.opModifies[op] is not self.set.empty: self.dumpTitle(out, 'Modify') self.dumpMasked(out, self.opModifies[op], mask) if self.opAllocates[op] is not self.set.empty: self.dumpTitle(out, 'Allocates') self.dumpMasked(out, self.opAllocates[op], mask) self.dumpNodes(out, 'Inputs', op.reverse(), mask) self.dumpNodes(out, 'Outputs', op.forward(), mask) out.endl() f.close() # Dump information about memory f = filesystem.fileOutput(directory, name+'-memory', 'html') out = XMLOutput(f) with out.scope('html'): with out.scope('head'): with out.scope('title'): out.write(name) out.endl() with out.scope('body'): for key, mask in self.objectExistanceMask.iteritems(): with out.scope('p'): assert isinstance(key, tuple), key obj, index = key out.write(obj) out.write(' - ') out.write(index) out.tag('br') out.write('preexisting' if self.objectIsPreexisting(obj, index) else 'allocated') out.tag('br') out.write(mask) out.endl() f.close()