Ignore:
Timestamp:
Sep 27, 2011, 1:16:37 PM (14 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r96131.
http://trac.webkit.org/changeset/96131
https://bugs.webkit.org/show_bug.cgi?id=68927

It made 18+ tests crash on all platform (Requested by
Ossy_night on #webkit).

Patch by Sheriff Bot <[email protected]> on 2011-09-27

Source/JavaScriptCore:

(JSC::Interpreter::throwException):

  • interpreter/Interpreter.h:
  • jsc.cpp:

(GlobalObject::finishCreation):

  • parser/Parser.h:

(JSC::Parser::parse):

  • runtime/CommonIdentifiers.h:
  • runtime/Error.cpp:

(JSC::addErrorInfo):

  • runtime/Error.h:

LayoutTests:

  • fast/js/exception-properties-expected.txt:
  • fast/js/script-tests/exception-properties.js:
  • fast/js/script-tests/stack-trace.js: Removed.
  • fast/js/stack-trace-expected.txt: Removed.
  • fast/js/stack-trace.html: Removed.
  • platform/chromium/test_expectations.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r96131 r96146  
    4646#include "JSArray.h"
    4747#include "JSByteArray.h"
     48#include "JSFunction.h"
    4849#include "JSNotAnObject.h"
    4950#include "JSPropertyNameIterator.h"
     
    687688}
    688689
    689 static void getCallerLine(JSGlobalData* globalData, CallFrame* callFrame, int& lineNumber)
    690 {
    691     (void)globalData;
    692     unsigned bytecodeOffset;
    693     lineNumber = -1;
    694     callFrame = callFrame->removeHostCallFrameFlag();
    695 
    696     if (callFrame->callerFrame() == CallFrame::noCaller() || callFrame->callerFrame()->hasHostCallFrameFlag())
    697         return;
    698 
    699     CodeBlock* callerCodeBlock = callFrame->callerFrame()->removeHostCallFrameFlag()->codeBlock();
    700 
    701 #if ENABLE(INTERPRETER)
    702     if (!globalData->canUseJIT())
    703         bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnVPC());
    704 #if ENABLE(JIT)
    705     else
    706         bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnPC());
    707 #endif
    708 #else
    709     bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnPC());
    710 #endif
    711 
    712     lineNumber = callerCodeBlock->lineNumberForBytecodeOffset(bytecodeOffset - 1);
    713 }
    714 
    715 static ALWAYS_INLINE const UString getSourceURLFromCallFrame(CallFrame* callFrame)
    716 {
    717     if (callFrame->hasHostCallFrameFlag())
    718         return UString();
    719 #if ENABLE(INTERPRETER)
    720     if (!callFrame->globalData().canUseJIT())
    721         return callFrame->codeBlock()->source()->url();
    722 #if ENABLE(JIT)
    723     return callFrame->codeBlock()->ownerExecutable()->sourceURL();
    724 #endif
    725 #else
    726     return callFrame->codeBlock()->ownerExecutable()->sourceURL();
    727 #endif
    728 }
    729 
    730 static StackFrameCodeType getStackFrameCodeType(CallFrame* callFrame)
    731 {
    732     if (callFrame->hasHostCallFrameFlag())
    733         return StackFrameNativeCode;
    734 
    735     switch (callFrame->codeBlock()->codeType()) {
    736     case EvalCode:
    737         return StackFrameEvalCode;
    738     case FunctionCode:
    739         return StackFrameFunctionCode;
    740     case GlobalCode:
    741         return StackFrameGlobalCode;
    742     }
    743     ASSERT_NOT_REACHED();
    744     return StackFrameGlobalCode;
    745 }
    746 
    747 void Interpreter::getStackTrace(JSGlobalData* globalData, int line, Vector<StackFrame>& results)
    748 {
    749     int stackLimit = 15;
    750     CallFrame* callFrame = globalData->topCallFrame->removeHostCallFrameFlag();
    751     if (!callFrame || callFrame == CallFrame::noCaller() || !callFrame->codeBlock())
    752         return;
    753     UString sourceURL;
    754     UString traceLevel;
    755 
    756     for (int i = 0; i < stackLimit; ++i) {
    757         if (!callFrame || callFrame == CallFrame::noCaller())
    758             break;
    759         if (callFrame->codeBlock()) {
    760             sourceURL = getSourceURLFromCallFrame(callFrame);
    761 
    762             StackFrame s = { Strong<JSObject>(*globalData, callFrame->callee()), Strong<CallFrame>(*globalData, callFrame), getStackFrameCodeType(callFrame), Strong<ExecutableBase>(*globalData, callFrame->codeBlock()->ownerExecutable()), line, sourceURL};
    763 
    764             results.append(s);
    765         }
    766         getCallerLine(globalData, callFrame, line);
    767         callFrame = callFrame->callerFrame()->removeHostCallFrameFlag();
    768     }
    769 }
    770 
    771690NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSValue& exceptionValue, unsigned bytecodeOffset)
    772691{
     
    787706            // FIXME: should only really be adding these properties to VM generated exceptions,
    788707            // but the inspector currently requires these for all thrown objects.
    789             Vector<StackFrame> stackTrace;
    790             getStackTrace(&callFrame->globalData(), codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), stackTrace);
    791             addErrorInfo(callFrame, exception, codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), codeBlock->ownerExecutable()->source(), stackTrace);
     708            addErrorInfo(callFrame, exception, codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), codeBlock->ownerExecutable()->source());
    792709        }
    793710
Note: See TracChangeset for help on using the changeset viewer.