#include "config.h"
#include "ExitKind.h"
#include <wtf/Assertions.h>
#include <wtf/PrintStream.h>
namespace JSC {
const char* exitKindToString(ExitKind kind)
{
switch (kind) {
case ExitKindUnset:
return "Unset";
case BadType:
return "BadType";
case BadFunction:
return "BadFunction";
case BadExecutable:
return "BadExecutable";
case BadCache:
return "BadCache";
case BadCacheWatchpoint:
return "BadCacheWatchpoint";
case BadWeakConstantCache:
return "BadWeakConstantCache";
case BadWeakConstantCacheWatchpoint:
return "BadWeakConstantCacheWatchpoint";
case BadIndexingType:
return "BadIndexingType";
case Overflow:
return "Overflow";
case NegativeZero:
return "NegativeZero";
case Int52Overflow:
return "Int52Overflow";
case StoreToHole:
return "StoreToHole";
case LoadFromHole:
return "LoadFromHole";
case OutOfBounds:
return "OutOfBounds";
case InadequateCoverage:
return "InadequateCoverage";
case ArgumentsEscaped:
return "ArgumentsEscaped";
case NotStringObject:
return "NotStringObject";
case Uncountable:
return "Uncountable";
case UncountableWatchpoint:
return "UncountableWatchpoint";
case UncountableInvalidation:
return "UncountableInvalidation";
case WatchdogTimerFired:
return "WatchdogTimerFired";
case DebuggerEvent:
return "DebuggerEvent";
}
RELEASE_ASSERT_NOT_REACHED();
return "Unknown";
}
bool exitKindIsCountable(ExitKind kind)
{
switch (kind) {
case ExitKindUnset:
RELEASE_ASSERT_NOT_REACHED();
case BadType:
case Uncountable:
case UncountableWatchpoint:
case LoadFromHole: case StoreToHole: case OutOfBounds: return false;
default:
return true;
}
}
}
namespace WTF {
void printInternal(PrintStream& out, JSC::ExitKind kind)
{
out.print(exitKindToString(kind));
}
}