1. 05 Nov, 2012 1 commit
    • fpizlo@apple.com's avatar
      Reduce the verbosity of referring to QNaN in JavaScriptCore · 3494d02f
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=101174
      
      Reviewed by Geoffrey Garen.
      
      Introduces a #define QNaN in JSValue.h, and replaces all previous uses of
      std::numeric_limits<double>::quiet_NaN() with QNaN.
      
      * API/JSValueRef.cpp:
      (JSValueMakeNumber):
      (JSValueToNumber):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::emitFloatTypedArrayGetByVal):
      * runtime/CachedTranscendentalFunction.h:
      (JSC::CachedTranscendentalFunction::initialize):
      * runtime/DateConstructor.cpp:
      (JSC::constructDate):
      * runtime/DateInstanceCache.h:
      (JSC::DateInstanceData::DateInstanceData):
      (JSC::DateInstanceCache::reset):
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::defaultValue):
      (JSC::TerminatedExecutionError::defaultValue):
      * runtime/JSCell.h:
      (JSC::JSValue::getPrimitiveNumber):
      * runtime/JSDateMath.cpp:
      (JSC::parseDateFromNullTerminatedCharacters):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::resetDateCache):
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::parseInt):
      (JSC::jsStrDecimalLiteral):
      (JSC::toDouble):
      (JSC::jsToNumber):
      (JSC::parseFloat):
      * runtime/JSValue.cpp:
      (JSC::JSValue::toNumberSlowCase):
      * runtime/JSValue.h:
      (JSC):
      * runtime/JSValueInlineMethods.h:
      (JSC::jsNaN):
      * runtime/MathObject.cpp:
      (JSC::mathProtoFuncMax):
      (JSC::mathProtoFuncMin):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3494d02f
  2. 22 Oct, 2012 1 commit
    • mark.lam@apple.com's avatar
      Change stack recursion checks to be based on stack availability. · 8b97fde5
      mark.lam@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=99872.
      
      Reviewed by Filip Pizlo and Geoffrey Garen.
      
      Source/JavaScriptCore: 
      
      - Remove m_reentryDepth, ThreadStackType which are now obsolete.
      - Replaced the reentryDepth checks with a StackBounds check.
      - Added the Interpreter::StackPolicy class to compute a reasonable
        stack capacity requirement given the native stack that the
        interpreter is executing on at that time.
      - Reserved an amount of JSStack space for the use of error handling
        and enable its use (using Interpreter::ErrorHandlingMode) when
        we're about to throw or report an exception.
      - Interpreter::StackPolicy also allows more native stack space
        to be used when in ErrorHandlingMode. This is needed in the case
        of native stack overflows.
      - Fixed the parser so that it throws a StackOverflowError instead of
        a SyntaxError when it encounters a stack overflow.
      
      * API/JSContextRef.cpp:
      (JSContextGroupCreate):
      (JSGlobalContextCreateInGroup):
      * JavaScriptCore.order:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::ErrorHandlingMode::ErrorHandlingMode):
      (JSC):
      (JSC::Interpreter::ErrorHandlingMode::~ErrorHandlingMode):
      (JSC::Interpreter::StackPolicy::StackPolicy):
      (JSC::Interpreter::Interpreter):
      (JSC::Interpreter::execute):
      (JSC::Interpreter::executeCall):
      (JSC::Interpreter::executeConstruct):
      (JSC::Interpreter::prepareForRepeatCall):
      * interpreter/Interpreter.h:
      (JSC):
      (Interpreter):
      (ErrorHandlingMode):
      (StackPolicy):
      (JSC::Interpreter::StackPolicy::requiredCapacity):
      * interpreter/JSStack.cpp:
      (JSC):
      (JSC::JSStack::JSStack):
      (JSC::JSStack::growSlowCase):
      (JSC::JSStack::enableErrorStackReserve):
      (JSC::JSStack::disableErrorStackReserve):
      * interpreter/JSStack.h:
      (JSStack):
      (JSC::JSStack::reservationEnd):
      (JSC):
      * jsc.cpp:
      (jscmain):
      * parser/Parser.cpp:
      (JSC::::Parser):
      * parser/Parser.h:
      (Parser):
      (JSC::::parse):
      * runtime/ExceptionHelpers.cpp:
      (JSC::throwStackOverflowError):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      (JSC::JSGlobalData::createContextGroup):
      (JSC::JSGlobalData::create):
      (JSC::JSGlobalData::createLeaked):
      (JSC::JSGlobalData::sharedInstance):
      * runtime/JSGlobalData.h:
      (JSC):
      (JSGlobalData):
      * runtime/StringRecursionChecker.h:
      (JSC::StringRecursionChecker::performCheck):
      * testRegExp.cpp:
      (realMain):
      
      Source/WebCore: 
      
      Removed the use of ThreadStackType. Enabled the reserved JSStack space
      for error processing before doing work in reportException().
      
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::reportException):
      * bindings/js/JSDOMWindowBase.cpp:
      (WebCore::JSDOMWindowBase::commonJSGlobalData):
      * bindings/js/WorkerScriptController.cpp:
      (WebCore::WorkerScriptController::WorkerScriptController):
      
      LayoutTests: 
      
      Updated test baseline.
      
      * fast/js/global-recursion-on-full-stack-expected.txt:
      * fast/xmlhttprequest/xmlhttprequest-recursive-sync-event-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8b97fde5
  3. 07 Sep, 2012 1 commit
    • benjamin@webkit.org's avatar
      Rename the ustring() accessor to string() · c9b7a208
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=95919
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-07
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore: 
      
      Rename ustring() to string() to make the accessor name more logical after
      r127191.
      
      * API/JSBase.cpp:
      (JSEvaluateScript):
      (JSCheckScriptSyntax):
      * API/JSObjectRef.cpp:
      (JSObjectMakeFunctionWithCallback):
      (JSObjectMakeFunction):
      (JSObjectCopyPropertyNames):
      * API/JSProfilerPrivate.cpp:
      (JSStartProfiling):
      (JSEndProfiling):
      * API/JSValueRef.cpp:
      (JSValueMakeString):
      (JSValueMakeFromJSONString):
      * API/OpaqueJSString.cpp:
      (OpaqueJSString::string):
      * API/OpaqueJSString.h:
      (OpaqueJSString):
      * bytecode/CodeBlock.cpp:
      (JSC::idName):
      (JSC::CodeBlock::dump):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::emitLoad):
      (JSC::BytecodeGenerator::addStringConstant):
      * bytecompiler/NodesCodegen.cpp:
      (JSC::RegExpNode::emitBytecode):
      (JSC::processClauseList):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * jsc.cpp:
      (GlobalObject::addFunction):
      (GlobalObject::addConstructableFunction):
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      * parser/ASTBuilder.h:
      (JSC::ASTBuilder::createRegExp):
      * parser/Parser.cpp:
      (JSC::::parsePrimaryExpression):
      * parser/Parser.h:
      (JSC::Scope::declareVariable):
      (JSC::Scope::declareParameter):
      (JSC::Scope::useVariable):
      * parser/SyntaxChecker.h:
      (JSC::SyntaxChecker::createRegExp):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createUndefinedVariableError):
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::paramString):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::finishCreation):
      * runtime/FunctionPrototype.cpp:
      (JSC::FunctionPrototype::addFunctionProperties):
      * runtime/Identifier.h:
      (JSC::Identifier::string):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::calculatedDisplayName):
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      * runtime/JSONObject.cpp:
      (JSC::PropertyNameForFunctionCall::value):
      (JSC::Stringifier::Holder::appendNextProperty):
      (JSC::Walker::walk):
      * runtime/JSPropertyNameIterator.h:
      (JSC::JSPropertyNameIterator::finishCreation):
      * runtime/JSScope.cpp:
      (JSC::JSScope::resolveBase):
      * runtime/JSString.h:
      (JSC::inlineJSValueNotStringtoString):
      * runtime/LiteralParser.cpp:
      (JSC::::parse):
      * runtime/ObjectConstructor.cpp:
      (JSC::ObjectConstructor::finishCreation):
      (JSC::objectConstructorGetOwnPropertyNames):
      (JSC::objectConstructorKeys):
      * runtime/RegExpConstructor.cpp:
      (JSC::RegExpConstructor::finishCreation):
      
      Source/WebCore: 
      
      * bindings/js/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
      (WebCore::Dictionary::getOwnPropertyNames):
      * bindings/js/SerializedScriptValue.cpp:
      Simplify a few String constructions which were still using type conversion
      through StringImpl.
      
      (WebCore::CloneSerializer::write):
      (WebCore::CloneDeserializer::CachedString::string):
      (WebCore::CloneDeserializer::readFile):
      (WebCore::CloneDeserializer::readTerminal):
      (WebCore::CloneDeserializer::deserialize):
      * bridge/NP_jsobject.cpp:
      (_NPN_Enumerate):
      
      Source/WebKit/efl: 
      
      * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
      (DumpRenderTreeSupportEfl::sendWebIntentResponse):
      (DumpRenderTreeSupportEfl::deliverWebIntent):
      Aslo update the code from the UString->String conversion through StringImpl.
      
      Source/WebKit/mac: 
      
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::enumerate):
      
      Source/WebKit2: 
      
      * WebProcess/Plugins/Netscape/NPJSObject.cpp:
      (WebKit::NPJSObject::enumerate):
      
      Tools: 
      
      Update EFL's DRT.
      
      Fix some string conversion that have been made useless
      with recent changes.
      
      * DumpRenderTree/efl/EventSender.cpp:
      (keyPadNameFromJSValue):
      (keyNameFromJSValue):
      * DumpRenderTree/efl/TestRunnerEfl.cpp:
      (TestRunner::queueLoad):
      (TestRunner::addOriginAccessWhitelistEntry):
      (TestRunner::removeOriginAccessWhitelistEntry):
      (TestRunner::setUserStyleSheetLocation):
      (TestRunner::setValueForUser):
      (TestRunner::elementDoesAutoCompleteForElementWithId):
      (TestRunner::execCommand):
      (TestRunner::findString):
      (TestRunner::isCommandEnabled):
      (TestRunner::clearApplicationCacheForOrigin):
      (TestRunner::setDomainRelaxationForbiddenForURLScheme):
      (TestRunner::pauseAnimationAtTimeOnElementWithId):
      (TestRunner::pauseTransitionAtTimeOnElementWithId):
      (toInt):
      (TestRunner::overridePreference):
      (TestRunner::addUserScript):
      (TestRunner::addUserStyleSheet):
      (TestRunner::evaluateInWebInspector):
      (TestRunner::evaluateScriptInIsolatedWorld):
      (TestRunner::setTextDirection):
      * DumpRenderTree/efl/WorkQueueItemEfl.cpp:
      (LoadItem::invoke):
      (LoadHTMLStringItem::invoke):
      (ScriptItem::invoke):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c9b7a208
  4. 04 Sep, 2012 1 commit
    • benjamin@webkit.org's avatar
      Improve JSC use of Strings after the UString->String change · 762e2c65
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=95633
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-04
      Reviewed by Geoffrey Garen.
      
      This patch improve the use of strings in the JSC runtime.
      
      The initialization of Identifier is left for future patches.
      
      The improvements are the following:
      -5% faster to raise one of the modified exception.
      -3 times faster to execute Boolean::toString()
      
      Most of the changes are just about using the new methods
      for string literals.
      
      With the changes, the binary on x86_64 gets 176 bytes smaller.
      
      * API/JSCallbackObjectFunctions.h:
      (JSC::::staticFunctionGetter):
      (JSC::::callbackGetter):
      * API/JSContextRef.cpp:
      (JSContextCreateBacktrace):
      * API/JSObjectRef.cpp:
      (JSObjectMakeFunctionWithCallback):
      * bytecode/CodeBlock.cpp:
      (JSC::valueToSourceString):
      (JSC::CodeBlock::nameForRegister):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::addStackTraceIfNecessary):
      * runtime/ArrayConstructor.cpp:
      (JSC::constructArrayWithSizeQuirk):
      * runtime/ArrayPrototype.cpp:
      (JSC::shift):
      (JSC::unshift):
      (JSC::arrayProtoFuncPop):
      (JSC::arrayProtoFuncReverse):
      * runtime/BooleanPrototype.cpp:
      (JSC::booleanProtoFuncToString): Instead of instanciating new strings, reuse the
      keywords available in SmallStrings. Avoiding the creation of the JSString and StringImpl
      makes the method significantly faster.
      
      * runtime/DateConversion.cpp:
      (JSC::formatDateTime):
      * runtime/DatePrototype.cpp:
      (JSC::formatLocaleDate):
      (JSC::formateDateInstance):
      (JSC::dateProtoFuncToISOString):
      Change the way we use snprintf() for clarity and performance.
      
      Instead of allocating one extra byte to put a zero "just in case", we use the size returned
      by snprintf().
      To prevent any overflow from a programming mistake, we explicitely test for overflow and
      return an empty string.
      
      (JSC::dateProtoFuncToJSON):
      * runtime/Error.cpp:
      (JSC::createNotEnoughArgumentsError):
      (JSC::throwTypeError):
      (JSC::throwSyntaxError):
      * runtime/Error.h:
      (JSC::StrictModeTypeErrorFunction::create):
      * runtime/ErrorPrototype.cpp:
      (JSC::ErrorPrototype::finishCreation):
      (JSC::errorProtoFuncToString):
      Using a null String is correct because (8) uses jsString(), (9) tests for a length of 0.
      
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::defaultValue):
      (JSC::TerminatedExecutionError::defaultValue):
      (JSC::createStackOverflowError):
      (JSC::createOutOfMemoryError):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::FunctionExecutable::paramString):
      * runtime/FunctionConstructor.cpp:
      (JSC::constructFunction):
      (JSC::constructFunctionSkippingEvalEnabledCheck):
      * runtime/FunctionPrototype.h:
      (JSC::FunctionPrototype::create):
      Using a null String for the name is correct because InternalFunction uses jsString()
      to create the name value.
      
      * runtime/InternalFunction.cpp:
      (JSC::InternalFunction::finishCreation):
      There is no need to create an empty string for a null string, jsString() handle both
      cases as empty JSString.
      
      * runtime/JSArray.cpp:
      (JSC::reject):
      (JSC::SparseArrayValueMap::put):
      (JSC::JSArray::put):
      (JSC::JSArray::putByIndexBeyondVectorLength):
      (JSC::JSArray::putDirectIndexBeyondVectorLength):
      (JSC::JSArray::setLength):
      (JSC::JSArray::pop):
      (JSC::JSArray::push):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::finishCreation): Same issue as InternalFunction::finishCreation.
      
      (JSC::JSFunction::callerGetter):
      (JSC::JSFunction::defineOwnProperty):
      * runtime/JSGlobalData.cpp:
      (JSC::enableAssembler): Use CFSTR() instead of CFStringCreateWithCString().
      CFStringCreateWithCString() copy the content and may choose to decode the data.
      CFSTR() is much more efficient.
      
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::reset):
      JSFunction uses jsString() to create the name, we can use null strings instead
      of creating empty strings.
      
      (JSC::JSGlobalObject::createThrowTypeError): ditto.
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::encode):
      (JSC::decode):
      (JSC::globalFuncEval):
      * runtime/JSONObject.cpp:
      (JSC::Stringifier::appendStringifiedValue):
      (JSC::Stringifier::Holder::appendNextProperty):
      (JSC::JSONProtoFuncParse):
      (JSC::JSONProtoFuncStringify):
      * runtime/JSObject.cpp:
      (JSC::JSObject::put):
      (JSC::JSObject::defaultValue):
      (JSC::JSObject::hasInstance):
      (JSC::JSObject::defineOwnProperty):
      * runtime/JSString.cpp:
      Return an empty JSString to avoid the creation of a temporary empty String.
      
      (JSC::JSRopeString::getIndexSlowCase):
      * runtime/JSString.h:
      (JSC): Remove the versions of jsNontrivialString() taking a char*. All the callers
      have been replaced by calls using ASCIILiteral.
      
      * runtime/JSValue.cpp:
      (JSC::JSValue::putToPrimitive):
      * runtime/LiteralParser.cpp:
      (JSC::::Lexer::lex):
      (JSC::::Lexer::lexString):
      (JSC::::Lexer::lexNumber):
      (JSC::::parse):
      * runtime/LiteralParser.h:
      (JSC::LiteralParser::getErrorMessage):
      * runtime/NumberPrototype.cpp:
      (JSC::numberProtoFuncToExponential):
      (JSC::numberProtoFuncToFixed):
      (JSC::numberProtoFuncToPrecision):
      (JSC::numberProtoFuncToString):
      * runtime/ObjectConstructor.cpp:
      (JSC::objectConstructorGetPrototypeOf):
      (JSC::objectConstructorGetOwnPropertyDescriptor):
      (JSC::objectConstructorGetOwnPropertyNames):
      (JSC::objectConstructorKeys):
      (JSC::toPropertyDescriptor):
      (JSC::objectConstructorDefineProperty):
      (JSC::objectConstructorDefineProperties):
      (JSC::objectConstructorCreate):
      (JSC::objectConstructorSeal):
      (JSC::objectConstructorFreeze):
      (JSC::objectConstructorPreventExtensions):
      (JSC::objectConstructorIsSealed):
      (JSC::objectConstructorIsFrozen):
      (JSC::objectConstructorIsExtensible):
      * runtime/ObjectPrototype.cpp:
      (JSC::objectProtoFuncDefineGetter):
      (JSC::objectProtoFuncDefineSetter):
      (JSC::objectProtoFuncToString):
      * runtime/RegExpConstructor.cpp:
      (JSC::constructRegExp):
      * runtime/RegExpObject.cpp:
      (JSC::reject):
      (JSC::regExpObjectSource):
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncCompile):
      * runtime/StringObject.cpp:
      (JSC::StringObject::defineOwnProperty):
      * runtime/StringPrototype.cpp:
      (JSC::jsSpliceSubstrings):
      (JSC::jsSpliceSubstringsWithSeparators):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      762e2c65
  5. 30 Aug, 2012 1 commit
    • benjamin@webkit.org's avatar
      Replace JSC::UString by WTF::String · cff06e46
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=95271
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-08-30
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore: 
      
      Having JSC::UString and WTF::String increase the complexity of working on WebKit, and
      add useless conversions in the bindings. It also cause some code bloat.
      
      The performance advantages of UString have been ported over in previous patches. This patch
      is the last step: getting rid of UString.
      
      In addition to the simplified code, this also reduce the binary size by 15kb on x86_64.
      
      * API/OpaqueJSString.cpp:
      (OpaqueJSString::ustring):
      * runtime/Identifier.h:
      (JSC::Identifier::ustring):
      To avoid changing everything at once, the function named ustring() were kept as is. They
      will be renamed in a follow up patch.
      
      * runtime/JSString.h:
      (JSC::JSString::string):
      (JSC::JSValue::toWTFString):
      (JSC::inlineJSValueNotStringtoString):
      (JSC::JSValue::toWTFStringInline):
      Since JSValue::toString() already exist (and return the JSString), the direct accessor is renamed
      to ::toWTFString(). We may change ::string() to ::jsString() and ::toWTFString() to ::toString()
      in the future.
      
      * runtime/StringPrototype.cpp:
      (JSC::substituteBackreferencesSlow): Replace the use of UString::getCharacters<>() by String::getCharactersWithUpconvert<>().
      
      Source/WebCore: 
      
      Update the code to use String instead of UString.
      
      On x86_64, this reduces the binary size by 22kb.
      
      Since it is no longer possible to differenciate JSC::jsString() and WebCore::jsString() by the input
      types, WebCore::jsString() is renated to WebCore::jsStringWithCache().
      
      Since the cache is using a PtrHash, JSC::jsString() is used in place of the old WebCore::jsString() when
      the string is generated locally. This is because the cache can never match in those cases.
      
      Source/WebKit/blackberry: 
      
      Replace UString by String.
      
      * WebCoreSupport/ClientExtension.cpp:
      * WebCoreSupport/PagePopupBlackBerry.cpp:
      (WebCore::PagePopupBlackBerry::installDomFunction):
      
      Source/WebKit/efl: 
      
      Replace UString by String.
      
      * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
      (DumpRenderTreeSupportEfl::sendWebIntentResponse):
      * ewk/ewk_frame.cpp:
      (ewk_frame_script_execute):
      
      Source/WebKit/gtk: 
      
      Replace UString by String.
      
      * gdom/ConvertToGCharPrivate.h:
      (copyAsGchar):
      
      Source/WebKit/mac: 
      
      Get rid of UString, replace it by String, and simplify the code when possible.
      
      On x86_64, this reduces the binary size by 7kb.
      
      * Plugins/Hosted/NetscapePluginHostProxy.mm:
      (identifierFromIdentifierRep):
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::addValueToArray):
      (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):
      * Plugins/Hosted/ProxyInstance.mm:
      (WebKit::ProxyRuntimeMethod::create):
      (WebKit::ProxyRuntimeMethod::finishCreation):
      (WebKit::ProxyInstance::getPropertyNames):
      (WebKit::ProxyInstance::methodsNamed):
      (WebKit::ProxyInstance::fieldNamed):
      * WebView/WebFrame.mm:
      (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
      (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
      * WebView/WebScriptDebugDelegate.mm:
      (-[WebScriptCallFrame functionName]):
      (-[WebScriptCallFrame evaluateWebScript:]):
      * WebView/WebScriptDebugger.h:
      (WTF):
      (JSC):
      (WebScriptDebugger):
      * WebView/WebScriptDebugger.mm:
      (toNSURL):
      (WebScriptDebugger::sourceParsed):
      * WebView/WebView.mm:
      (aeDescFromJSValue):
      
      Source/WebKit/qt: 
      
      Replace UString by String.
      
      * Api/qwebelement.cpp:
      (QWebElement::evaluateJavaScript):
      
      Source/WebKit/win: 
      
      Replace UString by String.
      
      * WebFrame.cpp:
      (WebFrame::stringByEvaluatingJavaScriptInScriptWorld):
      * WebView.cpp:
      (WebView::stringByEvaluatingJavaScriptFromString):
      
      Source/WebKit/wx: 
      
      Update the #includes to use the correct types.
      
      * WebFrame.cpp:
      * WebView.cpp:
      
      Source/WebKit2: 
      
      Update to code to switch from UString to String.
      
      * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
      (WebKit::JSNPMethod::finishCreation):
      * WebProcess/Plugins/Netscape/JSNPMethod.h:
      (WebKit::JSNPMethod::create):
      (JSNPMethod):
      * WebProcess/Plugins/Netscape/JSNPObject.cpp:
      (WebKit::npIdentifierFromIdentifier):
      * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
      (WebKit::NPRuntimeObjectMap::evaluate):
      (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState):
      
      Source/WTF: 
      
      * wtf/Platform.h: Useless edit to force a full build. This is needed for some bots for some reason.
      * wtf/text/WTFString.h: Export a symbol that was exported on UString and needed in WebCore.
      
      Add String::getCharactersWithUpconvert<>(), which is similar to String::getCharacters<>() but with the same
      behaviors as UString::getCharacters<>().
      
      String::getCharactersWithUpconvert<>() is useful when manipulating multiple strings, it allow writting code
      using 16bits characters if any of the input String is not 8bit.
      
      Tools: 
      
      Get rid of UString.
      
      * DumpRenderTree/efl/WorkQueueItemEfl.cpp:
      * gdb/webkit.py:
      (WTFStringPrinter.to_string):
      (JSCIdentifierPrinter.to_string):
      (JSCJSStringPrinter.to_string):
      (add_pretty_printers):
      
      Websites/webkit.org: 
      
      Update the coding style to avoid mentioning a class that no longer exist.
      
      * coding/coding-style.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cff06e46
  6. 24 Jan, 2012 1 commit
    • ggaren@apple.com's avatar
      JSValue::toString() should return a JSString* instead of a UString · 64be5e90
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=76861
      
      ../JavaScriptCore: 
      
      Reviewed by Gavin Barraclough.
              
      This makes the common case -- toString() on a string -- faster and
      inline-able. (Not a measureable speedup, but we can now remove a bunch
      of duplicate hand-rolled code for this optimization.)
              
      This also clarifies the boundary between "C++ strings" and "JS strings".
              
      In all cases other than true, false, null, undefined, and multi-digit
      numbers, the JS runtime was just retrieving a UString from a JSString,
      so returning a JSString* is strictly better. In the other cases, we can
      optimize to avoid creating a new JSString if we care to, but it doesn't
      seem to be a big deal.
      
      * JavaScriptCore.exp: Export!
              
      * jsc.cpp:
      (functionPrint):
      (functionDebug):
      (functionRun):
      (functionLoad):
      (functionCheckSyntax):
      (runWithScripts):
      (runInteractive):
      * API/JSValueRef.cpp:
      (JSValueToStringCopy):
      * bytecode/CodeBlock.cpp:
      (JSC::valueToSourceString): Call value() after calling toString(), to
      convert from "JS string" (JSString*) to "C++ string" (UString), since
      toString() no longer returns a "C++ string".
      
      * dfg/DFGOperations.cpp:
      (JSC::DFG::operationValueAddNotNumber):
      * jit/JITStubs.cpp:
      (op_add): Updated for removal of toPrimitiveString():
      all '+' operands can use toString(), except for object operands, which
      need to take a slow path to call toPrimitive().
      
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncToString):
      (JSC::arrayProtoFuncToLocaleString):
      (JSC::arrayProtoFuncJoin):
      (JSC::arrayProtoFuncPush):
      * runtime/CommonSlowPaths.h:
      (JSC::CommonSlowPaths::opIn):
      * runtime/DateConstructor.cpp:
      (JSC::dateParse):
      * runtime/DatePrototype.cpp:
      (JSC::formatLocaleDate): Call value() after calling toString(), as above.
      
      * runtime/ErrorInstance.h:
      (JSC::ErrorInstance::create): Simplified down to one canonical create()
      function, to make string handling easier.
      
      * runtime/ErrorPrototype.cpp:
      (JSC::errorProtoFuncToString):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createInvalidParamError):
      (JSC::createNotAConstructorError):
      (JSC::createNotAFunctionError):
      (JSC::createNotAnObjectError):
      * runtime/FunctionConstructor.cpp:
      (JSC::constructFunctionSkippingEvalEnabledCheck):
      * runtime/FunctionPrototype.cpp:
      (JSC::functionProtoFuncBind):
      * runtime/JSArray.cpp:
      (JSC::JSArray::sort): Call value() after calling toString(), as above.
      
      * runtime/JSCell.cpp:
      * runtime/JSCell.h: Removed JSCell::toString() because JSValue does this
      job now. Doing it in JSCell is slower (requires extra type checking), and
      creates the misimpression that language-defined toString() behavior is
      an implementation detail of JSCell.
              
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::encode):
      (JSC::decode):
      (JSC::globalFuncEval):
      (JSC::globalFuncParseInt):
      (JSC::globalFuncParseFloat):
      (JSC::globalFuncEscape):
      (JSC::globalFuncUnescape): Call value() after calling toString(), as above.
      
      * runtime/JSONObject.cpp:
      (JSC::unwrapBoxedPrimitive):
      (JSC::Stringifier::Stringifier):
      (JSC::JSONProtoFuncParse): Removed some manual optimization that toString()
      takes care of.
      
      * runtime/JSObject.cpp:
      (JSC::JSObject::toString):
      * runtime/JSObject.h: Updated to return JSString*.
      
      * runtime/JSString.cpp:
      * runtime/JSString.h:
      (JSC::JSValue::toString): Removed, since I removed JSCell::toString().
      
      * runtime/JSValue.cpp:
      (JSC::JSValue::toStringSlowCase): Removed toPrimitiveString(), and re-
      spawned toStringSlowCase() from its zombie corpse, since toPrimitiveString()
      basically did what we want all the time. (Note that the toPrimitive()
      preference changes from NoPreference to PreferString, because that's
      how ToString is defined in the language. op_add does not want this behavior.)
      
      * runtime/NumberPrototype.cpp:
      (JSC::numberProtoFuncToString):
      (JSC::numberProtoFuncToLocaleString): A little simpler, now that toString()
      returns a JSString*.
      
      * runtime/ObjectConstructor.cpp:
      (JSC::objectConstructorGetOwnPropertyDescriptor):
      (JSC::objectConstructorDefineProperty):
      * runtime/ObjectPrototype.cpp:
      (JSC::objectProtoFuncHasOwnProperty):
      (JSC::objectProtoFuncDefineGetter):
      (JSC::objectProtoFuncDefineSetter):
      (JSC::objectProtoFuncLookupGetter):
      (JSC::objectProtoFuncLookupSetter):
      (JSC::objectProtoFuncPropertyIsEnumerable): More calls to value(), as above.
      
      * runtime/Operations.cpp:
      (JSC::jsAddSlowCase): Need to check for object before taking the toString()
      fast path becuase adding an object to a string requires calling toPrimitive()
      on the object, not toString(). (They differ in their preferred conversion
      type.)
      
      * runtime/Operations.h:
      (JSC::jsString):
      (JSC::jsStringFromArguments): This code gets simpler, now that toString()
      does the right thing.
      
      (JSC::jsAdd): Now checks for object, just like jsAddSlowCase().
      
      * runtime/RegExpConstructor.cpp:
      (JSC::setRegExpConstructorInput):
      (JSC::constructRegExp):
      * runtime/RegExpObject.cpp:
      (JSC::RegExpObject::match):
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncCompile):
      (JSC::regExpProtoFuncToString): More calls to value(), as above.
      
      * runtime/StringConstructor.cpp:
      (JSC::constructWithStringConstructor):
      (JSC::callStringConstructor): This code gets simpler, now that toString()
      does the right thing.
      
      * runtime/StringPrototype.cpp:
      (JSC::replaceUsingRegExpSearch):
      (JSC::replaceUsingStringSearch):
      (JSC::stringProtoFuncReplace):
      (JSC::stringProtoFuncCharAt):
      (JSC::stringProtoFuncCharCodeAt):
      (JSC::stringProtoFuncConcat):
      (JSC::stringProtoFuncIndexOf):
      (JSC::stringProtoFuncLastIndexOf):
      (JSC::stringProtoFuncMatch):
      (JSC::stringProtoFuncSearch):
      (JSC::stringProtoFuncSlice):
      (JSC::stringProtoFuncSplit):
      (JSC::stringProtoFuncSubstr):
      (JSC::stringProtoFuncSubstring):
      (JSC::stringProtoFuncToLowerCase):
      (JSC::stringProtoFuncToUpperCase):
      (JSC::stringProtoFuncLocaleCompare):
      (JSC::stringProtoFuncBig):
      (JSC::stringProtoFuncSmall):
      (JSC::stringProtoFuncBlink):
      (JSC::stringProtoFuncBold):
      (JSC::stringProtoFuncFixed):
      (JSC::stringProtoFuncItalics):
      (JSC::stringProtoFuncStrike):
      (JSC::stringProtoFuncSub):
      (JSC::stringProtoFuncSup):
      (JSC::stringProtoFuncFontcolor):
      (JSC::stringProtoFuncFontsize):
      (JSC::stringProtoFuncAnchor):
      (JSC::stringProtoFuncLink):
      (JSC::trimString): Some of this code gets simpler, now that toString()
      does the right thing. More calls to value(), as above.
      
      ../JavaScriptGlue: 
      
      Reviewed by Gavin Barraclough.
      
      * JSUtils.cpp:
      (KJSValueToCFTypeInternal):
      
      ../WebCore: 
      
      Reviewed by Gavin Barraclough.
      
      Mechanical changes to call value() after calling toString(), to
      convert from "JS string" (JSString*) to "C++ string" (UString), since
      toString() no longer returns a "C++ string".
      
      * bindings/js/IDBBindingUtilities.cpp:
      (WebCore::createIDBKeyFromValue):
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
      * bindings/js/JSClipboardCustom.cpp:
      (WebCore::JSClipboard::clearData):
      (WebCore::JSClipboard::getData):
      * bindings/js/JSCustomXPathNSResolver.cpp:
      (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::valueToStringWithNullCheck):
      (WebCore::valueToStringWithUndefinedOrNullCheck):
      (WebCore::reportException):
      * bindings/js/JSDOMFormDataCustom.cpp:
      (WebCore::JSDOMFormData::append):
      * bindings/js/JSDOMStringMapCustom.cpp:
      (WebCore::JSDOMStringMap::putDelegate):
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::JSDOMWindow::setLocation):
      (WebCore::JSDOMWindow::open):
      (WebCore::JSDOMWindow::addEventListener):
      (WebCore::JSDOMWindow::removeEventListener):
      * bindings/js/JSDeviceMotionEventCustom.cpp:
      (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
      * bindings/js/JSDeviceOrientationEventCustom.cpp:
      (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
      * bindings/js/JSDictionary.cpp:
      (WebCore::JSDictionary::convertValue):
      * bindings/js/JSDocumentCustom.cpp:
      (WebCore::JSDocument::setLocation):
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::handleEvent):
      * bindings/js/JSHTMLAllCollectionCustom.cpp:
      (WebCore::callHTMLAllCollection):
      (WebCore::JSHTMLAllCollection::item):
      (WebCore::JSHTMLAllCollection::namedItem):
      * bindings/js/JSHTMLCanvasElementCustom.cpp:
      (WebCore::JSHTMLCanvasElement::getContext):
      * bindings/js/JSHTMLCollectionCustom.cpp:
      (WebCore::JSHTMLCollection::item):
      (WebCore::JSHTMLCollection::namedItem):
      * bindings/js/JSHTMLDocumentCustom.cpp:
      (WebCore::documentWrite):
      * bindings/js/JSHTMLInputElementCustom.cpp:
      (WebCore::JSHTMLInputElement::setSelectionDirection):
      (WebCore::JSHTMLInputElement::setSelectionRange):
      * bindings/js/JSInspectorFrontendHostCustom.cpp:
      (WebCore::JSInspectorFrontendHost::showContextMenu):
      * bindings/js/JSJavaScriptCallFrameCustom.cpp:
      (WebCore::JSJavaScriptCallFrame::evaluate):
      * bindings/js/JSLocationCustom.cpp:
      (WebCore::JSLocation::setHref):
      (WebCore::JSLocation::setProtocol):
      (WebCore::JSLocation::setHost):
      (WebCore::JSLocation::setHostname):
      (WebCore::JSLocation::setPort):
      (WebCore::JSLocation::setPathname):
      (WebCore::JSLocation::setSearch):
      (WebCore::JSLocation::setHash):
      (WebCore::JSLocation::replace):
      (WebCore::JSLocation::assign):
      * bindings/js/JSMessageEventCustom.cpp:
      (WebCore::handleInitMessageEvent):
      * bindings/js/JSSQLTransactionCustom.cpp:
      (WebCore::JSSQLTransaction::executeSql):
      * bindings/js/JSSQLTransactionSyncCustom.cpp:
      (WebCore::JSSQLTransactionSync::executeSql):
      * bindings/js/JSSharedWorkerCustom.cpp:
      (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
      * bindings/js/JSStorageCustom.cpp:
      (WebCore::JSStorage::putDelegate):
      * bindings/js/JSWebGLRenderingContextCustom.cpp:
      (WebCore::JSWebGLRenderingContext::getExtension):
      * bindings/js/JSWebSocketCustom.cpp:
      (WebCore::JSWebSocketConstructor::constructJSWebSocket):
      (WebCore::JSWebSocket::send):
      (WebCore::JSWebSocket::close):
      * bindings/js/JSWorkerContextCustom.cpp:
      (WebCore::JSWorkerContext::importScripts):
      * bindings/js/JSWorkerCustom.cpp:
      (WebCore::JSWorkerConstructor::constructJSWorker):
      * bindings/js/JSXMLHttpRequestCustom.cpp:
      (WebCore::JSXMLHttpRequest::open):
      (WebCore::JSXMLHttpRequest::send):
      * bindings/js/JSXSLTProcessorCustom.cpp:
      (WebCore::JSXSLTProcessor::setParameter):
      (WebCore::JSXSLTProcessor::getParameter):
      (WebCore::JSXSLTProcessor::removeParameter):
      * bindings/js/ScheduledAction.cpp:
      (WebCore::ScheduledAction::create):
      * bindings/js/ScriptEventListener.cpp:
      (WebCore::eventListenerHandlerBody):
      * bindings/js/ScriptValue.cpp:
      (WebCore::ScriptValue::toString):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateEventListenerCall):
      (JSValueToNative):
      (GenerateConstructorDefinition):
      * bridge/c/c_utility.cpp:
      (JSC::Bindings::convertValueToNPVariant):
      * bridge/jni/jni_jsobject.mm:
      (JavaJSObject::convertValueToJObject):
      * bridge/jni/jsc/JNIUtilityPrivate.cpp:
      (JSC::Bindings::convertArrayInstanceToJavaArray):
      (JSC::Bindings::convertValueToJValue):
      * bridge/jni/jsc/JavaFieldJSC.cpp:
      (JavaField::dispatchValueFromInstance):
      (JavaField::valueFromInstance):
      (JavaField::dispatchSetValueToInstance):
      (JavaField::setValueToInstance):
      * bridge/jni/jsc/JavaInstanceJSC.cpp:
      (JavaInstance::invokeMethod):
      * testing/js/JSInternalsCustom.cpp:
      (WebCore::JSInternals::setUserPreferredLanguages):
      
      ../WebKit/mac: 
      
      Reviewed by Gavin Barraclough.
      
      Mechanical changes to call value() after calling toString(), to
      convert from "JS string" (JSString*) to "C++ string" (UString), since
      toString() no longer returns a "C++ string".
      
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::addValueToArray):
      * WebView/WebFrame.mm:
      (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
      (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
      
      ../WebKit2: 
      
      Reviewed by Gavin Barraclough.
      
      Mechanical changes to call value() after calling toString(), to
      convert from "JS string" (JSString*) to "C++ string" (UString), since
      toString() no longer returns a "C++ string".
      
      * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
      (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      64be5e90
  7. 16 Dec, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      De-virtualize destructors · c58d54d7
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=74331
      
      Reviewed by Geoffrey Garen.
      
      .: 
      
      * Source/autotools/symbols.filter: Removed symbol no longer present.
      
      Source/JavaScriptCore: 
      
      This is a megapatch which frees us from the chains of virtual destructors.
      
      In order to remove the virtual destructors, which are the last of the virtual 
      functions, from the JSCell hierarchy, we need to add the ClassInfo pointer to 
      the cell rather than to the structure because in order to be able to lazily call 
      the static destroy() functions that will replace the virtual destructors, we 
      need to be able to access the ClassInfo without the danger of the object's 
      Structure being collected before the object itself.
      
      After adding the ClassInfo to the cell, we can then begin to remove our use 
      of vptrs for optimizations within the JIT and the GC.  When we have removed 
      all of the stored vptrs from JSGlobalData, we can then also remove all of 
      the related VPtrStealingHack code.
      
      The replacement for virtual destructors will be to add a static destroy function 
      pointer to the MethodTable stored in ClassInfo.  Any subclass of JSCell that has 
      a non-trivial destructor will require its own static destroy function to static 
      call its corresponding destructor, which will now be non-virtual.  In future 
      patches we will slowly move away from destructors altogether as we make more and 
      more objects backed by GC memory rather than malloc-ed memory.  The GC will now 
      call the static destroy method rather than the virtual destructor.
      
      As we go through the hierarchy and add static destroy functions to classes, 
      we will also add a new assert, ASSERT_HAS_TRIVIAL_DESTRUCTOR, to those classes 
      to which it applies.  The future goal is to eventually have every class have that assert.
      
      * API/JSCallbackConstructor.cpp:
      (JSC::JSCallbackConstructor::destroy): Add a destroy function to statically call 
      ~JSCallbackConstructor because it has some extra destruction logic.
      * API/JSCallbackConstructor.h:
      * API/JSCallbackFunction.cpp: Add trivial destructor assert for JSCallbackFunction.
      * API/JSCallbackObject.cpp: Add a destroy function to statically call ~JSCallbackObject 
      because it has a member OwnPtr that needs destruction.
      (JSC::::destroy):
      * API/JSCallbackObject.h:
      * JavaScriptCore.exp: Add/remove necessary symbols for JSC.
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Same for Windows symbols.
      * debugger/DebuggerActivation.cpp: DebuggerActivation, for some strange reason, didn't 
      have its own ClassInfo despite the fact that it overrides a number of MethodTable 
      methods.  Added the ClassInfo, along with an assertion that its destructor is trivial.
      * debugger/DebuggerActivation.h:
      * dfg/DFGOperations.cpp: Remove global data first argument to isJSArray, isJSByteArray, 
      isJSString, as it is no longer necessary.
      (JSC::DFG::putByVal):
      * dfg/DFGRepatch.cpp:  Ditto.  Also remove uses of jsArrayVPtr in favor of using the 
      JSArray ClassInfo pointer.
      (JSC::DFG::tryCacheGetByID):
      * dfg/DFGSpeculativeJIT.cpp:  Replace uses of the old vptrs with new ClassInfo 
      comparisons since we don't have vptrs anymore.
      (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
      (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
      (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
      (JSC::DFG::SpeculativeJIT::compilePutByValForByteArray):
      (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength):
      (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
      (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
      (JSC::DFG::SpeculativeJIT::compare):
      (JSC::DFG::SpeculativeJIT::compileStrictEq):
      (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
      * dfg/DFGSpeculativeJIT.h: Ditto.
      (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject):
      * dfg/DFGSpeculativeJIT32_64.cpp: Ditto.
      (JSC::DFG::SpeculativeJIT::compileObjectEquality):
      (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
      (JSC::DFG::SpeculativeJIT::compileLogicalNot):
      (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp: Ditto.
      (JSC::DFG::SpeculativeJIT::compileObjectEquality):
      (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
      (JSC::DFG::SpeculativeJIT::compileLogicalNot):
      (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      * heap/Heap.cpp: Remove all uses of vptrs in GC optimizations and replace them with 
      ClassInfo comparisons.
      (JSC::Heap::Heap):
      * heap/MarkStack.cpp: Ditto.
      (JSC::MarkStackThreadSharedData::markingThreadMain):
      (JSC::visitChildren):
      (JSC::SlotVisitor::drain):
      * heap/MarkStack.h: Ditto.
      (JSC::MarkStack::MarkStack):
      * heap/MarkedBlock.cpp: Ditto.
      (JSC::MarkedBlock::callDestructor):
      (JSC::MarkedBlock::specializedSweep):
      * heap/MarkedBlock.h: Ditto.
      * heap/SlotVisitor.h: Ditto.
      (JSC::SlotVisitor::SlotVisitor):
      * heap/VTableSpectrum.cpp: Now that we don't have vptrs, we can't count them.  
      We'll have to rename this class and make it use ClassInfo ptrs in a future patch.
      (JSC::VTableSpectrum::count):
      * interpreter/Interpreter.cpp: Remove all global data arguments from isJSArray, 
      etc. functions.
      (JSC::loadVarargs):
      (JSC::Interpreter::tryCacheGetByID):
      (JSC::Interpreter::privateExecute):
      * jit/JIT.h: Remove vptr argument from emitAllocateBasicJSObject 
      * jit/JITInlineMethods.h: Remove vptr planting, and add ClassInfo planting, 
      remove all vtable related code.
      (JSC::JIT::emitLoadCharacterString):
      (JSC::JIT::emitAllocateBasicJSObject):
      (JSC::JIT::emitAllocateJSFinalObject):
      (JSC::JIT::emitAllocateJSFunction):
      * jit/JITOpcodes.cpp: Replace vptr related branch code with corresponding ClassInfo.
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::emit_op_to_primitive):
      (JSC::JIT::emit_op_convert_this):
      * jit/JITOpcodes32_64.cpp: Ditto.
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::emit_op_to_primitive):
      (JSC::JIT::emitSlow_op_eq):
      (JSC::JIT::emitSlow_op_neq):
      (JSC::JIT::compileOpStrictEq):
      (JSC::JIT::emit_op_convert_this):
      * jit/JITPropertyAccess.cpp: Ditto.
      (JSC::JIT::stringGetByValStubGenerator):
      (JSC::JIT::emit_op_get_by_val):
      (JSC::JIT::emitSlow_op_get_by_val):
      (JSC::JIT::emit_op_put_by_val):
      (JSC::JIT::privateCompilePutByIdTransition):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      * jit/JITPropertyAccess32_64.cpp: Ditto.
      (JSC::JIT::stringGetByValStubGenerator):
      (JSC::JIT::emit_op_get_by_val):
      (JSC::JIT::emitSlow_op_get_by_val):
      (JSC::JIT::emit_op_put_by_val):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      * jit/JITStubs.cpp: Remove global data argument from isJSString, etc.
      (JSC::JITThunks::tryCacheGetByID):
      (JSC::DEFINE_STUB_FUNCTION):
      * jit/SpecializedThunkJIT.h: Replace vptr related stuff with ClassInfo stuff.
      (JSC::SpecializedThunkJIT::loadJSStringArgument):
      * runtime/ArrayConstructor.cpp: Add trivial destructor assert.
      * runtime/ArrayPrototype.cpp: Remove global data argument from isJSArray.
      (JSC::arrayProtoFuncToString):
      (JSC::arrayProtoFuncJoin):
      (JSC::arrayProtoFuncPop):
      (JSC::arrayProtoFuncPush):
      (JSC::arrayProtoFuncShift):
      (JSC::arrayProtoFuncSplice):
      (JSC::arrayProtoFuncUnShift):
      (JSC::arrayProtoFuncFilter):
      (JSC::arrayProtoFuncMap):
      (JSC::arrayProtoFuncEvery):
      (JSC::arrayProtoFuncForEach):
      (JSC::arrayProtoFuncSome):
      (JSC::arrayProtoFuncReduce):
      (JSC::arrayProtoFuncReduceRight):
      * runtime/BooleanConstructor.cpp: Add trivial destructor assert.
      * runtime/BooleanObject.cpp: Ditto.
      * runtime/BooleanPrototype.cpp: Ditto.
      * runtime/ClassInfo.h: Add destroy function pointer to MethodTable.
      * runtime/DateConstructor.cpp: Add trivial destructor assert.
      * runtime/DateInstance.cpp: Add destroy function for DateInstance because it has a RefPtr 
      that needs destruction.
      (JSC::DateInstance::destroy):
      * runtime/DateInstance.h:
      * runtime/Error.cpp: Ditto (because of UString member).
      (JSC::StrictModeTypeErrorFunction::destroy):
      * runtime/Error.h:
      * runtime/ErrorConstructor.cpp: Add trivial destructor assert.
      * runtime/ErrorInstance.cpp: Ditto.
      * runtime/ExceptionHelpers.cpp: Ditto.
      * runtime/Executable.cpp: Add destroy functions for ExecutableBase and subclasses.
      (JSC::ExecutableBase::destroy):
      (JSC::NativeExecutable::destroy):
      (JSC::ScriptExecutable::destroy):
      (JSC::EvalExecutable::destroy):
      (JSC::ProgramExecutable::destroy):
      (JSC::FunctionExecutable::destroy):
      * runtime/Executable.h:
      * runtime/FunctionConstructor.cpp: Add trivial destructor assert.
      * runtime/FunctionPrototype.cpp: Ditto. Also remove global data first arg from isJSArray.
      (JSC::functionProtoFuncApply):
      * runtime/GetterSetter.cpp: Ditto.
      * runtime/InitializeThreading.cpp: Remove call to JSGlobalData::storeVPtrs since it no 
      longer exists.
      (JSC::initializeThreadingOnce):
      * runtime/InternalFunction.cpp: Remove vtableAnchor function, add trivial destructor assert, 
      remove first arg from isJSString.
      (JSC::InternalFunction::displayName):
      * runtime/InternalFunction.h: Remove VPtrStealingHack.
      * runtime/JSAPIValueWrapper.cpp: Add trivial destructor assert.
      * runtime/JSArray.cpp: Add static destroy to call ~JSArray.  Replace vptr checks in 
      destructor with ClassInfo checks.
      (JSC::JSArray::~JSArray):
      (JSC::JSArray::destroy):
      * runtime/JSArray.h: Remove VPtrStealingHack.  Remove globalData argument from isJSArray 
      and change them to check the ClassInfo rather than the vptrs.
      (JSC::isJSArray):
      * runtime/JSBoundFunction.cpp: Add trival destructor assert. Remove first arg from isJSArray.
      (JSC::boundFunctionCall):
      (JSC::boundFunctionConstruct):
      * runtime/JSByteArray.cpp: Add static destroy function, replace vptr checks with ClassInfo checks.
      (JSC::JSByteArray::~JSByteArray):
      (JSC::JSByteArray::destroy):
      * runtime/JSByteArray.h: Remove VPtrStealingHack code.
      (JSC::isJSByteArray):
      * runtime/JSCell.cpp: Add trivial destructor assert.  Add static destroy function.
      (JSC::JSCell::destroy):
      * runtime/JSCell.h: Remove VPtrStealingHack code.  Add function for returning the offset 
      of the ClassInfo pointer in the object for use by the JIT.  Add the ClassInfo pointer to 
      the JSCell itself, and grab it from the Structure.  Remove the vptr and setVPtr functions, 
      as they are no longer used.  Add a validatedClassInfo function to JSCell for any clients 
      that want to verify, while in Debug mode, that the ClassInfo contained in the cell is the 
      same one as that contained in the Structure.  This isn't used too often, because most of 
      the places where we compare the ClassInfo to things can be called during destruction.  
      Since the Structure is unreliable during the phase when destructors are being called, 
      we can't call validatedClassInfo.
      (JSC::JSCell::classInfoOffset):
      (JSC::JSCell::structure):
      (JSC::JSCell::classInfo):
      * runtime/JSFunction.cpp: Remove VPtrStealingHack code.  Add static destroy, remove vtableAnchor, 
      remove first arg from call to isJSString.
      (JSC::JSFunction::destroy):
      (JSC::JSFunction::displayName):
      * runtime/JSFunction.h: 
      * runtime/JSGlobalData.cpp: Remove all VPtr stealing code and storage, including storeVPtrs, 
      as these vptrs are no longer needed in the codebase.
      * runtime/JSGlobalData.h:
      (JSC::TypedArrayDescriptor::TypedArrayDescriptor): Changed the TypedArrayDescriptor to use 
      ClassInfo rather than the vptr.
      * runtime/JSGlobalObject.cpp: Add static destroy function.
      (JSC::JSGlobalObject::destroy):
      * runtime/JSGlobalObject.h:
      * runtime/JSGlobalThis.cpp: Add trivial destructor assert.
      * runtime/JSNotAnObject.cpp: Ditto.
      * runtime/JSONObject.cpp: Ditto. Remove first arg from isJSArray calls.
      (JSC::Stringifier::Holder::appendNextProperty):
      (JSC::Walker::walk):
      * runtime/JSObject.cpp: 
      (JSC::JSFinalObject::destroy):
      (JSC::JSNonFinalObject::destroy):
      (JSC::JSObject::destroy):
      * runtime/JSObject.h: Add trivial destructor assert for JSObject, remove vtableAnchor 
      from JSNonFinalObject and JSFinalObject, add static destroy for JSFinalObject and 
      JSNonFinalObject, add isJSFinalObject utility function similar to isJSArray, remove all VPtrStealingHack code.
      (JSC::JSObject::finishCreation):
      (JSC::JSNonFinalObject::finishCreation):
      (JSC::JSFinalObject::finishCreation):
      (JSC::isJSFinalObject):
      * runtime/JSPropertyNameIterator.cpp: Add static destroy.
      (JSC::JSPropertyNameIterator::destroy):
      * runtime/JSPropertyNameIterator.h:
      * runtime/JSStaticScopeObject.cpp: Ditto.
      (JSC::JSStaticScopeObject::destroy):
      * runtime/JSStaticScopeObject.h: Ditto. 
      * runtime/JSString.cpp:
      (JSC::JSString::destroy):
      * runtime/JSString.h: Ditto. Remove VPtrStealingHack code. Also remove fixupVPtr code, 
      since we no longer need to fixup vptrs.
      (JSC::jsSingleCharacterString):
      (JSC::jsSingleCharacterSubstring):
      (JSC::jsNontrivialString):
      (JSC::jsString):
      (JSC::jsSubstring8):
      (JSC::jsSubstring):
      (JSC::jsOwnedString):
      (JSC::jsStringBuilder):
      (JSC::isJSString):
      * runtime/JSVariableObject.cpp: 
      (JSC::JSVariableObject::destroy):
      * runtime/JSVariableObject.h: Ditto.
      * runtime/JSWrapperObject.cpp:
      * runtime/JSWrapperObject.h: Add trivial destructor assert.
      * runtime/MathObject.cpp: Ditto.
      * runtime/NativeErrorConstructor.cpp: Ditto.
      * runtime/NumberConstructor.cpp: Ditto.
      * runtime/NumberObject.cpp: Ditto.
      * runtime/NumberPrototype.cpp: Ditto.
      * runtime/ObjectConstructor.cpp: Ditto.
      * runtime/ObjectPrototype.cpp: Ditto.
      * runtime/Operations.h: Remove calls to fixupVPtr, remove first arg to isJSString.
      (JSC::jsString):
      (JSC::jsLess):
      (JSC::jsLessEq):
      * runtime/RegExp.cpp: Add static destroy.
      (JSC::RegExp::destroy):
      * runtime/RegExp.h:
      * runtime/RegExpConstructor.cpp: Add static destroy for RegExpConstructor and RegExpMatchesArray.
      (JSC::RegExpConstructor::destroy):
      (JSC::RegExpMatchesArray::destroy):
      * runtime/RegExpConstructor.h:
      * runtime/RegExpMatchesArray.h:
      * runtime/RegExpObject.cpp: Add static destroy.
      (JSC::RegExpObject::destroy):
      * runtime/RegExpObject.h:
      * runtime/ScopeChain.cpp: Add trivial destructor assert.
      * runtime/ScopeChain.h:
      * runtime/StrictEvalActivation.cpp: Ditto.
      * runtime/StringConstructor.cpp:
      * runtime/StringObject.cpp: Ditto. Remove vtableAnchor.
      * runtime/StringObject.h:
      * runtime/StringPrototype.cpp: Ditto.
      * runtime/Structure.cpp: Add static destroy.
      (JSC::Structure::destroy):
      * runtime/Structure.h: Move JSCell::finishCreation and JSCell constructor into Structure.h 
      because they need to have the full Structure type to access the ClassInfo to store in the JSCell.
      (JSC::JSCell::setStructure):
      (JSC::JSCell::validatedClassInfo):
      (JSC::JSCell::JSCell):
      (JSC::JSCell::finishCreation):
      * runtime/StructureChain.cpp: Add static destroy.
      (JSC::StructureChain::destroy):
      * runtime/StructureChain.h:
      * wtf/Assertions.h: Add new assertion ASSERT_HAS_TRIVIAL_DESTRUCTOR, which uses clangs 
      ability to tell us when a class has a trivial destructor. We will use this assert 
      more in future patches as we move toward having all JSC objects backed by GC memory, 
      which means moving away from using destructors/finalizers.
      
      Source/JavaScriptGlue: 
      
      * UserObjectImp.cpp: Add static destroy function.
      (UserObjectImp::destroy):
      * UserObjectImp.h:
      
      Source/WebCore: 
      
      No new tests.
      
      Doing everything here that was done to the JSCell hierarchy in JavaScriptCore. 
      See the ChangeLog for this commit for a more in-depth description.
      
      * WebCore.exp.in: Add/remove symbols.
      * bindings/js/JSCanvasRenderingContext2DCustom.cpp: Remove first arg from isJSArray call.
      (WebCore::JSCanvasRenderingContext2D::setWebkitLineDash):
      * bindings/js/JSDOMBinding.cpp: Add trival destructor assert for DOMConstructorObject 
      and DOMConstructorWithDocument.
      * bindings/js/JSDOMGlobalObject.cpp: Add static destroy.  Add implementation for 
      scriptExecutionContext that dispatches to different functions in subclasses 
      depending on our current ClassInfo.  We do this so that we can get rid of the 
      virtual-ness of scriptExecutionContext, because any virtual functions will throw 
      off the layout of the object and we'll crash at runtime.
      (WebCore::JSDOMGlobalObject::destroy):
      (WebCore::JSDOMGlobalObject::scriptExecutionContext):
      * bindings/js/JSDOMGlobalObject.h:
      * bindings/js/JSDOMWindowBase.cpp: Add static destroy.
      (WebCore::JSDOMWindowBase::destroy):
      * bindings/js/JSDOMWindowBase.h: De-virtualize scriptExecutionContext.
      * bindings/js/JSDOMWindowShell.cpp: Add static destroy.
      (WebCore::JSDOMWindowShell::destroy):
      * bindings/js/JSDOMWindowShell.h:
      * bindings/js/JSDOMWrapper.cpp: Add trivial destructor assert.
      * bindings/js/JSDOMWrapper.h: Add a ClassInfo to JSDOMWrapper since it now overrides 
      a MethodTable function. Remove vtableAnchor virtual function.
      * bindings/js/JSImageConstructor.cpp: Add trivial destructor assert.
      * bindings/js/JSNodeCustom.cpp: Change implementation of pushEventHandlerScope so that 
      it dispatches to the correct function depending on the 
      identity of the class as specified by the ClassInfo.  
      See JSDOMGlobalObject::scriptExecutionContext for explanation.
      (WebCore::JSNode::pushEventHandlerScope):
      * bindings/js/JSWebSocketCustom.cpp: Remove first arg to isJSArray call.
      (WebCore::JSWebSocketConstructor::constructJSWebSocket):
      * bindings/js/JSWorkerContextBase.cpp: Add static destroy.
      (WebCore::JSWorkerContextBase::destroy):
      * bindings/js/JSWorkerContextBase.h: 
      * bindings/js/ScriptValue.cpp: Remove first arg to isJSArray call.
      (WebCore::jsToInspectorValue): 
      * bindings/js/SerializedScriptValue.cpp: Ditto.
      (WebCore::CloneSerializer::isArray):
      (WebCore::CloneSerializer::getSparseIndex):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHeader): Remove virtual-ness of any custom pushEventHandlerScope (see 
      JSNodeCustom::pushEventHandlerScope for explanation).  Remove virtual toBoolean 
      for anybody who masquerades as undefined, since our JSObject implementation handles 
      this based on the TypeInfo in the Structure. Add trivial destructor assert for any 
      class other than DOMWindow or WorkerContexts.
      (GenerateImplementation): Change ClassInfo definitions to use Base::s_info, since 
      typing the parent class more than once is duplication of information and increases 
      the likelihood of mistakes.  Pass ClassInfo to TypeArrayDescriptors instead of vptr. 
      (GenerateConstructorDefinition): Add trivial destructor assert for all generated constructors.
      * bridge/c/CRuntimeObject.cpp: Remove empty virtual destructor.
      * bridge/c/CRuntimeObject.h: 
      * bridge/jni/jsc/JavaRuntimeObject.cpp: Ditto.
      * bridge/jni/jsc/JavaRuntimeObject.h: 
      * bridge/objc/ObjCRuntimeObject.h: Ditto.
      * bridge/objc/ObjCRuntimeObject.mm:
      * bridge/objc/objc_runtime.h: Add static destroy for ObjcFallbackObjectImp. De-virtualize 
      toBoolean in the short term.  Need longer term fix.
      * bridge/objc/objc_runtime.mm:
      (JSC::Bindings::ObjcFallbackObjectImp::destroy):
      * bridge/qt/qt_runtime.cpp: Add static destroy to QtRuntimeMethod.
      (JSC::Bindings::QtRuntimeMethod::destroy):
      * bridge/qt/qt_runtime.h: De-virtualize ~QtRuntimeMethod.
      * bridge/runtime_array.cpp: De-virtualize destructor. Add static destroy.
      (JSC::RuntimeArray::destroy):
      * bridge/runtime_array.h:
      * bridge/runtime_method.cpp: Remove vtableAnchor. Add static destroy.
      (JSC::RuntimeMethod::destroy):
      * bridge/runtime_method.h:
      * bridge/runtime_object.cpp: Add static destroy.
      (JSC::Bindings::RuntimeObject::destroy):
      * bridge/runtime_object.h:
      
      Source/WebKit/mac: 
      
      * Plugins/Hosted/ProxyRuntimeObject.h: Remove empty virtual destructor.
      * Plugins/Hosted/ProxyRuntimeObject.mm:
      
      Source/WebKit2: 
      
      * WebProcess/Plugins/Netscape/JSNPMethod.cpp: Add trivial destructor assert.
      * WebProcess/Plugins/Netscape/JSNPObject.cpp: Add static destroy.
      (WebKit::JSNPObject::destroy):
      * WebProcess/Plugins/Netscape/JSNPObject.h:
      * win/WebKit2.def: Add/remove necessary symbols.
      * win/WebKit2CFLite.def: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c58d54d7
  8. 31 Oct, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      De-virtualize JSObject::defaultValue · 6e506e6f
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=71146
      
      Reviewed by Sam Weinig.
      
      Source/JavaScriptCore: 
      
      Added defaultValue to the MethodTable.  Replaced all virtual versions of 
      defaultValue with static versions.  Replaced all call sites with lookups in the 
      MethodTable.
      
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * runtime/ClassInfo.h:
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::defaultValue):
      (JSC::TerminatedExecutionError::defaultValue):
      * runtime/ExceptionHelpers.h:
      * runtime/JSCell.cpp:
      (JSC::JSCell::defaultValue):
      * runtime/JSCell.h:
      * runtime/JSNotAnObject.cpp:
      (JSC::JSNotAnObject::defaultValue):
      * runtime/JSNotAnObject.h:
      * runtime/JSObject.cpp:
      (JSC::JSObject::getPrimitiveNumber):
      (JSC::JSObject::defaultValue):
      * runtime/JSObject.h:
      (JSC::JSObject::toPrimitive):
      
      Source/WebCore: 
      
      No new tests.
      
      Added defaultValue to the MethodTable.  Replaced all virtual versions of 
      defaultValue with static versions.  Replaced all call sites with lookups in the 
      MethodTable.
      
      * WebCore.exp.in:
      * bridge/objc/objc_runtime.h:
      * bridge/objc/objc_runtime.mm:
      (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
      * bridge/runtime_object.cpp:
      (JSC::Bindings::RuntimeObject::defaultValue):
      * bridge/runtime_object.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6e506e6f
  9. 12 Oct, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      De-virtualize JSCell::toString · 7b72b790
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=69677
      
      Reviewed by Sam Weinig.
      
      Source/JavaScriptCore:
      
      Removed toString from JSCallbackObject, since it is no
      longer necessary since we now implicitly add toString and valueOf
      functions to object prototypes when a convertToType callback
      is provided, which is now the standard way to override toString
      and valueOf in the JSC C API.
      * API/JSCallbackObject.h:
      * API/JSCallbackObjectFunctions.h:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      
      Removed toString from InterruptedExecutionError and
      TerminatedExecutionError and replaced it with defaultValue,
      which JSObject::toString calls.  We'll probably have to de-virtualize
      defaultValue eventually, but we'll cross that bridge when we
      come to it.
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::defaultValue):
      (JSC::TerminatedExecutionError::defaultValue):
      * runtime/ExceptionHelpers.h:
      
      Removed toString from JSNotAnObject, since its return value doesn't
      actually matter and JSObject::toString can cover it.
      * runtime/JSNotAnObject.cpp:
      * runtime/JSNotAnObject.h:
      
      De-virtualized JSCell::toString, JSObject::toString and JSString::toString.
      Added handling of all cases for JSCell to JSCell::toString.
      * runtime/JSObject.h:
      * runtime/JSString.h:
      * runtime/JSCell.cpp:
      (JSC::JSCell::toString):
      * runtime/JSCell.h:
      
      Source/JavaScriptGlue:
      
      Removed UserObjectImp::toString because it's no longer necessary since
      clients can provide their own toString callback which will in turn be
      called by JSObject::toString.
      * UserObjectImp.cpp:
      * UserObjectImp.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7b72b790
  10. 26 Sep, 2011 1 commit
    • mhahnenberg@apple.com's avatar
      Add custom vtable struct to ClassInfo struct · 3e084662
      mhahnenberg@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=68567
      
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore:
      
      Declared/defined the MethodTable struct and added it to the ClassInfo struct.
      Also defined the CREATE_METHOD_TABLE macro to generate these method tables
      succinctly where they need to be defined.
      
      Also added to it the first function to use this macro, visitChildren.
      
      This is part of the process of getting rid of all C++ virtual methods in JSCell.
      Eventually all virtual functions in JSCell that can't easily be converted to
      non-virtual functions will be put into this custom vtable structure.
      * runtime/ClassInfo.h:
      
      Added the CREATE_METHOD_TABLE macro call as the last argument to each of the
      ClassInfo structs declared in these classes.  This saves us from having to visit
      each s_info definition in the future when we add more methods to the MethodTable.
      * API/JSCallbackConstructor.cpp:
      * API/JSCallbackFunction.cpp:
      * API/JSCallbackObject.cpp:
      * JavaScriptCore.exp:
      * runtime/Arguments.cpp:
      * runtime/ArrayConstructor.cpp:
      * runtime/ArrayPrototype.cpp:
      * runtime/BooleanObject.cpp:
      * runtime/BooleanPrototype.cpp:
      * runtime/DateConstructor.cpp:
      * runtime/DateInstance.cpp:
      * runtime/DatePrototype.cpp:
      * runtime/ErrorInstance.cpp:
      * runtime/ErrorPrototype.cpp:
      * runtime/ExceptionHelpers.cpp:
      * runtime/Executable.cpp:
      * runtime/GetterSetter.cpp:
      * runtime/InternalFunction.cpp:
      * runtime/JSAPIValueWrapper.cpp:
      * runtime/JSActivation.cpp:
      * runtime/JSArray.cpp:
      * runtime/JSByteArray.cpp:
      * runtime/JSFunction.cpp:
      * runtime/JSGlobalObject.cpp:
      * runtime/JSONObject.cpp:
      * runtime/JSObject.cpp:
      * runtime/JSPropertyNameIterator.cpp:
      * runtime/JSString.cpp:
      * runtime/MathObject.cpp:
      * runtime/NativeErrorConstructor.cpp:
      * runtime/NumberConstructor.cpp:
      * runtime/NumberObject.cpp:
      * runtime/NumberPrototype.cpp:
      * runtime/ObjectConstructor.cpp:
      * runtime/ObjectPrototype.cpp:
      * runtime/RegExp.cpp:
      * runtime/RegExpConstructor.cpp:
      * runtime/RegExpObject.cpp:
      * runtime/RegExpPrototype.cpp:
      * runtime/ScopeChain.cpp:
      * runtime/StringConstructor.cpp:
      * runtime/StringObject.cpp:
      * runtime/StringPrototype.cpp:
      * runtime/Structure.cpp:
      * runtime/StructureChain.cpp:
      
      Had to make visitChildren and visitChildrenVirtual protected instead of private
      because some of the subclasses of JSWrapperObject need access to JSWrapperObject's
      visitChildren function pointer in their vtable since they don't provide their own
      implementation. Same for RegExpObject.
      * runtime/JSWrapperObject.h:
      * runtime/RegExpObject.h:
      
      Source/JavaScriptGlue:
      
      Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
      specified class in its ClassInfo.  Also added to it the first function to use
      this macro, visitChildren.  This is part of the process of getting rid of all
      C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
      that can't easily be converted to non-virtual functions will be put into
      this custom vtable structure.
      
      * UserObjectImp.cpp:
      
      Source/WebCore:
      
      No new tests.
      
      Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
      specified class in its ClassInfo.  Also added to it the first function to use
      this macro, visitChildren.  This is part of the process of getting rid of all
      C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
      that can't easily be converted to non-virtual functions will be put into
      this custom vtable structure.
      
      * bindings/js/JSAudioConstructor.cpp:
      * bindings/js/JSDOMGlobalObject.cpp:
      * bindings/js/JSDOMWindowBase.cpp:
      * bindings/js/JSDOMWindowShell.cpp:
      * bindings/js/JSImageConstructor.cpp:
      * bindings/js/JSImageDataCustom.cpp:
      (WebCore::toJS):
      * bindings/js/JSOptionConstructor.cpp:
      * bindings/js/JSWorkerContextBase.cpp:
      
      Changed the bindings generator to add the call to the CREATE_METHOD_TABLE macro where
      necessary.
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateImplementation):
      (GenerateConstructorDefinition):
      * bindings/scripts/test/JS/JSTestInterface.cpp:
      * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
      * bindings/scripts/test/JS/JSTestObj.cpp:
      * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
      * bridge/c/CRuntimeObject.cpp:
      * bridge/c/c_instance.cpp:
      * bridge/jni/jsc/JavaInstanceJSC.cpp:
      * bridge/jni/jsc/JavaRuntimeObject.cpp:
      * bridge/objc/ObjCRuntimeObject.mm:
      * bridge/objc/objc_instance.mm:
      * bridge/objc/objc_runtime.mm:
      * bridge/qt/qt_instance.cpp:
      * bridge/qt/qt_pixmapruntime.cpp:
      * bridge/qt/qt_runtime.cpp:
      * bridge/runtime_array.cpp:
      * bridge/runtime_method.cpp:
      * bridge/runtime_object.cpp:
      
      Source/WebKit/mac:
      
      Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
      specified class in its ClassInfo.  Also added to it the first function to use
      this macro, visitChildren.  This is part of the process of getting rid of all
      C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
      that can't easily be converted to non-virtual functions will be put into
      this custom vtable structure.
      
      * Plugins/Hosted/ProxyInstance.mm:
      * Plugins/Hosted/ProxyRuntimeObject.mm:
      
      Source/WebKit2:
      
      Added CREATE_METHOD_TABLE macro to generate the custom vtable for the
      specified class in its ClassInfo.  Also added to it the first function to use
      this macro, visitChildren.  This is part of the process of getting rid of all
      C++ virtual methods in JSCell.  Eventually all virtual functions in JSCell
      that can't easily be converted to non-virtual functions will be put into
      this custom vtable structure.
      
      * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
      * WebProcess/Plugins/Netscape/JSNPObject.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3e084662
  11. 10 Sep, 2011 1 commit
    • weinig@apple.com's avatar
      Add isInterruptedExecutionException and isTerminatedExecutionException predicates · 76c11465
      weinig@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=67892
      
      Reviewed by Andy "First Time Reviewer" Estes.
      
      ../JavaScriptCore: 
      
      * JavaScriptCore.exp:
      Add symbols.
      
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::throwException):
      Use new predicates.
      
      * runtime/ExceptionHelpers.cpp:
      (JSC::createInterruptedExecutionException):
      (JSC::isInterruptedExecutionException):
      (JSC::createTerminatedExecutionException):
      (JSC::isTerminatedExecutionException):
      * runtime/ExceptionHelpers.h:
      (JSC::InterruptedExecutionError::InterruptedExecutionError):
      Add predicates.
      
      ../WebCore: 
      
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::reportException):
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::handleEvent):
      * bindings/js/WorkerScriptController.cpp:
      (WebCore::WorkerScriptController::evaluate):
      Use the new predicates instead of probing the ClassInfo directly.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      76c11465
  12. 09 Sep, 2011 1 commit
  13. 08 Sep, 2011 1 commit
    • weinig@apple.com's avatar
      Remove the Completion object from JSC, I have never liked it · f41a7da7
      weinig@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=67755
      
      Reviewed by Gavin Barraclough.
      
      ../JavaScriptCore: 
      
      - Removes the Completion object and replaces its use with out parameter exceptions.
      - Remove ComplType and virtual exceptionType() function on JSObject. Replace with
        ClassInfo for InterruptedExecutionError and TerminatedExecutionError.
      
      * API/JSBase.cpp:
      (JSEvaluateScript):
      (JSCheckScriptSyntax):
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::throwException):
      * jsc.cpp:
      (functionLoad):
      (functionCheckSyntax):
      (runWithScripts):
      (runInteractive):
      * runtime/Completion.cpp:
      (JSC::checkSyntax):
      (JSC::evaluate):
      * runtime/Completion.h:
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::toString):
      (JSC::TerminatedExecutionError::toString):
      (JSC::createInterruptedExecutionException):
      * runtime/ExceptionHelpers.h:
      (JSC::InterruptedExecutionError::InterruptedExecutionError):
      (JSC::InterruptedExecutionError::create):
      (JSC::InterruptedExecutionError::createStructure):
      (JSC::TerminatedExecutionError::TerminatedExecutionError):
      (JSC::TerminatedExecutionError::create):
      (JSC::TerminatedExecutionError::createStructure):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      * runtime/JSObject.h:
      
      ../JavaScriptGlue: 
      
      * JSRun.cpp:
      (JSRun::Evaluate):
      (JSRun::CheckSyntax):
      * JSRun.h:
      * JavaScriptGlue.cpp:
      (JSRunEvaluate):
      
      ../WebCore: 
      
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::reportException):
      * bindings/js/JSEventListener.cpp:
      (WebCore::JSEventListener::handleEvent):
      * bindings/js/JSInjectedScriptManager.cpp:
      (WebCore::InjectedScriptManager::createInjectedScript):
      * bindings/js/JSMainThreadExecState.h:
      (WebCore::JSMainThreadExecState::evaluate):
      * bindings/js/ScriptController.cpp:
      (WebCore::ScriptController::evaluateInWorld):
      * bindings/js/WorkerScriptController.cpp:
      (WebCore::WorkerScriptController::evaluate):
      * bindings/objc/WebScriptObject.mm:
      (-[WebScriptObject evaluateWebScript:]):
      * bridge/NP_jsobject.cpp:
      (_NPN_Evaluate):
      * bridge/jni/jni_jsobject.mm:
      (JavaJSObject::eval):
      
      ../WebKit/mac: 
      
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::evaluate):
      
      ../WebKit/qt: 
      
      * Api/qwebelement.cpp:
      (QWebElement::evaluateJavaScript):
      
      ../WebKit2: 
      
      * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
      (WebKit::NPRuntimeObjectMap::evaluate):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f41a7da7
  14. 01 Sep, 2011 1 commit
    • commit-queue@webkit.org's avatar
      Unzip initialization lists and constructors in JSCell hierarchy (4/7) · 6e5671b6
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=67174
      
      Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-09-01
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore:
      
      Completed the fourth level of the refactoring to add finishCreation()
      methods to all classes within the JSCell hierarchy with non-trivial
      constructor bodies.
      
      This primarily consists of pushing the calls to finishCreation() down
      into the constructors of the subclasses of the second level of the hierarchy
      as well as pulling the finishCreation() calls out into the class's corresponding
      create() method if it has one.  Doing both simultaneously allows us to
      maintain the invariant that the finishCreation() method chain is called exactly
      once during the creation of an object, since calling it any other number of
      times (0, 2, or more) will cause an assertion failure.
      
      * API/JSCallbackConstructor.cpp:
      (JSC::JSCallbackConstructor::JSCallbackConstructor):
      (JSC::JSCallbackConstructor::finishCreation):
      * API/JSCallbackConstructor.h:
      * API/JSCallbackObject.h:
      (JSC::JSCallbackObject::create):
      * API/JSCallbackObjectFunctions.h:
      (JSC::::JSCallbackObject):
      (JSC::::finishCreation):
      * JavaScriptCore.JSVALUE64only.exp:
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * debugger/DebuggerActivation.cpp:
      (JSC::DebuggerActivation::DebuggerActivation):
      (JSC::DebuggerActivation::create):
      * debugger/DebuggerActivation.h:
      * runtime/Arguments.h:
      (JSC::Arguments::create):
      (JSC::Arguments::createNoParameters):
      (JSC::Arguments::Arguments):
      * runtime/ArrayPrototype.cpp:
      (JSC::ArrayPrototype::ArrayPrototype):
      (JSC::ArrayPrototype::finishCreation):
      * runtime/ArrayPrototype.h:
      * runtime/BooleanObject.cpp:
      (JSC::BooleanObject::BooleanObject):
      (JSC::BooleanObject::finishCreation):
      * runtime/BooleanObject.h:
      * runtime/DateInstance.cpp:
      (JSC::DateInstance::DateInstance):
      (JSC::DateInstance::finishCreation):
      * runtime/DateInstance.h:
      * runtime/ErrorInstance.cpp:
      (JSC::ErrorInstance::ErrorInstance):
      * runtime/ErrorInstance.h:
      (JSC::ErrorInstance::create):
      * runtime/ErrorPrototype.cpp:
      (JSC::ErrorPrototype::ErrorPrototype):
      (JSC::ErrorPrototype::finishCreation):
      * runtime/ErrorPrototype.h:
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::InterruptedExecutionError):
      (JSC::InterruptedExecutionError::create):
      (JSC::TerminatedExecutionError::TerminatedExecutionError):
      (JSC::TerminatedExecutionError::create):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::EvalExecutable):
      (JSC::ProgramExecutable::ProgramExecutable):
      (JSC::FunctionExecutable::FunctionExecutable):
      * runtime/Executable.h:
      (JSC::NativeExecutable::create):
      (JSC::NativeExecutable::NativeExecutable):
      (JSC::EvalExecutable::create):
      (JSC::ProgramExecutable::create):
      (JSC::FunctionExecutable::create):
      * runtime/InternalFunction.cpp:
      (JSC::InternalFunction::InternalFunction):
      (JSC::InternalFunction::finishCreation):
      * runtime/InternalFunction.h:
      * runtime/JSActivation.cpp:
      (JSC::JSActivation::JSActivation):
      (JSC::JSActivation::finishCreation):
      * runtime/JSActivation.h:
      * runtime/JSArray.cpp:
      (JSC::JSArray::JSArray):
      * runtime/JSArray.h:
      (JSC::JSArray::create):
      * runtime/JSByteArray.cpp:
      (JSC::JSByteArray::JSByteArray):
      * runtime/JSByteArray.h:
      (JSC::JSByteArray::create):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::JSFunction):
      (JSC::JSFunction::finishCreation):
      * runtime/JSFunction.h:
      (JSC::JSFunction::create):
      * runtime/JSGlobalObject.h:
      (JSC::JSGlobalObject::JSGlobalObject):
      (JSC::JSGlobalObject::finishCreation):
      * runtime/JSNotAnObject.h:
      (JSC::JSNotAnObject::JSNotAnObject):
      (JSC::JSNotAnObject::create):
      * runtime/JSONObject.cpp:
      (JSC::JSONObject::JSONObject):
      (JSC::JSONObject::finishCreation):
      * runtime/JSONObject.h:
      * runtime/JSObjectWithGlobalObject.cpp:
      (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
      * runtime/JSObjectWithGlobalObject.h:
      * runtime/JSStaticScopeObject.h:
      (JSC::JSStaticScopeObject::create):
      (JSC::JSStaticScopeObject::finishCreation):
      (JSC::JSStaticScopeObject::JSStaticScopeObject):
      * runtime/JSVariableObject.h:
      (JSC::JSVariableObject::JSVariableObject):
      * runtime/JSWrapperObject.h:
      (JSC::JSWrapperObject::JSWrapperObject):
      * runtime/MathObject.cpp:
      (JSC::MathObject::MathObject):
      (JSC::MathObject::finishCreation):
      * runtime/MathObject.h:
      * runtime/NumberObject.cpp:
      (JSC::NumberObject::NumberObject):
      (JSC::NumberObject::finishCreation):
      * runtime/NumberObject.h:
      * runtime/ObjectPrototype.cpp:
      (JSC::ObjectPrototype::ObjectPrototype):
      * runtime/ObjectPrototype.h:
      (JSC::ObjectPrototype::create):
      * runtime/RegExpConstructor.cpp:
      (JSC::RegExpMatchesArray::RegExpMatchesArray):
      (JSC::RegExpMatchesArray::finishCreation):
      * runtime/RegExpMatchesArray.h:
      * runtime/RegExpObject.cpp:
      (JSC::RegExpObject::RegExpObject):
      (JSC::RegExpObject::finishCreation):
      * runtime/RegExpObject.h:
      * runtime/StrictEvalActivation.cpp:
      (JSC::StrictEvalActivation::StrictEvalActivation):
      * runtime/StrictEvalActivation.h:
      (JSC::StrictEvalActivation::create):
      * runtime/StringObject.cpp:
      (JSC::StringObject::StringObject):
      (JSC::StringObject::finishCreation):
      * runtime/StringObject.h:
      
      Source/JavaScriptGlue:
      
      Completed the fourth level of the refactoring to add finishCreation()
      methods to all classes within the JSCell hierarchy with non-trivial
      constructor bodies.
      
      This primarily consists of pushing the calls to finishCreation() down
      into the constructors of the subclasses of the second level of the hierarchy
      as well as pulling the finishCreation() calls out into the class's corresponding
      create() method if it has one.  Doing both simultaneously allows us to
      maintain the invariant that the finishCreation() method chain is called exactly
      once during the creation of an object, since calling it any other number of
      times (0, 2, or more) will cause an assertion failure.
      
      * UserObjectImp.cpp:
      (UserObjectImp::UserObjectImp):
      * UserObjectImp.h:
      (UserObjectImp::create):
      
      Source/WebCore:
      
      No new tests.
      
      Completed the fourth level of the refactoring to add finishCreation()
      methods to all classes within the JSCell hierarchy with non-trivial
      constructor bodies.
      
      This primarily consists of pushing the calls to finishCreation() down
      into the constructors of the subclasses of the second level of the hierarchy
      as well as pulling the finishCreation() calls out into the class's corresponding
      create() method if it has one.  Doing both simultaneously allows us to
      maintain the invariant that the finishCreation() method chain is called exactly
      once during the creation of an object, since calling it any other number of
      times (0, 2, or more) will cause an assertion failure.
      
      * bindings/js/JSDOMWindowShell.cpp:
      (WebCore::JSDOMWindowShell::JSDOMWindowShell):
      (WebCore::JSDOMWindowShell::create):
      * bindings/js/JSDOMWindowShell.h:
      * bindings/js/JSDOMWrapper.h:
      (WebCore::JSDOMWrapper::JSDOMWrapper):
      * bindings/js/ScriptController.cpp:
      (WebCore::ScriptController::createWindowShell):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHeader):
      * bindings/scripts/test/JS/JSTestInterface.h:
      (WebCore::JSTestInterfacePrototype::JSTestInterfacePrototype):
      * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
      (WebCore::JSTestMediaQueryListListenerPrototype::JSTestMediaQueryListListenerPrototype):
      * bindings/scripts/test/JS/JSTestObj.h:
      (WebCore::JSTestObjPrototype::JSTestObjPrototype):
      * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
      (WebCore::JSTestSerializedScriptValueInterfacePrototype::JSTestSerializedScriptValueInterfacePrototype):
      * bridge/objc/objc_runtime.h:
      * bridge/objc/objc_runtime.mm:
      (JSC::Bindings::ObjcFallbackObjectImp::ObjcFallbackObjectImp):
      (JSC::Bindings::ObjcFallbackObjectImp::finishCreation):
      * bridge/runtime_array.cpp:
      (JSC::RuntimeArray::RuntimeArray):
      (JSC::RuntimeArray::finishCreation):
      * bridge/runtime_array.h:
      * bridge/runtime_object.cpp:
      (JSC::Bindings::RuntimeObject::RuntimeObject):
      (JSC::Bindings::RuntimeObject::finishCreation):
      * bridge/runtime_object.h:
      
      Source/WebKit2:
      
      Completed the fourth level of the refactoring to add finishCreation()
      methods to all classes within the JSCell hierarchy with non-trivial
      constructor bodies.
      
      This primarily consists of pushing the calls to finishCreation() down
      into the constructors of the subclasses of the second level of the hierarchy
      as well as pulling the finishCreation() calls out into the class's corresponding
      create() method if it has one.  Doing both simultaneously allows us to
      maintain the invariant that the finishCreation() method chain is called exactly
      once during the creation of an object, since calling it any other number of
      times (0, 2, or more) will cause an assertion failure.
      
      * WebProcess/Plugins/Netscape/JSNPObject.cpp:
      (WebKit::JSNPObject::JSNPObject):
      (WebKit::JSNPObject::finishCreation):
      * WebProcess/Plugins/Netscape/JSNPObject.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6e5671b6
  15. 29 Aug, 2011 1 commit
    • commit-queue@webkit.org's avatar
      Unzip initialization lists and constructors in JSCell hierarchy (3/7) · 1a0a3631
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=67064
      
      Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-08-29
      Reviewed by Darin Adler.
      
      Source/JavaScriptCore:
      
      Completed the third level of the refactoring to add finishCreation()
      methods to all classes within the JSCell hierarchy with non-trivial
      constructor bodies.
      
      This primarily consists of pushing the calls to finishCreation() down
      into the constructors of the subclasses of the second level of the hierarchy
      as well as pulling the finishCreation() calls out into the class's corresponding
      create() method if it has one.  Doing both simultaneously allows us to
      maintain the invariant that the finishCreation() method chain is called exactly
      once during the creation of an object, since calling it any other number of
      times (0, 2, or more) will cause an assertion failure.
      
      * debugger/DebuggerActivation.cpp:
      (JSC::DebuggerActivation::DebuggerActivation):
      (JSC::DebuggerActivation::finishCreation):
      * debugger/DebuggerActivation.h:
      (JSC::DebuggerActivation::create):
      * runtime/Arguments.h:
      (JSC::Arguments::create):
      (JSC::Arguments::createNoParameters):
      (JSC::Arguments::Arguments):
      (JSC::Arguments::finishCreation):
      * runtime/ErrorInstance.cpp:
      (JSC::ErrorInstance::ErrorInstance):
      * runtime/ErrorInstance.h:
      (JSC::ErrorInstance::finishCreation):
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::InterruptedExecutionError):
      (JSC::TerminatedExecutionError::TerminatedExecutionError):
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::EvalExecutable):
      (JSC::ProgramExecutable::ProgramExecutable):
      (JSC::FunctionExecutable::FunctionExecutable):
      Moved the assignment of m_firstLine and m_lastLine into the
      FunctionExecutable::finishCreation() method in Executable.h
      * runtime/Executable.h:
      (JSC::ScriptExecutable::ScriptExecutable):
      (JSC::EvalExecutable::create):
      (JSC::ProgramExecutable::create):
      (JSC::FunctionExecutable::create):
      (JSC::FunctionExecutable::finishCreation):
      * runtime/JSArray.cpp:
      (JSC::JSArray::JSArray):
      (JSC::JSArray::finishCreation):
      * runtime/JSArray.h:
      * runtime/JSByteArray.cpp:
      (JSC::JSByteArray::JSByteArray):
      * runtime/JSByteArray.h:
      (JSC::JSByteArray::finishCreation):
      * runtime/JSNotAnObject.h:
      (JSC::JSNotAnObject::JSNotAnObject):
      * runtime/JSObject.h:
      (JSC::JSNonFinalObject::JSNonFinalObject):
      * runtime/JSObjectWithGlobalObject.cpp:
      (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
      (JSC::JSObjectWithGlobalObject::finishCreation):
      * runtime/JSObjectWithGlobalObject.h:
      * runtime/JSVariableObject.h:
      (JSC::JSVariableObject::JSVariableObject):
      (JSC::JSVariableObject::finishCreation):
      * runtime/JSWrapperObject.h:
      (JSC::JSWrapperObject::JSWrapperObject):
      * runtime/ObjectPrototype.cpp:
      (JSC::ObjectPrototype::ObjectPrototype):
      (JSC::ObjectPrototype::finishCreation):
      * runtime/ObjectPrototype.h:
      * runtime/StrictEvalActivation.cpp:
      (JSC::StrictEvalActivation::StrictEvalActivation):
      
      Source/JavaScriptGlue:
      
      Completed the third level of the refactoring to add finishCreation()
      methods to all classes within the JSCell hierarchy with non-trivial
      constructor bodies.
      
      This primarily consists of pushing the calls to finishCreation() down
      into the constructors of the subclasses of the second level of the hierarchy
      as well as pulling the finishCreation() calls out into the class's corresponding
      create() method if it has one.  Doing both simultaneously allows us to
      maintain the invariant that the finishCreation() method chain is called exactly
      once during the creation of an object, since calling it any other number of
      times (0, 2, or more) will cause an assertion failure.
      
      * UserObjectImp.cpp:
      (UserObjectImp::UserObjectImp):
      
      Source/WebCore:
      
      No new tests.
      
      Completed the third level of the refactoring to add finishCreation()
      methods to all classes within the JSCell hierarchy with non-trivial
      constructor bodies.
      
      This primarily consists of pushing the calls to finishCreation() down
      into the constructors of the subclasses of the second level of the hierarchy
      as well as pulling the finishCreation() calls out into the class's corresponding
      create() method if it has one.  Doing both simultaneously allows us to
      maintain the invariant that the finishCreation() method chain is called exactly
      once during the creation of an object, since calling it any other number of
      times (0, 2, or more) will cause an assertion failure.
      
      * bindings/js/JSDOMWindowShell.cpp:
      (WebCore::JSDOMWindowShell::JSDOMWindowShell):
      (WebCore::JSDOMWindowShell::finishCreation):
      * bindings/js/JSDOMWindowShell.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1a0a3631
  16. 09 Aug, 2011 1 commit
    • commit-queue@webkit.org's avatar
      Add ParentClass typedef in all JSC classes · 6c25c52f
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=65731
      
      Patch by Mark Hahnenberg <mhahnenberg@apple.com> on 2011-08-09
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore:
      
      Just added the Base typedefs in all the classes that are a subclass of JSCell
      to point at their parent classes.  This is a change to support future changes to the way
      constructors and destructors are implemented in JS objects, among other things.
      
      * API/JSCallbackConstructor.h:
      * API/JSCallbackFunction.h:
      * API/JSCallbackObject.h:
      (JSC::JSCallbackObject::createStructure):
      (JSC::JSCallbackObject::visitChildren):
      * API/JSCallbackObjectFunctions.h:
      (JSC::::asCallbackObject):
      (JSC::::JSCallbackObject):
      (JSC::::init):
      (JSC::::className):
      (JSC::::getOwnPropertySlot):
      (JSC::::getOwnPropertyDescriptor):
      (JSC::::put):
      (JSC::::deleteProperty):
      (JSC::::getConstructData):
      (JSC::::construct):
      (JSC::::hasInstance):
      (JSC::::getCallData):
      (JSC::::call):
      (JSC::::getOwnPropertyNames):
      (JSC::::toNumber):
      (JSC::::toString):
      (JSC::::setPrivate):
      (JSC::::getPrivate):
      (JSC::::inherits):
      (JSC::::getStaticValue):
      (JSC::::staticFunctionGetter):
      (JSC::::callbackGetter):
      * debugger/DebuggerActivation.h:
      * jsc.cpp:
      * runtime/Arguments.h:
      * runtime/ArrayConstructor.h:
      * runtime/ArrayPrototype.h:
      * runtime/BooleanConstructor.h:
      * runtime/BooleanObject.h:
      * runtime/BooleanPrototype.h:
      * runtime/DateConstructor.h:
      * runtime/DateInstance.h:
      * runtime/DatePrototype.h:
      * runtime/Error.cpp:
      * runtime/ErrorConstructor.h:
      * runtime/ErrorInstance.h:
      * runtime/ErrorPrototype.h:
      * runtime/ExceptionHelpers.cpp:
      * runtime/Executable.h:
      * runtime/FunctionConstructor.h:
      * runtime/FunctionPrototype.h:
      * runtime/GetterSetter.h:
      * runtime/InternalFunction.h:
      * runtime/JSAPIValueWrapper.h:
      * runtime/JSActivation.h:
      * runtime/JSArray.h:
      * runtime/JSFunction.h:
      * runtime/JSGlobalObject.h:
      * runtime/JSNotAnObject.h:
      * runtime/JSONObject.h:
      * runtime/JSObject.h:
      * runtime/JSPropertyNameIterator.h:
      * runtime/JSStaticScopeObject.h:
      * runtime/JSString.h:
      * runtime/JSVariableObject.h:
      * runtime/JSWrapperObject.h:
      * runtime/MathObject.h:
      * runtime/NativeErrorConstructor.h:
      * runtime/NativeErrorPrototype.h:
      * runtime/NumberConstructor.h:
      * runtime/NumberObject.h:
      * runtime/NumberPrototype.h:
      * runtime/ObjectConstructor.h:
      * runtime/ObjectPrototype.h:
      * runtime/RegExp.h:
      * runtime/RegExpConstructor.h:
      * runtime/RegExpMatchesArray.h:
      * runtime/RegExpObject.h:
      (JSC::RegExpObject::create):
      * runtime/RegExpPrototype.h:
      * runtime/ScopeChain.h:
      * runtime/StrictEvalActivation.h:
      * runtime/StringConstructor.h:
      * runtime/StringObject.h:
      * runtime/StringObjectThatMasqueradesAsUndefined.h:
      * runtime/StringPrototype.h:
      * runtime/Structure.h:
      * runtime/StructureChain.h:
      
      Source/JavaScriptGlue:
      
      Just added the Base typedefs in all the classes that are a subclass of JSCell
      to point at their parent classes.  This is a change to support future changes to the way
      constructors and destructors are implemented in JS objects, among other things.
      
      * JSRun.h:
      * UserObjectImp.h:
      
      Source/WebCore:
      
      No new tests.
      
      Just added the Base typedefs in all the classes that are a subclass of JSCell
      to point at their parent classes.  This is a change to support future changes to the way
      constructors and destructors are implemented in JS objects, among other things.
      
      * bindings/js/JSAudioConstructor.h:
      * bindings/js/JSImageConstructor.h:
      * bindings/js/JSOptionConstructor.h:
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateHeader):
      (GenerateConstructorDeclaration):
      * bindings/scripts/test/JS/JSTestInterface.cpp:
      * bindings/scripts/test/JS/JSTestInterface.h:
      * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
      * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
      * bindings/scripts/test/JS/JSTestObj.cpp:
      * bindings/scripts/test/JS/JSTestObj.h:
      * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
      * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
      * bridge/c/CRuntimeObject.h:
      * bridge/c/c_instance.cpp:
      * bridge/jni/jsc/JavaInstanceJSC.cpp:
      * bridge/jni/jsc/JavaRuntimeObject.h:
      * bridge/objc/ObjCRuntimeObject.h:
      * bridge/objc/objc_runtime.h:
      * bridge/qt/qt_instance.cpp:
      * bridge/qt/qt_pixmapruntime.cpp:
      * bridge/qt/qt_runtime.h:
      * bridge/runtime_array.h:
      * bridge/runtime_method.h:
      * bridge/runtime_object.h:
      * bridge/testqtbindings.cpp:
      (Global::className):
      
      Source/WebKit/mac:
      
      Just added the Base typedefs in all the classes that are a subclass of JSCell
      to point at their parent classes.  This is a change to support future changes to the way
      constructors and destructors are implemented in JS objects, among other things.
      
      * Plugins/Hosted/ProxyInstance.mm:
      * Plugins/Hosted/ProxyRuntimeObject.h:
      
      Source/WebKit2:
      
      Just added the Base typedefs in all the classes that are a subclass of JSCell
      to point at their parent classes.  This is a change to support future changes to the way
      constructors and destructors are implemented in JS objects, among other things.
      
      * WebProcess/Plugins/Netscape/JSNPMethod.h:
      * WebProcess/Plugins/Netscape/JSNPObject.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6c25c52f
  17. 18 Jul, 2011 1 commit
    • oliver@apple.com's avatar
      2011-07-18 Mark Hahnenberg <mhahnenberg@apple.com> · fcacd3c8
      oliver@apple.com authored
              Refactor JSC to replace JSCell::operator new with static create method
              https://bugs.webkit.org/show_bug.cgi?id=64466
      
              Reviewed by Oliver Hunt (oliver@apple.com) and Darin Adler (darin@apple.com).
      
              First step in a longer refactoring process to remove the use of
              operator new overloading in order to allocate GC objects and to replace
              this method with static create methods for each individual type of heap-allocated
              JS object.  This particular patch only deals with replacing uses of
              operator new within JSC proper.  Future patches will remove it from the
              parts that interface with the DOM.  Due to the DOM's continued dependence
              on it, operator new has not actually been removed from JSCell.
      
              * API/JSCallbackConstructor.h:
              (JSC::JSCallbackConstructor::create):
              * API/JSCallbackFunction.h:
              (JSC::JSCallbackFunction::create):
              * API/JSCallbackObject.h:
              (JSC::JSCallbackObject::operator new):
              (JSC::JSCallbackObject::create):
              * API/JSCallbackObjectFunctions.h:
              (JSC::::staticFunctionGetter):
              * API/JSClassRef.cpp:
              (OpaqueJSClass::prototype):
              * API/JSContextRef.cpp:
              * API/JSObjectRef.cpp:
              (JSObjectMake):
              (JSObjectMakeFunctionWithCallback):
              (JSObjectMakeConstructor):
              * JavaScriptCore.exp:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
              * bytecode/CodeBlock.cpp:
              (JSC::CodeBlock::createActivation):
              * bytecompiler/BytecodeGenerator.cpp:
              (JSC::BytecodeGenerator::BytecodeGenerator):
              * bytecompiler/BytecodeGenerator.h:
              (JSC::BytecodeGenerator::makeFunction):
              * bytecompiler/NodesCodegen.cpp:
              (JSC::RegExpNode::emitBytecode):
              * interpreter/Interpreter.cpp:
              (JSC::Interpreter::privateExecute):
              (JSC::Interpreter::retrieveArguments):
              * jit/JITStubs.cpp:
              (JSC::DEFINE_STUB_FUNCTION):
              * jsc.cpp:
              (GlobalObject::create):
              (GlobalObject::GlobalObject):
              (functionRun):
              (jscmain):
              * runtime/Arguments.h:
              (JSC::Arguments::create):
              (JSC::Arguments::createNoParameters):
              * runtime/ArrayConstructor.cpp:
              (JSC::constructArrayWithSizeQuirk):
              * runtime/ArrayConstructor.h:
              (JSC::ArrayConstructor::create):
              * runtime/ArrayPrototype.cpp:
              (JSC::arrayProtoFuncSplice):
              * runtime/ArrayPrototype.h:
              (JSC::ArrayPrototype::create):
              * runtime/BooleanConstructor.cpp:
              (JSC::constructBoolean):
              (JSC::constructBooleanFromImmediateBoolean):
              * runtime/BooleanConstructor.h:
              (JSC::BooleanConstructor::create):
              * runtime/BooleanObject.h:
              (JSC::BooleanObject::create):
              * runtime/BooleanPrototype.h:
              (JSC::BooleanPrototype::create):
              * runtime/DateConstructor.cpp:
              (JSC::constructDate):
              * runtime/DateConstructor.h:
              (JSC::DateConstructor::create):
              * runtime/DateInstance.h:
              (JSC::DateInstance::create):
              * runtime/DatePrototype.h:
              (JSC::DatePrototype::create):
              * runtime/Error.cpp:
              (JSC::createError):
              (JSC::createEvalError):
              (JSC::createRangeError):
              (JSC::createReferenceError):
              (JSC::createSyntaxError):
              (JSC::createTypeError):
              (JSC::createURIError):
              (JSC::StrictModeTypeErrorFunction::create):
              (JSC::createTypeErrorFunction):
              * runtime/ErrorConstructor.h:
              (JSC::ErrorConstructor::create):
              * runtime/ErrorInstance.cpp:
              (JSC::ErrorInstance::ErrorInstance):
              (JSC::ErrorInstance::create):
              * runtime/ErrorInstance.h:
              * runtime/ErrorPrototype.cpp:
              (JSC::ErrorPrototype::ErrorPrototype):
              * runtime/ErrorPrototype.h:
              (JSC::ErrorPrototype::create):
              * runtime/ExceptionHelpers.cpp:
              (JSC::InterruptedExecutionError::InterruptedExecutionError):
              (JSC::InterruptedExecutionError::create):
              (JSC::createInterruptedExecutionException):
              (JSC::TerminatedExecutionError::TerminatedExecutionError):
              (JSC::TerminatedExecutionError::create):
              (JSC::createTerminatedExecutionException):
              * runtime/Executable.cpp:
              (JSC::FunctionExecutable::FunctionExecutable):
              (JSC::FunctionExecutable::fromGlobalCode):
              * runtime/Executable.h:
              (JSC::ExecutableBase::create):
              (JSC::NativeExecutable::create):
              (JSC::ScriptExecutable::ScriptExecutable):
              (JSC::EvalExecutable::create):
              (JSC::ProgramExecutable::create):
              (JSC::FunctionExecutable::create):
              (JSC::FunctionExecutable::make):
              * runtime/FunctionConstructor.cpp:
              (JSC::constructFunctionSkippingEvalEnabledCheck):
              * runtime/FunctionConstructor.h:
              (JSC::FunctionConstructor::create):
              * runtime/FunctionPrototype.cpp:
              (JSC::FunctionPrototype::addFunctionProperties):
              * runtime/FunctionPrototype.h:
              (JSC::FunctionPrototype::create):
              * runtime/GetterSetter.h:
              (JSC::GetterSetter::create):
              * runtime/JSAPIValueWrapper.h:
              (JSC::JSAPIValueWrapper::create):
              (JSC::jsAPIValueWrapper):
              * runtime/JSActivation.cpp:
              (JSC::JSActivation::argumentsGetter):
              * runtime/JSActivation.h:
              (JSC::JSActivation::create):
              * runtime/JSArray.h:
              (JSC::JSArray::create):
              * runtime/JSCell.h:
              (JSC::JSCell::allocateCell):
              * runtime/JSFunction.h:
              (JSC::JSFunction::create):
              * runtime/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::init):
              (JSC::JSGlobalObject::reset):
              * runtime/JSGlobalObject.h:
              (JSC::constructEmptyArray):
              (JSC::constructArray):
              * runtime/JSNotAnObject.h:
              (JSC::JSNotAnObject::create):
              * runtime/JSONObject.h:
              (JSC::JSONObject::create):
              * runtime/JSObject.cpp:
              (JSC::JSObject::defineGetter):
              (JSC::JSObject::defineSetter):
              (JSC::putDescriptor):
              * runtime/JSObject.h:
              (JSC::JSFinalObject::create):
              * runtime/JSPropertyNameIterator.cpp:
              (JSC::JSPropertyNameIterator::create):
              * runtime/JSPropertyNameIterator.h:
              (JSC::JSPropertyNameIterator::create):
              * runtime/JSString.cpp:
              (JSC::JSString::substringFromRope):
              (JSC::JSString::replaceCharacter):
              (JSC::StringObject::create):
              * runtime/JSString.h:
              (JSC::RopeBuilder::JSString):
              (JSC::RopeBuilder::create):
              (JSC::RopeBuilder::createHasOtherOwner):
              (JSC::jsSingleCharacterString):
              (JSC::jsSingleCharacterSubstring):
              (JSC::jsNontrivialString):
              (JSC::jsString):
              (JSC::jsSubstring):
              (JSC::jsOwnedString):
              * runtime/JSValue.cpp:
              (JSC::JSValue::toObjectSlowCase):
              (JSC::JSValue::synthesizeObject):
              (JSC::JSValue::synthesizePrototype):
              * runtime/Lookup.cpp:
              (JSC::setUpStaticFunctionSlot):
              * runtime/MathObject.h:
              (JSC::MathObject::create):
              * runtime/NativeErrorConstructor.cpp:
              (JSC::NativeErrorConstructor::NativeErrorConstructor):
              * runtime/NativeErrorConstructor.h:
              (JSC::NativeErrorConstructor::create):
              * runtime/NativeErrorPrototype.h:
              (JSC::NativeErrorPrototype::create):
              * runtime/NumberConstructor.cpp:
              (JSC::constructWithNumberConstructor):
              * runtime/NumberConstructor.h:
              (JSC::NumberConstructor::create):
              * runtime/NumberObject.cpp:
              (JSC::constructNumber):
              * runtime/NumberObject.h:
              (JSC::NumberObject::create):
              * runtime/NumberPrototype.h:
              (JSC::NumberPrototype::create):
              * runtime/ObjectConstructor.h:
              (JSC::ObjectConstructor::create):
              * runtime/ObjectPrototype.h:
              (JSC::ObjectPrototype::create):
              * runtime/Operations.h:
              (JSC::jsString):
              * runtime/RegExp.cpp:
              (JSC::RegExp::RegExp):
              (JSC::RegExp::createWithoutCaching):
              (JSC::RegExp::create):
              * runtime/RegExp.h:
              * runtime/RegExpCache.cpp:
              (JSC::RegExpCache::lookupOrCreate):
              * runtime/RegExpConstructor.cpp:
              (JSC::RegExpConstructor::arrayOfMatches):
              (JSC::constructRegExp):
              * runtime/RegExpConstructor.h:
              (JSC::RegExpConstructor::create):
              * runtime/RegExpMatchesArray.h:
              (JSC::RegExpMatchesArray::create):
              * runtime/RegExpObject.h:
              (JSC::RegExpObject::create):
              * runtime/RegExpPrototype.cpp:
              (JSC::regExpProtoFuncCompile):
              * runtime/RegExpPrototype.h:
              (JSC::RegExpPrototype::create):
              * runtime/ScopeChain.h:
              (JSC::ScopeChainNode::create):
              (JSC::ScopeChainNode::push):
              * runtime/SmallStrings.cpp:
              (JSC::SmallStrings::createEmptyString):
              (JSC::SmallStrings::createSingleCharacterString):
              * runtime/StringConstructor.cpp:
              (JSC::constructWithStringConstructor):
              * runtime/StringConstructor.h:
              (JSC::StringConstructor::create):
              * runtime/StringObject.h:
              (JSC::StringObject::create):
              * runtime/StringObjectThatMasqueradesAsUndefined.h:
              (JSC::StringObjectThatMasqueradesAsUndefined::create):
              * runtime/StringPrototype.cpp:
              (JSC::stringProtoFuncMatch):
              (JSC::stringProtoFuncSearch):
              * runtime/StringPrototype.h:
              (JSC::StringPrototype::create):
              * runtime/Structure.h:
              (JSC::Structure::create):
              (JSC::Structure::createStructure):
              * runtime/StructureChain.h:
              (JSC::StructureChain::create):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fcacd3c8
  18. 15 Apr, 2011 2 commits
  19. 13 Apr, 2011 1 commit
    • oliver@apple.com's avatar
      2011-04-13 Oliver Hunt <oliver@apple.com> · bb8da910
      oliver@apple.com authored
              Reviewed by Geoff Garen.
      
              GC allocate Structure
              https://bugs.webkit.org/show_bug.cgi?id=58483
      
              Additional structures are allocated beyond the expected threshold
              so we preflight the test to get them allocated.
      
              * fast/dom/gc-10.html:
      2011-04-13  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Geoff Garen.
      
              GC allocate Structure
              https://bugs.webkit.org/show_bug.cgi?id=58483
      
              Turn Structure into a GC allocated object.  Most of this patch
              is the mechanical change of replacing variations on RefPtr<Structure>
              with either Structure* (for arguments and locals), WriteBarrier<Structure>
              for the few cases where Structures are held by GC allocated objects
              and Strong<Structure> for the root structure objects in GlobalData.
      
              * API/JSCallbackConstructor.cpp:
              (JSC::JSCallbackConstructor::JSCallbackConstructor):
              * API/JSCallbackConstructor.h:
              (JSC::JSCallbackConstructor::createStructure):
              * API/JSCallbackFunction.h:
              (JSC::JSCallbackFunction::createStructure):
              * API/JSCallbackObject.h:
              (JSC::JSCallbackObject::createStructure):
              * API/JSCallbackObjectFunctions.h:
              (JSC::::JSCallbackObject):
              * API/JSContextRef.cpp:
              * JavaScriptCore.JSVALUE32_64only.exp:
              * JavaScriptCore.JSVALUE64only.exp:
              * JavaScriptCore.exp:
              * bytecode/CodeBlock.cpp:
              (JSC::CodeBlock::~CodeBlock):
              (JSC::CodeBlock::markStructures):
              (JSC::CodeBlock::markAggregate):
              * bytecode/CodeBlock.h:
              (JSC::MethodCallLinkInfo::setSeen):
              (JSC::GlobalResolveInfo::GlobalResolveInfo):
              * bytecode/Instruction.h:
              (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
              (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
              (JSC::PolymorphicAccessStructureList::markAggregate):
              (JSC::Instruction::Instruction):
              * bytecode/StructureStubInfo.cpp:
              (JSC::StructureStubInfo::deref):
              (JSC::StructureStubInfo::markAggregate):
              * bytecode/StructureStubInfo.h:
              (JSC::StructureStubInfo::initGetByIdSelf):
              (JSC::StructureStubInfo::initGetByIdProto):
              (JSC::StructureStubInfo::initGetByIdChain):
              (JSC::StructureStubInfo::initPutByIdTransition):
              (JSC::StructureStubInfo::initPutByIdReplace):
              * debugger/DebuggerActivation.cpp:
              (JSC::DebuggerActivation::DebuggerActivation):
              * debugger/DebuggerActivation.h:
              (JSC::DebuggerActivation::createStructure):
              * heap/Handle.h:
              * heap/MarkStack.cpp:
              (JSC::MarkStack::markChildren):
              (JSC::MarkStack::drain):
              * heap/MarkedBlock.cpp:
              (JSC::MarkedBlock::MarkedBlock):
              (JSC::MarkedBlock::sweep):
              * heap/Strong.h:
              (JSC::Strong::Strong):
              (JSC::Strong::set):
              * interpreter/Interpreter.cpp:
              (JSC::Interpreter::resolveGlobal):
              (JSC::Interpreter::resolveGlobalDynamic):
              (JSC::Interpreter::tryCachePutByID):
              (JSC::Interpreter::uncachePutByID):
              (JSC::Interpreter::tryCacheGetByID):
              (JSC::Interpreter::uncacheGetByID):
              (JSC::Interpreter::privateExecute):
              * jit/JIT.h:
              * jit/JITPropertyAccess.cpp:
              (JSC::JIT::privateCompilePutByIdTransition):
              (JSC::JIT::patchMethodCallProto):
              (JSC::JIT::privateCompileGetByIdProto):
              (JSC::JIT::privateCompileGetByIdSelfList):
              (JSC::JIT::privateCompileGetByIdProtoList):
              (JSC::JIT::privateCompileGetByIdChainList):
              (JSC::JIT::privateCompileGetByIdChain):
              * jit/JITPropertyAccess32_64.cpp:
              (JSC::JIT::privateCompilePutByIdTransition):
              (JSC::JIT::patchMethodCallProto):
              (JSC::JIT::privateCompileGetByIdProto):
              (JSC::JIT::privateCompileGetByIdSelfList):
              (JSC::JIT::privateCompileGetByIdProtoList):
              (JSC::JIT::privateCompileGetByIdChainList):
              (JSC::JIT::privateCompileGetByIdChain):
              * jit/JITStubs.cpp:
              (JSC::JITThunks::tryCachePutByID):
              (JSC::JITThunks::tryCacheGetByID):
              (JSC::DEFINE_STUB_FUNCTION):
              (JSC::getPolymorphicAccessStructureListSlot):
              * jit/JSInterfaceJIT.h:
              (JSC::JSInterfaceJIT::storePtrWithWriteBarrier):
              * jsc.cpp:
              (cleanupGlobalData):
              * runtime/Arguments.h:
              (JSC::Arguments::createStructure):
              (JSC::Arguments::Arguments):
              (JSC::JSActivation::copyRegisters):
              * runtime/ArrayConstructor.cpp:
              (JSC::ArrayConstructor::ArrayConstructor):
              (JSC::constructArrayWithSizeQuirk):
              * runtime/ArrayConstructor.h:
              * runtime/ArrayPrototype.cpp:
              (JSC::ArrayPrototype::ArrayPrototype):
              (JSC::arrayProtoFuncSplice):
              * runtime/ArrayPrototype.h:
              (JSC::ArrayPrototype::createStructure):
              * runtime/BatchedTransitionOptimizer.h:
              (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
              * runtime/BooleanConstructor.cpp:
              (JSC::BooleanConstructor::BooleanConstructor):
              * runtime/BooleanConstructor.h:
              * runtime/BooleanObject.cpp:
              (JSC::BooleanObject::BooleanObject):
              * runtime/BooleanObject.h:
              (JSC::BooleanObject::createStructure):
              * runtime/BooleanPrototype.cpp:
              (JSC::BooleanPrototype::BooleanPrototype):
              * runtime/BooleanPrototype.h:
              * runtime/DateConstructor.cpp:
              (JSC::DateConstructor::DateConstructor):
              * runtime/DateConstructor.h:
              * runtime/DateInstance.cpp:
              (JSC::DateInstance::DateInstance):
              * runtime/DateInstance.h:
              (JSC::DateInstance::createStructure):
              * runtime/DatePrototype.cpp:
              (JSC::DatePrototype::DatePrototype):
              * runtime/DatePrototype.h:
              (JSC::DatePrototype::createStructure):
              * runtime/Error.cpp:
              (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
              * runtime/ErrorConstructor.cpp:
              (JSC::ErrorConstructor::ErrorConstructor):
              * runtime/ErrorConstructor.h:
              * runtime/ErrorInstance.cpp:
              (JSC::ErrorInstance::ErrorInstance):
              (JSC::ErrorInstance::create):
              * runtime/ErrorInstance.h:
              (JSC::ErrorInstance::createStructure):
              * runtime/ErrorPrototype.cpp:
              (JSC::ErrorPrototype::ErrorPrototype):
              * runtime/ErrorPrototype.h:
              * runtime/ExceptionHelpers.cpp:
              (JSC::InterruptedExecutionError::InterruptedExecutionError):
              (JSC::TerminatedExecutionError::TerminatedExecutionError):
              * runtime/Executable.cpp:
              * runtime/Executable.h:
              (JSC::ExecutableBase::ExecutableBase):
              (JSC::ExecutableBase::createStructure):
              (JSC::NativeExecutable::createStructure):
              (JSC::NativeExecutable::NativeExecutable):
              (JSC::ScriptExecutable::ScriptExecutable):
              (JSC::EvalExecutable::createStructure):
              (JSC::ProgramExecutable::createStructure):
              (JSC::FunctionExecutable::createStructure):
              * runtime/FunctionConstructor.cpp:
              (JSC::FunctionConstructor::FunctionConstructor):
              * runtime/FunctionConstructor.h:
              * runtime/FunctionPrototype.cpp:
              (JSC::FunctionPrototype::FunctionPrototype):
              * runtime/FunctionPrototype.h:
              (JSC::FunctionPrototype::createStructure):
              * runtime/GetterSetter.h:
              (JSC::GetterSetter::GetterSetter):
              (JSC::GetterSetter::createStructure):
              * runtime/InitializeThreading.cpp:
              (JSC::initializeThreadingOnce):
              * runtime/InternalFunction.cpp:
              (JSC::InternalFunction::InternalFunction):
              * runtime/InternalFunction.h:
              (JSC::InternalFunction::createStructure):
              * runtime/JSAPIValueWrapper.h:
              (JSC::JSAPIValueWrapper::createStructure):
              (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
              * runtime/JSActivation.cpp:
              (JSC::JSActivation::JSActivation):
              * runtime/JSActivation.h:
              (JSC::JSActivation::createStructure):
              * runtime/JSArray.cpp:
              (JSC::JSArray::JSArray):
              * runtime/JSArray.h:
              (JSC::JSArray::createStructure):
              * runtime/JSByteArray.cpp:
              (JSC::JSByteArray::JSByteArray):
              (JSC::JSByteArray::createStructure):
              * runtime/JSByteArray.h:
              (JSC::JSByteArray::JSByteArray):
              * runtime/JSCell.cpp:
              (JSC::isZombie):
              * runtime/JSCell.h:
              (JSC::JSCell::JSCell::JSCell):
              (JSC::JSCell::JSCell::addressOfStructure):
              (JSC::JSCell::JSCell::structure):
              (JSC::JSCell::JSCell::markChildren):
              (JSC::JSCell::JSValue::isZombie):
              * runtime/JSFunction.cpp:
              (JSC::JSFunction::JSFunction):
              * runtime/JSFunction.h:
              (JSC::JSFunction::createStructure):
              * runtime/JSGlobalData.cpp:
              (JSC::JSGlobalData::storeVPtrs):
              (JSC::JSGlobalData::JSGlobalData):
              (JSC::JSGlobalData::clearBuiltinStructures):
              (JSC::JSGlobalData::createLeaked):
              * runtime/JSGlobalData.h:
              (JSC::allocateGlobalHandle):
              * runtime/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::reset):
              (JSC::JSGlobalObject::markChildren):
              (JSC::JSGlobalObject::copyGlobalsFrom):
              * runtime/JSGlobalObject.h:
              (JSC::JSGlobalObject::JSGlobalObject):
              (JSC::JSGlobalObject::createStructure):
              (JSC::Structure::prototypeChain):
              (JSC::Structure::isValid):
              (JSC::constructEmptyArray):
              * runtime/JSNotAnObject.h:
              (JSC::JSNotAnObject::JSNotAnObject):
              (JSC::JSNotAnObject::createStructure):
              * runtime/JSONObject.cpp:
              (JSC::JSONObject::JSONObject):
              * runtime/JSONObject.h:
              (JSC::JSONObject::createStructure):
              * runtime/JSObject.cpp:
              (JSC::JSObject::defineGetter):
              (JSC::JSObject::defineSetter):
              (JSC::JSObject::seal):
              (JSC::JSObject::freeze):
              (JSC::JSObject::preventExtensions):
              (JSC::JSObject::removeDirect):
              (JSC::JSObject::createInheritorID):
              * runtime/JSObject.h:
              (JSC::JSObject::createStructure):
              (JSC::JSObject::JSObject):
              (JSC::JSNonFinalObject::createStructure):
              (JSC::JSNonFinalObject::JSNonFinalObject):
              (JSC::JSFinalObject::create):
              (JSC::JSFinalObject::createStructure):
              (JSC::JSFinalObject::JSFinalObject):
              (JSC::constructEmptyObject):
              (JSC::createEmptyObjectStructure):
              (JSC::JSObject::~JSObject):
              (JSC::JSObject::setPrototype):
              (JSC::JSObject::setStructure):
              (JSC::JSObject::inheritorID):
              (JSC::JSObject::putDirectInternal):
              (JSC::JSObject::transitionTo):
              (JSC::JSObject::markChildrenDirect):
              * runtime/JSObjectWithGlobalObject.cpp:
              (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
              * runtime/JSObjectWithGlobalObject.h:
              (JSC::JSObjectWithGlobalObject::createStructure):
              (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
              * runtime/JSPropertyNameIterator.cpp:
              (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
              (JSC::JSPropertyNameIterator::create):
              (JSC::JSPropertyNameIterator::get):
              * runtime/JSPropertyNameIterator.h:
              (JSC::JSPropertyNameIterator::createStructure):
              (JSC::JSPropertyNameIterator::setCachedStructure):
              (JSC::Structure::setEnumerationCache):
              * runtime/JSStaticScopeObject.h:
              (JSC::JSStaticScopeObject::JSStaticScopeObject):
              (JSC::JSStaticScopeObject::createStructure):
              * runtime/JSString.h:
              (JSC::RopeBuilder::JSString):
              (JSC::RopeBuilder::createStructure):
              * runtime/JSType.h:
              * runtime/JSTypeInfo.h:
              (JSC::TypeInfo::TypeInfo):
              * runtime/JSValue.h:
              * runtime/JSVariableObject.h:
              (JSC::JSVariableObject::createStructure):
              (JSC::JSVariableObject::JSVariableObject):
              (JSC::JSVariableObject::copyRegisterArray):
              * runtime/JSWrapperObject.h:
              (JSC::JSWrapperObject::createStructure):
              (JSC::JSWrapperObject::JSWrapperObject):
              * runtime/JSZombie.cpp:
              * runtime/JSZombie.h:
              (JSC::JSZombie::JSZombie):
              (JSC::JSZombie::createStructure):
              * runtime/MathObject.cpp:
              (JSC::MathObject::MathObject):
              * runtime/MathObject.h:
              (JSC::MathObject::createStructure):
              * runtime/NativeErrorConstructor.cpp:
              (JSC::NativeErrorConstructor::NativeErrorConstructor):
              (JSC::NativeErrorConstructor::markChildren):
              * runtime/NativeErrorConstructor.h:
              (JSC::NativeErrorConstructor::createStructure):
              * runtime/NativeErrorPrototype.cpp:
              (JSC::NativeErrorPrototype::NativeErrorPrototype):
              * runtime/NativeErrorPrototype.h:
              * runtime/NumberConstructor.cpp:
              (JSC::NumberConstructor::NumberConstructor):
              * runtime/NumberConstructor.h:
              (JSC::NumberConstructor::createStructure):
              * runtime/NumberObject.cpp:
              (JSC::NumberObject::NumberObject):
              * runtime/NumberObject.h:
              (JSC::NumberObject::createStructure):
              * runtime/NumberPrototype.cpp:
              (JSC::NumberPrototype::NumberPrototype):
              * runtime/NumberPrototype.h:
              * runtime/ObjectConstructor.cpp:
              (JSC::ObjectConstructor::ObjectConstructor):
              * runtime/ObjectConstructor.h:
              (JSC::ObjectConstructor::createStructure):
              * runtime/ObjectPrototype.cpp:
              (JSC::ObjectPrototype::ObjectPrototype):
              * runtime/ObjectPrototype.h:
              * runtime/PropertyMapHashTable.h:
              (JSC::PropertyTable::PropertyTable):
              * runtime/RegExpConstructor.cpp:
              (JSC::RegExpConstructor::RegExpConstructor):
              (JSC::RegExpMatchesArray::RegExpMatchesArray):
              * runtime/RegExpConstructor.h:
              (JSC::RegExpConstructor::createStructure):
              * runtime/RegExpObject.cpp:
              (JSC::RegExpObject::RegExpObject):
              * runtime/RegExpObject.h:
              (JSC::RegExpObject::createStructure):
              * runtime/RegExpPrototype.cpp:
              (JSC::RegExpPrototype::RegExpPrototype):
              * runtime/RegExpPrototype.h:
              * runtime/ScopeChain.h:
              (JSC::ScopeChainNode::ScopeChainNode):
              (JSC::ScopeChainNode::createStructure):
              * runtime/StrictEvalActivation.cpp:
              (JSC::StrictEvalActivation::StrictEvalActivation):
              * runtime/StringConstructor.cpp:
              (JSC::StringConstructor::StringConstructor):
              * runtime/StringConstructor.h:
              * runtime/StringObject.cpp:
              (JSC::StringObject::StringObject):
              * runtime/StringObject.h:
              (JSC::StringObject::createStructure):
              * runtime/StringObjectThatMasqueradesAsUndefined.h:
              (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
              (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
              * runtime/StringPrototype.cpp:
              (JSC::StringPrototype::StringPrototype):
              * runtime/StringPrototype.h:
              (JSC::StringPrototype::createStructure):
              * runtime/Structure.cpp:
              (JSC::StructureTransitionTable::remove):
              (JSC::StructureTransitionTable::add):
              (JSC::Structure::Structure):
              (JSC::Structure::~Structure):
              (JSC::Structure::materializePropertyMap):
              (JSC::Structure::addPropertyTransitionToExistingStructure):
              (JSC::Structure::addPropertyTransition):
              (JSC::Structure::removePropertyTransition):
              (JSC::Structure::changePrototypeTransition):
              (JSC::Structure::despecifyFunctionTransition):
              (JSC::Structure::getterSetterTransition):
              (JSC::Structure::toDictionaryTransition):
              (JSC::Structure::toCacheableDictionaryTransition):
              (JSC::Structure::toUncacheableDictionaryTransition):
              (JSC::Structure::sealTransition):
              (JSC::Structure::freezeTransition):
              (JSC::Structure::preventExtensionsTransition):
              (JSC::Structure::flattenDictionaryStructure):
              (JSC::Structure::copyPropertyTable):
              (JSC::Structure::put):
              (JSC::Structure::markChildren):
              * runtime/Structure.h:
              (JSC::Structure::create):
              (JSC::Structure::setPrototypeWithoutTransition):
              (JSC::Structure::createStructure):
              (JSC::JSCell::createDummyStructure):
              (JSC::StructureTransitionTable::WeakGCMapFinalizerCallback::keyForFinalizer):
              * runtime/StructureChain.cpp:
              (JSC::StructureChain::StructureChain):
              (JSC::StructureChain::markChildren):
              * runtime/StructureChain.h:
              (JSC::StructureChain::create):
              (JSC::StructureChain::head):
              (JSC::StructureChain::createStructure):
              * runtime/StructureTransitionTable.h:
              (JSC::StructureTransitionTable::WeakGCMapFinalizerCallback::finalizerContextFor):
              (JSC::StructureTransitionTable::~StructureTransitionTable):
              (JSC::StructureTransitionTable::slot):
              (JSC::StructureTransitionTable::setMap):
              (JSC::StructureTransitionTable::singleTransition):
              (JSC::StructureTransitionTable::clearSingleTransition):
              (JSC::StructureTransitionTable::setSingleTransition):
              * runtime/WeakGCMap.h:
              (JSC::DefaultWeakGCMapFinalizerCallback::finalizerContextFor):
              (JSC::DefaultWeakGCMapFinalizerCallback::keyForFinalizer):
              (JSC::WeakGCMap::contains):
              (JSC::WeakGCMap::find):
              (JSC::WeakGCMap::remove):
              (JSC::WeakGCMap::add):
              (JSC::WeakGCMap::set):
              (JSC::WeakGCMap::finalize):
              * runtime/WriteBarrier.h:
              (JSC::writeBarrier):
              (JSC::WriteBarrierBase::set):
              (JSC::WriteBarrierBase::operator*):
              (JSC::WriteBarrierBase::operator->):
              (JSC::WriteBarrierBase::setWithoutWriteBarrier):
      2011-04-13  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Geoff Garen.
      
              GC allocate Structure
              https://bugs.webkit.org/show_bug.cgi?id=58483
      
              Fix up JSG to correctly mark Structure, et al.
      
              * JSRun.cpp:
              (JSGlueGlobalObject::JSGlueGlobalObject):
              * JSRun.h:
              * JSUtils.cpp:
              (JSObjectKJSValue):
              * UserObjectImp.cpp:
              (UserObjectImp::UserObjectImp):
              * UserObjectImp.h:
              (UserObjectImp::createStructure):
      2011-04-13  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Geoff Garen.
      
              GC allocate Structure
              https://bugs.webkit.org/show_bug.cgi?id=58483
      
              Update WebCore for Structure being a GC allocated object
      
              * WebCore.exp.in:
              * bindings/js/JSAudioConstructor.h:
              (WebCore::JSAudioConstructor::createStructure):
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::cacheDOMStructure):
              * bindings/js/JSDOMBinding.h:
              (WebCore::DOMObjectWithGlobalPointer::createStructure):
              (WebCore::DOMObjectWithGlobalPointer::DOMObjectWithGlobalPointer):
              (WebCore::DOMConstructorObject::createStructure):
              (WebCore::DOMConstructorObject::DOMConstructorObject):
              (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
              * bindings/js/JSDOMGlobalObject.cpp:
              (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
              (WebCore::JSDOMGlobalObject::markChildren):
              * bindings/js/JSDOMGlobalObject.h:
              (WebCore::JSDOMGlobalObject::createStructure):
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::JSDOMWindowBase):
              * bindings/js/JSDOMWindowBase.h:
              (WebCore::JSDOMWindowBase::createStructure):
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::JSDOMWindowShell):
              (WebCore::JSDOMWindowShell::setWindow):
              * bindings/js/JSDOMWindowShell.h:
              (WebCore::JSDOMWindowShell::createStructure):
              * bindings/js/JSDOMWrapper.h:
              (WebCore::DOMObject::DOMObject):
              * bindings/js/JSEventListener.cpp:
              (WebCore::JSEventListener::JSEventListener):
              * bindings/js/JSImageConstructor.h:
              (WebCore::JSImageConstructor::createStructure):
              * bindings/js/JSImageDataCustom.cpp:
              (WebCore::toJS):
              * bindings/js/JSOptionConstructor.h:
              (WebCore::JSOptionConstructor::createStructure):
              * bindings/js/JSWorkerContextBase.cpp:
              (WebCore::JSWorkerContextBase::JSWorkerContextBase):
              * bindings/js/JSWorkerContextBase.h:
              (WebCore::JSWorkerContextBase::createStructure):
              * bindings/js/ScriptCachedFrameData.h:
              * bindings/js/SerializedScriptValue.h:
              * bindings/js/WorkerScriptController.cpp:
              (WebCore::WorkerScriptController::initScript):
              * bindings/scripts/CodeGeneratorJS.pm:
              * bridge/c/CRuntimeObject.h:
              (JSC::Bindings::CRuntimeObject::createStructure):
              * bridge/c/c_instance.cpp:
              (JSC::Bindings::CRuntimeMethod::createStructure):
              * bridge/jni/jsc/JavaInstanceJSC.cpp:
              (JavaRuntimeMethod::createStructure):
              * bridge/jni/jsc/JavaRuntimeObject.h:
              (JSC::Bindings::JavaRuntimeObject::createStructure):
              * bridge/objc/ObjCRuntimeObject.h:
              (JSC::Bindings::ObjCRuntimeObject::createStructure):
              * bridge/objc/objc_instance.mm:
              (ObjCRuntimeMethod::createStructure):
              * bridge/objc/objc_runtime.h:
              (JSC::Bindings::ObjcFallbackObjectImp::createStructure):
              * bridge/runtime_array.cpp:
              (JSC::RuntimeArray::RuntimeArray):
              * bridge/runtime_array.h:
              (JSC::RuntimeArray::createStructure):
              * bridge/runtime_method.cpp:
              (JSC::RuntimeMethod::RuntimeMethod):
              * bridge/runtime_method.h:
              (JSC::RuntimeMethod::createStructure):
              * bridge/runtime_object.cpp:
              (JSC::Bindings::RuntimeObject::RuntimeObject):
              * bridge/runtime_object.h:
              (JSC::Bindings::RuntimeObject::createStructure):
              * history/HistoryItem.h:
      2011-04-13  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Geoff Garen.
      
              GC allocate Structure
              https://bugs.webkit.org/show_bug.cgi?id=58483
      
              Update WebKit for the world of GC allocated Structure
      
              * Plugins/Hosted/NetscapePluginInstanceProxy.h:
              * Plugins/Hosted/ProxyInstance.mm:
              (WebKit::ProxyRuntimeMethod::createStructure):
              * Plugins/Hosted/ProxyRuntimeObject.h:
              (WebKit::ProxyRuntimeObject::createStructure):
      2011-04-13  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Geoff Garen.
      
              GC allocate Structure
              https://bugs.webkit.org/show_bug.cgi?id=58483
      
              Update WK2 for the world of GC allocated Structure
      
              * WebProcess/Plugins/Netscape/JSNPMethod.h:
              (WebKit::JSNPMethod::createStructure):
              * WebProcess/Plugins/Netscape/JSNPObject.h:
              (WebKit::JSNPObject::createStructure):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bb8da910
  20. 16 Feb, 2011 1 commit
    • barraclough@apple.com's avatar
      Bug 54524 - Allow JSObject to fully utilize cell's capacity for inline storage. · 77da1086
      barraclough@apple.com authored
      Reviewed by Geoff Garen.
      
      Currently JSObject is both directly instantiated for regular JS objects, and
      derived to implement subtypes. A consequence of this is that we need to ensure
      that sufficient space from the cell is left unused and available for any data
      members that will be introduced by subclasses of JSObject. By restructuring
      the internal storage array out of JSObject we can increase the size in the
      internal storage for regular objects.
      
      Add classes JSFinalObject and JSNonFinalObject. JSNonFinalObject retains as
      much additional capacity as is currently available to allow for data members
      in subclasses. JSFinalObject utilizes all available space for internal storage,
      and only allows construction through JSFinalObject::create().
      
      Source/JavaScriptCore: 
      
      The additional storage made available in the JSObject means that we need no
      longer rely on a union of the internal storage with a pointer to storage that
      is only valid for external storage. This means we can go back to always having
      a valid pointer to property storage, regardless of whether this is internal or
      external. This simplifies some cases of access to the array from C code, and
      significantly simplifies JIT access, since repatching no longer needs to be
      able to change between a load of the storage pointer / a LEA of the internal
      storage.
      
      * API/JSObjectRef.cpp:
      (JSObjectMake):
      * assembler/ARMAssembler.h:
      * assembler/ARMv7Assembler.h:
      * assembler/AbstractMacroAssembler.h:
      (JSC::AbstractMacroAssembler::repatchPointer):
      * assembler/MIPSAssembler.h:
      * assembler/MacroAssemblerARM.h:
      * assembler/MacroAssemblerARMv7.h:
      * assembler/MacroAssemblerMIPS.h:
      * assembler/MacroAssemblerX86.h:
      * assembler/MacroAssemblerX86_64.h:
      * assembler/RepatchBuffer.h:
      * assembler/X86Assembler.h:
      * debugger/DebuggerActivation.cpp:
      (JSC::DebuggerActivation::DebuggerActivation):
      * debugger/DebuggerActivation.h:
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JIT.h:
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_resolve_global):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_resolve_global):
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::compileGetDirectOffset):
      (JSC::JIT::emit_op_get_by_pname):
      (JSC::JIT::compileGetByIdHotPath):
      (JSC::JIT::emit_op_put_by_id):
      (JSC::JIT::compilePutDirectOffset):
      (JSC::JIT::patchGetByIdSelf):
      (JSC::JIT::patchPutByIdReplace):
      (JSC::JIT::privateCompileGetByIdProto):
      (JSC::JIT::privateCompileGetByIdSelfList):
      (JSC::JIT::privateCompileGetByIdProtoList):
      (JSC::JIT::privateCompileGetByIdChainList):
      (JSC::JIT::privateCompileGetByIdChain):
      * jit/JITPropertyAccess32_64.cpp:
      (JSC::JIT::compileGetByIdHotPath):
      (JSC::JIT::emit_op_put_by_id):
      (JSC::JIT::compilePutDirectOffset):
      (JSC::JIT::compileGetDirectOffset):
      (JSC::JIT::patchGetByIdSelf):
      (JSC::JIT::patchPutByIdReplace):
      (JSC::JIT::privateCompileGetByIdProto):
      (JSC::JIT::privateCompileGetByIdSelfList):
      (JSC::JIT::privateCompileGetByIdProtoList):
      (JSC::JIT::privateCompileGetByIdChainList):
      (JSC::JIT::privateCompileGetByIdChain):
      (JSC::JIT::emit_op_get_by_pname):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * runtime/Arguments.h:
      (JSC::Arguments::Arguments):
      * runtime/ErrorInstance.cpp:
      (JSC::ErrorInstance::ErrorInstance):
      * runtime/ErrorInstance.h:
      * runtime/ExceptionHelpers.cpp:
      (JSC::InterruptedExecutionError::InterruptedExecutionError):
      (JSC::TerminatedExecutionError::TerminatedExecutionError):
      * runtime/JSArray.cpp:
      (JSC::JSArray::JSArray):
      * runtime/JSArray.h:
      * runtime/JSByteArray.cpp:
      (JSC::JSByteArray::JSByteArray):
      * runtime/JSByteArray.h:
      (JSC::JSByteArray::JSByteArray):
      * runtime/JSFunction.cpp:
      (JSC::JSFunction::getOwnPropertySlot):
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      * runtime/JSGlobalObject.h:
      (JSC::constructEmptyObject):
      * runtime/JSNotAnObject.h:
      (JSC::JSNotAnObject::JSNotAnObject):
      * runtime/JSObject.cpp:
      (JSC::JSObject::createInheritorID):
      (JSC::JSObject::allocatePropertyStorage):
      * runtime/JSObject.h:
      (JSC::JSObject::propertyStorage):
      (JSC::JSNonFinalObject::JSNonFinalObject):
      (JSC::JSNonFinalObject::createStructure):
      (JSC::JSFinalObject::create):
      (JSC::JSFinalObject::createStructure):
      (JSC::JSFinalObject::JSFinalObject):
      (JSC::JSObject::offsetOfInlineStorage):
      (JSC::constructEmptyObject):
      (JSC::createEmptyObjectStructure):
      (JSC::JSObject::JSObject):
      (JSC::JSObject::~JSObject):
      (JSC::Structure::isUsingInlineStorage):
      * runtime/JSObjectWithGlobalObject.cpp:
      (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
      * runtime/JSObjectWithGlobalObject.h:
      (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
      * runtime/JSTypeInfo.h:
      (JSC::TypeInfo::TypeInfo):
      (JSC::TypeInfo::isVanilla):
      * runtime/JSVariableObject.h:
      (JSC::JSVariableObject::JSVariableObject):
      * runtime/JSWrapperObject.h:
      (JSC::JSWrapperObject::JSWrapperObject):
      * runtime/ObjectConstructor.cpp:
      (JSC::constructObject):
      * runtime/ObjectPrototype.cpp:
      (JSC::ObjectPrototype::ObjectPrototype):
      * runtime/ObjectPrototype.h:
      * runtime/StrictEvalActivation.cpp:
      (JSC::StrictEvalActivation::StrictEvalActivation):
      * runtime/StrictEvalActivation.h:
      * runtime/Structure.cpp:
      (JSC::Structure::Structure):
      (JSC::Structure::growPropertyStorageCapacity):
      
      Source/JavaScriptGlue: 
      
      * UserObjectImp.cpp:
      * UserObjectImp.h:
          Update JSObject -> JSNonFinalObject.
      
      Source/WebCore: 
      
      * bindings/js/JSDOMWindowShell.h:
          Update JSObject -> JSNonFinalObject.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      77da1086
  21. 10 Jan, 2011 1 commit
    • barraclough@apple.com's avatar
      Bug 52079 - Syntax errors should be early errors. · 7e6bd6d6
      barraclough@apple.com authored
      Reviewed by Oliver Hunt.
      
      Source/JavaScriptCore: 
      
      From chapter 16 the spec:
          An implementation must report most errors at the time the relevant ECMAScript language construct is
          evaluated. An early error is an error that can be detected and reported prior to the evaluation of
          any construct in the Program containing the error. An implementation must report early errors in a
          Program prior to the first evaluation of that Program. Early errors in eval code are reported at
          the time eval is called but prior to evaluation of any construct within the eval code. All errors
          that are not early errors are runtime errors.
      
          An implementation must treat any instance of the following kinds of errors as an early error:
              * Any syntax error."
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
          Added new files.
      * bytecode/CodeBlock.cpp:
          Removed op_throw_syntax_error.
      * bytecode/Opcode.h:
          Removed op_throw_syntax_error.
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::generate):
          If m_expressionTooDeep then throw a runtime error.
      (JSC::BytecodeGenerator::BytecodeGenerator):
          Initialize m_expressionTooDeep.
      (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
          Sets m_expressionTooDeep.
      * bytecompiler/BytecodeGenerator.h:
          Added m_expressionTooDeep, removed emitThrowSyntaxError.
      * bytecompiler/NodesCodegen.cpp:
      (JSC::RegExpNode::emitBytecode):
      (JSC::ContinueNode::emitBytecode):
      (JSC::BreakNode::emitBytecode):
      (JSC::ReturnNode::emitBytecode):
      (JSC::LabelNode::emitBytecode):
          Conditions that threw syntax error are now handled during parsing;
          during bytecompilation these are now just ASSERTs.
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * jit/JIT.h:
      * jit/JITOpcodes.cpp:
      * jit/JITOpcodes32_64.cpp:
      * jit/JITStubs.cpp:
      * jit/JITStubs.h:
          Removed op_throw_syntax_error.
      * parser/ASTBuilder.h:
      (JSC::ASTBuilder::createRegExp):
          Renamed; added syntax check.
      * parser/JSParser.cpp:
      (JSC::JSParser::breakIsValid):
      (JSC::JSParser::hasLabel):
      (JSC::JSParser::Scope::Scope):
      (JSC::JSParser::Scope::setIsFunction):
      (JSC::JSParser::Scope::isFunctionBoundary):
      (JSC::JSParser::ScopeRef::hasContainingScope):
      (JSC::JSParser::ScopeRef::containingScope):
      (JSC::JSParser::AutoPopScopeRef::AutoPopScopeRef):
      (JSC::JSParser::AutoPopScopeRef::~AutoPopScopeRef):
      (JSC::JSParser::AutoPopScopeRef::setPopped):
      (JSC::JSParser::popScopeInternal):
      (JSC::JSParser::popScope):
      (JSC::jsParse):
      (JSC::JSParser::JSParser):
      (JSC::JSParser::parseProgram):
      (JSC::JSParser::parseBreakStatement):
      (JSC::JSParser::parseContinueStatement):
      (JSC::JSParser::parseReturnStatement):
      (JSC::JSParser::parseTryStatement):
      (JSC::JSParser::parseFunctionInfo):
      (JSC::JSParser::parseExpressionOrLabelStatement):
      (JSC::JSParser::parsePrimaryExpression):
      * parser/JSParser.h:
      * parser/Nodes.h:
      * parser/Parser.cpp:
      (JSC::Parser::parse):
      * parser/SyntaxChecker.h:
      (JSC::SyntaxChecker::createRegExp):
          Renamed; added syntax check.
      * runtime/ExceptionHelpers.cpp:
      (JSC::createOutOfMemoryError):
      (JSC::throwOutOfMemoryError):
      * runtime/ExceptionHelpers.h:
          Broke out createOutOfMemoryError.
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
          Add check for exception after bytecode generation.
      * runtime/RegExpConstructor.cpp:
      (JSC::constructRegExp):
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncCompile):
          RegExp error prefixes not included in error string.
      * yarr/RegexParser.h:
      (JSC::Yarr::Parser::parse):
          Removed regexBegin/regexEnd/regexError.
      * yarr/RegexPattern.cpp:
      (JSC::Yarr::RegexPatternConstructor::regexBegin):
          Removed regexEnd/regexError.
      (JSC::Yarr::compileRegex):
          Add call to regexBegin (no longer called from the parser).
      * yarr/YarrSyntaxChecker.cpp: Added.
      (JSC::Yarr::SyntaxChecker::assertionBOL):
      (JSC::Yarr::SyntaxChecker::assertionEOL):
      (JSC::Yarr::SyntaxChecker::assertionWordBoundary):
      (JSC::Yarr::SyntaxChecker::atomPatternCharacter):
      (JSC::Yarr::SyntaxChecker::atomBuiltInCharacterClass):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassBegin):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassAtom):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassRange):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassBuiltIn):
      (JSC::Yarr::SyntaxChecker::atomCharacterClassEnd):
      (JSC::Yarr::SyntaxChecker::atomParenthesesSubpatternBegin):
      (JSC::Yarr::SyntaxChecker::atomParentheticalAssertionBegin):
      (JSC::Yarr::SyntaxChecker::atomParenthesesEnd):
      (JSC::Yarr::SyntaxChecker::atomBackReference):
      (JSC::Yarr::SyntaxChecker::quantifyAtom):
      (JSC::Yarr::SyntaxChecker::disjunction):
      (JSC::Yarr::checkSyntax):
      * yarr/YarrSyntaxChecker.h: Added.
          Check RegExp syntax.
      
      LayoutTests: 
      
      Fix syntax errors in layout tests, and update expected results.
      
      * editing/selection/select-crash-001.html:
      * editing/selection/select-crash-002.html:
      * fast/canvas/webgl/renderbuffer-initialization.html:
      * fast/forms/25153.html:
      * fast/forms/textfield-drag-into-disabled.html:
      * fast/js/exception-codegen-crash-expected.txt:
      * fast/js/exception-codegen-crash.html:
      * fast/js/kde/parse-expected.txt:
      * fast/js/kde/script-tests/parse.js:
      * fast/js/large-expressions-expected.txt:
      * fast/js/named-function-expression-expected.txt:
      * fast/js/parser-syntax-check-expected.txt:
      * fast/js/script-tests/large-expressions.js:
      * fast/js/script-tests/named-function-expression.js:
      * fast/js/script-tests/parser-syntax-check.js:
      * fast/js/sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A11.1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A11_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A12.1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.6_Iteration_Statements/12.6.3_The_for_Statement/S12.6.3_A12_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A1_T4-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A5_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A6-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A8_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.7_The_continue_Statement/S12.7_A8_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A1_T4-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A5_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A6-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A8_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.8_The_break_Statement/S12.8_A8_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T1-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T10-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T2-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T3-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T4-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T5-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T6-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T7-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T8-expected.txt:
      * fast/js/sputnik/Conformance/12_Statement/12.9_The_return_Statement/S12.9_A1_T9-expected.txt:
      * http/tests/security/isolatedWorld/events.html:
      * http/tests/security/isolatedWorld/userGestureEvents.html:
      * svg/custom/resources/use-instanceRoot-event-listeners.js:
      * svg/custom/rgbcolor-syntax.svg:
      * svg/custom/use-instanceRoot-modifications.svg:
      * svg/custom/use-property-changes-through-svg-dom.svg:
      * webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive:
      * webarchive/resources/adopt-attribute-styled-body-iframe.html:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7e6bd6d6
  22. 01 Jan, 2011 1 commit
    • abarth@webkit.org's avatar
      Move JavaScriptCore to Source · 76da8fc1
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=51604
      
      Reviewed by Eric Seidel.
      
      Update references to JavaScriptCore to point to the new location.
      
      * Android.mk:
      * CMakeLists.txt:
      * DerivedSources.pro:
      * GNUmakefile.am:
      * Makefile:
      * WebKit.pri:
      * WebKit.pro:
      * wscript:
      
      Tools: 
      
      Update references to JavaScriptCore to point to the new location.
      
      * BuildSlaveSupport/build.webkit.org-config/master.cfg:
      * DumpRenderTree/qt/DumpRenderTree.pro:
      * DumpRenderTree/qt/ImageDiff.pro:
      * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
      * DumpRenderTree/wscript:
      * Scripts/build-jsc:
      * Scripts/build-webkit:
      * Scripts/do-file-rename:
      * Scripts/do-webcore-rename:
      * Scripts/run-javascriptcore-tests:
      * Scripts/update-javascriptcore-test-results:
      * Scripts/webkitdirs.pm:
      * Scripts/webkitpy/common/config/build_unittest.py:
      * Scripts/webkitpy/style/checker.py:
      * Scripts/webkitpy/style/checker_unittest.py:
      * Scripts/webkitpy/style/checkers/cpp_unittest.py:
      * WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro:
      * WebKitTestRunner/qt/WebKitTestRunner.pro:
      * wx/build/settings.py:
      
      WebCore: 
      
      Update references to JavaScriptCore.
      
      * Android.derived.jscbindings.mk:
      * Android.v8bindings.mk:
      * CMakeLists.txt:
      * WebCore.gyp/WebCore.gyp:
      * WebCore.pro:
        - These changes are subtle and might not be 100% correct.
      * move-js-headers.sh:
      
      WebKit/chromium: 
      
      * WebKit.gyp:
        - Point to JavaScriptCore in its new location.
      
      WebKit/gtk: 
      
      * GNUmakefile.am:
      * docs/GNUmakefile.am:
        - Point to JavaScriptCore in its new location.
      
      WebKit/qt: 
      
      * WebKit_pch.h:
      * docs/qtwebkit.qdocconf:
        - Point to JavaScriptCore in its new location.
      
      WebKit/win: 
      
      * WebKit.vcproj/WebKit.sln:
        - Point to JavaScriptCore in its new location.
      
      WebKit/wx: 
      
      * bindings/python/wscript:
      * wscript:
        - Point to JavaScriptCore in its new location.
      
      WebKit2: 
      
      * WebKit2.pro:
        - Point to JavaScriptCore in its new location.
      
      Websites/bugs.webkit.org: 
      
      * PrettyPatch/PrettyPatch.rb:
        - Remove reference to JavaScriptCore as a source directory.
      
      Websites/webkit.org: 
      
      * coding/assertion-guidelines.html:
        - Update documentation to point to the new location of
          JavaScriptCore.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      76da8fc1
  23. 16 Nov, 2010 1 commit
    • barraclough@apple.com's avatar
      JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=49606 · 8da6d979
      barraclough@apple.com authored
      Reviewed by Oliver Hunt.
      
      The bug here is that we read the prototype from the RHS argument using a regular
      op_get_by_id before op_instanceof has checked that this is an object implementing
      HasInstance. This incorrect behaviour gives rise to further unnecessary complexity
      in the code base, since we have additional logic (implemented using the
      GetByIdExceptionInfo data structures on CodeBlock) to convert not an object errors
      from the get_by_id into invalid parameter errors. Having fixed this bug this code
      is all redundant, since in these cases the get_by_id will never have been reached.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump):
      (JSC::CodeBlock::shrinkToFit):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::addExpressionInfo):
      * bytecode/Opcode.h:
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::BytecodeGenerator):
      (JSC::BytecodeGenerator::emitCheckHasInstance):
      * bytecompiler/BytecodeGenerator.h:
      * bytecompiler/NodesCodegen.cpp:
      (JSC::InstanceOfNode::emitBytecode):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::throwException):
      (JSC::Interpreter::privateExecute):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      (JSC::JIT::privateCompileSlowCases):
      * jit/JIT.h:
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_check_has_instance):
      (JSC::JIT::emit_op_instanceof):
      (JSC::JIT::emitSlow_op_check_has_instance):
      (JSC::JIT::emitSlow_op_instanceof):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_check_has_instance):
      (JSC::JIT::emit_op_instanceof):
      (JSC::JIT::emitSlow_op_check_has_instance):
      (JSC::JIT::emitSlow_op_instanceof):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * jit/JITStubs.h:
      * runtime/ExceptionHelpers.cpp:
      (JSC::createInterruptedExecutionException):
      (JSC::createTerminatedExecutionException):
      (JSC::createUndefinedVariableError):
      (JSC::createNotAFunctionError):
      (JSC::createNotAnObjectError):
      * runtime/ExceptionHelpers.h:
      * runtime/JSGlobalData.cpp:
      (JSC::JSGlobalData::JSGlobalData):
      * runtime/JSGlobalData.h:
      * runtime/JSNotAnObject.cpp:
      (JSC::JSNotAnObject::toPrimitive):
      (JSC::JSNotAnObject::getPrimitiveNumber):
      (JSC::JSNotAnObject::toBoolean):
      (JSC::JSNotAnObject::toNumber):
      (JSC::JSNotAnObject::toString):
      (JSC::JSNotAnObject::toObject):
      (JSC::JSNotAnObject::getOwnPropertySlot):
      (JSC::JSNotAnObject::getOwnPropertyDescriptor):
      (JSC::JSNotAnObject::put):
      (JSC::JSNotAnObject::deleteProperty):
      (JSC::JSNotAnObject::getOwnPropertyNames):
      * runtime/JSNotAnObject.h:
      (JSC::JSNotAnObject::JSNotAnObject):
      * runtime/JSObject.h:
      (JSC::JSObject::isActivationObject):
      * runtime/JSValue.cpp:
      (JSC::JSValue::toObjectSlowCase):
      (JSC::JSValue::synthesizeObject):
      (JSC::JSValue::synthesizePrototype):
      
      LayoutTests: Bug 49606 - instanceof should only get the prototype property if the RHS operand implements HasInstance
      
      Reviewed by Oliver Hunt.
      
      * fast/js/instanceof-XMLHttpRequest-expected.txt: Copied from LayoutTests/fast/js/instanceof-operator-expected.txt.
      * fast/js/instanceof-XMLHttpRequest.html: Copied from LayoutTests/fast/js/instanceof-operator.html.
      * fast/js/script-tests/instanceof-XMLHttpRequest.js: Copied from LayoutTests/fast/js/script-tests/instanceof-operator.js.
          - renamed existing testcase; these really test XMLHttpRequest objects, rather than the instanceof operator.
      
      * fast/js/instanceof-operator-expected.txt:
      * fast/js/script-tests/instanceof-operator.js:
          - added test case for: javascript: ({} instanceof { get prototype(){ alert("Error!"); } })
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8da6d979
  24. 15 Nov, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 49488 - Only add source specific information to exceptions in Interpreter::throwException · e979a658
      barraclough@apple.com authored
      Reviewed by Geoff Garen.
      
      JavaScriptCore: 
      
      Three types of source location information are added to errors.
      
      (1) Divot information.
      
      This was added with the intention of using it to provide better source highlighting in the inspector.
      We may still want to do so, but we probably should not be exposing these values in a manner visible to
      user scripts – only through an internal C++ interface. The code adding divot properties to objects has
      been removed.
      
      (2) Line number information.
      
      Line number information is presently sometimes added at the point the exception is created, and sometimes
      added at the point the exception passes through throwException. Change this so that throwException has
      the sole responsibility for adding line number and source file information.
      
      (3) Source snippets in the message of certain type errors (e.g. 'doc' in `Result of expression 'doc' [undefined] is not an object.`).
      
      These messages are currently created at the point the exceptions is raised. Instead reformat the message
      such that the source snippet is located at the end (`Result of expression 'b1' [undefined] is not an object.`
      becomes `'undefined' is not an object (evaluating 'b1.property')`), and append these to the message at
      the in throw Exception. This presents a number of advantages:
        * we no longer need to have source location information to create these TypeErrors.
        * we can chose to append source location information in other error messages, including those where
          passing source location to the point of construction would be inconvenient.
        * we can chose in future to omit to append source location information when running in a non-debug mode.
      
      This also cleans up some error output, e.g. removing double brackets ('[[]]') around objects in output,
      removing double periods (..) at end of lines, and adding slightly more context to some errors.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::expressionRangeForBytecodeOffset):
          - Separated called to access line and range information.
      
      * bytecode/CodeBlock.h:
          - Separated called to access line and range information.
      
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::resolve):
      (JSC::Interpreter::resolveSkip):
      (JSC::Interpreter::resolveGlobal):
      (JSC::Interpreter::resolveGlobalDynamic):
      (JSC::Interpreter::resolveBaseAndProperty):
      (JSC::isInvalidParamForIn):
      (JSC::isInvalidParamForInstanceOf):
          - Update parameters passed to error constructors.
      (JSC::appendSourceToError):
          - Update message property to add location information (previously added in createErrorMessage, in ExceptionHelpers)
      (JSC::Interpreter::throwException):
          - Updated to call appendSourceToError. 
      (JSC::Interpreter::privateExecute):
          - Update parameters passed to error constructors.
      
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
          - Update parameters passed to error constructors.
      
      * runtime/Error.cpp:
      (JSC::addErrorInfo):
      (JSC::hasErrorInfo):
          - Removed divot properties.
      
      * runtime/Error.h:
          - Removed divot properties.
      
      * runtime/ErrorInstance.cpp:
      (JSC::ErrorInstance::ErrorInstance):
          - Initialize new property.
      
      * runtime/ErrorInstance.h:
      (JSC::ErrorInstance::appendSourceToMessage):
      (JSC::ErrorInstance::setAppendSourceToMessage):
      (JSC::ErrorInstance::clearAppendSourceToMessage):
          - Added flag to check for errors needing location information appending.
      (JSC::ErrorInstance::isErrorInstance):
          - Added virtual method to check for ErrorInstances.
      
      * runtime/ExceptionHelpers.cpp:
      (JSC::createUndefinedVariableError):
      (JSC::createInvalidParamError):
      (JSC::createNotAConstructorError):
      (JSC::createNotAFunctionError):
      (JSC::createNotAnObjectError):
          - Update parameters passed to error constructors, stopped adding line number information early, changed TypeError messages.
      
      * runtime/ExceptionHelpers.h:
          - Updated function signatures.
      
      * runtime/JSFunction.cpp:
      (JSC::callHostFunctionAsConstructor):
          - Update parameters passed to error constructors.
      
      * runtime/JSObject.h:
      (JSC::JSObject::isErrorInstance):
          - Added virtual method to check for ErrorInstances.
      
      LayoutTests: 
      
      Updated results to account for changes in TypeError messages.
      (e.g. `Result of expression 'b1' [undefined] is not an object.` -> `'undefined' is not an object (evaluating 'b1.property')`).
      
      * fast/css/font-face-descriptor-multiple-values-parsing-expected.txt:
      * fast/css/resources/font-face-descriptor-multiple-values-parsing.js:
      * fast/css/variables/color-hex-test-expected.txt:
      * fast/dom/HTMLSelectElement/named-options-expected.txt:
      * fast/dom/Range/getClientRects-expected.txt:
      * fast/dom/SelectorAPI/dumpNodeList-almost-strict-expected.txt:
      * fast/dom/SelectorAPI/dumpNodeList-expected.txt:
      * fast/forms/select-namedItem-expected.txt:
      * fast/js/basic-strict-mode-expected.txt:
      * fast/js/date-toisostring-expected.txt:
      * fast/js/delete-getters-setters-expected.txt:
      * fast/js/exception-expression-offset-expected.txt:
      * fast/js/exception-for-nonobject-expected.txt:
      * fast/js/exception-thrown-from-new-expected.txt:
      * fast/js/exception-thrown-from-new.html:
      * fast/js/instance-of-immediates-expected.txt:
      * fast/js/script-tests/exception-expression-offset.js:
      (testException):
      * fast/js/sputnik/Conformance/08_Types/8.6_The_Object_Type/8.6.2_Internal_Properties_and_Methods/S8.6.2_A7-expected.txt:
      * fast/js/sputnik/Conformance/13_Function_Definition/S13_A17_T2-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A1_T1-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A1_T2-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A2_T1-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.2_Object.prototype.toString/S15.2.4.2_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.3_Object.prototype.toLocaleString/S15.2.4.3_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.4_Object.prototype.valueOf/S15.2.4.4_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.5_Object.prototype.hasOwnProperty/S15.2.4.5_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.6_Object.prototype.isPrototypeOf/S15.2.4.6_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/15.2.4.7_Object.prototype.propertyIsEnumerable/S15.2.4.7_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A4-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/15.3.4.2_Function.prototype.toString/S15.3.4.2_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/S15.3.4_A5-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T4-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.13_String.prototype.slice/S15.5.4.13_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.15_String.prototype.substring/S15.5.4.15_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.17_String.prototype.toLocaleLowerCase/S15.5.4.17_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.7_String.prototype.indexOf/S15.5.4.7_A7-expected.txt:
      * fast/js/sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.8_String.prototype.lastIndexOf/S15.5.4.8_A7-expected.txt:
      * fast/xsl/transform-xhr-doc-expected.txt:
      * http/tests/security/aboutBlank/xss-DENIED-navigate-opener-document-write-expected.txt:
      * http/tests/security/aboutBlank/xss-DENIED-navigate-opener-javascript-url-expected.txt:
      * http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt:
      * java/lc3/ArrayMethods/byte-001-expected.txt:
      * java/lc3/CallStatic/object-001-expected.txt:
      * java/lc3/ConvertBoolean/boolean-007-n-expected.txt:
      * java/lc3/ConvertBoolean/boolean-008-n-expected.txt:
      * java/lc3/ConvertBoolean/boolean-009-n-expected.txt:
      * java/lc3/ConvertBoolean/boolean-010-n-expected.txt:
      * java/lc3/ConvertBoolean/boolean-011-n-expected.txt:
      * java/lc3/ConvertBoolean/boolean-012-n-expected.txt:
      * java/lc3/ConvertBoolean/boolean-013-n-expected.txt:
      * java/lc3/ConvertBoolean/boolean-014-expected.txt:
      * java/lc3/ConvertNull/null-001-expected.txt:
      * java/lc3/ConvertNumber/number-011-expected.txt:
      * java/lc3/ConvertString/string-006-expected.txt:
      * java/lc3/ConvertString/string-007-n-expected.txt:
      * java/lc3/ConvertUndefined/undefined-002-expected.txt:
      * java/lc3/ConvertUndefined/undefined-003-expected.txt:
      * java/lc3/JSBoolean/boolean-005-n-expected.txt:
      * java/lc3/JSNumber/ToDouble-002-expected.txt:
      * java/lc3/JSObject/ToJSObject-001-expected.txt:
      * java/lc3/JSObject/ToObject-001-expected.txt:
      * java/lc3/JavaObject/JavaObjectFieldOrMethod-001-expected.txt:
      * platform/mac-snowleopard/canvas/philip/tests/2d.imageData.create1.type-expected.txt:
      * platform/mac-snowleopard/canvas/philip/tests/2d.imageData.create2.type-expected.txt:
      * platform/mac-snowleopard/canvas/philip/tests/2d.imageData.get.type-expected.txt:
      * platform/mac/compositing/reflections/reflection-opacity-expected.txt:
      * platform/mac/fast/css/variables/remove-variable-test-expected.txt:
      * platform/mac/fast/css/variables/set-variable-test-expected.txt:
      * platform/mac/fast/css/variables/variable-iteration-test-expected.txt:
      * platform/mac/fast/events/updateLayoutForHitTest-expected.txt:
      * platform/mac/svg/custom/createelement-expected.txt:
      * platform/mac/tables/mozilla/bugs/bug53690-1-expected.txt:
      * platform/mac/tables/mozilla_expected_failures/bugs/bug92868_1-expected.txt:
      * plugins/npruntime/object-from-destroyed-plugin-expected.txt:
      * plugins/npruntime/plugin-scriptable-object-invoke-default-expected.txt:
      * svg/custom/use-nested-missing-target-removed-expected.txt:
      * svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e979a658
  25. 27 Oct, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 48365 - Remove output parameters from JITStackFrame · 2607dd06
      barraclough@apple.com authored
      Reviewed by Oliver Hunt.
      
      The JIT stub functions presently use the stackframe to provide a couple of additional return values.
        * In the case of uncaught exceptions the exception value is returned on the stackframe.exception property.
        * In the case of caught exceptions the updated value for the callFrame register is returned on the stackframe.callFrame property.
      
      Change exception returns such that exceptions are always returned on JSGlobalData::exception.
      Change op_catch such that the new CallFrame value is returned from op_throw / vm_throw in regT0.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * debugger/Debugger.cpp:
      (JSC::evaluateInGlobalCallFrame):
      * debugger/DebuggerCallFrame.cpp:
      (JSC::DebuggerCallFrame::evaluate):
      * interpreter/CachedCall.h:
      (JSC::CachedCall::CachedCall):
      (JSC::CachedCall::call):
      * interpreter/CallFrame.h:
      (JSC::ExecState::exception):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::callEval):
      (JSC::Interpreter::Interpreter):
      (JSC::Interpreter::execute):
      (JSC::Interpreter::executeCall):
      (JSC::Interpreter::executeConstruct):
      (JSC::Interpreter::prepareForRepeatCall):
      (JSC::Interpreter::privateExecute):
      * interpreter/Interpreter.h:
      * jit/JITCode.h:
      (JSC::JITCode::execute):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_catch):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_catch):
      * jit/JITStubs.cpp:
      (JSC::ctiTrampoline):
      (JSC::jitThrow):
      (JSC::DEFINE_STUB_FUNCTION):
      * jit/JITStubs.h:
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncFilter):
      (JSC::arrayProtoFuncMap):
      (JSC::arrayProtoFuncEvery):
      (JSC::arrayProtoFuncForEach):
      (JSC::arrayProtoFuncSome):
      (JSC::arrayProtoFuncReduce):
      (JSC::arrayProtoFuncReduceRight):
      * runtime/CallData.cpp:
      (JSC::call):
      * runtime/Completion.cpp:
      (JSC::evaluate):
      * runtime/ConstructData.cpp:
      (JSC::construct):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createErrorForInvalidGlobalAssignment):
      (JSC::throwOutOfMemoryError):
      (JSC::throwStackOverflowError):
      * runtime/ExceptionHelpers.h:
      * runtime/JSArray.cpp:
      (JSC::JSArray::sort):
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::globalFuncEval):
      * runtime/StringPrototype.cpp:
      (JSC::stringProtoFuncReplace):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2607dd06
  26. 17 Oct, 2010 1 commit
    • oliver@apple.com's avatar
      2010-10-17 Oliver Hunt <oliver@apple.com> · aad311c0
      oliver@apple.com authored
              Reviewed by Sam Weinig.
      
              Strict mode: Assignment that would create a global should be a late ReferenceError, not a syntax failure
              https://bugs.webkit.org/show_bug.cgi?id=47788
      
              Fixing this required a couple of changes:
               * resolve_base now has a flag to indicate whether it is being used for a put in strict mode.
                 this allows us to throw an exception when we're doing a completely generic resolve for
                 assignment, and that assignment would create a new global.
               * There is a new opcode 'op_ensure_property_exists' that is used to determine whether
                 the property being assigned to already exists on the global object.  This currently
                 has no caching, but such caching could be added relatively trivially.  It is only used
                 in the case where we know that a property will be placed on the global object, and
                 we cannot verify that the property already exists.
      
              In the jit we plant a call to cti_op_resolve_base_strict_put in the effected case rather
              than making op_resolve_base have an additional runtime branch.
      
              There's also a new helper function to create the exception for the invalid assignment.
      
              * bytecode/CodeBlock.cpp:
              (JSC::CodeBlock::dump):
              * bytecode/Opcode.h:
              * bytecompiler/BytecodeGenerator.cpp:
              (JSC::BytecodeGenerator::emitResolveBase):
              (JSC::BytecodeGenerator::emitResolveBaseForPut):
              * bytecompiler/BytecodeGenerator.h:
              * bytecompiler/NodesCodegen.cpp:
              (JSC::AssignResolveNode::emitBytecode):
              (JSC::ForInNode::emitBytecode):
              * interpreter/Interpreter.cpp:
              (JSC::Interpreter::resolveBase):
              (JSC::Interpreter::privateExecute):
              * jit/JIT.cpp:
              (JSC::JIT::privateCompileMainPass):
              * jit/JIT.h:
              * jit/JITOpcodes.cpp:
              (JSC::JIT::emit_op_resolve_base):
              (JSC::JIT::emit_op_ensure_property_exists):
              * jit/JITOpcodes32_64.cpp:
              (JSC::JIT::emit_op_resolve_base):
              (JSC::JIT::emit_op_ensure_property_exists):
              * jit/JITStubs.cpp:
              (JSC::DEFINE_STUB_FUNCTION):
              * jit/JITStubs.h:
              * parser/JSParser.cpp:
              (JSC::JSParser::parseProgram):
              * runtime/ExceptionHelpers.cpp:
              (JSC::createErrorForInvalidGlobalAssignment):
              * runtime/ExceptionHelpers.h:
              * runtime/Operations.h:
              (JSC::resolveBase):
      2010-10-17  Oliver Hunt  <oliver@apple.com>
      
              Reviewed by Sam Weinig.
      
              Strict mode: Assignment that would create a global should be a late ReferenceError, not a syntax failure
              https://bugs.webkit.org/show_bug.cgi?id=47788
      
              Update test to check for the correct behaviour.
      
              * fast/js/basic-strict-mode-expected.txt:
              * fast/js/script-tests/basic-strict-mode.js:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aad311c0
  27. 13 Oct, 2010 1 commit
    • zimmermann@webkit.org's avatar
      2010-10-13 Nikolas Zimmermann <nzimmermann@rim.com> · 4e37bb26
      zimmermann@webkit.org authored
              Reviewed by Dirk Schulze.
      
              Add wtf/text/StringConcatenate
              https://bugs.webkit.org/show_bug.cgi?id=47584
      
              Move runtime/StringConcatenate.h to wtf/text, make it work for Strings too.
              Add a special runtime/UStringConcatenate.h class that inherits from StringConcatenate, and extends it for use with UString.
              Exactly the same design that has been followed while refactoring StringBuilder.
      
              The UString variants can all be removed as soon as WTF::String & JSC::UString converge.
      
              * GNUmakefile.am: Add wtf/text/StringConcatenate.h and runtime/UStringConcatenate.h.
              * JavaScriptCore.gypi: Ditto.
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
              * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
              * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
              * bytecode/CodeBlock.cpp: s/makeString/makeUString/
              (JSC::escapeQuotes):
              (JSC::valueToSourceString):
              (JSC::constantName):
              (JSC::idName):
              (JSC::CodeBlock::registerName):
              (JSC::regexpToSourceString):
              (JSC::regexpName):
              * bytecompiler/NodesCodegen.cpp: Ditto.
              (JSC::substitute):
              * profiler/Profiler.cpp: Ditto.
              (JSC::Profiler::createCallIdentifier):
              * runtime/ExceptionHelpers.cpp: Ditto.
              (JSC::createUndefinedVariableError):
              (JSC::createErrorMessage):
              (JSC::createInvalidParamError):
              * runtime/FunctionConstructor.cpp: Ditto.
              (JSC::constructFunction):
              * runtime/FunctionPrototype.cpp: Ditto.
              (JSC::insertSemicolonIfNeeded):
              * runtime/JSONObject.cpp: Ditto.
              (JSC::Stringifier::indent):
              * runtime/JSStringBuilder.h:
              (JSC::jsMakeNontrivialString):
              * runtime/RegExpConstructor.cpp: Ditto.
              (JSC::constructRegExp):
              * runtime/RegExpObject.cpp: Ditto.
              (JSC::RegExpObject::match):
              * runtime/RegExpPrototype.cpp: Ditto.
              (JSC::regExpProtoFuncCompile):
              * runtime/StringConcatenate.h: Removed.
              * runtime/UStringConcatenate.h: Added. Only contains the StringTypeAdapter<JSC::UString> code and the makeUString variants, the rest lives in wtf/text/StringConcatenate.h
              (JSC::makeUString):
              * wtf/text/StringConcatenate.h: Copied from runtime/StringConcatenate.h.
              (WTF::makeString):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4e37bb26
  28. 26 Aug, 2010 1 commit
    • barraclough@apple.com's avatar
      Rolling out r64608, this regressed performance. · ce1490e8
      barraclough@apple.com authored
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * assembler/ARMAssembler.cpp:
      (JSC::ARMAssembler::executableCopy):
      * assembler/LinkBuffer.h:
      (JSC::LinkBuffer::LinkBuffer):
      (JSC::LinkBuffer::~LinkBuffer):
      (JSC::LinkBuffer::performFinalization):
      * assembler/MIPSAssembler.h:
      (JSC::MIPSAssembler::executableCopy):
      * assembler/X86Assembler.h:
      (JSC::X86Assembler::executableCopy):
      * bytecode/StructureStubInfo.h:
      (JSC::StructureStubInfo::initGetByIdProto):
      (JSC::StructureStubInfo::initGetByIdChain):
      (JSC::StructureStubInfo::initGetByIdSelfList):
      (JSC::StructureStubInfo::initGetByIdProtoList):
      (JSC::StructureStubInfo::initPutByIdTransition):
      * jit/ExecutableAllocator.cpp:
      (JSC::ExecutablePool::systemAlloc):
      * jit/ExecutableAllocator.h:
      (JSC::ExecutablePool::create):
      (JSC::ExecutableAllocator::ExecutableAllocator):
      (JSC::ExecutableAllocator::poolForSize):
      (JSC::ExecutablePool::ExecutablePool):
      (JSC::ExecutablePool::poolAllocate):
      * jit/ExecutableAllocatorFixedVMPool.cpp:
      (JSC::FixedVMPoolAllocator::allocInternal):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile):
      * jit/JIT.h:
      (JSC::JIT::compileGetByIdProto):
      (JSC::JIT::compileGetByIdSelfList):
      (JSC::JIT::compileGetByIdProtoList):
      (JSC::JIT::compileGetByIdChainList):
      (JSC::JIT::compileGetByIdChain):
      (JSC::JIT::compilePutByIdTransition):
      (JSC::JIT::compilePatchGetArrayLength):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::privateCompileCTINativeCall):
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::stringGetByValStubGenerator):
      (JSC::JIT::privateCompilePutByIdTransition):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      (JSC::JIT::privateCompileGetByIdProto):
      (JSC::JIT::privateCompileGetByIdSelfList):
      (JSC::JIT::privateCompileGetByIdProtoList):
      (JSC::JIT::privateCompileGetByIdChainList):
      (JSC::JIT::privateCompileGetByIdChain):
      * jit/JITPropertyAccess32_64.cpp:
      (JSC::JIT::stringGetByValStubGenerator):
      (JSC::JIT::privateCompilePutByIdTransition):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      (JSC::JIT::privateCompileGetByIdProto):
      (JSC::JIT::privateCompileGetByIdSelfList):
      (JSC::JIT::privateCompileGetByIdProtoList):
      (JSC::JIT::privateCompileGetByIdChainList):
      (JSC::JIT::privateCompileGetByIdChain):
      * jit/JITStubs.cpp:
      (JSC::JITThunks::tryCachePutByID):
      (JSC::JITThunks::tryCacheGetByID):
      (JSC::DEFINE_STUB_FUNCTION):
      (JSC::getPolymorphicAccessStructureListSlot):
      * jit/JITStubs.h:
      * jit/SpecializedThunkJIT.h:
      (JSC::SpecializedThunkJIT::finalize):
      * runtime/ExceptionHelpers.cpp:
      * runtime/ExceptionHelpers.h:
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      (JSC::FunctionExecutable::reparseExceptionInfo):
      (JSC::EvalExecutable::reparseExceptionInfo):
      * yarr/RegexJIT.cpp:
      (JSC::Yarr::RegexGenerator::compile):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ce1490e8
  29. 11 Aug, 2010 1 commit
    • barraclough@apple.com's avatar
      Rubber stamps by Darin Adler & Sam Weinig. · c2527d64
      barraclough@apple.com authored
      Bug 43867 - Some UString cleanup
      
      Change JSC::UString data(), size(), and from(), to characters(), length(), and number() to match WTF::String.
      Move string concatenation methods to a new header to simplify down UString.h.  Remove is8Bit().
      
      JavaScriptCore: 
      
      * API/JSClassRef.cpp:
      (OpaqueJSClass::~OpaqueJSClass):
      (OpaqueJSClass::className):
      * API/OpaqueJSString.cpp:
      (OpaqueJSString::create):
      * JavaScriptCore.exp:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/CodeBlock.cpp:
      (JSC::constantName):
      (JSC::idName):
      (JSC::CodeBlock::registerName):
      (JSC::regexpName):
      * bytecode/EvalCodeCache.h:
      (JSC::EvalCodeCache::get):
      * bytecompiler/NodesCodegen.cpp:
      (JSC::ResolveNode::emitBytecode):
      (JSC::FunctionCallResolveNode::emitBytecode):
      (JSC::ReadModifyResolveNode::emitBytecode):
      (JSC::processClauseList):
      * parser/ASTBuilder.h:
      (JSC::ASTBuilder::createRegex):
      * parser/ParserArena.h:
      (JSC::IdentifierArena::makeNumericIdentifier):
      * parser/SourceProvider.h:
      (JSC::UStringSourceProvider::data):
      (JSC::UStringSourceProvider::length):
      * profiler/Profiler.cpp:
      * runtime/Arguments.cpp:
      (JSC::Arguments::getOwnPropertySlot):
      (JSC::Arguments::getOwnPropertyNames):
      (JSC::Arguments::put):
      (JSC::Arguments::deleteProperty):
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncToString):
      * runtime/DatePrototype.cpp:
      (JSC::formatLocaleDate):
      * runtime/ExceptionHelpers.cpp:
      * runtime/FunctionConstructor.cpp:
      * runtime/FunctionPrototype.cpp:
      (JSC::insertSemicolonIfNeeded):
      * runtime/Identifier.h:
      (JSC::Identifier::characters):
      (JSC::Identifier::length):
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::decode):
      (JSC::parseInt):
      (JSC::parseFloat):
      (JSC::globalFuncEscape):
      (JSC::globalFuncUnescape):
      * runtime/JSNumberCell.cpp:
      (JSC::JSNumberCell::toString):
      * runtime/JSONObject.cpp:
      (JSC::gap):
      (JSC::Stringifier::appendQuotedString):
      (JSC::Stringifier::appendStringifiedValue):
      (JSC::Stringifier::indent):
      (JSC::Stringifier::unindent):
      (JSC::Walker::walk):
      * runtime/JSString.cpp:
      (JSC::JSString::replaceCharacter):
      (JSC::JSString::getIndexSlowCase):
      * runtime/JSString.h:
      (JSC::RopeBuilder::JSString):
      (JSC::RopeBuilder::appendValueInConstructAndIncrementLength):
      (JSC::RopeBuilder::fiberCount):
      (JSC::jsSingleCharacterSubstring):
      (JSC::jsNontrivialString):
      (JSC::JSString::getIndex):
      (JSC::jsString):
      (JSC::jsStringWithFinalizer):
      (JSC::jsSubstring):
      (JSC::jsOwnedString):
      * runtime/JSStringBuilder.h:
      (JSC::JSStringBuilder::append):
      * runtime/LiteralParser.h:
      (JSC::LiteralParser::Lexer::Lexer):
      * runtime/NumberPrototype.cpp:
      (JSC::numberProtoFuncToString):
      (JSC::numberProtoFuncToFixed):
      (JSC::numberProtoFuncToExponential):
      (JSC::numberProtoFuncToPrecision):
      * runtime/NumericStrings.h:
      (JSC::NumericStrings::add):
      (JSC::NumericStrings::lookupSmallString):
      * runtime/Operations.h:
      (JSC::jsString):
      * runtime/RegExp.cpp:
      (JSC::RegExp::match):
      * runtime/RegExpCache.cpp:
      (JSC::RegExpCache::lookupOrCreate):
      (JSC::RegExpCache::create):
      * runtime/RegExpConstructor.cpp:
      (JSC::RegExpConstructor::getRightContext):
      * runtime/RegExpObject.cpp:
      (JSC::RegExpObject::match):
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncToString):
      * runtime/StringBuilder.h:
      (JSC::StringBuilder::append):
      * runtime/StringConcatenate.h: Copied from JavaScriptCore/runtime/UString.h.
      (JSC::):
      (JSC::sumWithOverflow):
      (JSC::tryMakeString):
      (JSC::makeString):
      * runtime/StringObject.cpp:
      (JSC::StringObject::getOwnPropertyNames):
      * runtime/StringPrototype.cpp:
      (JSC::substituteBackreferencesSlow):
      (JSC::localeCompare):
      (JSC::jsSpliceSubstringsWithSeparators):
      (JSC::stringProtoFuncReplace):
      (JSC::stringProtoFuncCharAt):
      (JSC::stringProtoFuncCharCodeAt):
      (JSC::stringProtoFuncIndexOf):
      (JSC::stringProtoFuncLastIndexOf):
      (JSC::stringProtoFuncSlice):
      (JSC::stringProtoFuncSplit):
      (JSC::stringProtoFuncSubstr):
      (JSC::stringProtoFuncSubstring):
      (JSC::stringProtoFuncToLowerCase):
      (JSC::stringProtoFuncToUpperCase):
      (JSC::stringProtoFuncFontsize):
      (JSC::stringProtoFuncLink):
      (JSC::trimString):
      * runtime/UString.cpp:
      (JSC::UString::number):
      (JSC::UString::ascii):
      (JSC::UString::operator[]):
      (JSC::UString::toDouble):
      (JSC::UString::find):
      (JSC::UString::rfind):
      (JSC::UString::substr):
      (JSC::operator==):
      (JSC::operator<):
      (JSC::operator>):
      (JSC::UString::UTF8String):
      * runtime/UString.h:
      (JSC::UString::UString):
      (JSC::UString::adopt):
      (JSC::UString::length):
      (JSC::UString::characters):
      (JSC::UString::isNull):
      (JSC::UString::isEmpty):
      (JSC::UString::impl):
      (JSC::UString::cost):
      (JSC::operator==):
      (JSC::operator!=):
      (JSC::codePointCompare):
      (JSC::UString::toArrayIndex):
      (JSC::IdentifierRepHash::hash):
      (WTF::):
      * yarr/RegexJIT.cpp:
      (JSC::Yarr::jitCompileRegex):
      * yarr/RegexParser.h:
      (JSC::Yarr::Parser::Parser):
      
      JavaScriptGlue: 
      
      * JSUtils.cpp:
      (UStringToCFString):
      (KJSValueToCFTypeInternal):
      * JavaScriptGlue.xcodeproj/project.pbxproj:
      
      WebCore: 
      
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/JSCSSStyleDeclarationCustom.cpp:
      (WebCore::hasCSSPropertyNamePrefix):
      (WebCore::cssPropertyName):
      * bindings/js/JSLocationCustom.cpp:
      (WebCore::JSLocation::setPort):
      * bindings/js/ScriptDebugServer.cpp:
      (WebCore::ScriptDebugServer::dispatchDidParseSource):
      * bindings/js/ScriptString.h:
      (WebCore::ScriptString::size):
      * bindings/js/ScriptValue.cpp:
      (WebCore::jsToInspectorValue):
      * bindings/objc/WebScriptObject.mm:
      (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
      * bridge/jni/jni_jsobject.mm:
      (JavaJSObject::convertValueToJObject):
      * bridge/jni/jsc/JNIUtilityPrivate.cpp:
      (JSC::Bindings::convertArrayInstanceToJavaArray):
      (JSC::Bindings::convertValueToJValue):
      * bridge/objc/objc_runtime.mm:
      (JSC::Bindings::callObjCFallbackObject):
      
      WebKit/mac: 
      
      * WebView/WebScriptDebugger.mm:
      (toNSString):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c2527d64
  30. 03 Aug, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 43390 - Do not CRASH if we run out of room for jit code. · 3c803686
      barraclough@apple.com authored
      Reviewed by Oliver Hunt.
      
      Change the ExecutableAllocator implementations not to crash, and to return 0 if memory cannot be allocated.
      The assemblers should pass this through without trying to use it in executableCopy.
      Change the LinkBuffer to handle this, and to provide an allocationSuccessful() method to test for this.
      
      Change the JIT to throw an exception if allocation fails.
      Make JIT optimizations fail gracefully if memory cannot be allocated (use non-optimized path).
      Change YARR JIT to fallback to PCRE 
      
      * assembler/ARMAssembler.cpp:
      (JSC::ARMAssembler::executableCopy):
      * assembler/ARMv7Assembler.h:
      (JSC::ARMv7Assembler::executableCopy):
      * assembler/LinkBuffer.h:
      (JSC::LinkBuffer::allocationSuccessful):
      * assembler/MIPSAssembler.h:
      (JSC::MIPSAssembler::executableCopy):
      * assembler/X86Assembler.h:
      (JSC::X86Assembler::executableCopy):
      * bytecode/StructureStubInfo.h:
      (JSC::StructureStubInfo::initGetByIdProto):
      (JSC::StructureStubInfo::initGetByIdChain):
      (JSC::StructureStubInfo::initGetByIdSelfList):
      (JSC::StructureStubInfo::initGetByIdProtoList):
      (JSC::StructureStubInfo::initPutByIdTransition):
      * jit/ExecutableAllocator.cpp:
      (JSC::ExecutablePool::systemAlloc):
      * jit/ExecutableAllocatorFixedVMPool.cpp:
      (JSC::FixedVMPoolAllocator::allocInternal):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile):
      * jit/JIT.h:
      (JSC::JIT::compileGetByIdProto):
      (JSC::JIT::compileGetByIdSelfList):
      (JSC::JIT::compileGetByIdProtoList):
      (JSC::JIT::compileGetByIdChainList):
      (JSC::JIT::compileGetByIdChain):
      (JSC::JIT::compilePutByIdTransition):
      (JSC::JIT::compilePatchGetArrayLength):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::privateCompileCTINativeCall):
      * jit/JITPropertyAccess.cpp:
      (JSC::JIT::stringGetByValStubGenerator):
      (JSC::JIT::privateCompilePutByIdTransition):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      (JSC::JIT::privateCompileGetByIdProto):
      (JSC::JIT::privateCompileGetByIdSelfList):
      (JSC::JIT::privateCompileGetByIdProtoList):
      (JSC::JIT::privateCompileGetByIdChainList):
      (JSC::JIT::privateCompileGetByIdChain):
      * jit/JITPropertyAccess32_64.cpp:
      (JSC::JIT::stringGetByValStubGenerator):
      (JSC::JIT::privateCompilePutByIdTransition):
      (JSC::JIT::privateCompilePatchGetArrayLength):
      (JSC::JIT::privateCompileGetByIdProto):
      (JSC::JIT::privateCompileGetByIdSelfList):
      (JSC::JIT::privateCompileGetByIdProtoList):
      (JSC::JIT::privateCompileGetByIdChainList):
      (JSC::JIT::privateCompileGetByIdChain):
      * jit/JITStubs.cpp:
      (JSC::JITThunks::tryCachePutByID):
      (JSC::JITThunks::tryCacheGetByID):
      (JSC::DEFINE_STUB_FUNCTION):
      (JSC::setupPolymorphicProtoList):
      * jit/JITStubs.h:
      * jit/SpecializedThunkJIT.h:
      (JSC::SpecializedThunkJIT::finalize):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createOutOfMemoryError):
      * runtime/ExceptionHelpers.h:
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      (JSC::FunctionExecutable::reparseExceptionInfo):
      (JSC::EvalExecutable::reparseExceptionInfo):
      * yarr/RegexJIT.cpp:
      (JSC::Yarr::RegexGenerator::compile):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3c803686
  31. 13 Jul, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 42207 - Clean up interface to compile executables, always check for exceptions · 40b4ad33
      barraclough@apple.com authored
      Reviewed by Oliver Hunt.
      
      Presently interface to compile executable is inconsistent between eval/program and
      function code, and is error prone in allowing a caller to byte compile without JIT
      compiling an executable (we rely on all executables with codeblocks having JIT code).
      Unify on an interface where all compilation is performed by a single compile (with
      ForCall|ForConstruct variants) method, and make all clients check for errors.
      
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::unwindCallFrame):
      (JSC::Interpreter::execute):
      (JSC::Interpreter::executeCall):
      (JSC::Interpreter::executeConstruct):
      (JSC::Interpreter::prepareForRepeatCall):
      (JSC::Interpreter::privateExecute):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * parser/Parser.h:
      (JSC::Parser::isFunctionBodyNode):
      (JSC::Parser::parse):
      * runtime/ArrayPrototype.cpp:
      (JSC::isNumericCompareFunction):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createStackOverflowError):
      * runtime/ExceptionHelpers.h:
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compileInternal):
      (JSC::ProgramExecutable::checkSyntax):
      (JSC::ProgramExecutable::compileInternal):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      (JSC::FunctionExecutable::reparseExceptionInfo):
      (JSC::EvalExecutable::reparseExceptionInfo):
      (JSC::FunctionExecutable::fromGlobalCode):
      * runtime/Executable.h:
      (JSC::EvalExecutable::compile):
      (JSC::EvalExecutable::generatedBytecode):
      (JSC::EvalExecutable::generatedJITCode):
      (JSC::ProgramExecutable::compile):
      (JSC::ProgramExecutable::generatedBytecode):
      (JSC::ProgramExecutable::generatedJITCode):
      (JSC::FunctionExecutable::generatedBytecode):
      (JSC::FunctionExecutable::compileForCall):
      (JSC::FunctionExecutable::compileForConstruct):
      (JSC::FunctionExecutable::generatedJITCodeForConstructWithArityCheck):
      * runtime/FunctionConstructor.cpp:
      (JSC::constructFunction):
      * runtime/JSActivation.cpp:
      (JSC::JSActivation::argumentsGetter):
      * runtime/JSGlobalData.h:
      (JSC::JSGlobalData::canUseJIT):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      40b4ad33
  32. 06 Jun, 2010 1 commit
    • barraclough@apple.com's avatar
      Bug 40214 - Clean up error construction / throwing in JSC. · 9c099f96
      barraclough@apple.com authored
              
      Reviewed by Sam Weinig.
      
      The one egregious insanity here is that creating an error requires
      a VM-entry-esqe-host call (the string argument is wrapped as a JS
      object & pushed on the RegisterFile, then unwrapped back to a
      UString).  Changing this also means you only require a global
      object, not an ExecState, to create an error.
      
      The methods to create error objects are also parameterized
      requiring a switch on the type, which can be made cleaner and
      faster by moving to a separate method per error type.  Code to add
      divot information to error had been duplicated, and is coalesced
      back into a single function.
      
      Convenience methods added to create & throw type & syntax error
      with a default error message, since this is a common case.
      
      Also, errors are currently thrown either using
      "throwError(exec, error)" or "exec->setException(error)" - unify
      on the former, since this is more commonly used.  Add
      "throwVMError(exec, error)" equivalents, as a convenience for
      cases where the result was being wrapped in "JSValue::encode(...)".
      
      JavaScriptCore: 
      
      * API/JSCallbackConstructor.cpp:
      (JSC::constructJSCallback):
      * API/JSCallbackFunction.cpp:
      (JSC::JSCallbackFunction::call):
      * API/JSCallbackObjectFunctions.h:
      (JSC::::getOwnPropertySlot):
      (JSC::::put):
      (JSC::::deleteProperty):
      (JSC::::construct):
      (JSC::::hasInstance):
      (JSC::::call):
      (JSC::::toNumber):
      (JSC::::toString):
      (JSC::::staticValueGetter):
      (JSC::::staticFunctionGetter):
      (JSC::::callbackGetter):
      * API/JSObjectRef.cpp:
      (JSObjectMakeError):
      * JavaScriptCore.exp:
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::emitNewError):
      (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
      * bytecompiler/BytecodeGenerator.h:
      * bytecompiler/NodesCodegen.cpp:
      (JSC::ThrowableExpressionData::emitThrowError):
      (JSC::RegExpNode::emitBytecode):
      (JSC::PostfixErrorNode::emitBytecode):
      (JSC::PrefixErrorNode::emitBytecode):
      (JSC::AssignErrorNode::emitBytecode):
      (JSC::ForInNode::emitBytecode):
      (JSC::ContinueNode::emitBytecode):
      (JSC::BreakNode::emitBytecode):
      (JSC::ReturnNode::emitBytecode):
      (JSC::LabelNode::emitBytecode):
      * interpreter/CallFrame.h:
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::throwException):
      (JSC::Interpreter::privateExecute):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * jsc.cpp:
      (functionRun):
      (functionLoad):
      (functionCheckSyntax):
      * parser/Nodes.h:
      * runtime/ArrayConstructor.cpp:
      (JSC::constructArrayWithSizeQuirk):
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncToString):
      (JSC::arrayProtoFuncToLocaleString):
      (JSC::arrayProtoFuncJoin):
      (JSC::arrayProtoFuncFilter):
      (JSC::arrayProtoFuncMap):
      (JSC::arrayProtoFuncEvery):
      (JSC::arrayProtoFuncForEach):
      (JSC::arrayProtoFuncSome):
      (JSC::arrayProtoFuncReduce):
      (JSC::arrayProtoFuncReduceRight):
      * runtime/BooleanPrototype.cpp:
      (JSC::booleanProtoFuncToString):
      (JSC::booleanProtoFuncValueOf):
      * runtime/DatePrototype.cpp:
      (JSC::dateProtoFuncToString):
      (JSC::dateProtoFuncToUTCString):
      (JSC::dateProtoFuncToISOString):
      (JSC::dateProtoFuncToDateString):
      (JSC::dateProtoFuncToTimeString):
      (JSC::dateProtoFuncToLocaleString):
      (JSC::dateProtoFuncToLocaleDateString):
      (JSC::dateProtoFuncToLocaleTimeString):
      (JSC::dateProtoFuncGetTime):
      (JSC::dateProtoFuncGetFullYear):
      (JSC::dateProtoFuncGetUTCFullYear):
      (JSC::dateProtoFuncToGMTString):
      (JSC::dateProtoFuncGetMonth):
      (JSC::dateProtoFuncGetUTCMonth):
      (JSC::dateProtoFuncGetDate):
      (JSC::dateProtoFuncGetUTCDate):
      (JSC::dateProtoFuncGetDay):
      (JSC::dateProtoFuncGetUTCDay):
      (JSC::dateProtoFuncGetHours):
      (JSC::dateProtoFuncGetUTCHours):
      (JSC::dateProtoFuncGetMinutes):
      (JSC::dateProtoFuncGetUTCMinutes):
      (JSC::dateProtoFuncGetSeconds):
      (JSC::dateProtoFuncGetUTCSeconds):
      (JSC::dateProtoFuncGetMilliSeconds):
      (JSC::dateProtoFuncGetUTCMilliseconds):
      (JSC::dateProtoFuncGetTimezoneOffset):
      (JSC::dateProtoFuncSetTime):
      (JSC::setNewValueFromTimeArgs):
      (JSC::setNewValueFromDateArgs):
      (JSC::dateProtoFuncSetMilliSeconds):
      (JSC::dateProtoFuncSetUTCMilliseconds):
      (JSC::dateProtoFuncSetSeconds):
      (JSC::dateProtoFuncSetUTCSeconds):
      (JSC::dateProtoFuncSetMinutes):
      (JSC::dateProtoFuncSetUTCMinutes):
      (JSC::dateProtoFuncSetHours):
      (JSC::dateProtoFuncSetUTCHours):
      (JSC::dateProtoFuncSetDate):
      (JSC::dateProtoFuncSetUTCDate):
      (JSC::dateProtoFuncSetMonth):
      (JSC::dateProtoFuncSetUTCMonth):
      (JSC::dateProtoFuncSetFullYear):
      (JSC::dateProtoFuncSetUTCFullYear):
      (JSC::dateProtoFuncSetYear):
      (JSC::dateProtoFuncGetYear):
      (JSC::dateProtoFuncToJSON):
      * runtime/Error.cpp:
      (JSC::createError):
      (JSC::createEvalError):
      (JSC::createRangeError):
      (JSC::createReferenceError):
      (JSC::createSyntaxError):
      (JSC::createTypeError):
      (JSC::createURIError):
      (JSC::addErrorSourceInfo):
      (JSC::addErrorDivotInfo):
      (JSC::addErrorInfo):
      (JSC::hasErrorInfo):
      (JSC::throwError):
      (JSC::throwTypeError):
      (JSC::throwSyntaxError):
      * runtime/Error.h:
      (JSC::throwVMError):
      (JSC::throwVMTypeError):
      * runtime/ErrorConstructor.cpp:
      (JSC::constructWithErrorConstructor):
      (JSC::callErrorConstructor):
      * runtime/ErrorConstructor.h:
      * runtime/ErrorInstance.cpp:
      (JSC::ErrorInstance::ErrorInstance):
      (JSC::ErrorInstance::create):
      * runtime/ErrorInstance.h:
      * runtime/ErrorPrototype.cpp:
      (JSC::ErrorPrototype::ErrorPrototype):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createStackOverflowError):
      (JSC::createUndefinedVariableError):
      (JSC::createInvalidParamError):
      (JSC::createNotAConstructorError):
      (JSC::createNotAFunctionError):
      (JSC::createNotAnObjectError):
      (JSC::throwOutOfMemoryError):
      * runtime/ExceptionHelpers.h:
      * runtime/Executable.cpp:
      (JSC::EvalExecutable::compile):
      (JSC::ProgramExecutable::checkSyntax):
      (JSC::ProgramExecutable::compile):
      * runtime/FunctionConstructor.cpp:
      (JSC::constructFunction):
      * runtime/FunctionPrototype.cpp:
      (JSC::functionProtoFuncToString):
      (JSC::functionProtoFuncApply):
      (JSC::functionProtoFuncCall):
      * runtime/Identifier.cpp:
      (JSC::Identifier::from):
      * runtime/Identifier.h:
      * runtime/JSArray.cpp:
      (JSC::JSArray::put):
      * runtime/JSFunction.cpp:
      (JSC::callHostFunctionAsConstructor):
      * runtime/JSGlobalObjectFunctions.cpp:
      (JSC::encode):
      (JSC::decode):
      (JSC::globalFuncEval):
      * runtime/JSONObject.cpp:
      (JSC::Stringifier::appendStringifiedValue):
      (JSC::Walker::walk):
      (JSC::JSONProtoFuncParse):
      (JSC::JSONProtoFuncStringify):
      * runtime/JSObject.cpp:
      (JSC::throwSetterError):
      (JSC::JSObject::put):
      (JSC::JSObject::putWithAttributes):
      (JSC::JSObject::defaultValue):
      (JSC::JSObject::hasInstance):
      (JSC::JSObject::defineOwnProperty):
      * runtime/JSObject.h:
      * runtime/JSValue.cpp:
      (JSC::JSValue::toObjectSlowCase):
      (JSC::JSValue::synthesizeObject):
      (JSC::JSValue::synthesizePrototype):
      * runtime/NativeErrorConstructor.cpp:
      (JSC::constructWithNativeErrorConstructor):
      (JSC::callNativeErrorConstructor):
      * runtime/NativeErrorConstructor.h:
      * runtime/NumberPrototype.cpp:
      (JSC::numberProtoFuncToString):
      (JSC::numberProtoFuncToLocaleString):
      (JSC::numberProtoFuncValueOf):
      (JSC::numberProtoFuncToFixed):
      (JSC::numberProtoFuncToExponential):
      (JSC::numberProtoFuncToPrecision):
      * runtime/ObjectConstructor.cpp:
      (JSC::objectConstructorGetPrototypeOf):
      (JSC::objectConstructorGetOwnPropertyDescriptor):
      (JSC::objectConstructorGetOwnPropertyNames):
      (JSC::objectConstructorKeys):
      (JSC::toPropertyDescriptor):
      (JSC::objectConstructorDefineProperty):
      (JSC::objectConstructorDefineProperties):
      (JSC::objectConstructorCreate):
      * runtime/ObjectPrototype.cpp:
      (JSC::objectProtoFuncDefineGetter):
      (JSC::objectProtoFuncDefineSetter):
      * runtime/RegExpConstructor.cpp:
      (JSC::constructRegExp):
      * runtime/RegExpObject.cpp:
      (JSC::RegExpObject::match):
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncTest):
      (JSC::regExpProtoFuncExec):
      (JSC::regExpProtoFuncCompile):
      (JSC::regExpProtoFuncToString):
      * runtime/StringPrototype.cpp:
      (JSC::stringProtoFuncToString):
      
      WebCore: 
      
      * WebCore.xcodeproj/project.pbxproj:
      * bindings/js/JSArrayBufferConstructor.h:
      (WebCore::construct):
      * bindings/js/JSArrayBufferViewHelper.h:
      (WebCore::setWebGLArrayHelper):
      * bindings/js/JSAudioConstructor.cpp:
      (WebCore::constructAudio):
      * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
      (WebCore::JSCanvasRenderingContext2D::setFillColor):
      (WebCore::JSCanvasRenderingContext2D::setStrokeColor):
      (WebCore::JSCanvasRenderingContext2D::drawImage):
      (WebCore::JSCanvasRenderingContext2D::drawImageFromRect):
      (WebCore::JSCanvasRenderingContext2D::setShadow):
      (WebCore::JSCanvasRenderingContext2D::createPattern):
      (WebCore::JSCanvasRenderingContext2D::fillText):
      (WebCore::JSCanvasRenderingContext2D::strokeText):
      * bindings/js/JSClipboardCustom.cpp:
      (WebCore::JSClipboard::clearData):
      (WebCore::JSClipboard::getData):
      (WebCore::JSClipboard::setDragImage):
      * bindings/js/JSDOMBinding.cpp:
      (WebCore::setDOMException):
      (WebCore::toJSSequence):
      * bindings/js/JSDOMWrapper.cpp:
      (WebCore::DOMObject::defineOwnProperty):
      * bindings/js/JSDesktopNotificationsCustom.cpp:
      (WebCore::JSNotificationCenter::requestPermission):
      * bindings/js/JSEventSourceConstructor.cpp:
      (WebCore::constructEventSource):
      * bindings/js/JSHTMLDocumentCustom.cpp:
      (WebCore::JSHTMLDocument::open):
      * bindings/js/JSHTMLInputElementCustom.cpp:
      (WebCore::JSHTMLInputElement::selectionStart):
      (WebCore::JSHTMLInputElement::setSelectionStart):
      (WebCore::JSHTMLInputElement::selectionEnd):
      (WebCore::JSHTMLInputElement::setSelectionEnd):
      (WebCore::JSHTMLInputElement::setSelectionRange):
      * bindings/js/JSImageConstructor.cpp:
      (WebCore::constructImage):
      * bindings/js/JSJavaScriptCallFrameCustom.cpp:
      (WebCore::JSJavaScriptCallFrame::evaluate):
      * bindings/js/JSMessageChannelConstructor.cpp:
      (WebCore::JSMessageChannelConstructor::construct):
      * bindings/js/JSMessagePortCustom.cpp:
      (WebCore::fillMessagePortArray):
      * bindings/js/JSOptionConstructor.cpp:
      (WebCore::constructHTMLOptionElement):
      * bindings/js/JSSVGMatrixCustom.cpp:
      (WebCore::JSSVGMatrix::multiply):
      * bindings/js/JSSharedWorkerConstructor.cpp:
      (WebCore::constructSharedWorker):
      * bindings/js/JSWebGLRenderingContextCustom.cpp:
      (WebCore::JSWebGLRenderingContext::bufferData):
      (WebCore::JSWebGLRenderingContext::bufferSubData):
      (WebCore::getObjectParameter):
      (WebCore::JSWebGLRenderingContext::getFramebufferAttachmentParameter):
      (WebCore::JSWebGLRenderingContext::getParameter):
      (WebCore::JSWebGLRenderingContext::getProgramParameter):
      (WebCore::JSWebGLRenderingContext::getShaderParameter):
      (WebCore::JSWebGLRenderingContext::getUniform):
      (WebCore::JSWebGLRenderingContext::texImage2D):
      (WebCore::JSWebGLRenderingContext::texSubImage2D):
      (WebCore::dataFunctionf):
      (WebCore::dataFunctioni):
      (WebCore::dataFunctionMatrix):
      * bindings/js/JSWebSocketConstructor.cpp:
      (WebCore::constructWebSocket):
      * bindings/js/JSWebSocketCustom.cpp:
      (WebCore::JSWebSocket::send):
      * bindings/js/JSWorkerConstructor.cpp:
      (WebCore::constructWorker):
      * bindings/js/JSXMLHttpRequestConstructor.cpp:
      (WebCore::constructXMLHttpRequest):
      * bindings/js/JSXMLHttpRequestCustom.cpp:
      (WebCore::JSXMLHttpRequest::open):
      * bindings/js/SerializedScriptValue.cpp:
      (WebCore::BaseWalker::throwStackOverflow):
      (WebCore::BaseWalker::throwInterruptedException):
      (WebCore::SerializingTreeWalker::startArray):
      (WebCore::SerializingTreeWalker::startObject):
      * bindings/js/WorkerScriptController.cpp:
      (WebCore::WorkerScriptController::setException):
      * bindings/scripts/CodeGeneratorJS.pm:
      * bridge/c/c_instance.cpp:
      (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
      (JSC::Bindings::CInstance::invokeMethod):
      (JSC::Bindings::CInstance::invokeDefaultMethod):
      (JSC::Bindings::CInstance::invokeConstruct):
      * bridge/jni/jsc/JNIBridgeJSC.cpp:
      (JavaField::dispatchValueFromInstance):
      (JavaField::dispatchSetValueToInstance):
      * bridge/jni/jsc/JavaInstanceJSC.cpp:
      (JavaInstance::invokeMethod):
      * bridge/objc/objc_instance.mm:
      (ObjcInstance::moveGlobalExceptionToExecState):
      (ObjcInstance::invokeMethod):
      * bridge/objc/objc_runtime.mm:
      (JSC::Bindings::ObjcField::valueFromInstance):
      (JSC::Bindings::ObjcField::setValueToInstance):
      (JSC::Bindings::ObjcArray::setValueAt):
      (JSC::Bindings::ObjcArray::valueAt):
      (JSC::Bindings::callObjCFallbackObject):
      * bridge/objc/objc_utility.h:
      * bridge/objc/objc_utility.mm:
      (JSC::Bindings::throwError):
      * bridge/runtime_array.cpp:
      (JSC::RuntimeArray::put):
      * bridge/runtime_method.cpp:
      (JSC::callRuntimeMethod):
      * bridge/runtime_object.cpp:
      (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
      
      WebKit/mac: 
      
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):
      * Plugins/Hosted/ProxyInstance.mm:
      (WebKit::ProxyInstance::invokeMethod):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9c099f96
  33. 24 May, 2010 3 commits
    • barraclough@apple.com's avatar
      Relanding r60075. · fd8c28a7
      barraclough@apple.com authored
      Reviewed by Sam Weinig.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump):
      (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
      * bytecode/CodeBlock.h:
      * bytecode/Opcode.h:
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::BytecodeGenerator):
      (JSC::BytecodeGenerator::emitConstruct):
      * bytecompiler/BytecodeGenerator.h:
      (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * jit/JIT.h:
      * jit/JITCall.cpp:
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITCall32_64.cpp:
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::privateCompileCTINativeCall):
      (JSC::JIT::emit_op_neq_null):
      (JSC::JIT::emit_op_convert_this):
      (JSC::JIT::emit_op_get_callee):
      (JSC::JIT::emit_op_create_this):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::privateCompileCTINativeCall):
      (JSC::JIT::emit_op_get_callee):
      (JSC::JIT::emit_op_create_this):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      (JSC::JITThunks::hostFunctionStub):
      * jit/JITStubs.h:
      (JSC::JITThunks::ctiNativeConstruct):
      (JSC::):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createNotAnObjectError):
      * runtime/Executable.h:
      (JSC::NativeExecutable::create):
      (JSC::NativeExecutable::NativeExecutable):
      * runtime/JSFunction.cpp:
      (JSC::callHostFunctionAsConstructor):
      * runtime/JSFunction.h:
      * wtf/Platform.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fd8c28a7
    • barraclough@apple.com's avatar
      Reverting 60075 & 60084, these broke the interpreter. · 9531967d
      barraclough@apple.com authored
      Reviewed by NOBODY (revert).
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump):
      (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
      * bytecode/CodeBlock.h:
      * bytecode/Opcode.h:
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::BytecodeGenerator):
      (JSC::BytecodeGenerator::emitConstruct):
      * bytecompiler/BytecodeGenerator.h:
      (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * jit/JIT.h:
      * jit/JITCall.cpp:
      (JSC::JIT::compileOpConstructSetupArgs):
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITCall32_64.cpp:
      (JSC::JIT::compileOpConstructSetupArgs):
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::emit_op_neq_null):
      (JSC::JIT::emit_op_convert_this):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      (JSC::JITThunks::hostFunctionStub):
      * jit/JITStubs.h:
      (JSC::JITThunks::ctiNativeCall):
      (JSC::):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createNotAnObjectError):
      * runtime/Executable.h:
      (JSC::NativeExecutable::create):
      (JSC::NativeExecutable::NativeExecutable):
      * runtime/JSFunction.cpp:
      * runtime/JSFunction.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9531967d
    • barraclough@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=39583 · f10670ff
      barraclough@apple.com authored
      Move creation of 'this' object from caller to callee in construction.
      
      Reviewed by Sam Weinig.
      
      Presently the caller of a constructor is responsible for providing a this
      object.  Instead, move the object creation into a new op_create_this opcode,
      planted in the head of the contructor bytecode for a function.  Since the
      prototype for the object is provided by performing a get_by_id on the callee,
      also add a new get_callee opcode (this is used to get the callee JSFunction
      into a register so that a normal get_by_id can be used).
      
      Currently the caller is also responsible for detecting when op_construct is
      performed on a JSFunction representing a host function, in which case an
      exception is thrown – and this check currently takes place when constructing
      the this object.  Instead, mirroring the recent changes for non-host functions,
      add a parallel code-path for native constructors to follow, with a thunk for
      invoking native constructors provided by JITStubs, and a constructor-specific
      NativeFunction on NativeExecutable.  Provide an implementation of a host
      constructor which will throw an exception.
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dump):
      (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
      * bytecode/CodeBlock.h:
      * bytecode/Opcode.h:
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::BytecodeGenerator):
      (JSC::BytecodeGenerator::emitConstruct):
      * bytecompiler/BytecodeGenerator.h:
      (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompileMainPass):
      * jit/JIT.h:
      * jit/JITCall.cpp:
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITCall32_64.cpp:
      (JSC::JIT::compileOpCall):
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::privateCompileCTINativeCall):
      (JSC::JIT::emit_op_neq_null):
      (JSC::JIT::emit_op_convert_this):
      (JSC::JIT::emit_op_get_callee):
      (JSC::JIT::emit_op_create_this):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::privateCompileCTIMachineTrampolines):
      (JSC::JIT::privateCompileCTINativeCall):
      (JSC::JIT::emit_op_get_callee):
      (JSC::JIT::emit_op_create_this):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      (JSC::JITThunks::hostFunctionStub):
      * jit/JITStubs.h:
      (JSC::JITThunks::ctiNativeConstruct):
      (JSC::):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createNotAnObjectError):
      * runtime/Executable.h:
      (JSC::NativeExecutable::create):
      (JSC::NativeExecutable::NativeExecutable):
      * runtime/JSFunction.cpp:
      (JSC::callHostFunctionAsConstructor):
      * runtime/JSFunction.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60075 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f10670ff
  34. 06 Apr, 2010 1 commit
    • eric@webkit.org's avatar
      2010-04-06 Adam Barth <abarth@webkit.org> · 5d91a8d3
      eric@webkit.org authored
              Reviewed by Eric Seidel.
      
              REGRESSION: Worker termination via JS timeout may cause worker tests like fast/workers/worker-terminate.html fail.
              https://bugs.webkit.org/show_bug.cgi?id=36646
      
              Add a new exception type for forcibly terminating a JavaScript stack.
              The new exception functions similarly to the
              InterruptedExecutionException but is conceptually different because
              execution is terminated instead of just interrupted.
      
              * GNUmakefile.am:
                  - Added new Terminator.h file.
              * JavaScriptCore.gypi:
                  - Added new Terminator.h file.
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
                  - Added new Terminator.h file.
              * JavaScriptCore.xcodeproj/project.pbxproj:
                  - Added new Terminator.h file.
              * interpreter/Interpreter.cpp:
              (JSC::Interpreter::throwException):
                  - Fully unwind the stack for TerminatedExecutionException.
              (JSC::Interpreter::privateExecute):
                  - Check if we've been terminated at the same time we check if we've
                    timed out.
              * jit/JITStubs.cpp:
              (JSC::DEFINE_STUB_FUNCTION):
                  - Check if we've been terminated at the same time we check if we've
                    timed out.
              * runtime/Completion.cpp:
                  - Some exceptions define special completion types so that calls can
                    see why we terminated evaluation.
              (JSC::evaluate):
              * runtime/Completion.h:
                  - Define a new completion type for termination.
              (JSC::):
              * runtime/ExceptionHelpers.cpp:
                  - Define TerminatedExecutionException and refactor pseudo-RTTI
                    virtual function to be more semantic.
              (JSC::InterruptedExecutionError::exceptionType):
              (JSC::TerminatedExecutionError::TerminatedExecutionError):
              (JSC::TerminatedExecutionError::exceptionType):
              (JSC::TerminatedExecutionError::toString):
              (JSC::createTerminatedExecutionException):
              * runtime/ExceptionHelpers.h:
                  - Entry point for generating a TerminatedExecutionException.
              * runtime/JSGlobalData.cpp:
              (JSC::JSGlobalData::JSGlobalData):
                  - Add a Terminator object that can be used to asynchronously
                    terminate a JavaScript execution stack.
              * runtime/JSGlobalData.h:
              * runtime/JSObject.h:
              (JSC::JSObject::exceptionType):
                  - Define that, by default, thrown objects have a normal exception
                    type.
              * runtime/Terminator.h: Added.
                  - Added a new controller object that can be used to terminate
                    execution asynchronously.  This object is more or less a
                    glorified bool.
              (JSC::Terminator::Terminator):
              (JSC::Terminator::termianteSoon):
              (JSC::Terminator::shouldTerminate):
      2010-04-06  Adam Barth  <abarth@webkit.org>
      
              Reviewed by Eric Seidel.
      
              REGRESSION: Worker termination via JS timeout may cause worker tests like fast/workers/worker-terminate.html fail.
              https://bugs.webkit.org/show_bug.cgi?id=36646
      
              * fast/workers/resources/worker-run-forever.js: Added.
              * fast/workers/worker-terminate-forever-expected.txt: Added.
              * fast/workers/worker-terminate-forever.html: Added.
                  - Test what happens when we terminate an infinitely running worker.
                    The essential point is that we don't spam the console with
                    nonsense about a timeout.
              * platform/mac/Skipped:
                  - Rescue worker-terminate.html from the Skipped list now that we've
                    fixed the underlying bug that was causing the flakiness.
      2010-04-06  Adam Barth  <abarth@webkit.org>
      
              Reviewed by Eric Seidel.
      
              REGRESSION: Worker termination via JS timeout may cause worker tests like fast/workers/worker-terminate.html fail.
              https://bugs.webkit.org/show_bug.cgi?id=36646
      
              Cause the worker code to swallow termination exceptions because these
              need not be reported to the user because they are an implementation
              detail of how we terminate worker execution.
      
              Test: fast/workers/worker-terminate-forever.html
      
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::reportException):
                  - Refuse to report termination exceptions to the user because they
                    are an implementation detail.
              * bindings/js/WorkerScriptController.cpp:
              (WebCore::WorkerScriptController::forbidExecution):
                  - Instead of using timeouts to stop run away workers, use our fancy
                    new Terminator object.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5d91a8d3
  35. 06 Feb, 2010 1 commit
    • barraclough@apple.com's avatar
      Change UStringImpl::create to CRASH if the string cannot be allocated, · e37590bc
      barraclough@apple.com authored
      rather than returning a null string (which will behave like a zero-length
      string if used).
      
      Reviewed by Geoff Garen.
      
      Also move createRep function from UString to become new overloaded
      UStringImpl::create methods.  In doing so, bring their behaviour closer to
      being in line with WebCore::StringImpl, in removing the behaviour that they
      can be used to produce null UStrings (ASSERT the char* provided is non-null).
      This behaviour of converting null C-strings to null UStrings is inefficient
      (cmompared to just using UString::null()), incompatible with WebCore::StringImpl's
      behaviour, and may generate unexpected behaviour, since in many cases a null
      UString can be used like an empty string.
      
      With these changes UStringImpl need not have a concept of null impls, we can
      start transitioning this to become an implementation detail of UString, that
      internally it chooses to use a null-object rather than an actually zero impl
      pointer.
      
      * JavaScriptCore.exp:
      * debugger/Debugger.cpp:
      (JSC::Debugger::recompileAllJSFunctions):
      * debugger/DebuggerCallFrame.cpp:
      (JSC::DebuggerCallFrame::calculatedFunctionName):
      * parser/Parser.cpp:
      (JSC::Parser::parse):
      * profiler/Profile.cpp:
      (JSC::Profile::Profile):
      * profiler/ProfileGenerator.cpp:
      (JSC::ProfileGenerator::stopProfiling):
      * runtime/Error.cpp:
      (JSC::Error::create):
      (JSC::throwError):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createError):
      * runtime/Identifier.cpp:
      (JSC::Identifier::add):
      * runtime/PropertyNameArray.cpp:
      (JSC::PropertyNameArray::add):
      * runtime/UString.cpp:
      (JSC::initializeUString):
      (JSC::UString::UString):
      (JSC::UString::operator=):
      * runtime/UString.h:
      (JSC::UString::isNull):
      (JSC::UString::null):
      (JSC::UString::rep):
      (JSC::UString::UString):
      * runtime/UStringImpl.cpp:
      (JSC::UStringImpl::create):
      * runtime/UStringImpl.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e37590bc
  36. 04 Feb, 2010 1 commit
    • barraclough@apple.com's avatar
      Add a JSStringBuilder class (similar-to, and derived-from StringBuilder) to · d2e92465
      barraclough@apple.com authored
      construct JSStrings, throwing a JS exception should we run out of memory whilst
      allocating storage for the string.
      
      Reviewed by Oliver Hunt.
      
      Similarly, add jsMakeNontrivialString methods to use in cases where previously
      we were calling makeString & passing the result to jsNontrivialString.  Again,
      these new methods throw if we hit an out of memory condition.
      
      Move throwOutOfMemoryError into ExceptionHelpers, to make it more widely available.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncToString):
      (JSC::arrayProtoFuncToLocaleString):
      (JSC::arrayProtoFuncJoin):
      * runtime/DateConstructor.cpp:
      (JSC::callDate):
      * runtime/DatePrototype.cpp:
      (JSC::dateProtoFuncToString):
      (JSC::dateProtoFuncToUTCString):
      (JSC::dateProtoFuncToGMTString):
      * runtime/ErrorPrototype.cpp:
      (JSC::errorProtoFuncToString):
      * runtime/ExceptionHelpers.cpp:
      (JSC::throwOutOfMemoryError):
      * runtime/ExceptionHelpers.h:
      * runtime/JSStringBuilder.h: Added.
      (JSC::JSStringBuilder::releaseJSString):
      (JSC::jsMakeNontrivialString):
      * runtime/NumberPrototype.cpp:
      (JSC::numberProtoFuncToPrecision):
      * runtime/ObjectPrototype.cpp:
      (JSC::objectProtoFuncToString):
      * runtime/Operations.cpp:
      * runtime/Operations.h:
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncToString):
      * runtime/StringBuilder.h:
      (JSC::StringBuilder::append):
      * runtime/StringPrototype.cpp:
      (JSC::stringProtoFuncBig):
      (JSC::stringProtoFuncSmall):
      (JSC::stringProtoFuncBlink):
      (JSC::stringProtoFuncBold):
      (JSC::stringProtoFuncFixed):
      (JSC::stringProtoFuncItalics):
      (JSC::stringProtoFuncStrike):
      (JSC::stringProtoFuncSub):
      (JSC::stringProtoFuncSup):
      (JSC::stringProtoFuncFontcolor):
      (JSC::stringProtoFuncFontsize):
      (JSC::stringProtoFuncAnchor):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d2e92465
  37. 11 Dec, 2009 1 commit
    • barraclough@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=32454 · e82d3905
      barraclough@apple.com authored
      Refactor construction of simple strings to avoid string concatenation.
      
      Reviewed by Oliver Hunt.
      
      Building strings through concatenation has a memory and performance cost -
      a memory cost since we must over-allocate the buffer to leave space to append
      into, and performance in that the string may still require reallocation (and
      thus copying during construction).  Instead move the full construction to
      within a single function call (makeString), so that the arguments' lengths
      can be calculated and an appropriate sized buffer allocated before copying
      any characters.
      
      ~No performance change (~2% progression on date tests).
      
      * bytecode/CodeBlock.cpp:
      (JSC::escapeQuotes):
      (JSC::valueToSourceString):
      (JSC::constantName):
      (JSC::idName):
      (JSC::CodeBlock::registerName):
      (JSC::regexpToSourceString):
      (JSC::regexpName):
      * bytecompiler/NodesCodegen.cpp:
      (JSC::substitute):
      * profiler/Profiler.cpp:
      (JSC::Profiler::createCallIdentifier):
      * runtime/DateConstructor.cpp:
      (JSC::callDate):
      * runtime/DateConversion.cpp:
      (JSC::formatDate):
      (JSC::formatDateUTCVariant):
      (JSC::formatTime):
      (JSC::formatTimeUTC):
      * runtime/DateConversion.h:
      (JSC::):
      * runtime/DatePrototype.cpp:
      (JSC::dateProtoFuncToString):
      (JSC::dateProtoFuncToUTCString):
      (JSC::dateProtoFuncToDateString):
      (JSC::dateProtoFuncToTimeString):
      (JSC::dateProtoFuncToGMTString):
      * runtime/ErrorPrototype.cpp:
      (JSC::errorProtoFuncToString):
      * runtime/ExceptionHelpers.cpp:
      (JSC::createUndefinedVariableError):
      (JSC::createErrorMessage):
      (JSC::createInvalidParamError):
      * runtime/FunctionPrototype.cpp:
      (JSC::insertSemicolonIfNeeded):
      (JSC::functionProtoFuncToString):
      * runtime/ObjectPrototype.cpp:
      (JSC::objectProtoFuncToString):
      * runtime/RegExpConstructor.cpp:
      (JSC::constructRegExp):
      * runtime/RegExpObject.cpp:
      (JSC::RegExpObject::match):
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncCompile):
      (JSC::regExpProtoFuncToString):
      * runtime/StringPrototype.cpp:
      (JSC::stringProtoFuncBig):
      (JSC::stringProtoFuncSmall):
      (JSC::stringProtoFuncBlink):
      (JSC::stringProtoFuncBold):
      (JSC::stringProtoFuncFixed):
      (JSC::stringProtoFuncItalics):
      (JSC::stringProtoFuncStrike):
      (JSC::stringProtoFuncSub):
      (JSC::stringProtoFuncSup):
      (JSC::stringProtoFuncFontcolor):
      (JSC::stringProtoFuncFontsize):
      (JSC::stringProtoFuncAnchor):
      * runtime/UString.h:
      (JSC::):
      (JSC::makeString):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e82d3905