From be0590187281a026e7618f10eb37728ca0921b81 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Thu, 26 Mar 2015 12:14:03 +0100 Subject: [PATCH] Bug 1146410: IonMonkey: Make it possible to print typeset information anywhere, r=jandem --- js/src/vm/TypeInference.cpp | 34 +++++++++++++++++----------------- js/src/vm/TypeInference.h | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/js/src/vm/TypeInference.cpp b/js/src/vm/TypeInference.cpp index 07d8d8fea20..867e958424c 100644 --- a/js/src/vm/TypeInference.cpp +++ b/js/src/vm/TypeInference.cpp @@ -641,53 +641,53 @@ ConstraintTypeSet::addType(ExclusiveContext *cxArg, Type type) } void -TypeSet::print() +TypeSet::print(FILE *fp) { if (flags & TYPE_FLAG_NON_DATA_PROPERTY) - fprintf(stderr, " [non-data]"); + fprintf(fp, " [non-data]"); if (flags & TYPE_FLAG_NON_WRITABLE_PROPERTY) - fprintf(stderr, " [non-writable]"); + fprintf(fp, " [non-writable]"); if (definiteProperty()) - fprintf(stderr, " [definite:%d]", definiteSlot()); + fprintf(fp, " [definite:%d]", definiteSlot()); if (baseFlags() == 0 && !baseObjectCount()) { - fprintf(stderr, " missing"); + fprintf(fp, " missing"); return; } if (flags & TYPE_FLAG_UNKNOWN) - fprintf(stderr, " unknown"); + fprintf(fp, " unknown"); if (flags & TYPE_FLAG_ANYOBJECT) - fprintf(stderr, " object"); + fprintf(fp, " object"); if (flags & TYPE_FLAG_UNDEFINED) - fprintf(stderr, " void"); + fprintf(fp, " void"); if (flags & TYPE_FLAG_NULL) - fprintf(stderr, " null"); + fprintf(fp, " null"); if (flags & TYPE_FLAG_BOOLEAN) - fprintf(stderr, " bool"); + fprintf(fp, " bool"); if (flags & TYPE_FLAG_INT32) - fprintf(stderr, " int"); + fprintf(fp, " int"); if (flags & TYPE_FLAG_DOUBLE) - fprintf(stderr, " float"); + fprintf(fp, " float"); if (flags & TYPE_FLAG_STRING) - fprintf(stderr, " string"); + fprintf(fp, " string"); if (flags & TYPE_FLAG_SYMBOL) - fprintf(stderr, " symbol"); + fprintf(fp, " symbol"); if (flags & TYPE_FLAG_LAZYARGS) - fprintf(stderr, " lazyargs"); + fprintf(fp, " lazyargs"); uint32_t objectCount = baseObjectCount(); if (objectCount) { - fprintf(stderr, " object[%u]", objectCount); + fprintf(fp, " object[%u]", objectCount); unsigned count = getObjectCount(); for (unsigned i = 0; i < count; i++) { ObjectKey *key = getObject(i); if (key) - fprintf(stderr, " %s", TypeString(ObjectType(key))); + fprintf(fp, " %s", TypeString(ObjectType(key))); } } } diff --git a/js/src/vm/TypeInference.h b/js/src/vm/TypeInference.h index 903dceaf076..9cd69ee2dd3 100644 --- a/js/src/vm/TypeInference.h +++ b/js/src/vm/TypeInference.h @@ -399,7 +399,7 @@ class TypeSet : flags(0), objectSet(nullptr) {} - void print(); + void print(FILE *fp = stderr); /* Whether this set contains a specific type. */ inline bool hasType(Type type) const;