Ignore:
Timestamp:
Dec 7, 2009, 3:14:04 PM (15 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=32184
Handle out-of-memory conditions with JSC Ropes with a JS exception, rather than crashing.
Switch from using fastMalloc to tryFastMalloc, pass an ExecState to record the exception on.

Reviewed by Oliver Hunt.

JavaScriptCore:

  • API/JSCallbackObjectFunctions.h:

(JSC::::toString):

  • API/JSValueRef.cpp:

(JSValueIsStrictEqual):

(JSC::BytecodeGenerator::emitEqualityOp):

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::functionName):
(JSC::DebuggerCallFrame::calculatedFunctionName):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::callEval):
(JSC::Interpreter::privateExecute):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • profiler/ProfileGenerator.cpp:

(JSC::ProfileGenerator::addParentForConsoleStart):

  • profiler/Profiler.cpp:

(JSC::Profiler::willExecute):
(JSC::Profiler::didExecute):
(JSC::Profiler::createCallIdentifier):
(JSC::createCallIdentifierFromFunctionImp):

  • profiler/Profiler.h:
  • runtime/ArrayPrototype.cpp:

(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):

  • runtime/DateConstructor.cpp:

(JSC::constructDate):

  • runtime/FunctionPrototype.cpp:

(JSC::functionProtoFuncToString):

  • runtime/InternalFunction.cpp:

(JSC::InternalFunction::name):
(JSC::InternalFunction::displayName):
(JSC::InternalFunction::calculatedDisplayName):

  • runtime/InternalFunction.h:
  • runtime/JSCell.cpp:

(JSC::JSCell::getString):

  • runtime/JSCell.h:

(JSC::JSValue::getString):

  • runtime/JSONObject.cpp:

(JSC::gap):
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::appendStringifiedValue):

  • runtime/JSObject.cpp:

(JSC::JSObject::putDirectFunction):
(JSC::JSObject::putDirectFunctionWithoutTransition):
(JSC::JSObject::defineOwnProperty):

  • runtime/JSObject.h:
  • runtime/JSPropertyNameIterator.cpp:

(JSC::JSPropertyNameIterator::get):

  • runtime/JSString.cpp:

(JSC::JSString::Rope::~Rope):
(JSC::JSString::resolveRope):
(JSC::JSString::getPrimitiveNumber):
(JSC::JSString::toNumber):
(JSC::JSString::toString):
(JSC::JSString::toThisString):
(JSC::JSString::getStringPropertyDescriptor):

  • runtime/JSString.h:

(JSC::JSString::Rope::createOrNull):
(JSC::JSString::Rope::operator new):
(JSC::JSString::value):
(JSC::JSString::tryGetValue):
(JSC::JSString::getIndex):
(JSC::JSString::getStringPropertySlot):
(JSC::JSValue::toString):

  • runtime/JSValue.h:
  • runtime/NativeErrorConstructor.cpp:

(JSC::NativeErrorConstructor::NativeErrorConstructor):

  • runtime/Operations.cpp:

(JSC::JSValue::strictEqualSlowCase):

  • runtime/Operations.h:

(JSC::JSValue::equalSlowCaseInline):
(JSC::JSValue::strictEqualSlowCaseInline):
(JSC::JSValue::strictEqual):
(JSC::jsLess):
(JSC::jsLessEq):
(JSC::jsAdd):
(JSC::concatenateStrings):

  • runtime/PropertyDescriptor.cpp:

(JSC::PropertyDescriptor::equalTo):

  • runtime/PropertyDescriptor.h:
  • runtime/StringPrototype.cpp:

(JSC::stringProtoFuncReplace):
(JSC::stringProtoFuncToLowerCase):
(JSC::stringProtoFuncToUpperCase):

WebCore:

  • bindings/ScriptControllerBase.cpp:

(WebCore::ScriptController::executeIfJavaScriptURL):

  • bindings/js/JSCanvasRenderingContext2DCustom.cpp:

(WebCore::toHTMLCanvasStyle):
(WebCore::JSCanvasRenderingContext2D::setFillColor):
(WebCore::JSCanvasRenderingContext2D::setStrokeColor):
(WebCore::JSCanvasRenderingContext2D::setShadow):

  • bindings/js/ScriptCallStack.cpp:

(WebCore::ScriptCallStack::ScriptCallStack):
(WebCore::ScriptCallStack::initialize):

  • bindings/js/ScriptValue.cpp:

(WebCore::ScriptValue::getString):

  • bindings/js/ScriptValue.h:
  • bindings/js/SerializedScriptValue.cpp:

(WebCore::SerializingTreeWalker::convertIfTerminal):

  • bindings/objc/WebScriptObject.mm:

(+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):

  • page/Console.cpp:

(WebCore::Console::addMessage):

WebKit/mac:

  • WebView/WebView.mm:

(aeDescFromJSValue):

File:
1 edited

Legend:

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

    r51735 r51801  
    301301        return program;
    302302
    303     UString programSource = asString(program)->value();
     303    UString programSource = asString(program)->value(callFrame);
    304304
    305305    LiteralParser preparser(callFrame, programSource, LiteralParser::NonStrictJSON);
     
    13071307        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
    13081308        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    1309         callFrame->r(dst) = jsBoolean(JSValue::strictEqual(src1, src2));
     1309        callFrame->r(dst) = jsBoolean(JSValue::strictEqual(callFrame, src1, src2));
    13101310
    13111311        vPC += OPCODE_LENGTH(op_stricteq);
     
    13221322        JSValue src1 = callFrame->r(vPC[2].u.operand).jsValue();
    13231323        JSValue src2 = callFrame->r(vPC[3].u.operand).jsValue();
    1324         callFrame->r(dst) = jsBoolean(!JSValue::strictEqual(src1, src2));
     1324        callFrame->r(dst) = jsBoolean(!JSValue::strictEqual(callFrame, src1, src2));
    13251325
    13261326        vPC += OPCODE_LENGTH(op_nstricteq);
     
    24802480                    result = jsArray->JSArray::get(callFrame, i);
    24812481            } else if (isJSString(globalData, baseValue) && asString(baseValue)->canGetIndex(i))
    2482                 result = asString(baseValue)->getIndex(&callFrame->globalData(), i);
     2482                result = asString(baseValue)->getIndex(callFrame, i);
    24832483            else if (isJSByteArray(globalData, baseValue) && asByteArray(baseValue)->canAccessIndex(i))
    24842484                result = asByteArray(baseValue)->getIndex(callFrame, i);
     
    29162916            vPC += defaultOffset;
    29172917        else {
    2918             UString::Rep* value = asString(scrutinee)->value().rep();
     2918            UString::Rep* value = asString(scrutinee)->value(callFrame).rep();
    29192919            if (value->size() != 1)
    29202920                vPC += defaultOffset;
     
    29392939            vPC += defaultOffset;
    29402940        else
    2941             vPC += callFrame->codeBlock()->stringSwitchJumpTable(tableIndex).offsetForValue(asString(scrutinee)->value().rep(), defaultOffset);
     2941            vPC += callFrame->codeBlock()->stringSwitchJumpTable(tableIndex).offsetForValue(asString(scrutinee)->value(callFrame).rep(), defaultOffset);
    29422942        NEXT_INSTRUCTION();
    29432943    }
     
    35323532
    35333533        callFrame->r(dst) = concatenateStrings(callFrame, &callFrame->registers()[src], count);
     3534        CHECK_FOR_EXCEPTION();
    35343535        vPC += OPCODE_LENGTH(op_strcat);
    35353536
Note: See TracChangeset for help on using the changeset viewer.