1. 07 Sep, 2008 1 commit
    • cwzwarich@webkit.org's avatar
      2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca> · 3f782f6a
      cwzwarich@webkit.org authored
              Reviewed by Maciej Stachowiak.
      
              Bug 20704: Replace the KJS namespace
              <https://bugs.webkit.org/show_bug.cgi?id=20704>
      
              Rename the KJS namespace to JSC. There are still some uses of KJS in
              preprocessor macros and comments, but these will also be changed some
              time in the near future. There are also some uses in the names of JNI
              functions, but I will check if these are safe to change as well.
      
              JavaScriptCore:
      
              * API/APICast.h:
              (toJS):
              (toRef):
              (toGlobalRef):
              * API/JSBase.cpp:
              * API/JSCallbackConstructor.cpp:
              * API/JSCallbackConstructor.h:
              * API/JSCallbackFunction.cpp:
              * API/JSCallbackFunction.h:
              * API/JSCallbackObject.cpp:
              * API/JSCallbackObject.h:
              * API/JSCallbackObjectFunctions.h:
              * API/JSClassRef.cpp:
              (OpaqueJSClass::staticValues):
              (OpaqueJSClass::staticFunctions):
              * API/JSClassRef.h:
              * API/JSContextRef.cpp:
              * API/JSObjectRef.cpp:
              * API/JSProfilerPrivate.cpp:
              * API/JSStringRef.cpp:
              * API/JSValueRef.cpp:
              (JSValueGetType):
              * API/OpaqueJSString.cpp:
              * API/OpaqueJSString.h:
              * JavaScriptCore.Debug.exp:
              * JavaScriptCore.base.exp:
              * VM/CTI.cpp:
              (JSC::):
              * VM/CTI.h:
              * VM/CodeBlock.cpp:
              * VM/CodeBlock.h:
              * VM/CodeGenerator.cpp:
              * VM/CodeGenerator.h:
              * VM/ExceptionHelpers.cpp:
              * VM/ExceptionHelpers.h:
              * VM/Instruction.h:
              * VM/JSPropertyNameIterator.cpp:
              * VM/JSPropertyNameIterator.h:
              * VM/LabelID.h:
              * VM/Machine.cpp:
              * VM/Machine.h:
              * VM/Opcode.cpp:
              * VM/Opcode.h:
              * VM/Register.h:
              (WTF::):
              * VM/RegisterFile.cpp:
              * VM/RegisterFile.h:
              * VM/RegisterID.h:
              (WTF::):
              * VM/SamplingTool.cpp:
              * VM/SamplingTool.h:
              * VM/SegmentedVector.h:
              * kjs/ArgList.cpp:
              * kjs/ArgList.h:
              * kjs/Arguments.cpp:
              * kjs/Arguments.h:
              * kjs/ArrayConstructor.cpp:
              * kjs/ArrayConstructor.h:
              * kjs/ArrayPrototype.cpp:
              * kjs/ArrayPrototype.h:
              * kjs/BatchedTransitionOptimizer.h:
              * kjs/BooleanConstructor.cpp:
              * kjs/BooleanConstructor.h:
              * kjs/BooleanObject.cpp:
              * kjs/BooleanObject.h:
              * kjs/BooleanPrototype.cpp:
              * kjs/BooleanPrototype.h:
              * kjs/CallData.cpp:
              * kjs/CallData.h:
              * kjs/ClassInfo.h:
              * kjs/CommonIdentifiers.cpp:
              * kjs/CommonIdentifiers.h:
              * kjs/ConstructData.cpp:
              * kjs/ConstructData.h:
              * kjs/DateConstructor.cpp:
              * kjs/DateConstructor.h:
              * kjs/DateInstance.cpp:
              (JSC::DateInstance::msToGregorianDateTime):
              * kjs/DateInstance.h:
              * kjs/DateMath.cpp:
              * kjs/DateMath.h:
              * kjs/DatePrototype.cpp:
              * kjs/DatePrototype.h:
              * kjs/DebuggerCallFrame.cpp:
              * kjs/DebuggerCallFrame.h:
              * kjs/Error.cpp:
              * kjs/Error.h:
              * kjs/ErrorConstructor.cpp:
              * kjs/ErrorConstructor.h:
              * kjs/ErrorInstance.cpp:
              * kjs/ErrorInstance.h:
              * kjs/ErrorPrototype.cpp:
              * kjs/ErrorPrototype.h:
              * kjs/ExecState.cpp:
              * kjs/ExecState.h:
              * kjs/FunctionConstructor.cpp:
              * kjs/FunctionConstructor.h:
              * kjs/FunctionPrototype.cpp:
              * kjs/FunctionPrototype.h:
              * kjs/GetterSetter.cpp:
              * kjs/GetterSetter.h:
              * kjs/GlobalEvalFunction.cpp:
              * kjs/GlobalEvalFunction.h:
              * kjs/IndexToNameMap.cpp:
              * kjs/IndexToNameMap.h:
              * kjs/InitializeThreading.cpp:
              * kjs/InitializeThreading.h:
              * kjs/InternalFunction.cpp:
              * kjs/InternalFunction.h:
              (JSC::InternalFunction::InternalFunction):
              * kjs/JSActivation.cpp:
              * kjs/JSActivation.h:
              * kjs/JSArray.cpp:
              * kjs/JSArray.h:
              * kjs/JSCell.cpp:
              * kjs/JSCell.h:
              * kjs/JSFunction.cpp:
              * kjs/JSFunction.h:
              (JSC::JSFunction::JSFunction):
              * kjs/JSGlobalData.cpp:
              (JSC::JSGlobalData::JSGlobalData):
              * kjs/JSGlobalData.h:
              * kjs/JSGlobalObject.cpp:
              * kjs/JSGlobalObject.h:
              * kjs/JSGlobalObjectFunctions.cpp:
              * kjs/JSGlobalObjectFunctions.h:
              * kjs/JSImmediate.cpp:
              * kjs/JSImmediate.h:
              * kjs/JSLock.cpp:
              * kjs/JSLock.h:
              * kjs/JSNotAnObject.cpp:
              * kjs/JSNotAnObject.h:
              * kjs/JSNumberCell.cpp:
              * kjs/JSNumberCell.h:
              * kjs/JSObject.cpp:
              * kjs/JSObject.h:
              * kjs/JSStaticScopeObject.cpp:
              * kjs/JSStaticScopeObject.h:
              * kjs/JSString.cpp:
              * kjs/JSString.h:
              * kjs/JSType.h:
              * kjs/JSValue.cpp:
              * kjs/JSValue.h:
              * kjs/JSVariableObject.cpp:
              * kjs/JSVariableObject.h:
              * kjs/JSWrapperObject.cpp:
              * kjs/JSWrapperObject.h:
              * kjs/LabelStack.cpp:
              * kjs/LabelStack.h:
              * kjs/MathObject.cpp:
              * kjs/MathObject.h:
              * kjs/NativeErrorConstructor.cpp:
              * kjs/NativeErrorConstructor.h:
              * kjs/NativeErrorPrototype.cpp:
              * kjs/NativeErrorPrototype.h:
              * kjs/NodeInfo.h:
              * kjs/NumberConstructor.cpp:
              * kjs/NumberConstructor.h:
              * kjs/NumberObject.cpp:
              * kjs/NumberObject.h:
              * kjs/NumberPrototype.cpp:
              * kjs/NumberPrototype.h:
              * kjs/ObjectConstructor.cpp:
              * kjs/ObjectConstructor.h:
              * kjs/ObjectPrototype.cpp:
              * kjs/ObjectPrototype.h:
              * kjs/Parser.cpp:
              * kjs/Parser.h:
              * kjs/PropertyMap.cpp:
              (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
              * kjs/PropertyMap.h:
              * kjs/PropertyNameArray.cpp:
              * kjs/PropertyNameArray.h:
              * kjs/PropertySlot.cpp:
              * kjs/PropertySlot.h:
              * kjs/PrototypeFunction.cpp:
              * kjs/PrototypeFunction.h:
              * kjs/PutPropertySlot.h:
              * kjs/RegExpConstructor.cpp:
              * kjs/RegExpConstructor.h:
              * kjs/RegExpObject.cpp:
              * kjs/RegExpObject.h:
              * kjs/RegExpPrototype.cpp:
              * kjs/RegExpPrototype.h:
              * kjs/ScopeChain.cpp:
              * kjs/ScopeChain.h:
              * kjs/ScopeChainMark.h:
              * kjs/Shell.cpp:
              (jscmain):
              * kjs/SmallStrings.cpp:
              * kjs/SmallStrings.h:
              * kjs/SourceProvider.h:
              * kjs/SourceRange.h:
              * kjs/StringConstructor.cpp:
              * kjs/StringConstructor.h:
              * kjs/StringObject.cpp:
              * kjs/StringObject.h:
              * kjs/StringObjectThatMasqueradesAsUndefined.h:
              * kjs/StringPrototype.cpp:
              * kjs/StringPrototype.h:
              * kjs/StructureID.cpp:
              * kjs/StructureID.h:
              * kjs/SymbolTable.h:
              * kjs/collector.cpp:
              * kjs/collector.h:
              * kjs/completion.h:
              * kjs/create_hash_table:
              * kjs/debugger.cpp:
              * kjs/debugger.h:
              * kjs/dtoa.cpp:
              * kjs/dtoa.h:
              * kjs/grammar.y:
              * kjs/identifier.cpp:
              * kjs/identifier.h:
              (JSC::Identifier::equal):
              * kjs/interpreter.cpp:
              * kjs/interpreter.h:
              * kjs/lexer.cpp:
              (JSC::Lexer::Lexer):
              (JSC::Lexer::clear):
              (JSC::Lexer::makeIdentifier):
              * kjs/lexer.h:
              * kjs/lookup.cpp:
              * kjs/lookup.h:
              * kjs/nodes.cpp:
              * kjs/nodes.h:
              * kjs/nodes2string.cpp:
              * kjs/operations.cpp:
              * kjs/operations.h:
              * kjs/protect.h:
              * kjs/regexp.cpp:
              * kjs/regexp.h:
              * kjs/ustring.cpp:
              * kjs/ustring.h:
              (JSC::operator!=):
              (JSC::IdentifierRepHash::hash):
              (WTF::):
              * masm/MacroAssembler.h:
              * masm/MacroAssemblerWin.cpp:
              * masm/X86Assembler.h:
              * pcre/pcre_exec.cpp:
              * profiler/CallIdentifier.h:
              (WTF::):
              * profiler/HeavyProfile.cpp:
              * profiler/HeavyProfile.h:
              * profiler/Profile.cpp:
              * profiler/Profile.h:
              * profiler/ProfileGenerator.cpp:
              * profiler/ProfileGenerator.h:
              * profiler/ProfileNode.cpp:
              * profiler/ProfileNode.h:
              * profiler/Profiler.cpp:
              * profiler/Profiler.h:
              * profiler/TreeProfile.cpp:
              * profiler/TreeProfile.h:
              * wrec/WREC.cpp:
              * wrec/WREC.h:
              * wtf/AVLTree.h:
      
              WebCore:
      
              * WebCore.base.exp:
              * bindings/js/GCController.cpp:
              * bindings/js/JSAttrCustom.cpp:
              * bindings/js/JSAudioConstructor.cpp:
              * bindings/js/JSAudioConstructor.h:
              (WebCore::JSAudioConstructor::classInfo):
              * bindings/js/JSCSSRuleCustom.cpp:
              * bindings/js/JSCSSStyleDeclarationCustom.cpp:
              * bindings/js/JSCSSValueCustom.cpp:
              * bindings/js/JSCanvasPixelArrayCustom.cpp:
              * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
              * bindings/js/JSClipboardCustom.cpp:
              * bindings/js/JSConsoleCustom.cpp:
              * bindings/js/JSCustomSQLStatementCallback.cpp:
              (WebCore::JSCustomSQLStatementCallback::handleEvent):
              * bindings/js/JSCustomSQLStatementCallback.h:
              (WebCore::JSCustomSQLStatementCallback::create):
              * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
              (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
              * bindings/js/JSCustomSQLStatementErrorCallback.h:
              (WebCore::JSCustomSQLStatementErrorCallback::create):
              * bindings/js/JSCustomSQLTransactionCallback.cpp:
              (WebCore::JSCustomSQLTransactionCallback::handleEvent):
              * bindings/js/JSCustomSQLTransactionCallback.h:
              (WebCore::JSCustomSQLTransactionCallback::create):
              * bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
              (WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):
              * bindings/js/JSCustomSQLTransactionErrorCallback.h:
              (WebCore::JSCustomSQLTransactionErrorCallback::create):
              * bindings/js/JSCustomVoidCallback.cpp:
              (WebCore::JSCustomVoidCallback::handleEvent):
              * bindings/js/JSCustomVoidCallback.h:
              (WebCore::JSCustomVoidCallback::create):
              * bindings/js/JSCustomXPathNSResolver.cpp:
              (WebCore::JSCustomXPathNSResolver::create):
              * bindings/js/JSCustomXPathNSResolver.h:
              * bindings/js/JSDOMApplicationCacheCustom.cpp:
              (WebCore::JSDOMApplicationCache::dispatchEvent):
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::jsOwnedStringOrNull):
              * bindings/js/JSDOMBinding.h:
              (WebCore::DOMObject::DOMObject):
              (WebCore::cacheDOMObject):
              (WebCore::cacheSVGDOMObject):
              (WebCore::DOMExceptionTranslator::DOMExceptionTranslator):
              (WebCore::toJS):
              * bindings/js/JSDOMWindowBase.cpp:
              * bindings/js/JSDOMWindowBase.h:
              (WebCore::JSDOMWindowBase::classInfo):
              (WebCore::JSDOMWindowBase::d):
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::getPropertyAttributes):
              * bindings/js/JSDOMWindowCustom.h:
              (WebCore::asJSDOMWindow):
              (WebCore::JSDOMWindow::customGetOwnPropertySlot):
              (WebCore::JSDOMWindow::customPut):
              (WebCore::JSDOMWindowBase::allowsAccessFrom):
              (WebCore::JSDOMWindowBase::allowsAccessFromNoErrorMessage):
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::getPropertyAttributes):
              * bindings/js/JSDOMWindowShell.h:
              (WebCore::JSDOMWindowShell::classInfo):
              * bindings/js/JSDatabaseCustom.cpp:
              * bindings/js/JSDocumentCustom.cpp:
              * bindings/js/JSDocumentFragmentCustom.cpp:
              * bindings/js/JSElementCustom.cpp:
              * bindings/js/JSEventCustom.cpp:
              * bindings/js/JSEventListener.cpp:
              * bindings/js/JSEventListener.h:
              (WebCore::JSUnprotectedEventListener::create):
              (WebCore::JSEventListener::create):
              * bindings/js/JSEventTargetBase.cpp:
              * bindings/js/JSEventTargetBase.h:
              (WebCore::JSEventTargetBase::getValueProperty):
              (WebCore::JSEventTargetBase::putValueProperty):
              (WebCore::JSEventTargetBase::getOwnPropertySlot):
              (WebCore::JSEventTargetBase::put):
              (WebCore::JSEventTargetPrototype::JSEventTargetPrototype):
              (WebCore::JSEventTargetPrototype::self):
              (WebCore::JSEventTargetPrototype::getOwnPropertySlot):
              (WebCore::JSEventTargetPrototype::classInfo):
              * bindings/js/JSEventTargetNode.cpp:
              * bindings/js/JSEventTargetNode.h:
              (WebCore::JSEventTargetNode::getOwnPropertySlot):
              (WebCore::JSEventTargetNode::getValueProperty):
              (WebCore::JSEventTargetNode::put):
              (WebCore::JSEventTargetNode::putValueProperty):
              * bindings/js/JSHTMLAllCollection.h:
              (WebCore::JSHTMLAllCollection::JSHTMLAllCollection):
              (WebCore::JSHTMLAllCollection::toBoolean):
              * bindings/js/JSHTMLAppletElementCustom.cpp:
              * bindings/js/JSHTMLCollectionCustom.cpp:
              * bindings/js/JSHTMLDocumentCustom.cpp:
              * bindings/js/JSHTMLElementCustom.cpp:
              * bindings/js/JSHTMLEmbedElementCustom.cpp:
              * bindings/js/JSHTMLFormElementCustom.cpp:
              * bindings/js/JSHTMLFrameElementCustom.cpp:
              * bindings/js/JSHTMLFrameSetElementCustom.cpp:
              * bindings/js/JSHTMLIFrameElementCustom.cpp:
              * bindings/js/JSHTMLInputElementBase.cpp:
              (WebCore::JSHTMLInputElementBase::JSHTMLInputElementBase):
              (WebCore::JSHTMLInputElementBase::getOwnPropertySlot):
              * bindings/js/JSHTMLInputElementBase.h:
              (WebCore::JSHTMLInputElementBase::classInfo):
              * bindings/js/JSHTMLObjectElementCustom.cpp:
              * bindings/js/JSHTMLOptionElementConstructor.cpp:
              * bindings/js/JSHTMLOptionElementConstructor.h:
              (WebCore::JSHTMLOptionElementConstructor::classInfo):
              * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
              * bindings/js/JSHTMLSelectElementCustom.cpp:
              (WebCore::selectIndexSetter):
              (WebCore::JSHTMLSelectElement::indexSetter):
              * bindings/js/JSHTMLSelectElementCustom.h:
              * bindings/js/JSHistoryCustom.cpp:
              * bindings/js/JSImageConstructor.cpp:
              * bindings/js/JSImageConstructor.h:
              (WebCore::JSImageConstructor::classInfo):
              * bindings/js/JSInspectedObjectWrapper.cpp:
              * bindings/js/JSInspectedObjectWrapper.h:
              (WebCore::JSInspectedObjectWrapper::wrapOutgoingValue):
              (WebCore::JSInspectedObjectWrapper::classInfo):
              * bindings/js/JSInspectorCallbackWrapper.cpp:
              * bindings/js/JSInspectorCallbackWrapper.h:
              (WebCore::JSInspectorCallbackWrapper::classInfo):
              (WebCore::JSInspectorCallbackWrapper::wrapOutgoingValue):
              * bindings/js/JSJavaScriptCallFrameCustom.cpp:
              * bindings/js/JSLocationCustom.cpp:
              * bindings/js/JSMimeTypeArrayCustom.cpp:
              * bindings/js/JSNSResolver.cpp:
              * bindings/js/JSNSResolver.h:
              (WebCore::JSNSResolver::create):
              * bindings/js/JSNamedNodeMapCustom.cpp:
              * bindings/js/JSNamedNodesCollection.cpp:
              (WebCore::JSNamedNodesCollection::JSNamedNodesCollection):
              * bindings/js/JSNamedNodesCollection.h:
              (WebCore::JSNamedNodesCollection::classInfo):
              * bindings/js/JSNavigatorCustom.cpp:
              * bindings/js/JSNodeCustom.cpp:
              * bindings/js/JSNodeFilterCondition.cpp:
              (WebCore::JSNodeFilterCondition::acceptNode):
              * bindings/js/JSNodeFilterCondition.h:
              (WebCore::JSNodeFilterCondition::create):
              * bindings/js/JSNodeFilterCustom.cpp:
              * bindings/js/JSNodeIteratorCustom.cpp:
              * bindings/js/JSNodeListCustom.cpp:
              * bindings/js/JSPluginArrayCustom.cpp:
              * bindings/js/JSPluginCustom.cpp:
              * bindings/js/JSPluginElementFunctions.cpp:
              (WebCore::getRuntimeObject):
              * bindings/js/JSPluginElementFunctions.h:
              * bindings/js/JSQuarantinedObjectWrapper.cpp:
              (WebCore::JSQuarantinedObjectWrapper::construct):
              (WebCore::JSQuarantinedObjectWrapper::call):
              * bindings/js/JSQuarantinedObjectWrapper.h:
              (WebCore::JSQuarantinedObjectWrapper::unwrappedObject):
              (WebCore::JSQuarantinedObjectWrapper::unwrappedGlobalObject):
              (WebCore::JSQuarantinedObjectWrapper::className):
              * bindings/js/JSRGBColor.cpp:
              * bindings/js/JSRGBColor.h:
              (WebCore::JSRGBColor::classInfo):
              * bindings/js/JSSQLResultSetRowListCustom.cpp:
              * bindings/js/JSSQLTransactionCustom.cpp:
              * bindings/js/JSSVGLazyEventListener.cpp:
              * bindings/js/JSSVGLazyEventListener.h:
              * bindings/js/JSSVGLengthCustom.cpp:
              * bindings/js/JSSVGMatrixCustom.cpp:
              (WebCore::JSSVGMatrix::inverse):
              (WebCore::JSSVGMatrix::rotateFromVector):
              * bindings/js/JSSVGPathSegCustom.cpp:
              * bindings/js/JSSVGPathSegListCustom.cpp:
              (WebCore::JSSVGPathSegList::initialize):
              (WebCore::JSSVGPathSegList::getItem):
              (WebCore::JSSVGPathSegList::insertItemBefore):
              (WebCore::JSSVGPathSegList::replaceItem):
              (WebCore::JSSVGPathSegList::removeItem):
              (WebCore::JSSVGPathSegList::appendItem):
              * bindings/js/JSSVGPointListCustom.cpp:
              * bindings/js/JSSVGTransformListCustom.cpp:
              * bindings/js/JSStorageCustom.cpp:
              * bindings/js/JSStyleSheetCustom.cpp:
              * bindings/js/JSStyleSheetListCustom.cpp:
              * bindings/js/JSTextCustom.cpp:
              * bindings/js/JSTreeWalkerCustom.cpp:
              * bindings/js/JSXMLHttpRequestConstructor.cpp:
              * bindings/js/JSXMLHttpRequestConstructor.h:
              (WebCore::JSXMLHttpRequestConstructor::classInfo):
              * bindings/js/JSXMLHttpRequestCustom.cpp:
              * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
              * bindings/js/JSXSLTProcessorConstructor.cpp:
              * bindings/js/JSXSLTProcessorConstructor.h:
              (WebCore::JSXSLTProcessorConstructor::classInfo):
              * bindings/js/JSXSLTProcessorCustom.cpp:
              * bindings/js/ScheduledAction.cpp:
              * bindings/js/ScheduledAction.h:
              * bindings/js/ScriptController.cpp:
              (WebCore::ScriptController::attachDebugger):
              (WebCore::ScriptController::windowScriptNPObject):
              * bindings/js/ScriptController.h:
              * bindings/js/ScriptControllerGtk.cpp:
              (WebCore::ScriptController::createScriptInstanceForWidget):
              * bindings/js/ScriptControllerMac.mm:
              (WebCore::ScriptController::createScriptInstanceForWidget):
              (WebCore::ScriptController::windowScriptObject):
              (WebCore::ScriptController::clearPlatformScriptObjects):
              (WebCore::updateRenderingForBindings):
              (WebCore::ScriptController::initJavaJSBindings):
              * bindings/js/ScriptControllerQt.cpp:
              (WebCore::ScriptController::createScriptInstanceForWidget):
              * bindings/js/ScriptControllerWin.cpp:
              (WebCore::ScriptController::createScriptInstanceForWidget):
              * bindings/js/ScriptControllerWx.cpp:
              (WebCore::ScriptController::createScriptInstanceForWidget):
              * bindings/js/StringSourceProvider.h:
              (WebCore::StringSourceProvider::getRange):
              * bindings/objc/DOM.mm:
              (-[DOMNode JSC::Bindings::]):
              * bindings/objc/DOMInternal.h:
              * bindings/objc/DOMInternal.mm:
              (-[WebScriptObject _initializeScriptDOMNodeImp]):
              * bindings/objc/DOMUtility.mm:
              (JSC::createDOMWrapper):
              (WebCore::createDOMWrapper):
              * bindings/objc/WebScriptObject.mm:
              (WebCore::createJSWrapper):
              (-[WebScriptObject _initWithJSObject:JSC::originRootObject:JSC::Bindings::rootObject:JSC::Bindings::]):
              * bindings/objc/WebScriptObjectPrivate.h:
              * bindings/scripts/CodeGeneratorJS.pm:
              * bridge/NP_jsobject.cpp:
              * bridge/NP_jsobject.h:
              * bridge/c/c_class.cpp:
              * bridge/c/c_class.h:
              * bridge/c/c_instance.cpp:
              * bridge/c/c_instance.h:
              * bridge/c/c_runtime.cpp:
              * bridge/c/c_runtime.h:
              * bridge/c/c_utility.cpp:
              * bridge/c/c_utility.h:
              * bridge/jni/jni_class.cpp:
              * bridge/jni/jni_class.h:
              * bridge/jni/jni_instance.cpp:
              * bridge/jni/jni_instance.h:
              * bridge/jni/jni_jsobject.h:
              * bridge/jni/jni_jsobject.mm:
              (JavaJSObject::call):
              (JavaJSObject::convertJObjectToValue):
              * bridge/jni/jni_objc.mm:
              (JSC::Bindings::dispatchJNICall):
              * bridge/jni/jni_runtime.cpp:
              * bridge/jni/jni_runtime.h:
              * bridge/jni/jni_utility.cpp:
              * bridge/jni/jni_utility.h:
              * bridge/npruntime.cpp:
              (_NPN_GetStringIdentifier):
              * bridge/objc/WebScriptObject.h:
              * bridge/objc/objc_class.h:
              * bridge/objc/objc_class.mm:
              * bridge/objc/objc_instance.h:
              * bridge/objc/objc_instance.mm:
              * bridge/objc/objc_runtime.h:
              * bridge/objc/objc_runtime.mm:
              * bridge/objc/objc_utility.h:
              * bridge/objc/objc_utility.mm:
              * bridge/qt/qt_class.cpp:
              * bridge/qt/qt_class.h:
              * bridge/qt/qt_instance.cpp:
              * bridge/qt/qt_instance.h:
              * bridge/qt/qt_runtime.cpp:
              (JSC::Bindings::convertQVariantToValue):
              (JSC::Bindings::):
              * bridge/qt/qt_runtime.h:
              * bridge/runtime.cpp:
              * bridge/runtime.h:
              * bridge/runtime_array.cpp:
              * bridge/runtime_array.h:
              * bridge/runtime_method.cpp:
              * bridge/runtime_method.h:
              * bridge/runtime_object.cpp:
              * bridge/runtime_object.h:
              * bridge/runtime_root.cpp:
              (JSC::Bindings::RootObject::invalidate):
              (JSC::Bindings::RootObject::gcProtect):
              (JSC::Bindings::RootObject::gcUnprotect):
              * bridge/runtime_root.h:
              * bridge/testbindings.cpp:
              * bridge/testbindings.mm:
              * bridge/testqtbindings.cpp:
              * dom/Document.cpp:
              (WebCore::Document::~Document):
              * dom/NSResolver.h:
              * dom/Node.cpp:
              (WebCore::Node::setDocument):
              (WebCore::ResolveNamespaceFunctor::ResolveNamespaceFunctor):
              (WebCore::resolveNamespacesForSelector):
              (WebCore::Node::querySelector):
              (WebCore::Node::querySelectorAll):
              * dom/Node.h:
              * dom/NodeFilter.cpp:
              * dom/NodeFilter.h:
              * dom/NodeFilterCondition.cpp:
              * dom/NodeFilterCondition.h:
              * dom/NodeIterator.cpp:
              * dom/NodeIterator.h:
              * dom/Traversal.cpp:
              * dom/Traversal.h:
              * dom/TreeWalker.cpp:
              * dom/TreeWalker.h:
              * dom/make_names.pl:
              * history/CachedPage.cpp:
              * history/CachedPage.h:
              * html/HTMLPlugInElement.cpp:
              (WebCore::HTMLPlugInElement::getInstance):
              * html/HTMLPlugInElement.h:
              * loader/FrameLoader.cpp:
              * loader/FrameLoader.h:
              * loader/icon/IconDatabase.cpp:
              (WebCore::iconDatabase):
              * page/Console.cpp:
              * page/Console.h:
              * page/InspectorController.cpp:
              (WebCore::XMLHttpRequestResource::XMLHttpRequestResource):
              (WebCore::XMLHttpRequestResource::~XMLHttpRequestResource):
              (WebCore::InspectorResource::setXMLHttpRequestProperties):
              (WebCore::InspectorResource::sourceString):
              (WebCore::getResourceDocumentNode):
              (WebCore::search):
              (WebCore::InspectorController::focusNode):
              (WebCore::InspectorController::inspectedWindowScriptObjectCleared):
              (WebCore::InspectorController::addDatabaseScriptResource):
              (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
              * page/InspectorController.h:
              (WebCore::InspectorController::profiles):
              * page/JavaScriptCallFrame.cpp:
              (WebCore::JavaScriptCallFrame::scopeChain):
              * page/JavaScriptCallFrame.h:
              (WebCore::JavaScriptCallFrame::create):
              (WebCore::JavaScriptCallFrame::update):
              * page/JavaScriptDebugListener.h:
              * page/JavaScriptDebugServer.cpp:
              (WebCore::dispatchDidParseSource):
              * page/JavaScriptDebugServer.h:
              * page/JavaScriptProfile.cpp:
              * page/JavaScriptProfile.h:
              * page/JavaScriptProfileNode.cpp:
              (WebCore::getTotalTime):
              (WebCore::getSelfTime):
              (WebCore::getTotalPercent):
              (WebCore::getSelfPercent):
              (WebCore::getNumberOfCalls):
              (WebCore::getChildren):
              (WebCore::getVisible):
              * page/JavaScriptProfileNode.h:
              * page/Page.cpp:
              (WebCore::Page::setDebuggerForAllPages):
              (WebCore::Page::setDebugger):
              * page/Page.h:
              (WebCore::Page::debugger):
              * page/mac/FrameMac.mm:
              * platform/KURL.h:
              (WebCore::KURL::operator JSC::UString):
              * platform/text/AtomicString.cpp:
              (WebCore::AtomicString::add):
              (WebCore::AtomicString::find):
              * platform/text/AtomicString.h:
              (WebCore::AtomicString::AtomicString):
              * platform/text/PlatformString.h:
              * platform/text/String.cpp:
              (WebCore::charactersToDouble):
              * platform/win/BString.cpp:
              * platform/win/BString.h:
              * plugins/MimeTypeArray.h:
              * plugins/Plugin.h:
              * plugins/PluginArray.h:
              * plugins/PluginView.cpp:
              (WebCore::PluginView::start):
              (WebCore::PluginView::performRequest):
              (WebCore::PluginView::bindingInstance):
              * plugins/PluginView.h:
              * plugins/gtk/PluginViewGtk.cpp:
              (WebCore::PluginView::paint):
              (WebCore::PluginView::handleKeyboardEvent):
              (WebCore::PluginView::handleMouseEvent):
              (WebCore::PluginView::setNPWindowRect):
              (WebCore::PluginView::stop):
              (WebCore::PluginView::init):
              * plugins/qt/PluginViewQt.cpp:
              (WebCore::PluginView::setNPWindowRect):
              (WebCore::PluginView::stop):
              (WebCore::PluginView::init):
              * plugins/win/PluginViewWin.cpp:
              (WebCore::PluginView::dispatchNPEvent):
              (WebCore::PluginView::handleKeyboardEvent):
              (WebCore::PluginView::handleMouseEvent):
              (WebCore::PluginView::setNPWindowRect):
              (WebCore::PluginView::stop):
              * storage/Database.cpp:
              (WebCore::Database::Database):
              * xml/XMLHttpRequest.cpp:
              (WebCore::XMLHttpRequest::responseText):
              (WebCore::XMLHttpRequest::loadRequestAsynchronously):
              (WebCore::XMLHttpRequest::clearResponse):
              (WebCore::XMLHttpRequest::dropProtection):
              (WebCore::XMLHttpRequest::didFinishLoading):
              (WebCore::XMLHttpRequest::didReceiveData):
              * xml/XMLHttpRequest.h:
      
              WebKit/gtk:
      
              * webkit/webkitprivate.cpp:
              (webkit_init):
      
              WebKit/mac:
      
              * Misc/WebCoreStatistics.mm:
              * Plugins/WebBaseNetscapePluginStream.mm:
              (-[WebBaseNetscapePluginStream wantsAllStreams]):
              * Plugins/WebBaseNetscapePluginView.mm:
              (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]):
              (-[WebBaseNetscapePluginView setWindowIfNecessary]):
              (-[WebBaseNetscapePluginView start]):
              (-[WebBaseNetscapePluginView createPluginScriptableObject]):
              (-[WebBaseNetscapePluginView evaluateJavaScriptPluginRequest:]):
              (-[WebBaseNetscapePluginView webFrame:didFinishLoadWithReason:]):
              (-[WebBaseNetscapePluginView loadPluginRequest:]):
              (-[WebBaseNetscapePluginView _printedPluginBitmap]):
              * Plugins/WebPluginController.mm:
              (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]):
              (-[WebPluginController startAllPlugins]):
              (-[WebPluginController stopAllPlugins]):
              (-[WebPluginController addPlugin:]):
              (-[WebPluginController destroyPlugin:]):
              (-[WebPluginController destroyAllPlugins]):
              * WebView/WebFrame.mm:
              * WebView/WebScriptDebugDelegate.mm:
              * WebView/WebScriptDebugger.h:
              * WebView/WebScriptDebugger.mm:
              * WebView/WebView.mm:
              (-[WebViewPrivate init]):
      
              WebKit/qt:
              
              * Api/qwebframe.cpp:
              (QWebFrame::addToJavaScriptWindowObject):
              (QWebFrame::evaluateJavaScript):
      
              WebKit/win:
      
              * WebCoreStatistics.cpp:
              * WebJavaScriptCollector.cpp:
              * WebScriptCallFrame.cpp:
              (WebScriptCallFrame::jsValueToString):
              * WebScriptCallFrame.h:
              (WebScriptCallFrame::state):
              * WebView.cpp:
              (WebView::WebView):
              (WebView::stringByEvaluatingJavaScriptFromString):
      
              WebKit/wx:
      
              * WebFrame.cpp:
              (wxWebFrame::RunScript):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3f782f6a
  2. 01 Sep, 2008 1 commit
    • weinig@apple.com's avatar
      JavaScriptCore: · 3412bb43
      weinig@apple.com authored
      2008-09-01  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Darin Adler.
      
              First cut at inline caching for access to vanilla JavaScript properties.
              
              SunSpider says 4% faster. Tests heavy on dictionary-like access have
              regressed a bit -- we have a lot of room to improve in this area,
              but this patch is over-ripe as-is.
              
              JSCells now have a StructureID that uniquely identifies their layout,
              and holds their prototype.
              
              JSValue::put takes a PropertySlot& argument, so it can fill in details
              about where it put a value, for the sake of caching.
      
              * VM/CodeGenerator.cpp:
              (KJS::CodeGenerator::CodeGenerator): Avoid calling removeDirect if we
              can, since it disables inline caching in the global object. This can
              probably improve in the future.
      
              * kjs/JSGlobalObject.cpp: Nixed reset(), since it complicates caching, and
              wasn't really necessary.
      
              * kjs/JSObject.cpp: Tweaked getter / setter behavior not to rely on the
              IsGetterSetter flag, since the flag was buggy. This is necessary in order
              to avoid accidentally accessing a getter / setter as a normal property.
              
              Also changed getter / setter creation to honor ReadOnly, matching Mozilla.
              
              * kjs/PropertyMap.cpp: Nixed clear(), since it complicates caching and
              isn't necessary.
      
              * kjs/Shell.cpp: Moved SamplingTool dumping outside the loop. This allows
              you to aggregate sampling of multiple files (or the same file repeatedly),
              which helped me track down regressions.
      
              * kjs/ustring.h: Moved IdentifierRepHash here to share it.
      
      WebCore:
      
      2008-09-01  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Darin Adler.
      
              First cut at inline caching for access to vanilla JavaScript properties.
      
              Updated for JavaScriptCore changes. Mostly mechanical addition of StructureIDs
              to WebCore classes, and PutPropertySlot& arguments to put functions.
      
              (WebCore::JSCSSStyleDeclaration::customPut): Be sure to play nice with
              inline caching for global properties, so global assignment can be optimized.
      
              * ForwardingHeaders/kjs/StructureID.h: Added.
              * bindings/js/JSDOMBinding.h:
              (WebCore::DOMObject::DOMObject):
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::put):
              * bindings/js/JSDOMWindowBase.h:
              * bindings/js/JSDOMWindowCustom.h:
              (WebCore::JSDOMWindow::customPut):
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::JSDOMWindowShell):
              (WebCore::JSDOMWindowShell::put):
              * bindings/js/JSDOMWindowShell.h:
              * bindings/js/JSEventTargetBase.h:
              (WebCore::JSEventTargetBase::put):
              * bindings/js/JSEventTargetNode.h:
              (WebCore::JSEventTargetNode::put):
              * bindings/js/JSHTMLAppletElementCustom.cpp:
              (WebCore::JSHTMLAppletElement::customPut):
              * bindings/js/JSHTMLEmbedElementCustom.cpp:
              (WebCore::JSHTMLEmbedElement::customPut):
              * bindings/js/JSHTMLInputElementBase.cpp:
              (WebCore::JSHTMLInputElementBase::put):
              * bindings/js/JSHTMLInputElementBase.h:
              * bindings/js/JSHTMLObjectElementCustom.cpp:
              (WebCore::JSHTMLObjectElement::customPut):
              * bindings/js/JSHistoryCustom.cpp:
              (WebCore::JSHistory::customPut):
              * bindings/js/JSInspectedObjectWrapper.cpp:
              (WebCore::JSInspectedObjectWrapper::wrap):
              (WebCore::JSInspectedObjectWrapper::JSInspectedObjectWrapper):
              * bindings/js/JSInspectedObjectWrapper.h:
              * bindings/js/JSInspectorCallbackWrapper.cpp:
              (WebCore::JSInspectorCallbackWrapper::wrap):
              (WebCore::JSInspectorCallbackWrapper::JSInspectorCallbackWrapper):
              * bindings/js/JSInspectorCallbackWrapper.h:
              * bindings/js/JSLocationCustom.cpp:
              (WebCore::JSLocation::customPut):
              * bindings/js/JSPluginElementFunctions.cpp:
              (WebCore::runtimeObjectCustomPut):
              * bindings/js/JSPluginElementFunctions.h:
              * bindings/js/JSQuarantinedObjectWrapper.cpp:
              (WebCore::JSQuarantinedObjectWrapper::JSQuarantinedObjectWrapper):
              (WebCore::JSQuarantinedObjectWrapper::put):
              * bindings/js/JSQuarantinedObjectWrapper.h:
              * bindings/js/JSStorageCustom.cpp:
              (WebCore::JSStorage::customPut):
              * bindings/objc/WebScriptObject.mm:
              (-[WebScriptObject setValue:forKey:]):
              * bindings/scripts/CodeGeneratorJS.pm:
              * bridge/NP_jsobject.cpp:
              (_NPN_SetProperty):
              * bridge/jni/jni_jsobject.mm:
              (JavaJSObject::setMember):
              * bridge/objc/objc_class.mm:
              (KJS::Bindings::ObjcClass::fallbackObject):
              * bridge/objc/objc_runtime.h:
              * bridge/objc/objc_runtime.mm:
              (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
              (ObjcFallbackObjectImp::put):
              * bridge/runtime.cpp:
              (KJS::Bindings::Instance::createRuntimeObject):
              * bridge/runtime_array.cpp:
              (RuntimeArray::put):
              * bridge/runtime_array.h:
              * bridge/runtime_object.cpp:
              (RuntimeObjectImp::RuntimeObjectImp):
              (RuntimeObjectImp::put):
              * bridge/runtime_object.h:
      
      LayoutTests:
      
      2008-09-01  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Darin Adler.
      
              First cut at inline caching for access to vanilla JavaScript properties.
              
              Tests for things I broke along the way.
              
              * fast/dom/getter-on-window-object2-expected.txt:
              * fast/js/pic: Added.
              * fast/js/pic/cached-deleted-properties-expected.txt: Added.
              * fast/js/pic/cached-deleted-properties.html: Added.
              * fast/js/pic/cached-getter-dictionary-and-proto-expected.txt: Added.
              * fast/js/pic/cached-getter-dictionary-and-proto.html: Added.
              * fast/js/pic/cached-getter-setter-expected.txt: Added.
              * fast/js/pic/cached-getter-setter.html: Added.
              * fast/js/pic/cached-prototype-setter-expected.txt: Added.
              * fast/js/pic/cached-prototype-setter.html: Added.
              * fast/js/pic/cached-single-entry-transition-expected.txt: Added.
              * fast/js/pic/cached-single-entry-transition.html: Added.
              * fast/js/pic/get-empty-string-expected.txt: Added.
              * fast/js/pic/get-empty-string.html: Added.
              * fast/js/pic/get-set-proxy-object-expected.txt: Added.
              * fast/js/pic/get-set-proxy-object.html: Added.
              * fast/js/pic/rehash-poisons-structure-expected.txt: Added.
              * fast/js/pic/rehash-poisons-structure.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3412bb43
  3. 25 Aug, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Darin. · ba3b6b5b
      ap@webkit.org authored
              Ensure that JSGlobalContextRelease() performs garbage collection, even if there are other
              contexts in the current context's group.
      
              This is only really necessary when the last reference is released, but there is no way to
              determine that, and no harm in collecting slightly more often.
      
              * API/JSContextRef.cpp: (JSGlobalContextRelease): Explicitly collect the heap if it is not
              being destroyed.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ba3b6b5b
  4. 23 Aug, 2008 1 commit
    • cwzwarich@webkit.org's avatar
      2008-08-23 Cameron Zwarich <cwzwarich@uwaterloo.ca> · 53ddf179
      cwzwarich@webkit.org authored
              Rubber-stamped by Mark Rowe.
      
              Remove modelines.
      
              JavaScriptCore:
      
              * API/APICast.h:
              * API/JSBase.cpp:
              * API/JSCallbackConstructor.cpp:
              * API/JSCallbackConstructor.h:
              * API/JSCallbackFunction.cpp:
              * API/JSCallbackFunction.h:
              * API/JSCallbackObject.cpp:
              * API/JSCallbackObject.h:
              * API/JSCallbackObjectFunctions.h:
              * API/JSClassRef.cpp:
              * API/JSContextRef.cpp:
              * API/JSObjectRef.cpp:
              * API/JSProfilerPrivate.cpp:
              * API/JSStringRef.cpp:
              * API/JSStringRefBSTR.cpp:
              * API/JSStringRefCF.cpp:
              * API/JSValueRef.cpp:
              * API/tests/JSNode.c:
              * API/tests/JSNode.h:
              * API/tests/JSNodeList.c:
              * API/tests/JSNodeList.h:
              * API/tests/Node.c:
              * API/tests/Node.h:
              * API/tests/NodeList.c:
              * API/tests/NodeList.h:
              * API/tests/minidom.c:
              * API/tests/minidom.js:
              * API/tests/testapi.c:
              * API/tests/testapi.js:
              * JavaScriptCore.pro:
              * kjs/FunctionConstructor.h:
              * kjs/FunctionPrototype.h:
              * kjs/JSArray.h:
              * kjs/JSString.h:
              * kjs/JSWrapperObject.cpp:
              * kjs/NumberConstructor.h:
              * kjs/NumberObject.h:
              * kjs/NumberPrototype.h:
              * kjs/lexer.h:
              * kjs/lookup.h:
              * wtf/Assertions.cpp:
              * wtf/Assertions.h:
              * wtf/HashCountedSet.h:
              * wtf/HashFunctions.h:
              * wtf/HashIterators.h:
              * wtf/HashMap.h:
              * wtf/HashSet.h:
              * wtf/HashTable.h:
              * wtf/HashTraits.h:
              * wtf/ListHashSet.h:
              * wtf/ListRefPtr.h:
              * wtf/Noncopyable.h:
              * wtf/OwnArrayPtr.h:
              * wtf/OwnPtr.h:
              * wtf/PassRefPtr.h:
              * wtf/Platform.h:
              * wtf/RefPtr.h:
              * wtf/RefPtrHashMap.h:
              * wtf/RetainPtr.h:
              * wtf/UnusedParam.h:
              * wtf/Vector.h:
              * wtf/VectorTraits.h:
              * wtf/unicode/Unicode.h:
              * wtf/unicode/icu/UnicodeIcu.h:
      
              WebCore:
      
              * WebCore.pro:
              * bridge/testbindings.cpp:
              * dom/DocPtr.h:
              * loader/SubstituteData.h:
              * page/Chrome.cpp:
              * page/Chrome.h:
              * page/ChromeClient.h:
              * page/Frame.h:
              * page/FrameLoadRequest.h:
              * page/FrameTree.cpp:
              * page/FrameTree.h:
              * page/Page.h:
              * page/mac/ChromeMac.mm:
              * platform/network/HTTPHeaderMap.h:
              * platform/network/ResourceErrorBase.cpp:
              * platform/network/ResourceErrorBase.h:
              * platform/network/ResourceHandleInternal.h:
              * platform/network/ResourceRequestBase.cpp:
              * platform/network/ResourceRequestBase.h:
              * platform/network/ResourceResponseBase.cpp:
              * platform/network/ResourceResponseBase.h:
              * platform/network/cf/ResourceError.h:
              * platform/network/cf/ResourceRequest.h:
              * platform/network/cf/ResourceRequestCFNet.h:
              * platform/network/cf/ResourceResponse.h:
              * platform/network/cf/ResourceResponseCFNet.h:
              * platform/network/curl/ResourceError.h:
              * platform/network/curl/ResourceRequest.h:
              * platform/network/curl/ResourceResponse.h:
              * platform/network/mac/ResourceError.h:
              * platform/network/mac/ResourceErrorMac.mm:
              * platform/network/mac/ResourceRequest.h:
              * platform/network/mac/ResourceRequestMac.mm:
              * platform/network/mac/ResourceResponse.h:
              * platform/network/mac/ResourceResponseMac.mm:
              * platform/network/qt/ResourceError.h:
              * platform/network/qt/ResourceRequest.h:
              * platform/network/qt/ResourceResponse.h:
              * platform/network/soup/CookieJarSoup.cpp:
              * platform/network/soup/ResourceError.h:
              * platform/network/soup/ResourceRequest.h:
              * platform/network/soup/ResourceResponse.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      53ddf179
  5. 20 Aug, 2008 1 commit
  6. 18 Aug, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Maciej. · bd1ac66b
      ap@webkit.org authored
              Make JSGlobalContextRetain/Release actually work.
      
              * API/JSContextRef.cpp:
              (JSGlobalContextRetain):
              (JSGlobalContextRelease):
              Ref/deref global data to give checking for globalData.refCount() some sense.
      
              * API/tests/testapi.c: (main): Added a test for this bug.
      
              * kjs/JSGlobalData.cpp:
              (KJS::JSGlobalData::~JSGlobalData):
              While checking for memory leaks, found that JSGlobalData::emptyList has changed to
              a pointer, but it was not destructed, causing a huge leak in run-webkit-tests --threaded.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bd1ac66b
  7. 11 Aug, 2008 1 commit
  8. 31 Jul, 2008 1 commit
  9. 30 Jul, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Geoff Garen. · 17b9b2c7
      ap@webkit.org authored
              Implement JSContextGroup APIs to make concurrent execution possible for
              JavaScriptCore clients.
      
              This changes the behavior of JSGlobalContextCreate(), so that it now uses a private context
              group for each context, making JSlock implicit locking unnecessary.
      
              * API/JSContextRef.h:
              * API/JSContextRef.cpp:
              (JSContextGroupCreate):
              (JSContextGroupRetain):
              (JSContextGroupRelease):
              (JSGlobalContextCreate):
              (JSGlobalContextCreateInGroup):
              (JSGlobalContextRelease):
              (JSContextGetGroup):
              Added new methods. JSGlobalContextCreate() calls JSGlobalContextCreateInGroup() now.
      
              * API/APICast.h: (toJS): (toRef): Added converters for JSContextGroupRef.
              * API/JSBase.cpp: (JSGarbageCollect): JSGarbageCollect(0) is now a no-op, and the passed in
              context is actually used.
      
              * API/JSBase.h: Aded a typedef for JSContextGroupRef. Updated documentation for
              JSGarbageCollect().
      
              * JavaScriptCore.exp: Removed JSGlobalData::sharedInstance().
      
              * kjs/JSGlobalData.cpp:
              * kjs/JSGlobalData.h:
              Removed support for JSGlobalData shared instance. JSGlobalData::isSharedInstance member
              variable still remains, to be deleted in a followup patch.
      
              * kjs/JSLock.cpp: (KJS::JSLock::JSLock): Disabled JSLock, to be deleted in a follow-up patch.
              
              * kjs/collector.cpp:
              (KJS::Heap::markOtherThreadConservatively): Removed an assertion that referenced
              JSGlobalData::sharedInstance.
      
              * kjs/collector.h: Made Heap destructor public, so that JSContextRelease can use it.
      
      JavaScriptGlue:
              * JSRun.cpp:
              (JSRun::JSRun):
              * JSUtils.cpp:
              (getThreadGlobalExecState):
              Changed JavaScriptGlue to use a JSGlobalData of its own, now that there is no shared
              instance.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      17b9b2c7
  10. 23 Jul, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Geoff Garen. · fb4e83b6
      ap@webkit.org authored
              JSClassRef is created context-free, but gets infatuated with the first context it sees.
      
              The implicit API contract is that JSClassRef can be used with any context on any thread.
              This no longer worked, because UStrings in the class were turned into per-context
              identifiers, and the cached JSObject prototype was tied to JSGlobalData, too.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fb4e83b6
  11. 14 Jul, 2008 1 commit
  12. 02 Jul, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Darin. · 32dab944
      ap@webkit.org authored
              Disable JSLock for per-thread contexts.
      
              No change on SunSpider.
      
              * kjs/JSGlobalData.h:
              * kjs/JSGlobalData.cpp:
              (KJS::JSGlobalData::JSGlobalData):
              (KJS::JSGlobalData::sharedInstance):
              Added isSharedInstance as a better way to tell whether the instance is shared (legacy).
      
              * kjs/JSLock.cpp:
              (KJS::createJSLockCount):
              (KJS::JSLock::lockCount):
              (KJS::setLockCount):
              (KJS::JSLock::JSLock):
              (KJS::JSLock::lock):
              (KJS::JSLock::unlock):
              (KJS::JSLock::currentThreadIsHoldingLock):
              (KJS::JSLock::DropAllLocks::DropAllLocks):
              (KJS::JSLock::DropAllLocks::~DropAllLocks):
              * kjs/JSLock.h:
              (KJS::JSLock::JSLock):
              (KJS::JSLock::~JSLock):
              Made JSLock and JSLock::DropAllLocks constructors take a parameter to decide whether to
              actually lock a mutex, or only to increment recursion count. We cannot turn it into no-op
              if we want to keep existing assertions working.
              Made recursion count per-thread, now that locks may not lock.
      
              * API/JSBase.cpp:
              (JSEvaluateScript): Take JSLock after casting JSContextRef to ExecState* (which doesn't need
              locking in any case), so that a decision whether to actually lock can be made.
              (JSCheckScriptSyntax): Ditto.
              (JSGarbageCollect): Only lock while collecting the shared heap, not the per-thread one.
      
              * API/JSObjectRef.cpp:
              (JSClassCreate): Don't lock, as there is no reason to.
              (JSClassRetain): Ditto.
              (JSClassRelease): Ditto.
              (JSPropertyNameArrayRetain): Ditto.
              (JSPropertyNameArrayRelease): Only lock while deleting the array, as that may touch
              identifier table.
              (JSPropertyNameAccumulatorAddName): Adding a string also involves an identifier table
              lookup, and possibly modification.
      
              * API/JSStringRef.cpp:
              (JSStringCreateWithCharacters):
              (JSStringCreateWithUTF8CString):
              (JSStringRetain):
              (JSStringRelease):
              (JSStringGetUTF8CString):
              (JSStringIsEqual):
              * API/JSStringRefCF.cpp:
              (JSStringCreateWithCFString):
              JSStringRef operations other than releasing do not need locking.
      
              * VM/Machine.cpp: Don't include unused JSLock.h.
      
              * kjs/CollectorHeapIntrospector.cpp: (KJS::CollectorHeapIntrospector::statistics):
              Don't take the lock for real, as heap introspection pauses the process anyway. It seems that
              the existing code could cause deadlocks.
      
              * kjs/Shell.cpp:
              (functionGC):
              (main):
              (jscmain):
              The test tool uses a per-thread context, so no real locking is required.
      
              * kjs/collector.h:
              (KJS::Heap::setGCProtectNeedsLocking): Optionally protect m_protectedValues access with a
              per-heap mutex. This is only needed for WebCore Database code, which violates the "no data
              migration between threads" by using ProtectedPtr on a background thread.
              (KJS::Heap::isShared): Keep a shared flag here, as well.
      
              * kjs/protect.h:
              (KJS::::ProtectedPtr):
              (KJS::::~ProtectedPtr):
              (KJS::::operator):
              (KJS::operator==):
              (KJS::operator!=):
              ProtectedPtr is ony used from WebCore, so it doesn't need to take JSLock. An assertion in
              Heap::protect/unprotect guards agains possible future unlocked uses of ProtectedPtr in JSC.
      
              * kjs/collector.cpp:
              (KJS::Heap::Heap): Initialize m_isShared.
              (KJS::Heap::~Heap): No need to lock for real during destruction, but must keep assertions
              in sweep() working.
              (KJS::destroyRegisteredThread): Registered thread list is only accessed for shared heap,
              so locking is always needed here.
              (KJS::Heap::registerThread): Ditto.
              (KJS::Heap::markStackObjectsConservatively): Use m_isShared instead of comparing to a shared
              instance for a small speedup.
              (KJS::Heap::setGCProtectNeedsLocking): Create m_protectedValuesMutex. There is currently no
              way to undo this - and ideally, Database code will be fixed to lo longer require this quirk.
              (KJS::Heap::protect): Take m_protectedValuesMutex (if it exists) while accessing
              m_protectedValues.
              (KJS::Heap::unprotect): Ditto.
              (KJS::Heap::markProtectedObjects): Ditto.
              (KJS::Heap::protectedGlobalObjectCount): Ditto.
              (KJS::Heap::protectedObjectCount): Ditto.
              (KJS::Heap::protectedObjectTypeCounts): Ditto.
      
              * kjs/ustring.cpp:
              * kjs/ustring.h:
              Don't include JSLock.h, which is no longer used here. As a result, an explicit include had
              to be added to many files in JavaScriptGlue, WebCore and WebKit.
      
              * kjs/JSGlobalObject.cpp:
              (KJS::JSGlobalObject::init):
              * API/JSCallbackConstructor.cpp:
              (KJS::constructJSCallback):
              * API/JSCallbackFunction.cpp:
              (KJS::JSCallbackFunction::call):
              * API/JSCallbackObjectFunctions.h:
              (KJS::::init):
              (KJS::::getOwnPropertySlot):
              (KJS::::put):
              (KJS::::deleteProperty):
              (KJS::::construct):
              (KJS::::hasInstance):
              (KJS::::call):
              (KJS::::getPropertyNames):
              (KJS::::toNumber):
              (KJS::::toString):
              (KJS::::staticValueGetter):
              (KJS::::callbackGetter):
              * API/JSContextRef.cpp:
              (JSGlobalContextCreate):
              (JSGlobalContextRetain):
              (JSGlobalContextRelease):
              * API/JSValueRef.cpp:
              (JSValueIsEqual):
              (JSValueIsStrictEqual):
              (JSValueIsInstanceOfConstructor):
              (JSValueMakeNumber):
              (JSValueMakeString):
              (JSValueToNumber):
              (JSValueToStringCopy):
              (JSValueToObject):
              (JSValueProtect):
              (JSValueUnprotect):
              * JavaScriptCore.exp:
              * kjs/PropertyNameArray.h:
              (KJS::PropertyNameArray::globalData):
              * kjs/interpreter.cpp:
              (KJS::Interpreter::checkSyntax):
              (KJS::Interpreter::evaluate):
              Pass a parameter to JSLock/JSLock::DropAllLocks to decide whether the lock needs to be taken.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      32dab944
  13. 19 Jun, 2008 1 commit
  14. 15 Jun, 2008 1 commit
    • darin@apple.com's avatar
      JavaScriptCore: · 3dcb636f
      darin@apple.com authored
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for a few key JavaScriptCore files
      
              * API/JSBase.cpp:
              * API/JSCallbackConstructor.h:
              * API/JSCallbackFunction.cpp:
              * API/JSCallbackFunction.h:
              * API/JSCallbackObject.h:
              * API/JSCallbackObjectFunctions.h:
              * API/JSClassRef.h:
              * API/JSContextRef.cpp:
              * API/JSObjectRef.cpp:
              * API/JSStringRef.cpp:
              * API/JSStringRefCF.cpp:
              * API/JSValueRef.cpp:
              * GNUmakefile.am:
              * JavaScriptCore.pri:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * JavaScriptCoreSources.bkl:
              * VM/CodeBlock.cpp:
              * VM/CodeGenerator.cpp:
              * VM/ExceptionHelpers.cpp:
              * VM/ExceptionHelpers.h:
              * VM/JSPropertyNameIterator.cpp:
              * VM/JSPropertyNameIterator.h:
              * VM/Machine.cpp:
              * kjs/AllInOneFile.cpp:
              * kjs/DateMath.cpp:
              * kjs/DebuggerCallFrame.cpp:
              * kjs/ExecState.cpp:
              * kjs/JSActivation.cpp:
              * kjs/JSFunction.cpp: Copied from JavaScriptCore/kjs/function.cpp.
              * kjs/JSFunction.h: Copied from JavaScriptCore/kjs/function.h.
              * kjs/JSImmediate.cpp:
              * kjs/JSNotAnObject.h:
              * kjs/JSObject.cpp: Copied from JavaScriptCore/kjs/object.cpp.
              * kjs/JSObject.h: Copied from JavaScriptCore/kjs/object.h.
              * kjs/JSString.h: Copied from JavaScriptCore/kjs/internal.h.
              * kjs/JSValue.cpp: Copied from JavaScriptCore/kjs/value.cpp.
              * kjs/JSValue.h: Copied from JavaScriptCore/kjs/value.h.
              * kjs/JSVariableObject.h:
              * kjs/JSWrapperObject.h:
              * kjs/Shell.cpp:
              * kjs/SymbolTable.h:
              * kjs/array_instance.h:
              * kjs/collector.cpp:
              * kjs/date_object.cpp:
              * kjs/date_object.h:
              * kjs/error_object.cpp:
              * kjs/function.cpp: Removed.
              * kjs/function.h: Removed.
              * kjs/function_object.cpp:
              * kjs/function_object.h:
              * kjs/grammar.y:
              * kjs/internal.cpp:
              * kjs/internal.h: Removed.
              * kjs/lexer.cpp:
              * kjs/list.h:
              * kjs/lookup.h:
              * kjs/nodes.h:
              * kjs/object.cpp: Removed.
              * kjs/object.h: Removed.
              * kjs/object_object.h:
              * kjs/operations.cpp:
              * kjs/property_map.cpp:
              * kjs/property_slot.cpp:
              * kjs/property_slot.h:
              * kjs/protect.h:
              * kjs/regexp_object.cpp:
              * kjs/scope_chain.cpp:
              * kjs/string_object.h:
              * kjs/ustring.cpp:
              * kjs/value.cpp: Removed.
              * kjs/value.h: Removed.
              * profiler/Profile.cpp:
              * profiler/Profiler.cpp:
      
      JavaScriptGlue:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for a few key JavaScriptCore files
      
              * ForwardingHeaders/kjs/JSValue.h: Copied from JavaScriptGlue/ForwardingHeaders/kjs/value.h.
              * ForwardingHeaders/kjs/value.h: Removed.
              * JSUtils.h:
      
      WebCore:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for a few key JavaScriptCore files
      
              * ForwardingHeaders/kjs/JSFunction.h: Copied from WebCore/ForwardingHeaders/kjs/function.h.
              * ForwardingHeaders/kjs/JSObject.h: Copied from WebCore/ForwardingHeaders/kjs/object.h.
              * ForwardingHeaders/kjs/JSString.h: Copied from WebCore/ForwardingHeaders/kjs/internal.h.
              * ForwardingHeaders/kjs/JSValue.h: Copied from WebCore/ForwardingHeaders/kjs/value.h.
              * ForwardingHeaders/kjs/function.h: Removed.
              * ForwardingHeaders/kjs/internal.h: Removed.
              * ForwardingHeaders/kjs/object.h: Removed.
              * ForwardingHeaders/kjs/value.h: Removed.
              * WebCore.vcproj/WebCore.vcproj:
              * bindings/js/JSCustomSQLStatementCallback.h:
              * bindings/js/JSCustomSQLStatementErrorCallback.h:
              * bindings/js/JSCustomSQLTransactionErrorCallback.h:
              * bindings/js/JSCustomVoidCallback.h:
              * bindings/js/JSDOMBinding.h:
              * bindings/js/JSDOMWindowCustom.cpp:
              * bindings/js/JSDOMWindowShell.cpp:
              * bindings/js/JSQuarantinedObjectWrapper.h:
              * bridge/objc/objc_runtime.h:
              * bridge/objc/objc_utility.h:
              * bridge/qt/qt_runtime.cpp:
              * bridge/runtime.h:
              * bridge/runtime_array.h:
              * bridge/runtime_method.h:
              * bridge/runtime_object.h:
              * bridge/testbindings.cpp:
              * bridge/testbindings.mm:
              * bridge/testqtbindings.cpp:
              * loader/FrameLoader.cpp:
              * page/JavaScriptCallFrame.cpp:
              * page/JavaScriptProfile.cpp:
              * page/JavaScriptProfileNode.cpp:
              * platform/graphics/gtk/VideoSinkGStreamer.h:
              * plugins/PluginView.cpp:
              * plugins/gtk/PluginViewGtk.cpp:
              * plugins/qt/PluginViewQt.cpp:
              * plugins/win/PluginViewWin.cpp:
      
      WebKit/gtk:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for a few key JavaScriptCore files
      
              * WebCoreSupport/ContextMenuClientGtk.cpp:
              * webkit/webkitnetworkrequest.h:
              * webkit/webkitwebbackforwardlist.h:
              * webkit/webkitwebframe.h:
              * webkit/webkitwebhistoryitem.h:
              * webkit/webkitwebsettings.h:
      
      WebKit/mac:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for a few key JavaScriptCore files
      
              * ForwardingHeaders/kjs/JSFunction.h: Copied from WebKit/mac/ForwardingHeaders/kjs/function.h.
              * ForwardingHeaders/kjs/JSObject.h: Copied from WebKit/mac/ForwardingHeaders/kjs/object.h.
              * ForwardingHeaders/kjs/JSString.h: Copied from WebKit/mac/ForwardingHeaders/kjs/internal.h.
              * ForwardingHeaders/kjs/JSValue.h: Copied from WebKit/mac/ForwardingHeaders/kjs/value.h.
              * ForwardingHeaders/kjs/function.h: Removed.
              * ForwardingHeaders/kjs/internal.h: Removed.
              * ForwardingHeaders/kjs/object.h: Removed.
              * ForwardingHeaders/kjs/value.h: Removed.
              * WebView/WebScriptDebugDelegate.mm:
      
      WebKit/qt:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for a few key JavaScriptCore files
      
              * Api/qwebframe.cpp:
      
      WebKit/win:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for a few key JavaScriptCore files
      
              * WebView.cpp:
      
      WebKit/wx:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for a few key JavaScriptCore files
      
              * WebView.cpp:
      
      WebKitTools:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              * Scripts/do-file-rename: Updated for the latest round of renaming.
              * Scripts/do-webcore-rename: Tweaked and reorganized a bit.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3dcb636f
  15. 02 May, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Darin. · 3d4a5419
      ap@webkit.org authored
              Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
              for the sake of non-WebKit clients.
      
      JavaScriptCore:
              * API/JSBase.cpp:
              (JSGarbageCollect):
              * API/JSContextRef.cpp:
              (JSGlobalContextCreate):
              These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
              and JSClassRef functions that can be called earlier, but they do not do anything that
              requires initializeThreading.
      
              * kjs/InitializeThreading.cpp:
              (KJS::doInitializeThreading):
              (KJS::initializeThreading):
              On Darwin, make the initialization happen under pthread_once, since there is no guarantee
              that non-WebKit clients won't try to call this function re-entrantly.
      
              * kjs/InitializeThreading.h:
              * wtf/Threading.h:
              Spell out initializeThreading contract.
      
              * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
              Darwin, even if threading was initialized from a secondary thread.
      
      JavaScriptGlue:
              * JavaScriptGlue.cpp:
              (JSRunCreate):
              (JSCollect):
              (JSCreateJSArrayFromCFArray):
              (JSLockInterpreter):
              These are all possible JavaScriptGlue entry points.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3d4a5419
  16. 16 Apr, 2008 1 commit
    • weinig@apple.com's avatar
      JavaScriptCore: · 6ae58b39
      weinig@apple.com authored
      2008-04-16  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Geoffrey Garen.
      
              - To keep the behavior of the WebKit and JavaScriptCore API's the same,
                we need to hide the fact that the global object and the window object
                are no longer the same thing, and the the global object now changes on
                navigations.  To do this, only the wrapper should ever be exposed.  This
                fixes the two remaining spots where the internal global object is exposed,
                the windowScriptObject returned from [WebFrame windowObject] and the object
                return by calling JSContextGetGlobalObject on [WebFrame globalContext].
      
              * API/JSContextRef.cpp:
              (JSContextGetGlobalObject):
              This is a bit of a hack, this returns the "this" representation of the globalObject
              which will be the WrapperWindow for WebCore and the globalObject for non-WebCore.
      
              * API/JSObjectRef.cpp:
              (JSObjectSetProperty):
              Call the new putWithAttributes method instead of relying on lower-level calls.
              This is needed so that the window wrapper can forward the calls.
      
              * JavaScriptCore.exp:
              * kjs/Activation.h:
              * kjs/JSGlobalObject.cpp:
              (KJS::JSGlobalObject::putWithAttributes):
              * kjs/JSGlobalObject.h:
              * kjs/JSVariableObject.h:
              (KJS::JSVariableObject::symbolTablePutWithAttributes):
              * kjs/function.cpp:
              (KJS::ActivationImp::putWithAttributes):
              * kjs/nodes.cpp:
              (KJS::ConstDeclNode::handleSlowCase):
              (KJS::ConstDeclNode::evaluateSingle):
              (KJS::EvalNode::processDeclarations):
              * kjs/object.cpp:
              (KJS::JSObject::putWithAttributes):
              * kjs/object.h:
              Rename initializeVariable to putWithAttributes and move it down to JSObject so it
              can be used for JSObjectSetProperty.
      
      WebCore:
      
      2008-04-16  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Geoffrey Garen.
      
              - To keep the behavior of the WebKit and JavaScriptCore API's the same,
                we need to hide the fact that the global object and the window object
                are no longer the same thing, and the the global object now changes on
                navigations.  To do this, only the wrapper should ever be exposed.  This
                fixes the two remaining spots where the internal global object is exposed,
                the windowScriptObject returned from [WebFrame windowObject] and the object
                return by calling JSContextGetGlobalObject on [WebFrame globalContext]
      
              * bindings/js/JSDOMWindowWrapper.cpp:
              (WebCore::JSDOMWindowWrapper::putWithAttributes):
              * bindings/js/JSDOMWindowWrapper.h:
              Forward this new method so that JSObjectSetProperty doesn't set properties on the 
              wrapper.
      
              * page/mac/FrameMac.mm:
              (WebCore::Frame::windowScriptObject):
              Return the wrapper instead of the global object.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6ae58b39
  17. 20 Dec, 2007 3 commits
    • darin@apple.com's avatar
      - re-fix http://bugs.webkit.org/show_bug.cgi?id=16471 · 74da9e05
      darin@apple.com authored
                Completions need to be smaller (or not exist at all)
      
              Same patch as last time with the test failures problem fixed.
      
              * kjs/function.cpp:
              (KJS::GlobalFuncImp::callAsFunction): Make sure to check the completion
              type from newExec to see if the execute raised an exception.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      74da9e05
    • darin@apple.com's avatar
      - roll out that last change -- it was causing test failures; · 6dbf9452
      darin@apple.com authored
                I'll check it back in after fixing them
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6dbf9452
    • darin@apple.com's avatar
      Reviewed by Eric. · f3eb7aae
      darin@apple.com authored
              - http://bugs.webkit.org/show_bug.cgi?id=16471
                Completions need to be smaller (or not exist at all)
      
              SuSpider shows 2.4% speedup.
      
              Stop using completions in the execution engine.
              Instead, the completion type and label target are both
              stored in the ExecState.
      
              * API/JSContextRef.cpp: Removed unneeded include of "completion.h".
              * bindings/runtime_method.cpp: Removed unused execute function.
              * bindings/runtime_method.h: Ditto.
      
              * kjs/ExecState.h: Added completionType, breakOrContinueTarget,
              setCompletionType, setNormalCompletion, setBreakCompletion,
              setContinueCompletion, setReturnValueCompletion, setThrowCompletion,
              setInterruptedCompletion, m_completionType, and m_breakOrContinueTarget.
      
              * kjs/completion.h: Removed constructor and getter for target
              for break and continue from Completion. This class is now only
              used for the public API to Interpreter and such.
      
              * kjs/date_object.h: Removed unused execute function.
      
              * kjs/function.cpp:
              (KJS::FunctionImp::callAsFunction): Removed some unneeded
              exception processing. Updated to call the new execute function
              and to get the completion type from the ExecState. Merged in
              the execute function, which repeated some of the same logic and
              was called only from here.
              (KJS::GlobalFuncImp::callAsFunction): More of the same for eval.
              * kjs/function.h: Removed execute.
      
              * kjs/interpreter.cpp:
              (KJS::Interpreter::evaluate): Added code to convert the result of
              execut into a Completion.
      
              * kjs/nodes.cpp:
              (KJS::Node::setErrorCompletion): Renamed from createErrorCompletion.
              Now sets the completion type in the ExecState.
              (KJS::Node::rethrowException): Now sets the completion type in the
              ExecState.
              (KJS::StatementNode::hitStatement): Now sets the completion type in
              the ExecState.
              (KJS::VarStatementNode::execute): Updated to put completion type in
              the ExecState instead of a Completion object.
              (KJS::statementListExecute): Ditto. Also changed the for loop to use
              indices instead of iterators.
              (KJS::BlockNode::execute): Updated return type.
              (KJS::EmptyStatementNode::execute): Updated to put completion type in
              the ExecState instead of a Completion object.
              (KJS::ExprStatementNode::execute): Ditto.
              (KJS::IfNode::execute): Ditto.
              (KJS::DoWhileNode::execute): Ditto. Also streamlined the logic a little
              to make the normal case a little faster and moved the end outside the
              loop so that "break" can do a break.
              (KJS::WhileNode::execute): Ditto.
              (KJS::ForNode::execute): Ditto.
              (KJS::ForInNode::execute): Ditto.
              (KJS::ContinueNode::execute): Updated to put completion type in
              the ExecState instead of a Completion object.
              (KJS::BreakNode::execute): Ditto.
              (KJS::ReturnNode::execute): Ditto.
              (KJS::WithNode::execute): Ditto.
              (KJS::CaseClauseNode::executeStatements): Ditto. Also renamed to have
              execute in its name to reflect the fact that it's a member of the same
              family of functions.
              (KJS::CaseBlockNode::executeBlock): Ditto.
              (KJS::SwitchNode::execute): Ditto.
              (KJS::LabelNode::execute): Ditto.
              (KJS::ThrowNode::execute): Ditto.
              (KJS::TryNode::execute): Ditto.
              (KJS::ProgramNode::execute): Ditto.
              (KJS::EvalNode::execute): Ditto.
              (KJS::FunctionBodyNode::execute): Ditto.
              (KJS::FuncDeclNode::execute): Ditto.
      
              * kjs/nodes.h: Renamed setErrorCompletion to createErrorCompletion, made
              hitStatement protected, changed return value of execute to a JSValue,
              renamed evalStatements to executeStatements, and evalBlock to executeBlock.
      
              * kjs/number_object.h: Removed unused execute function.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f3eb7aae
  18. 05 Dec, 2007 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: · 1b4d90ba
      ggaren@apple.com authored
              Reviewed by Darin Adler.
      
              Third step in refactoring JSGlobalObject: Moved data members and 
              functions accessing data members from Interpreter to JSGlobalObject.
              Changed Interpreter member functions to static functions.
              
              This resolves a bug in global object bootstrapping, where the global
              ExecState could be used when uninitialized.
              
              This is a big change, but it's mostly code motion and renaming.
              
              Layout and JS tests, and testjsglue and testapi, pass. SunSpider reports
              a .7% regression, but Shark sees no difference related to this patch,
              and SunSpider reported a .7% speedup from an earlier step in this 
              refactoring, so I think it's fair to call that a wash.
      
      JavaScriptGlue:
      
              Reviewed by Darin Adler.
      
              Third step in refactoring JSGlobalObject: Moved data members and data
              member access from Interpreter to JSGlobalObject. Replaced JSInterpreter
              subclass with JSGlobalObject subclass.
              
              * JSRun.cpp:
              (JSRun::JSRun):
              (JSRun::Evaluate):
              (JSRun::CheckSyntax):
              * JSRun.h:
              (JSGlueGlobalObject::JSGlueGlobalObject):
              * JSUtils.cpp:
              (KJSValueToCFTypeInternal):
              * JSValueWrapper.cpp:
              (getThreadGlobalExecState):
      
      WebCore:
      
              Reviewed by Darin Adler.
      
              Third step in refactoring JSGlobalObject: Moved data members and data
              member access from Interpreter to JSGlobalObject. Changed Interpreter
              member functions to static functions. Same for the subclass, 
              ScriptInterpreter.
              
              This is a big change, but it's mostly code motion and renaming.
      
      WebKit/mac:
      
              Reviewed by Darin Adler.
      
              Third step in refactoring JSGlobalObject: Moved data members and data
              member access from Interpreter to JSGlobalObject.
              
              * WebView/WebFrame.mm:
              (-[WebFrame _attachScriptDebugger]):
      
      WebKit/win:
      
              Reviewed by Darin Adler.
      
              Third step in refactoring JSGlobalObject: Moved data members and data
              member access from Interpreter to JSGlobalObject.
              
              * WebFrame.cpp:
              (WebFrame::globalContext):
              (WebFrame::attachScriptDebugger):
              (WebFrame::windowObjectCleared):
              * WebScriptDebugger.cpp:
              (WebScriptDebugger::WebScriptDebugger):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1b4d90ba
  19. 03 Dec, 2007 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: · 66bf8cbb
      ggaren@apple.com authored
              Reviewed by Eric Seidel.
      
              Second step in refactoring JSGlobalObject: moved virtual functions from
              Interpreter to JSGlobalObject.
              
              Layout and JS tests pass. SunSpider reports a .7% speedup -- don't 
              believe his lies.
      
      JavaScriptGlue:
      
              Reviewed by Eric Seidel.
      
              Updated to match the JavaScriptCore change to move virtual methods from
              Interpreter to JSGlobalObject.
              
              * JSRun.cpp:
              * JSRun.h:
              * JSValueWrapper.cpp:
              (getThreadGlobalExecState):
              * JavaScriptGlue.cpp:
              (JSRunCopyGlobalObject):
              (JSRunEvaluate):
      
      WebCore:
      
              Reviewed by Eric Seidel.
      
              Updated to match the JavaScriptCore change to move virtual methods from
              Interpreter to JSGlobalObject.
              
              Moved virtual ScriptInterpreter functions to Window.
      
      WebKit/mac:
      
              Reviewed by Eric Seidel.
      
              Updated to match the JavaScriptCore change to move virtual methods from
              Interpreter to JSGlobalObject.
      
              * WebView/WebFrame.mm:
              (-[WebFrame globalContext]): Use the toRef function instead of manually
              casting.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      66bf8cbb
  20. 01 Dec, 2007 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: · 41893215
      ggaren@apple.com authored
              Reviewed by Beth Dakin.
              
              Reversed the ownership relationship between Interpreter and JSGlobalObject.
              Now, the JSGlobalObject owns the Interpreter, and top-level objects
              that need the two to persist just protect the JSGlobalObject from GC.
              
              Global object bootstrapping looks a little odd right now, but it will
              make much more sense soon, after further rounds of refactoring.
      
              * bindings/runtime_root.h: Made this class inherit from RefCounted,
              to avoid code duplication.
      
              * kjs/collector.cpp:
              (KJS::Collector::collect): No need to give special GC treatment to 
              Interpreters, since we mark their global objects, which mark them.
      
              * kjs/interpreter.cpp:
              (KJS::Interpreter::mark): No need to mark our global object, since it
              marks us.
              * kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject 
              owns us directly.
      
              * kjs/testkjs.cpp: Modified to follow the new rules.
              (createGlobalObject):
              (runWithScripts):
      
      JavaScriptGlue:
      
              Reviewed by Beth Dakin.
              
              Modified to follow new JSGlobalObject/Interpreter ownership rules 
              in JavaScriptCore.
      
              * JSRun.cpp:
              (JSRun::JSRun):
              (JSRun::GetInterpreter):
              (JSRun::Evaluate):
              (JSRun::CheckSyntax):
              * JSRun.h:
              * JSValueWrapper.cpp:
              (unprotectGlobalObject):
              (initializeGlobalObjectKey):
              (getThreadGlobalExecState):
      
      WebCore:
      
              Reviewed by Beth Dakin.
              
              Modified WebCore to follow the new JSGlobalObject/Interpreter ownership
              rules in JavaScriptCore.
      
              * bindings/js/kjs_binding.cpp:
              * bindings/js/kjs_binding.h: Removed stale, unused 
              interpreterForGlobalObject().
      
              * bindings/js/kjs_proxy.cpp: Changed to store a global object, rather
              than an interpreter.
              (WebCore::KJSProxy::finishedWithEvent): Need to NULL check 
              m_globalObject here because we no longer unnecessarily instantiate it.
      
              * bindings/js/kjs_window.cpp:
              (KJS::ScheduledAction::execute):
              * bindings/js/kjs_window.h: Removed redundant and less efficient 
              interpreter() function -- global objects have direct access to their
              interpreters now.
      
              Changed these functions to pass around JSGlobalObjects instead of 
              Interpreters:
      
              * page/Frame.cpp:
              (WebCore::Frame::bindingRootObject):
              (WebCore::Frame::createRootObject):
              * page/Frame.h:
              * page/mac/WebCoreFrameBridge.mm:
              (createRootObject):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      41893215
  21. 18 Nov, 2007 1 commit
  22. 12 Nov, 2007 1 commit
    • darin@apple.com's avatar
      Reviewed by Geoff. · 7f984871
      darin@apple.com authored
              - fix use of prefix and config.h, got rid of a few unneeded things in
                the PCRE code; no behavior changes
      
              * API/JSBase.cpp: Added include of config.h.
              * API/JSCallbackConstructor.cpp: Ditto.
              * API/JSCallbackFunction.cpp: Ditto.
              * API/JSCallbackObject.cpp: Ditto.
              * API/JSClassRef.cpp: Ditto.
              * API/JSContextRef.cpp: Ditto.
              * API/JSObjectRef.cpp: Ditto.
              * API/JSStringRef.cpp: Ditto.
              * API/JSValueRef.cpp: Ditto.
      
              * JavaScriptCorePrefix.h: Removed obsolete <ctype.h> workaround.
              Moved new/delete macros after includes, as they are in WebCore's prefix.
              Removed "config.h".
      
              * pcre/dftables.cpp: (main): Changed back to not use a separate maketables
              function. This is needed for PCRE, but not helpful for our use. Also changed
              the tables to all be 128 entries long instead of 256, since only the first
              128 are ever used.
      
              * pcre/pcre_compile.cpp: Added include of config.h. Eliminated digitab,
              which was only being used to check hex digits. Changed all uses of TRUE and
              FALSE to use the C++ true and false instead.
              (check_escape): Just the TRUE/FALSE thing.
              (is_counted_repeat): Ditto.
              (could_be_empty_branch): Ditto.
              (get_othercase_range): Ditto.
              (compile_branch): Ditto.
              (compile_regex): Ditto.
              (is_anchored): Ditto.
              (is_startline): Ditto.
              (find_firstassertedchar): Ditto.
              (jsRegExpCompile): Ditto.
      
              * pcre/pcre_exec.cpp: Added include of config.h. Changed all uses of TRUE and
              FALSE to use the C++ true and false instead.
              (match_ref): Just the TRUE/FALSE thing.
              (match): Ditto. Removed some unneeded braces.
              (jsRegExpExecute): Just the TRUE/FALSE thing.
      
              * pcre/pcre_internal.h: Moved the constants needed by dftables.cpp to the top
              of the file instead of the bottom, so they can be used. Also changed the table
              sizes to 128 instead of 256. Removed macro definitions of FALSE and TRUE.
              Set array sizes for all the const arrays. Changed _pcre_utf8_table1_size to
              be a macro instead of a extern int.
      
              * pcre/pcre_maketables.cpp: Removed. It's all in dftables.cpp now.
      
              * pcre/pcre_tables.cpp: Made table sizes explicit.
      
              * pcre/pcre_xclass.cpp: Just the TRUE/FALSE thing.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7f984871
  23. 25 Oct, 2007 1 commit
    • eseidel's avatar
      2007-10-24 Eric Seidel <eric@webkit.org> · 5417cd59
      eseidel authored
              Reviewed by Maciej.
              
              Add a JSGlobalObject class and remove the InterpreterMap
              http://bugs.webkit.org/show_bug.cgi?id=15681
              
              This required making JSCallbackObject a template class to allow for
              JSGlobalObjects with JSCallbackObject functionality.
              
              SunSpider claims this was a 0.5% speedup.
      
              * API/JSCallbackObject.cpp:
              (KJS::):
              * API/JSCallbackObject.h:
              * API/JSCallbackObjectFunctions.h: Copied from API/JSCallbackObject.cpp.
              (KJS::::JSCallbackObject):
              (KJS::::init):
              (KJS::::~JSCallbackObject):
              (KJS::::initializeIfNeeded):
              (KJS::::className):
              (KJS::::getOwnPropertySlot):
              (KJS::::put):
              (KJS::::deleteProperty):
              (KJS::::implementsConstruct):
              (KJS::::construct):
              (KJS::::implementsHasInstance):
              (KJS::::hasInstance):
              (KJS::::implementsCall):
              (KJS::::callAsFunction):
              (KJS::::getPropertyNames):
              (KJS::::toNumber):
              (KJS::::toString):
              (KJS::::setPrivate):
              (KJS::::getPrivate):
              (KJS::::inherits):
              (KJS::::cachedValueGetter):
              (KJS::::staticValueGetter):
              (KJS::::staticFunctionGetter):
              (KJS::::callbackGetter):
              * API/JSClassRef.cpp:
              (OpaqueJSClass::prototype):
              * API/JSContextRef.cpp:
              (JSGlobalContextCreate):
              * API/JSObjectRef.cpp:
              (JSObjectMake):
              (JSObjectGetPrivate):
              (JSObjectSetPrivate):
              * API/JSValueRef.cpp:
              (JSValueIsObjectOfClass):
              * JavaScriptCore.exp:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * bindings/c/c_utility.cpp:
              (KJS::Bindings::convertValueToNPVariant):
              * bindings/jni/jni_jsobject.cpp:
              * bindings/objc/objc_utility.mm:
              (KJS::Bindings::convertValueToObjcValue):
              * kjs/Context.cpp:
              (KJS::Context::Context):
              * kjs/ExecState.cpp:
              (KJS::ExecState::lexicalInterpreter):
              * kjs/JSGlobalObject.h: Added.
              (KJS::JSGlobalObject::JSGlobalObject):
              (KJS::JSGlobalObject::isGlobalObject):
              (KJS::JSGlobalObject::interpreter):
              (KJS::JSGlobalObject::setInterpreter):
              * kjs/array_instance.cpp:
              * kjs/context.h:
              * kjs/function.cpp:
              (KJS::FunctionImp::callAsFunction):
              (KJS::GlobalFuncImp::callAsFunction):
              * kjs/interpreter.cpp:
              (KJS::Interpreter::Interpreter):
              (KJS::Interpreter::init):
              (KJS::Interpreter::~Interpreter):
              (KJS::Interpreter::globalObject):
              (KJS::Interpreter::initGlobalObject):
              (KJS::Interpreter::evaluate):
              * kjs/interpreter.h:
              * kjs/lookup.h:
              (KJS::cacheGlobalObject):
              * kjs/object.h:
              (KJS::JSObject::isGlobalObject):
              * kjs/testkjs.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5417cd59
  24. 27 Aug, 2007 2 commits
    • bdash's avatar
      2007-08-26 Mark Rowe <mrowe@apple.com> · bea0d9af
      bdash authored
              Reviewed by Darin Adler.
      
              <rdar://problem/4949002> JSGlobalContextCreate can cause crashes because it passes a NULL JSContextRef to the globalObjectClass's initialize callback
      
              JSCallbackObject now tracks whether it was constructed with a null ExecState.  This will happen when the object is being used as the global object,
              as the Interpreter needs to be created after the global object.  In this situation the initialization is deferred until after the Interpreter's
              ExecState is available to be passed down to the initialize callbacks.
      
              * API/JSCallbackObject.cpp:
              (KJS::JSCallbackObject::init): Track whether we successfully initialized.
              (KJS::JSCallbackObject::initializeIfNeeded): Attempt to initialize with the new ExecState.
              * API/JSCallbackObject.h:
              * API/JSContextRef.cpp:
              (JSGlobalContextCreate): Initialize the JSCallbackObject with the Interpreter's ExecState.
              * API/testapi.c:
              (testInitializeOfGlobalObjectClassHasNonNullContext):
              (main): Verify that the context passed to the initialize callback is non-null.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bea0d9af
    • bdash's avatar
      2007-08-26 Mark Rowe <mrowe@apple.com> · 19c9a3e4
      bdash authored
              Reviewed by Darin Adler.
      
              <rdar://problem/5438496> JSGlobalContextCreate crashes when passed a custom class
      
              * API/JSContextRef.cpp:
              (JSGlobalContextCreate): Specify jsNull() as the prototype and let Interpreter's constructor fix it up to point at builtinObjectPrototype().
              * API/testapi.c:
              (main): Use an instance of a custom class as the global object to ensure the code path is exercised in the test.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@25256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      19c9a3e4
  25. 23 Jan, 2007 1 commit
    • ggaren's avatar
      Reviewed by Maciej Stachowiak. · 94d02334
      ggaren authored
              
              Fixed <rdar://problem/4885131> Move CFString function declarations from 
              JSStringRef.h to JSStringRefCF.h
              
              Also removed remaining API FIXMEs and changed them into Radars.
      
              * API/JSClassRef.cpp:
              (OpaqueJSClass::OpaqueJSClass): Added Radar numbers for UTF8 conversion.
      
              * API/JSContextRef.cpp:
              (JSGlobalContextCreate): Replaced FIXME for NULL JSContextRef with Radar number.
      
              * API/JSObjectRef.h: Removed FIXME, which is unprofessional in a public header.
      
              * API/JSStringRef.cpp: Moved CF related implementations to JSStringRefCF.cpp.
              (JSStringCreateWithUTF8CString): Replaced FIXME with Radar number.
              * API/JSStringRef.h: Moved CF related declarations to JSStringRefCF.h. Added
              #include of JSStringRefCF.h as a stopgap until clients start #including
              it as needed by themselves.
      
              * API/JSStringRefCF.cpp: Added.
              (JSStringCreateWithCFString):
              (JSStringCopyCFString): Replaced JSChar cast with UniChar cast, which is 
              more appropriate for a CF call.
              * API/JSStringRefCF.h: Added.
              * JavaScriptCore.xcodeproj/project.pbxproj:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      94d02334
  26. 15 Sep, 2006 1 commit
    • andersca's avatar
      2006-09-15 Anders Carlsson <acarlsson@apple.com> · 53794dc8
      andersca authored
              Reviewed by Steve.
      
              Add JavaScriptCore API to the build.
              * API/JSBase.cpp:
              * API/JSCallbackConstructor.cpp:
              * API/JSCallbackFunction.cpp:
              * API/JSCallbackObject.cpp:
              * API/JSClassRef.cpp:
              * API/JSContextRef.cpp:
              * API/JSObjectRef.cpp:
              * API/JSStringRef.cpp:
              * API/JSValueRef.cpp:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * os-win32/stdbool.h: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      53794dc8
  27. 17 Jul, 2006 2 commits
    • ggaren's avatar
      Reviewed by Maciej. · 39f19043
      ggaren authored
              
              - Removed the exception parameter from the initialize callback and, by extension,
              JSObjectMake. We have never had a need for exceptions when iniitializing,
              so the parameter seemed likely to "get in the way." 
              
              Also, an exception in JavaScript is thrown in response to input -- 
              "invalid URL", "index not a number", etc., so it's the job of the 
              constructor function, not the initialize method, to throw.
              
              If initialize *really* wants to throw, it can communicate the throw to
              the constructor through the constructed object's private data (e.g., set
              it to NULL, signaling to the consntructor that initialization failed.)
              
              - Added JSObjectMakeWithData, which enables a constructor to set private
              data on an object *before* it has been initialized. That way, the initialize
              methods can properly operate on the data. 
      
              * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
              now that it's possible.
              * API/JSNodeList.c: ditto
              * API/minidom.c:
              (main): Do more aggressive garbage collection to test ref/deref and 
              initialize/finalize.
              * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
              like a thousand times. This makes debugging ref/deref easier
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      39f19043
    • mjs's avatar
      Reviewed by Geoff. · 127f8592
      mjs authored
              
              - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
              except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
              
              Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
              but usually uninteresting parameter.
      
              * API/JSBase.cpp:
              (JSEvaluateScript):
              (JSCheckScriptSyntax):
              (JSGarbageCollect):
              * API/JSBase.h:
              * API/JSCallbackObject.cpp:
              (KJS::JSCallbackObject::JSCallbackObject):
              (KJS::JSCallbackObject::init):
              (KJS::JSCallbackObject::getOwnPropertySlot):
              (KJS::JSCallbackObject::put):
              (KJS::JSCallbackObject::deleteProperty):
              (KJS::JSCallbackObject::toNumber):
              (KJS::JSCallbackObject::toString):
              * API/JSContextRef.cpp:
              (JSGlobalContextCreate):
              (JSGlobalContextRetain):
              (JSGlobalContextRelease):
              (JSContextGetGlobalObject):
              * API/JSContextRef.h:
              * API/JSNode.c:
              (JSNodePrototype_appendChild):
              (JSNodePrototype_removeChild):
              (JSNodePrototype_replaceChild):
              (JSNode_getNodeType):
              (JSNode_getFirstChild):
              (JSNode_prototype):
              * API/JSNodeList.c:
              (JSNodeListPrototype_item):
              (JSNodeList_length):
              (JSNodeList_getProperty):
              (JSNodeList_prototype):
              * API/JSObjectRef.cpp:
              (JSObjectMake):
              (JSObjectMakeFunctionWithCallback):
              (JSObjectMakeConstructor):
              (JSObjectMakeFunction):
              (JSObjectGetPrototype):
              (JSObjectSetPrototype):
              (JSObjectHasProperty):
              (JSObjectGetProperty):
              (JSObjectSetProperty):
              (JSObjectGetPropertyAtIndex):
              (JSObjectSetPropertyAtIndex):
              (JSObjectDeleteProperty):
              (JSObjectIsFunction):
              (JSObjectCallAsFunction):
              (JSObjectIsConstructor):
              (JSObjectCallAsConstructor):
              (JSObjectCopyPropertyNames):
              * API/JSObjectRef.h:
              * API/JSStringRef.cpp:
              * API/JSValueRef.cpp:
              (JSValueGetType):
              (JSValueIsUndefined):
              (JSValueIsNull):
              (JSValueIsBoolean):
              (JSValueIsNumber):
              (JSValueIsString):
              (JSValueIsObject):
              (JSValueIsObjectOfClass):
              (JSValueIsEqual):
              (JSValueIsStrictEqual):
              (JSValueIsInstanceOfConstructor):
              (JSValueMakeUndefined):
              (JSValueMakeNull):
              (JSValueMakeBoolean):
              (JSValueMakeNumber):
              (JSValueMakeString):
              (JSValueToBoolean):
              (JSValueToNumber):
              (JSValueToStringCopy):
              (JSValueToObject):
              (JSValueProtect):
              (JSValueUnprotect):
              * API/JSValueRef.h:
              * API/minidom.c:
              (print):
              * API/testapi.c:
              (MyObject_getProperty):
              (MyObject_deleteProperty):
              (MyObject_callAsFunction):
              (MyObject_callAsConstructor):
              (MyObject_convertToType):
              (print_callAsFunction):
              (main):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      127f8592
  28. 14 Jul, 2006 2 commits
    • ggaren's avatar
      JavaScriptCore: · 41694b65
      ggaren authored
              Reviewed by Maciej.
              
              - Implemented ref-counting of JSContexts by splitting into two datatypes:
              JSGlobalContext, which you can create/retain/release, and JSContext, which
              you can't.
              
              Internally, you retain a JSGlobalContext/ExecState by retaining its
              interpreter, which, in the case of a global ExecState, owns it.
              
              - Also made ~Interpreter() protected to catch places where Interpreter
              is manually deleted. (Can't make it private because some crazy fool
              decided it would be a good idea to subclass Interpreter in other frameworks.
              I pity da fool.)
      
              * API/APICast.h: 
              (toJS): Added cast for new JSGlobalContext
              * API/JSStringRef.h: Changed vague "you must" language to more specific
              (but, ultimately, equally vague) "behavior is undefined if you don't" 
              language.
              (KJS::Interpreter::Interpreter): Factored more common initialization into
              init()
              * kjs/interpreter.h:
              (KJS::Interpreter::ref): new
              (KJS::Interpreter::deref): new
              (KJS::Interpreter::refCount): new
              * kjs/testkjs.cpp: 
              (doIt): Ref-count the interpreter.
      
      JavaScriptGlue:
      
              Reviewed by Maciej.
              
              - Updated JSInterpreter to work with Interpreter ref-counting in JavaScriptCore.
      
              (JSInterpreter::JSInterpreter::~JSInterpreter): Now protected to catch
              manual delete.
      
      WebCore:
      
              Reviewed by Maciej.
      
              - Updated ScriptInterpreter to work with Interpreter ref-counting in 
              JavaScriptCore.
      
              (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
              manual delete.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      41694b65
    • ggaren's avatar
      Reviewed by Beth. · 6105a724
      ggaren authored
              
              Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
              JSBase.h/.cpp. They don't belong in the value-specific or context-specific 
              files because they're not part of the value or context implementations.
      
              * API/JSBase.h:
              * API/JSContextRef.cpp:
              (JSContextGetGlobalObject):
              * API/JSContextRef.h:
              * API/JSValueRef.cpp:
              (JSValueUnprotect):
              * API/JSValueRef.h:
              * JavaScriptCore.xcodeproj/project.pbxproj:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6105a724
  29. 13 Jul, 2006 1 commit
    • ggaren's avatar
      Pleasing to Maciej. · 81d8be04
      ggaren authored
              
              - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
              - Added exception out parameters to JSValueTo* and JSValueIsEqual because
              they can throw
              - Removed JSObjectGetDescription because it's useless and vague, and 
              JSValueToString/JSValueIsObjectOfClass do a better job, anyway
              - Clarified comments about "IsFunction/Constructor" to indicate that they
              are true of all functions/constructors, not just those created by JSObjectMake*
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      81d8be04
  30. 12 Jul, 2006 1 commit
    • ggaren's avatar
      Reviewed by Maciej. · e66ccee6
      ggaren authored
              
              - Implemented a vast number of renames and comment clarifications 
              suggested during API review.
              
              JSInternalString -> JSString
              JS*Make -> JSValueMake*, JSObjectMake*
              JSTypeCode -> JSType
              JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
              JSGC*Protect -> JSValue*Protect
              JS*Callback -> JSObject*Callback
              JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
              JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
              JSString* -> 
                  JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
                  JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString, 
                  JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
              
              - Changed functions taking a JSValue out arg and returning a bool indicating
              whether it was set to simply return a JSValue or NULL.
              
              - Removed JSStringGetCharacters because it's more documentation than code,
              and it's just a glorified memcpy built on existing API functionality.
              
              - Moved standard library includes into the headers that actually require them.
              
              - Standardized use of the phrase "Create Rule."
              
              - Removed JSLock from make functions that don't allocate.
              
              - Added exception handling to JSValueToBoolean, since we now allow
              callback objects to throw exceptions upon converting to boolean.
              
              - Renamed JSGCCollect to JSGarbageCollect.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e66ccee6
  31. 10 Jul, 2006 3 commits
    • ggaren's avatar
      Reviewed by Darin. · 3f491d49
      ggaren authored
              
              Added exception out parameter to API object callbacks, removed semi-bogus
              JSContext(.*)Exception functions.
              
              To make these calls syntactically simple, I added an exceptionSlot()
              method to the ExecState class, which provides a JSValue** slot in which to 
              store a JSValue* exception.
      
              * API/APICast.h:
              (toRef):
              * API/JSCallbackConstructor.cpp:
              (KJS::JSCallbackConstructor::construct):
              * API/JSCallbackFunction.cpp:
              (KJS::JSCallbackFunction::callAsFunction):
              * API/JSCallbackObject.cpp:
              (KJS::JSCallbackObject::init):
              (KJS::JSCallbackObject::getOwnPropertySlot):
              (KJS::JSCallbackObject::put):
              (KJS::JSCallbackObject::deleteProperty):
              (KJS::JSCallbackObject::construct):
              (KJS::JSCallbackObject::callAsFunction):
              (KJS::JSCallbackObject::getPropertyList):
              (KJS::JSCallbackObject::toBoolean):
              (KJS::JSCallbackObject::toNumber):
              (KJS::JSCallbackObject::toString):
              (KJS::JSCallbackObject::staticValueGetter):
              (KJS::JSCallbackObject::callbackGetter):
              * API/JSContextRef.cpp:
              (JSCheckSyntax):
              * API/JSContextRef.h:
              * API/JSNode.c:
              (JSNodePrototype_appendChild):
              (JSNodePrototype_removeChild):
              (JSNodePrototype_replaceChild):
              (JSNode_getNodeType):
              (JSNode_getChildNodes):
              (JSNode_getFirstChild):
              (JSNode_construct):
              * API/JSNode.h:
              * API/JSNodeList.c:
              (JSNodeListPrototype_item):
              (JSNodeList_length):
              (JSNodeList_getProperty):
              * API/JSObjectRef.h:
              * API/minidom.c:
              (print):
              * API/testapi.c:
              (MyObject_initialize):
              (MyObject_hasProperty):
              (MyObject_getProperty):
              (MyObject_setProperty):
              (MyObject_deleteProperty):
              (MyObject_getPropertyList):
              (MyObject_callAsFunction):
              (MyObject_callAsConstructor):
              (MyObject_convertToType):
              (print_callAsFunction):
              (myConstructor_callAsConstructor):
              (main):
              * JavaScriptCore.exp:
              * kjs/ExecState.h:
              (KJS::ExecState::exceptionHandle):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3f491d49
    • ggaren's avatar
      Reviewed by Darin. · 20c233d3
      ggaren authored
              Improved type safety by implementing opaque JSValue/JSObject typing through 
              abuse of 'const', not void*. Also fixed an alarming number of bugs
              exposed by this new type safety.
              
              I made one design change in JavaScriptCore, which is that the JSObject
              constructor should take a JSValue* as its prototype argument, not a JSObject*,
              since we allow the prototype to be any JSValue*, including jsNull(), for
              example.
              
              * API/APICast.h:
              (toJS):
              * API/JSBase.h:
              * API/JSCallbackConstructor.cpp:
              (KJS::JSCallbackConstructor::construct):
              * API/JSCallbackFunction.cpp:
              (KJS::JSCallbackFunction::callAsFunction):
              * API/JSCallbackObject.cpp:
              (KJS::JSCallbackObject::JSCallbackObject):
              (KJS::JSCallbackObject::getOwnPropertySlot):
              (KJS::JSCallbackObject::put):
              (KJS::JSCallbackObject::construct):
              (KJS::JSCallbackObject::callAsFunction):
              (KJS::JSCallbackObject::staticFunctionGetter):
              * API/JSCallbackObject.h:
              * API/JSContextRef.cpp:
              (JSEvaluate):
              * API/JSNode.c:
              (JSNodePrototype_appendChild):
              (JSNodePrototype_removeChild):
              (JSNodePrototype_replaceChild):
              * API/JSObjectRef.cpp:
              (JSObjectMake):
              (JSFunctionMakeWithBody):
              (JSObjectGetProperty):
              (JSObjectCallAsFunction):
              (JSObjectCallAsConstructor):
              * API/JSObjectRef.h:
              * API/testapi.c:
              (main):
              * ChangeLog:
              * kjs/object.h:
              (KJS::JSObject::JSObject):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      20c233d3
    • ggaren's avatar
      Approved by Maciej, Darin. · 5d6a0f29
      ggaren authored
              
              Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the 
              JavaScript engine's internal string representation, which is the most 
              low-level and efficient representation to use when interfacing with JavaScript.
      
              * API/APICast.h:
              (toJS):
              (toRef):
              * API/JSBase.h:
              * API/JSCallbackObject.cpp:
              (KJS::JSCallbackObject::getOwnPropertySlot):
              (KJS::JSCallbackObject::put):
              (KJS::JSCallbackObject::deleteProperty):
              (KJS::JSCallbackObject::staticValueGetter):
              (KJS::JSCallbackObject::callbackGetter):
              * API/JSContextRef.cpp:
              (JSEvaluate):
              (JSCheckSyntax):
              * API/JSContextRef.h:
              * API/JSInternalStringRef.cpp: Added.
              (JSStringMake):
              (JSInternalStringCreate):
              (JSInternalStringCreateUTF8):
              (JSInternalStringRetain):
              (JSInternalStringRelease):
              (JSValueCopyStringValue):
              (JSInternalStringGetLength):
              (JSInternalStringGetCharactersPtr):
              (JSInternalStringGetCharacters):
              (JSInternalStringGetMaxLengthUTF8):
              (JSInternalStringGetCharactersUTF8):
              (JSInternalStringIsEqual):
              (JSInternalStringIsEqualUTF8):
              (JSInternalStringCreateCF):
              (CFStringCreateWithJSInternalString):
              * API/JSInternalStringRef.h: Added.
              * API/JSNode.c:
              (JSNodePrototype_appendChild):
              (JSNode_getNodeType):
              (JSNode_getChildNodes):
              (JSNode_getFirstChild):
              * API/JSNodeList.c:
              (JSNodeList_length):
              (JSNodeList_getProperty):
              * API/JSObjectRef.cpp:
              (JSFunctionMakeWithBody):
              (JSObjectGetDescription):
              (JSObjectHasProperty):
              (JSObjectGetProperty):
              (JSObjectSetProperty):
              (JSObjectDeleteProperty):
              (JSPropertyEnumeratorGetNext):
              (JSPropertyListAdd):
              * API/JSObjectRef.h:
              * API/JSStringBufferRef.cpp: Removed.
              * API/JSStringBufferRef.h: Removed.
              * API/JSValueRef.h:
              * API/JavaScriptCore.h:
              * API/minidom.c:
              (main):
              (print):
              * API/testapi.c:
              (assertEqualsAsUTF8String):
              (assertEqualsAsCharactersPtr):
              (assertEqualsAsCharacters):
              (MyObject_hasProperty):
              (MyObject_getProperty):
              (MyObject_setProperty):
              (MyObject_deleteProperty):
              (MyObject_getPropertyList):
              (print_callAsFunction):
              (myConstructor_callAsConstructor):
              (main):
              * JavaScriptCore.exp:
              * JavaScriptCore.xcodeproj/project.pbxproj:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5d6a0f29
  32. 08 Jul, 2006 1 commit
  33. 07 Jul, 2006 1 commit
    • ggaren's avatar
      Reviewed by Maciej. · 2564df29
      ggaren authored
              
              - Standardized which functions take a JSContext as an argument. The rule is:
              if you might execute JavaScript, you take a JSContext, otherwise you don't.
              
              The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
              but not API changes, so I'm putting it off until later.
      
              * API/JSCallbackObject.cpp:
              (KJS::JSCallbackObject::JSCallbackObject):
              (KJS::JSCallbackObject::init):
              * API/JSCallbackObject.h:
              * API/JSContextRef.cpp:
              (JSContextCreate):
              * API/JSContextRef.h:
              * API/JSObjectRef.cpp:
              (JSObjectMake):
              (JSPropertyEnumeratorGetNext):
              * API/JSObjectRef.h:
              * API/testapi.c:
              (MyObject_initialize):
              (main):
              * JavaScriptCore.exp:
              * kjs/array_object.cpp:
              (ArrayInstance::setLength):
              (ArrayInstance::pushUndefinedObjectsToEnd):
              * kjs/nodes.cpp:
              (ForInNode::execute):
              * kjs/reference.cpp:
              (KJS::Reference::getPropertyName):
              (KJS::Reference::getValue):
              * kjs/reference.h:
              * kjs/scope_chain.cpp:
              (KJS::ScopeChain::print):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2564df29