Changeset 147846 in webkit


Ignore:
Timestamp:
Apr 6, 2013 11:24:37 AM (11 years ago)
Author:
ggaren@apple.com
Message:

Rolled out 147820 and 147818 because they caused plugins tests to ASSERT
https://bugs.webkit.org/show_bug.cgi?id=114094

Reviewed by Anders Carlsson.

Source/JavaScriptCore:

  • API/JSContextRef.cpp:

(JSContextCreateBacktrace):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitDebugHook):

  • interpreter/Interpreter.cpp:

(JSC):
(JSC::Interpreter::dumpRegisters):
(JSC::Interpreter::unwindCallFrame):
(JSC::getLineNumberForCallFrame):
(JSC::getCallerInfo):
(JSC::Interpreter::getStackTrace):
(JSC::Interpreter::addStackTraceIfNecessary):
(JSC::Interpreter::retrieveCallerFromVMCode):

  • interpreter/Interpreter.h:

(StackFrame):
(JSC::StackFrame::toString):
(JSC::StackFrame::friendlyLineNumber):
(Interpreter):

  • runtime/Error.cpp:

(JSC::throwError):

  • runtime/JSGlobalData.h:

(JSC):
(JSGlobalData):

  • runtime/JSGlobalObject.cpp:

(JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):

Source/WebCore:

  • bindings/js/ScriptCallStackFactory.cpp:

(WebCore::createScriptCallStack):

  • inspector/ScriptCallFrame.cpp:

(WebCore::ScriptCallFrame::isEqual):

  • inspector/ScriptCallFrame.h:

(ScriptCallFrame):
(WebCore::ScriptCallFrame::lineNumber):

Tools:

  • Scripts/run-jsc:
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r147818 r147846  
    3737#include "JSObject.h"
    3838#include "Operations.h"
    39 #include "SourceProvider.h"
    4039#include <wtf/text/StringBuilder.h>
    4140#include <wtf/text/StringHash.h>
     
    177176    ExecState* exec = toJS(ctx);
    178177    JSLockHolder lock(exec);
     178
     179    unsigned count = 0;
    179180    StringBuilder builder;
    180     Vector<StackFrame> stackTrace;
    181     Interpreter::getStackTrace(&exec->globalData(), stackTrace, maxStackSize);
    182 
    183     for (size_t i = 0; i < stackTrace.size(); i++) {
     181    CallFrame* callFrame = exec;
     182    String functionName;
     183    if (exec->callee()) {
     184        if (asObject(exec->callee())->inherits(&InternalFunction::s_info)) {
     185            functionName = asInternalFunction(exec->callee())->name(exec);
     186            builder.appendLiteral("#0 ");
     187            builder.append(functionName);
     188            builder.appendLiteral("() ");
     189            count++;
     190        }
     191    }
     192    while (true) {
     193        RELEASE_ASSERT(callFrame);
     194        int signedLineNumber;
     195        intptr_t sourceID;
    184196        String urlString;
    185         String functionName;
    186         StackFrame& frame = stackTrace[i];
    187         JSValue function = frame.callee.get();
    188         if (frame.callee)
    189             functionName = frame.friendlyFunctionName(exec);
     197        JSValue function;
     198
     199        exec->interpreter()->retrieveLastCaller(callFrame, signedLineNumber, sourceID, urlString, function);
     200
     201        if (function)
     202            functionName = jsCast<JSFunction*>(function)->name(exec);
    190203        else {
    191204            // Caller is unknown, but if frame is empty we should still add the frame, because
    192205            // something called us, and gave us arguments.
    193             if (i)
     206            if (count)
    194207                break;
    195208        }
    196         unsigned lineNumber = frame.line();
     209        unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
    197210        if (!builder.isEmpty())
    198211            builder.append('\n');
    199212        builder.append('#');
    200         builder.appendNumber(i);
     213        builder.appendNumber(count);
    201214        builder.append(' ');
    202215        builder.append(functionName);
    203216        builder.appendLiteral("() at ");
    204217        builder.append(urlString);
    205         if (frame.codeType != StackFrameNativeCode) {
    206             builder.append(':');
    207             builder.appendNumber(lineNumber);
    208         }
    209         if (!function)
     218        builder.append(':');
     219        builder.appendNumber(lineNumber);
     220        if (!function || ++count == maxStackSize)
    210221            break;
     222        callFrame = callFrame->callerFrame();
    211223    }
    212224    return OpaqueJSString::create(builder.toString()).leakRef();
  • trunk/Source/JavaScriptCore/ChangeLog

    r147842 r147846  
     12013-04-06  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Rolled out 147820 and 147818 because they caused plugins tests to ASSERT
     4        https://bugs.webkit.org/show_bug.cgi?id=114094
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * API/JSContextRef.cpp:
     9        (JSContextCreateBacktrace):
     10        * bytecompiler/BytecodeGenerator.cpp:
     11        (JSC::BytecodeGenerator::emitDebugHook):
     12        * interpreter/Interpreter.cpp:
     13        (JSC):
     14        (JSC::Interpreter::dumpRegisters):
     15        (JSC::Interpreter::unwindCallFrame):
     16        (JSC::getLineNumberForCallFrame):
     17        (JSC::getCallerInfo):
     18        (JSC::Interpreter::getStackTrace):
     19        (JSC::Interpreter::addStackTraceIfNecessary):
     20        (JSC::Interpreter::retrieveCallerFromVMCode):
     21        * interpreter/Interpreter.h:
     22        (StackFrame):
     23        (JSC::StackFrame::toString):
     24        (JSC::StackFrame::friendlyLineNumber):
     25        (Interpreter):
     26        * runtime/Error.cpp:
     27        (JSC::throwError):
     28        * runtime/JSGlobalData.h:
     29        (JSC):
     30        (JSGlobalData):
     31        * runtime/JSGlobalObject.cpp:
     32        (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
     33
    1342013-04-06  Patrick Gansterer  <paroga@webkit.org>
    235
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r147818 r147846  
    20562056        return;
    20572057#endif
    2058     emitExpressionInfo(charPosition, 0, 0);
    20592058    emitOpcode(op_debug);
    20602059    instructions().append(debugHookID);
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r147820 r147846  
    200200
    201201
    202 static CallFrame* getCallerInfo(JSGlobalData*, CallFrame*, unsigned& bytecodeOffset, CodeBlock*& callerOut);
     202static CallFrame* getCallerInfo(JSGlobalData*, CallFrame*, int& lineNumber, unsigned& bytecodeOffset, CodeBlock*& callerOut);
    203203
    204204// Returns the depth of the scope chain within a given call frame.
     
    423423    unsigned bytecodeOffset = 0;
    424424    int line = 0;
    425     CodeBlock* callerCodeBlock = 0;
    426     getCallerInfo(&callFrame->globalData(), callFrame, bytecodeOffset, callerCodeBlock);
    427     line = callerCodeBlock->lineNumberForBytecodeOffset(bytecodeOffset);
     425    CodeBlock* unusedCallerCodeBlock = 0;
     426    getCallerInfo(&callFrame->globalData(), callFrame, line, bytecodeOffset, unusedCallerCodeBlock);
    428427    dataLogF("[ReturnVPC]                | %10p | %d (line %d)\n", it, bytecodeOffset, line);
    429428    ++it;
     
    509508    if (callerFrame->hasHostCallFrameFlag())
    510509        return false;
    511     callFrame = getCallerInfo(&callFrame->globalData(), callFrame, bytecodeOffset, codeBlock);
     510    int unusedLineNumber = 0;
     511    callFrame = getCallerInfo(&callFrame->globalData(), callFrame, unusedLineNumber, bytecodeOffset, codeBlock);
    512512    return true;
    513513}
     
    565565}
    566566
    567 static unsigned getBytecodeOffsetForCallFrame(CallFrame* callFrame)
    568 {
     567static int getLineNumberForCallFrame(JSGlobalData* globalData, CallFrame* callFrame)
     568{
     569    UNUSED_PARAM(globalData);
    569570    callFrame = callFrame->removeHostCallFrameFlag();
    570571    CodeBlock* codeBlock = callFrame->codeBlock();
    571572    if (!codeBlock)
    572         return 0;
    573 #if ENABLE(JIT)
     573        return -1;
     574#if ENABLE(JIT) || ENABLE(LLINT)
    574575#if ENABLE(DFG_JIT)
    575576    if (codeBlock->getJITType() == JITCode::DFGJIT)
    576         return codeBlock->codeOrigin(callFrame->codeOriginIndexForDFG()).bytecodeIndex;
    577 #endif
    578     return callFrame->bytecodeOffsetForNonDFGCode();
    579 #endif
    580 }
    581 
    582 static CallFrame* getCallerInfo(JSGlobalData* globalData, CallFrame* callFrame, unsigned& bytecodeOffset, CodeBlock*& caller)
     577        return codeBlock->lineNumberForBytecodeOffset(codeBlock->codeOrigin(callFrame->codeOriginIndexForDFG()).bytecodeIndex);
     578#endif
     579    return codeBlock->lineNumberForBytecodeOffset(callFrame->bytecodeOffsetForNonDFGCode());
     580#endif
     581}
     582
     583static CallFrame* getCallerInfo(JSGlobalData* globalData, CallFrame* callFrame, int& lineNumber, unsigned& bytecodeOffset, CodeBlock*& caller)
    583584{
    584585    ASSERT_UNUSED(globalData, globalData);
    585586    bytecodeOffset = 0;
     587    lineNumber = -1;
    586588    ASSERT(!callFrame->hasHostCallFrameFlag());
    587589    CallFrame* callerFrame = callFrame->codeBlock() ? callFrame->trueCallerFrame() : callFrame->callerFrame()->removeHostCallFrameFlag();
     
    653655    RELEASE_ASSERT(callerCodeBlock);
    654656    caller = callerCodeBlock;
     657    lineNumber = callerCodeBlock->lineNumberForBytecodeOffset(bytecodeOffset);
    655658    return callerFrame;
    656659}
     
    678681}
    679682
    680 unsigned StackFrame::line()
    681 {
    682     return codeBlock ? codeBlock->lineNumberForBytecodeOffset(bytecodeOffset) + lineOffset : 0;
    683 }
    684 
    685 unsigned StackFrame::column()
    686 {
    687     if (!code)
    688         return 0;
    689     int divot = 0;
    690     int unusedStartOffset = 0;
    691     int unusedEndOffset = 0;
    692     expressionInfo(divot, unusedStartOffset, unusedEndOffset);
    693     return code->charPositionToColumnNumber(divot);
    694 }
    695 
    696 void StackFrame::expressionInfo(int& divot, int& startOffset, int& endOffset)
    697 {
    698     codeBlock->expressionRangeForBytecodeOffset(bytecodeOffset, divot, startOffset, endOffset);
    699     divot += startOffset;
    700 }
    701 
    702 String StackFrame::toString(CallFrame* callFrame)
    703 {
    704     StringBuilder traceBuild;
    705     String functionName = friendlyFunctionName(callFrame);
    706     String sourceURL = friendlySourceURL();
    707     traceBuild.append(functionName);
    708     if (!sourceURL.isEmpty()) {
    709         if (!functionName.isEmpty())
    710             traceBuild.append('@');
    711         traceBuild.append(sourceURL);
    712         if (codeType != StackFrameNativeCode) {
    713             traceBuild.append(':');
    714             traceBuild.appendNumber(line());
    715         }
    716     }
    717     return traceBuild.toString().impl();
    718 }
    719 
    720 void Interpreter::getStackTrace(JSGlobalData* globalData, Vector<StackFrame>& results, size_t maxStackSize)
     683void Interpreter::getStackTrace(JSGlobalData* globalData, Vector<StackFrame>& results)
    721684{
    722685    CallFrame* callFrame = globalData->topCallFrame->removeHostCallFrameFlag();
    723686    if (!callFrame || callFrame == CallFrame::noCaller())
    724687        return;
    725     unsigned bytecodeOffset = getBytecodeOffsetForCallFrame(callFrame);
     688    int line = getLineNumberForCallFrame(globalData, callFrame);
     689
    726690    callFrame = callFrame->trueCallFrameFromVMCode();
    727691    if (!callFrame)
    728692        return;
    729     CodeBlock* callerCodeBlock = callFrame->codeBlock();
    730 
    731     while (callFrame && callFrame != CallFrame::noCaller() && maxStackSize--) {
     693
     694    while (callFrame && callFrame != CallFrame::noCaller()) {
    732695        String sourceURL;
    733         if (callerCodeBlock) {
     696        if (callFrame->codeBlock()) {
    734697            sourceURL = getSourceURLFromCallFrame(callFrame);
    735             StackFrame s = {
    736                 Strong<JSObject>(*globalData, callFrame->callee()),
    737                 getStackFrameCodeType(callFrame),
    738                 Strong<ExecutableBase>(*globalData, callerCodeBlock->ownerExecutable()),
    739                 Strong<UnlinkedCodeBlock>(*globalData, callerCodeBlock->unlinkedCodeBlock()),
    740                 callerCodeBlock->source(),
    741                 callerCodeBlock->ownerExecutable()->lineNo(),
    742                 callerCodeBlock->sourceOffset(),
    743                 bytecodeOffset,
    744                 sourceURL
    745             };
     698            StackFrame s = { Strong<JSObject>(*globalData, callFrame->callee()), getStackFrameCodeType(callFrame), Strong<ExecutableBase>(*globalData, callFrame->codeBlock()->ownerExecutable()), line, sourceURL};
    746699            results.append(s);
    747700        } else {
    748             StackFrame s = { Strong<JSObject>(*globalData, callFrame->callee()), StackFrameNativeCode, Strong<ExecutableBase>(), Strong<UnlinkedCodeBlock>(), 0, 0, 0, 0, String()};
     701            StackFrame s = { Strong<JSObject>(*globalData, callFrame->callee()), StackFrameNativeCode, Strong<ExecutableBase>(), -1, String()};
    749702            results.append(s);
    750703        }
    751         callFrame = getCallerInfo(globalData, callFrame, bytecodeOffset, callerCodeBlock);
    752     }
    753 }
    754 
    755 void Interpreter::addStackTraceIfNecessary(CallFrame* callFrame, JSValue error)
     704        unsigned unusedBytecodeOffset = 0;
     705        CodeBlock* unusedCallerCodeBlock = 0;
     706        callFrame = getCallerInfo(globalData, callFrame, line, unusedBytecodeOffset, unusedCallerCodeBlock);
     707    }
     708}
     709
     710void Interpreter::addStackTraceIfNecessary(CallFrame* callFrame, JSObject* error)
    756711{
    757712    JSGlobalData* globalData = &callFrame->globalData();
    758713    ASSERT(callFrame == globalData->topCallFrame || callFrame == callFrame->lexicalGlobalObject()->globalExec() || callFrame == callFrame->dynamicGlobalObject()->globalExec());
     714    if (error->hasProperty(callFrame, globalData->propertyNames->stack))
     715        return;
    759716
    760717    Vector<StackFrame> stackTrace;
    761718    getStackTrace(&callFrame->globalData(), stackTrace);
    762719   
    763     if (stackTrace.isEmpty() || !error.isObject())
     720    if (stackTrace.isEmpty())
    764721        return;
    765     JSObject* errorObject = asObject(error);
     722   
    766723    JSGlobalObject* globalObject = 0;
    767724    if (isTerminatedExecutionException(error) || isInterruptedExecutionException(error))
    768725        globalObject = globalData->dynamicGlobalObject;
    769726    else
    770         globalObject = errorObject->globalObject();
     727        globalObject = error->globalObject();
    771728
    772729    // FIXME: JSStringJoiner could be more efficient than StringBuilder here.
     
    777734            builder.append('\n');
    778735    }
    779 
    780     if (errorObject->hasProperty(callFrame, globalData->propertyNames->stack))
    781         return;
    782     errorObject->putDirect(*globalData, globalData->propertyNames->stack, jsString(globalData, builder.toString()), ReadOnly | DontDelete);
     736   
     737    error->putDirect(*globalData, globalData->propertyNames->stack, jsString(globalData, builder.toString()), ReadOnly | DontDelete);
    783738}
    784739
     
    14231378        return jsNull();
    14241379   
     1380    int lineNumber;
    14251381    unsigned bytecodeOffset;
    14261382    CodeBlock* unusedCallerCodeBlock = 0;
    1427     CallFrame* callerFrame = getCallerInfo(&callFrame->globalData(), functionCallFrame, bytecodeOffset, unusedCallerCodeBlock);
     1383    CallFrame* callerFrame = getCallerInfo(&callFrame->globalData(), functionCallFrame, lineNumber, bytecodeOffset, unusedCallerCodeBlock);
    14281384    if (!callerFrame)
    14291385        return jsNull();
     
    14351391    ASSERT(caller.isObject());
    14361392    while (asObject(caller)->inherits(&JSBoundFunction::s_info)) {
    1437         callerFrame = getCallerInfo(&callFrame->globalData(), callerFrame, bytecodeOffset, unusedCallerCodeBlock);
     1393        callerFrame = getCallerInfo(&callFrame->globalData(), callerFrame, lineNumber, bytecodeOffset, unusedCallerCodeBlock);
    14381394        if (!callerFrame)
    14391395            return jsNull();
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r147818 r147846  
    8080        StackFrameCodeType codeType;
    8181        Strong<ExecutableBase> executable;
    82         Strong<UnlinkedCodeBlock> codeBlock;
    83         RefPtr<SourceProvider> code;
    84         int lineOffset;
    85         unsigned characterOffset;
    86         unsigned bytecodeOffset;
     82        int line;
    8783        String sourceURL;
    88         JS_EXPORT_PRIVATE String toString(CallFrame*);
     84        String toString(CallFrame* callFrame) const
     85        {
     86            StringBuilder traceBuild;
     87            String functionName = friendlyFunctionName(callFrame);
     88            String sourceURL = friendlySourceURL();
     89            traceBuild.append(functionName);
     90            if (!sourceURL.isEmpty()) {
     91                if (!functionName.isEmpty())
     92                    traceBuild.append('@');
     93                traceBuild.append(sourceURL);
     94                if (line > -1) {
     95                    traceBuild.append(':');
     96                    traceBuild.appendNumber(line);
     97                }
     98            }
     99            return traceBuild.toString().impl();
     100        }
    89101        String friendlySourceURL() const
    90102        {
     
    126138            return traceLine.isNull() ? emptyString() : traceLine;
    127139        }
    128         JS_EXPORT_PRIVATE unsigned line();
    129         JS_EXPORT_PRIVATE unsigned column();
    130         JS_EXPORT_PRIVATE void expressionInfo(int& divot, int& startOffset, int& endOffset);
     140        unsigned friendlyLineNumber() const
     141        {
     142            return line > -1 ? line : 0;
     143        }
    131144    };
    132145
     
    220233        NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine, int column);
    221234        static const String getTraceLine(CallFrame*, StackFrameCodeType, const String&, int);
    222         JS_EXPORT_PRIVATE static void getStackTrace(JSGlobalData*, Vector<StackFrame>& results, size_t maxStackSize = std::numeric_limits<size_t>::max());
    223         static void addStackTraceIfNecessary(CallFrame*, JSValue error);
     235        JS_EXPORT_PRIVATE static void getStackTrace(JSGlobalData*, Vector<StackFrame>& results);
     236        static void addStackTraceIfNecessary(CallFrame*, JSObject* error);
    224237
    225238        void dumpSampleData(ExecState* exec);
  • trunk/Source/JavaScriptCore/runtime/Error.cpp

    r147818 r147846  
    156156JSValue throwError(ExecState* exec, JSValue error)
    157157{
    158     Interpreter::addStackTraceIfNecessary(exec, error);
     158    if (error.isObject())
     159        return throwError(exec, asObject(error));
    159160    exec->globalData().exception = error;
    160161    return error;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.h

    r147818 r147846  
    5555#include <wtf/Forward.h>
    5656#include <wtf/HashMap.h>
    57 #include <wtf/RefCountedArray.h>
    5857#include <wtf/SimpleStats.h>
    5958#include <wtf/ThreadSafeRefCounted.h>
     
    8382    class SourceProvider;
    8483    class SourceProviderCache;
    85     struct StackFrame;
    8684    class Stringifier;
    8785    class Structure;
     
    331329
    332330        JSValue exception;
    333         RefCountedArray<StackFrame> exceptionStack;
    334331
    335332        const ClassInfo* const jsArrayClassInfo;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r147818 r147846  
    598598        globalData.resetDateCache();
    599599    }
    600     // Clear the exception stack between entries
    601     globalData.exceptionStack = RefCountedArray<StackFrame>();
    602600}
    603601
  • trunk/Source/WebCore/ChangeLog

    r147843 r147846  
     12013-04-06  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Rolled out 147820 and 147818 because they caused plugins tests to ASSERT
     4        https://bugs.webkit.org/show_bug.cgi?id=114094
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * bindings/js/ScriptCallStackFactory.cpp:
     9        (WebCore::createScriptCallStack):
     10        * inspector/ScriptCallFrame.cpp:
     11        (WebCore::ScriptCallFrame::isEqual):
     12        * inspector/ScriptCallFrame.h:
     13        (ScriptCallFrame):
     14        (WebCore::ScriptCallFrame::lineNumber):
     15
    1162013-04-06  Anders Carlsson  <andersca@apple.com>
    217
  • trunk/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp

    r147818 r147846  
    5959    if (JSC::ExecState* exec = JSMainThreadExecState::currentState()) {
    6060        Vector<StackFrame> stackTrace;
    61         Interpreter::getStackTrace(&exec->globalData(), stackTrace, maxStackSize);
    62         for (size_t i = 0; i < stackTrace.size(); i++)
    63             frames.append(ScriptCallFrame(stackTrace[i].friendlyFunctionName(exec), stackTrace[i].friendlySourceURL(), stackTrace[i].line(), stackTrace[i].column()));
     61        Interpreter::getStackTrace(&exec->globalData(), stackTrace);
     62        for (Vector<StackFrame>::const_iterator iter = stackTrace.begin(); iter < stackTrace.end(); iter++) {
     63            frames.append(ScriptCallFrame(iter->friendlyFunctionName(exec), iter->friendlySourceURL(), iter->friendlyLineNumber()));
     64            if (frames.size() >= maxStackSize)
     65                break;
     66        }
    6467    }
    6568    if (frames.isEmpty() && !emptyIsAllowed) {
     
    6770        // a bound function is called from native code for example.
    6871        // Fallback to setting lineNumber to 0, and source and function name to "undefined".
    69         frames.append(ScriptCallFrame("undefined", "undefined", 0, 0));
     72        frames.append(ScriptCallFrame("undefined", "undefined", 0));
    7073    }
    7174    return ScriptCallStack::create(frames);
     
    7578{
    7679    Vector<ScriptCallFrame> frames;
    77     Vector<StackFrame> stackTrace;
    78     Interpreter::getStackTrace(&exec->globalData(), stackTrace, maxStackSize + 1);
    79     for (size_t i = 1; i < stackTrace.size(); i++) {
    80         // This early exit is necessary to maintain our old behaviour
    81         // but the stack trace we produce now is complete and handles all
    82         // ways in which code may be running
    83         if (!stackTrace[i].callee && frames.size())
     80    CallFrame* callFrame = exec;
     81    while (true) {
     82        ASSERT(callFrame);
     83        int signedLineNumber;
     84        intptr_t sourceID;
     85        String urlString;
     86        JSValue function;
     87
     88        exec->interpreter()->retrieveLastCaller(callFrame, signedLineNumber, sourceID, urlString, function);
     89        String functionName;
     90        if (function)
     91            functionName = jsCast<JSFunction*>(function)->name(exec);
     92        else {
     93            // Caller is unknown, but if frames is empty we should still add the frame, because
     94            // something called us, and gave us arguments.
     95            if (!frames.isEmpty())
     96                break;
     97        }
     98        unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
     99        frames.append(ScriptCallFrame(functionName, urlString, lineNumber));
     100        if (!function || frames.size() == maxStackSize)
    84101            break;
    85         String functionName = stackTrace[i].friendlyFunctionName(exec);
    86         frames.append(ScriptCallFrame(functionName, stackTrace[i].sourceURL, stackTrace[i].line(), stackTrace[i].column()));
     102        callFrame = callFrame->callerFrame();
    87103    }
    88 
    89104    return ScriptCallStack::create(frames);
    90105}
  • trunk/Source/WebCore/inspector/ScriptCallFrame.cpp

    r147818 r147846  
    5454    return m_functionName == o.m_functionName
    5555        && m_scriptName == o.m_scriptName
    56         && m_lineNumber == o.m_lineNumber
    57         && m_column == o.m_column;
     56        && m_lineNumber == o.m_lineNumber;
    5857}
    5958
  • trunk/Source/WebCore/inspector/ScriptCallFrame.h

    r147818 r147846  
    4545class ScriptCallFrame  {
    4646public:
    47     ScriptCallFrame(const String& functionName, const String& scriptName, unsigned lineNumber, unsigned column);
     47    ScriptCallFrame(const String& functionName, const String& scriptName, unsigned lineNumber, unsigned column = 0);
    4848    ~ScriptCallFrame();
    4949
     
    5151    const String& sourceURL() const { return m_scriptName; }
    5252    unsigned lineNumber() const { return m_lineNumber; }
    53     unsigned columnNumber() const { return m_column; }
    5453
    5554    bool isEqual(const ScriptCallFrame&) const;
  • trunk/Tools/ChangeLog

    r147833 r147846  
     12013-04-06  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Rolled out 147820 and 147818 because they caused plugins tests to ASSERT
     4        https://bugs.webkit.org/show_bug.cgi?id=114094
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Scripts/run-jsc:
     9
    1102013-04-05  Ojan Vafai  <ojan@chromium.org>
    211
  • trunk/Tools/Scripts/run-jsc

    r147818 r147846  
    4343GetOptions("count|c=i" => \$count,
    4444           "verbose|v" => \$verbose);
     45die "$usage\n" if (@ARGV < 1);
    4546
    4647my $jsc = jscProductDir() . "/jsc @ARGV";
Note: See TracChangeset for help on using the changeset viewer.