Пример #1
0
CallIdentifier Profiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const String& defaultSourceURL, int defaultLineNumber)
{
    if (!functionValue)
        return CallIdentifier(GlobalCodeExecution, defaultSourceURL, defaultLineNumber);
    if (!functionValue.isObject())
        return CallIdentifier("(unknown)", defaultSourceURL, defaultLineNumber);
    if (asObject(functionValue)->inherits(&JSFunction::s_info) || asObject(functionValue)->inherits(&InternalFunction::s_info))
        return createCallIdentifierFromFunctionImp(exec, asObject(functionValue), defaultSourceURL, defaultLineNumber);
    return CallIdentifier(makeString("(", asObject(functionValue)->methodTable()->className(asObject(functionValue)), " object)"), defaultSourceURL, defaultLineNumber);
}
Пример #2
0
CallIdentifier LegacyProfiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const String& defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber)
{
    if (!functionValue)
        return CallIdentifier(ASCIILiteral(GlobalCodeExecution), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
    if (!functionValue.isObject())
        return CallIdentifier(ASCIILiteral("(unknown)"), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
    if (asObject(functionValue)->inherits(JSFunction::info()) || asObject(functionValue)->inherits(InternalFunction::info()))
        return createCallIdentifierFromFunctionImp(exec, asObject(functionValue), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
    return CallIdentifier(asObject(functionValue)->methodTable()->className(asObject(functionValue)), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
}
Пример #3
0
CallIdentifier createCallIdentifier(JSObject* calledFunction)
{
    if (calledFunction->inherits(&JSFunction::info))
        return createCallIdentifierFromFunctionImp(static_cast<JSFunction*>(calledFunction));
    if (calledFunction->inherits(&InternalFunction::info))
        return CallIdentifier(static_cast<InternalFunction*>(calledFunction)->functionName().ustring(), "", 0);

    UString name = "(" + calledFunction->className() + " object)";
    return CallIdentifier(name, 0, 0);
}
Пример #4
0
CallIdentifier Profiler::createCallIdentifier(ExecState* exec, JSObject* calledFunction, const UString& defaultSourceURL, int defaultLineNumber)
{
    if (!calledFunction)
        return CallIdentifier(GlobalCodeExecution, defaultSourceURL, defaultLineNumber);

    if (calledFunction->inherits(&JSFunction::info))
        return createCallIdentifierFromFunctionImp(exec, static_cast<JSFunction*>(calledFunction));
    if (calledFunction->inherits(&InternalFunction::info))
        return CallIdentifier(static_cast<InternalFunction*>(calledFunction)->name(exec), defaultSourceURL, defaultLineNumber);

    UString name = "(" + calledFunction->className() + " object)";
    return CallIdentifier(name, defaultSourceURL, defaultLineNumber);
}
Пример #5
0
CallIdentifier Profiler::createCallIdentifier(TiExcState* exec, TiValue functionValue, const UString& defaultSourceURL, int defaultLineNumber)
{
    if (!functionValue)
        return CallIdentifier(GlobalCodeExecution, defaultSourceURL, defaultLineNumber);
    if (!functionValue.isObject())
        return CallIdentifier("(unknown)", defaultSourceURL, defaultLineNumber);
    if (asObject(functionValue)->inherits(&TiFunction::info)) {
        TiFunction* function = asFunction(functionValue);
        if (!function->executable()->isHostFunction())
            return createCallIdentifierFromFunctionImp(exec, function);
    }
    if (asObject(functionValue)->inherits(&InternalFunction::info))
        return CallIdentifier(static_cast<InternalFunction*>(asObject(functionValue))->name(exec), defaultSourceURL, defaultLineNumber);
    return CallIdentifier(makeString("(", asObject(functionValue)->className(), " object)"), defaultSourceURL, defaultLineNumber);
}