1. 06 Oct, 2008 2 commits
    • mjs@apple.com's avatar
      JavaScriptCore: · 6c3268ce
      mjs@apple.com authored
      2008-10-06  Maciej Stachowiak  <mjs@apple.com>
      
              Not reviewed. Build fix.
              
              - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
      
              * API/JSValueRef.cpp:
              (JSValueToBoolean):
              * ChangeLog:
              * JavaScriptCore.exp:
              * VM/CodeBlock.cpp:
              (JSC::CodeBlock::dump):
              * VM/Machine.cpp:
              (JSC::Machine::privateExecute):
              (JSC::Machine::cti_op_loop_if_true):
              (JSC::Machine::cti_op_not):
              (JSC::Machine::cti_op_jtrue):
              * kjs/ArrayPrototype.cpp:
              (JSC::arrayProtoFuncFilter):
              (JSC::arrayProtoFuncEvery):
              (JSC::arrayProtoFuncSome):
              * kjs/BooleanConstructor.cpp:
              (JSC::constructBoolean):
              (JSC::callBooleanConstructor):
              * kjs/GetterSetter.h:
              * kjs/JSCell.h:
              (JSC::JSValue::toBoolean):
              * kjs/JSNumberCell.cpp:
              (JSC::JSNumberCell::toBoolean):
              * kjs/JSNumberCell.h:
              * kjs/JSObject.cpp:
              (JSC::JSObject::toBoolean):
              * kjs/JSObject.h:
              * kjs/JSString.cpp:
              (JSC::JSString::toBoolean):
              * kjs/JSString.h:
              * kjs/JSValue.h:
              * kjs/RegExpConstructor.cpp:
              (JSC::setRegExpConstructorMultiline):
              * kjs/RegExpObject.cpp:
              (JSC::RegExpObject::match):
              * kjs/RegExpPrototype.cpp:
              (JSC::regExpProtoFuncToString):
      
      JavaScriptGlue:
      
      2008-10-06  Maciej Stachowiak  <mjs@apple.com>
      
              Not reviewed. Build fix.
      
              - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
      
              * JSUtils.cpp:
              (KJSValueToCFTypeInternal):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6c3268ce
    • mjs@apple.com's avatar
      2008-10-06 Maciej Stachowiak <mjs@apple.com> · d2c36fec
      mjs@apple.com authored
              Reviewed by Sam Weinig.
              
              - optimize op_jtrue, op_loop_if_true and op_not in various ways
              https://bugs.webkit.org/show_bug.cgi?id=21404
              
              1) Make JSValue::toBoolean nonvirtual and completely inline by
              making use of the StructureID type field.
              
              2) Make JSValue::toBoolean not take an ExecState; doesn't need it.
              
              3) Make op_not, op_loop_if_true and op_jtrue not read the
              ExecState (toBoolean doesn't need it any more) and not check
              exceptions (toBoolean can't throw).
      
              * API/JSValueRef.cpp:
              (JSValueToBoolean):
              * JavaScriptCore.exp:
              * VM/CodeBlock.cpp:
              (JSC::CodeBlock::dump):
              * VM/Machine.cpp:
              (JSC::Machine::privateExecute):
              (JSC::Machine::cti_op_loop_if_true):
              (JSC::Machine::cti_op_not):
              (JSC::Machine::cti_op_jtrue):
              * kjs/ArrayPrototype.cpp:
              (JSC::arrayProtoFuncFilter):
              (JSC::arrayProtoFuncEvery):
              (JSC::arrayProtoFuncSome):
              * kjs/BooleanConstructor.cpp:
              (JSC::constructBoolean):
              (JSC::callBooleanConstructor):
              * kjs/GetterSetter.h:
              * kjs/JSCell.h:
              (JSC::JSValue::toBoolean):
              * kjs/JSNumberCell.cpp:
              * kjs/JSNumberCell.h:
              (JSC::JSNumberCell::toBoolean):
              * kjs/JSObject.cpp:
              * kjs/JSObject.h:
              (JSC::JSObject::toBoolean):
              (JSC::JSCell::toBoolean):
              * kjs/JSString.cpp:
              * kjs/JSString.h:
              (JSC::JSString::toBoolean):
              * kjs/JSValue.h:
              * kjs/RegExpConstructor.cpp:
              (JSC::setRegExpConstructorMultiline):
              * kjs/RegExpObject.cpp:
              (JSC::RegExpObject::match):
              * kjs/RegExpPrototype.cpp:
              (JSC::regExpProtoFuncToString):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d2c36fec
  2. 04 Oct, 2008 1 commit
    • mjs@apple.com's avatar
      JavaScriptCore: · 8b246d6d
      mjs@apple.com authored
      2008-10-03  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Cameron Zwarich.
              
              - "this" object in methods called on primitives should be wrapper object
              https://bugs.webkit.org/show_bug.cgi?id=21362
      
              I changed things so that functions which use "this" do a fast
              version of toThisObject conversion if needed. Currently we miss
              the conversion entirely, at least for primitive types. Using
              TypeInfo and the primitive check, I made the fast case bail out
              pretty fast.
              
              This is inexplicably an 1.007x SunSpider speedup (and a wash on V8 benchmarks).
           
              Also renamed some opcodes for clarity:
              
              init ==> enter
              init_activation ==> enter_with_activation
              
              * VM/CTI.cpp:
              (JSC::CTI::privateCompileMainPass):
              (JSC::CTI::privateCompileSlowCases):
              * VM/CodeBlock.cpp:
              (JSC::CodeBlock::dump):
              * VM/CodeGenerator.cpp:
              (JSC::CodeGenerator::generate):
              (JSC::CodeGenerator::CodeGenerator):
              * VM/Machine.cpp:
              (JSC::Machine::privateExecute):
              (JSC::Machine::cti_op_convert_this):
              * VM/Machine.h:
              * VM/Opcode.h:
              * kjs/JSActivation.cpp:
              (JSC::JSActivation::JSActivation):
              * kjs/JSActivation.h:
              (JSC::JSActivation::createStructureID):
              * kjs/JSCell.h:
              (JSC::JSValue::needsThisConversion):
              * kjs/JSGlobalData.cpp:
              (JSC::JSGlobalData::JSGlobalData):
              * kjs/JSGlobalData.h:
              * kjs/JSNumberCell.h:
              (JSC::JSNumberCell::createStructureID):
              * kjs/JSStaticScopeObject.h:
              (JSC::JSStaticScopeObject::JSStaticScopeObject):
              (JSC::JSStaticScopeObject::createStructureID):
              * kjs/JSString.h:
              (JSC::JSString::createStructureID):
              * kjs/JSValue.h:
              * kjs/TypeInfo.h:
              (JSC::TypeInfo::needsThisConversion):
              * kjs/nodes.h:
              (JSC::ScopeNode::usesThis):
      
      WebCore:
      
      2008-10-03  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Cameron Zwarich.
      
              - "this" object in methods called on primitives should be wrapper object
              https://bugs.webkit.org/show_bug.cgi?id=21362
      
              Updated so toThis conversion for the split window is handled properly.
      
              * bindings/scripts/CodeGeneratorJS.pm:
      
      LayoutTests:
      
      2008-10-03  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Cameron Zwarich.
              
              - test case for: "this" object in methods called on primitives should be wrapper object
      
              * fast/js/primitive-method-this-expected.txt: Added.
              * fast/js/primitive-method-this.html: Added.
              * fast/js/resources/primitive-method-this.js: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8b246d6d
  3. 22 Sep, 2008 1 commit
    • mjs@apple.com's avatar
      JavaScriptCore: · a173abd0
      mjs@apple.com authored
      2008-09-22  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Dave Hyatt.
              
              Based on initial work by Darin Adler.
              
              - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
              - use this to JIT inline code for eq_null and neq_null
              https://bugs.webkit.org/show_bug.cgi?id=20823
      
              0.5% speedup on SunSpider
              ~4% speedup on Richards benchmark
              
              * VM/CTI.cpp:
              (JSC::CTI::privateCompileMainPass):
              * VM/Machine.cpp:
              (JSC::jsTypeStringForValue):
              (JSC::jsIsObjectType):
              (JSC::Machine::privateExecute):
              (JSC::Machine::cti_op_is_undefined):
              * VM/Machine.h:
              * kjs/JSCell.h:
              * kjs/JSValue.h:
              * kjs/StringObjectThatMasqueradesAsUndefined.h:
              (JSC::StringObjectThatMasqueradesAsUndefined::create):
              (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
              * kjs/StructureID.h:
              (JSC::StructureID::mutableTypeInfo):
              * kjs/TypeInfo.h:
              (JSC::TypeInfo::TypeInfo):
              (JSC::TypeInfo::masqueradesAsUndefined):
              * kjs/operations.cpp:
              (JSC::equal):
              * masm/X86Assembler.h:
              (JSC::X86Assembler::):
              (JSC::X86Assembler::setne_r):
              (JSC::X86Assembler::setnz_r):
              (JSC::X86Assembler::testl_i32m):
      
      WebCore:
      
      2008-09-22  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Dave Hyatt.
      
              Based on initial work by Darin Adler.
              
              - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
              - use this to JIT inline code for eq_null and neq_null
              https://bugs.webkit.org/show_bug.cgi?id=20823
              
              * WebCore.xcodeproj/project.pbxproj:
              * WebCore.vcproj/WebCore.vcproj:
              * bindings/js/JSCSSStyleDeclarationCustom.cpp:
              (WebCore::JSCSSStyleDeclaration::nameGetter):
              * bindings/js/JSHTMLAllCollection.cpp: Added.
              (WebCore::):
              * bindings/js/JSHTMLAllCollection.h:
              (WebCore::JSHTMLAllCollection::createStructureID):
              (WebCore::JSHTMLAllCollection::toBoolean):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a173abd0
  4. 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
  5. 06 Sep, 2008 1 commit
  6. 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
  7. 18 Aug, 2008 1 commit
    • darin@apple.com's avatar
      JavaScriptCore: · 349e1eb0
      darin@apple.com authored
      2008-08-12  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              - eliminate JSValue::type()
      
              This will make it slightly easier to change the JSImmediate design without
              having to touch so many call sites.
      
              SunSpider says this change is a wash (looked like a slight speedup, but not
              statistically significant).
      
              * API/JSStringRef.cpp: Removed include of JSType.h.
              * API/JSValueRef.cpp: Removed include of JSType.h.
              (JSValueGetType): Replaced use of JSValue::type() with
              JSValue::is functions.
      
              * JavaScriptCore.exp: Updated.
      
              * VM/JSPropertyNameIterator.cpp: Removed type() implementation.
              (KJS::JSPropertyNameIterator::toPrimitive): Changed to take
              PreferredPrimitiveType argument instead of JSType.
              * VM/JSPropertyNameIterator.h: Ditto.
      
              * VM/Machine.cpp:
              (KJS::fastIsNumber): Updated for name change.
              (KJS::fastToInt32): Ditto.
              (KJS::fastToUInt32): Ditto.
              (KJS::jsAddSlowCase): Updated toPrimitive caller for change from
              JSType to PreferredPrimitiveType.
              (KJS::jsAdd): Replaced calls to JSValue::type() with calls to
              JSValue::isString().
              (KJS::jsTypeStringForValue): Replaced calls to JSValue::type()
              with multiple calls to JSValue::is -- we could make this a
              virtual function instead if we want to have faster performance.
              (KJS::Machine::privateExecute): Renamed JSImmediate::toTruncatedUInt32
              to JSImmediate::getTruncatedUInt32 for consistency with other functions.
              Changed two calls of JSValue::type() to JSValue::isString().
      
              * kjs/GetterSetter.cpp:
              (KJS::GetterSetter::toPrimitive): Changed to take
              PreferredPrimitiveType argument instead of JSType.
              (KJS::GetterSetter::isGetterSetter): Added.
              * kjs/GetterSetter.h:
      
              * kjs/JSCell.cpp:
              (KJS::JSCell::isString): Added.
              (KJS::JSCell::isGetterSetter): Added.
              (KJS::JSCell::isObject): Added.
      
              * kjs/JSCell.h: Eliminated type function. Added isGetterSetter.
              Made isString and isObject virtual. Changed toPrimitive to take
              PreferredPrimitiveType argument instead of JSType.
              (KJS::JSCell::isNumber): Use Heap::isNumber for faster performance.
              (KJS::JSValue::isGetterSetter): Added.
              (KJS::JSValue::toPrimitive): Changed to take
              PreferredPrimitiveType argument instead of JSType.
      
              * kjs/JSImmediate.h: Removed JSValue::type() and replaced
              JSValue::toTruncatedUInt32 with JSValue::getTruncatedUInt32.
              (KJS::JSImmediate::isEitherImmediate): Added.
      
              * kjs/JSNotAnObject.cpp:
              (KJS::JSNotAnObject::toPrimitive): Changed to take
              PreferredPrimitiveType argument instead of JSType.
              * kjs/JSNotAnObject.h: Ditto.
              * kjs/JSNumberCell.cpp:
              (KJS::JSNumberCell::toPrimitive): Ditto.
              * kjs/JSNumberCell.h:
              (KJS::JSNumberCell::toInt32): Renamed from fastToInt32. There's no
              other "slow" version of this once you have a JSNumberCell, so there's
              no need for "fast" in the name. It's a feature that this hides the
              base class toInt32, which does the same job less efficiently (and has
              an additional ExecState argument).
              (KJS::JSNumberCell::toUInt32): Ditto.
      
              * kjs/JSObject.cpp:
              (KJS::callDefaultValueFunction): Use isGetterSetter instead of type.
              (KJS::JSObject::getPrimitiveNumber): Use PreferredPrimitiveType.
              (KJS::JSObject::defaultValue): Ditto.
              (KJS::JSObject::defineGetter): Use isGetterSetter.
              (KJS::JSObject::defineSetter): Ditto.
              (KJS::JSObject::lookupGetter): Ditto.
              (KJS::JSObject::lookupSetter): Ditto.
              (KJS::JSObject::toNumber): Use PreferredPrimitiveType.
              (KJS::JSObject::toString): Ditto.
              (KJS::JSObject::isObject): Added.
      
              * kjs/JSObject.h:
              (KJS::JSObject::inherits): Call the isObject from JSCell; it's now
              hidden by our override of isObject.
              (KJS::JSObject::getOwnPropertySlotForWrite): Use isGetterSetter
              instead of type.
              (KJS::JSObject::getOwnPropertySlot): Ditto.
              (KJS::JSObject::toPrimitive): Use PreferredPrimitiveType.
      
              * kjs/JSString.cpp:
              (KJS::JSString::toPrimitive): Use PreferredPrimitiveType.
              (KJS::JSString::isString): Added.
              * kjs/JSString.h: Ditto.
      
              * kjs/JSValue.h: Removed type(), added isGetterSetter(). Added
              PreferredPrimitiveType enum and used it as the argument for the
              toPrimitive function.
              (KJS::JSValue::getBoolean): Simplified a bit an removed a branch.
      
              * kjs/collector.cpp:
              (KJS::typeName): Changed to use JSCell::is functions instead of
              calling JSCell::type.
      
              * kjs/collector.h:
              (KJS::Heap::isNumber): Renamed from fastIsNumber.
      
              * kjs/nodes.h: Added now-needed include of JSType, since the type
              is used here to record types of values in the tree.
      
              * kjs/operations.cpp:
              (KJS::equal): Rewrote to no longer depend on type().
              (KJS::strictEqual): Ditto.
      
      JavaScriptGlue:
      
      2008-08-12  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              - eliminate JSValue::type()
      
              * JSUtils.cpp:
              (KJSValueToCFTypeInternal): Replaced uses of JSValue::type() with
              JSValue::is functions.
              * UserObjectImp.cpp:
              (UserObjectImp::getOwnPropertySlot): Ditto.
              (UserObjectImp::toPrimitive): Take PreferredPrimitiveType argument
              instead of JSType argument.
              * UserObjectImp.h: Ditto.
      
      WebCore:
      
      2008-08-12  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              - eliminate JSValue::type()
      
              * bridge/c/c_instance.cpp:
              (KJS::Bindings::CInstance::defaultValue): Take PreferredPrimitiveType
              argument instead of JSType argument. Removed unneeded code to handle
              boolean, since that's never passed.
              * bridge/c/c_instance.h: Ditto.
      
              * bridge/c/c_utility.cpp:
              (KJS::Bindings::convertValueToNPVariant): Use JSValue::is functions
              instead of JSValue::type(). Removed unneeded code to handle
              "unspecified".
      
              * bridge/jni/jni_instance.cpp:
              (JavaInstance::defaultValue): Take PreferredPrimitiveType argument
              instead of JSType argument. Removed unneeded code to handle boolean.
              * bridge/jni/jni_instance.h: Ditto.
      
              * bridge/jni/jni_jsobject.mm:
              (JavaJSObject::convertValueToJObject): Use JSValue::is functions
              instead of JSValue::type().
      
              * bridge/objc/objc_instance.h: Take PreferredPrimitiveType argument
              instead of JSType argument. Removed unused argument.
              * bridge/objc/objc_instance.mm:
              (ObjcInstance::getValueOfUndefinedField): Removed unused argument.
              (ObjcInstance::defaultValue): Take PreferredPrimitiveType argument
              instead of JSType argument. Removed unneeded code to handle boolean
              and another dead code path for unknown types.
      
              * bridge/objc/objc_runtime.h: Take PreferredPrimitiveType argument
              instead of JSType argument. Removed override of type() that caused
              the fallback object to return "UndefinedType" when there is no
              invokeUndefinedMethodFromWebScript:withArguments: method defined.
              That didn't accomplish much, since most checks for undefined don't
              ever call type().
              * bridge/objc/objc_runtime.mm:
              (ObjcFallbackObjectImp::defaultValue): Ditto.
      
              * bridge/qt/qt_instance.cpp:
              (KJS::Bindings::QtInstance::defaultValue): Take PreferredPrimitiveType
              argument instead of JSType argument. Removed unneeded code to handle
              boolean.
              * bridge/qt/qt_instance.h: Ditto.
      
              * bridge/runtime.h:
              (KJS::Bindings::Instance::getValueOfUndefinedField): Removed
              unsed argument.
              * bridge/runtime_object.cpp:
              (RuntimeObjectImp::defaultValue): Take PreferredPrimitiveType
              argument instead of JSType argument.
              * bridge/runtime_object.h: Ditto.
      
      WebKit/mac:
      
      2008-08-12  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              - eliminate JSValue::type()
      
              * WebView/WebView.mm:
              (aeDescFromJSValue): Rewrite to use the JSValue::is functions instead
              of a switch on JSValue::type().
      
      LayoutTests:
      
      2008-08-12  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              - added a test since I had to rewrite the == and === operators
      
              * fast/js/equality-expected.txt: Added.
              * fast/js/equality.html: Added.
              * fast/js/resources/equality.js: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      349e1eb0
  8. 16 Jul, 2008 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: · b5b6b9a9
      ggaren@apple.com authored
      2008-07-16  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Oliver Hunt.
              
              First step toward putting doubles in registers: Turned Register into a
              proper abstraction layer. It is no longer possible to cast a Register
              to a JSValue*, or a Register& to a JSValue*&, or to access the union
              inside a Register directly.
              
              SunSpider reports no change.
              
              In support of this change, I had to make the following mechanical changes
              in a lot of places:
              
              1. Clients now use explicit accessors to read data out of Registers, and
              implicit copy constructors to write data into registers.
              
              So, assignment that used to look like
              
                  x.u.jsValue = y;
              
              now looks like
              
                  x = y;
                  
              And access that used to look like
              
                  x = y.u.jsValue;
              
              now looks like
              
                  x = y.jsValue();
      
              2. I made generic flow control specific in opcodes that made their flow
              control generic by treating a Register& as a JSValue*&. This had the
              added benefit of removing some exception checking branches from immediate
              number code.
      
              3. I beefed up PropertySlot to support storing a Register* in a property
              slot. For now, only JSVariableObject's symbolTableGet and symbolTablePut
              use this functionality, but I expect more clients to use it in the future.
              
              4. I changed ArgList to be a buffer of Registers, not JSValue*'s, and I
              changed ArgList iterator clients to iterate Registers, not JSValue*'s.
      
      WebCore:
      
      2008-07-16  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Oliver Hunt.
      
              Support for JavaScriptCore's first step toward putting doubles in
              registers: Treat ArgList iterators as Register*'s, not JSValue*'s.
      
              * bindings/js/ScheduledAction.cpp:
              (WebCore::ScheduledAction::ScheduledAction):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b5b6b9a9
  9. 06 Jul, 2008 1 commit
    • weinig@apple.com's avatar
      JavaScriptCore: · 2947a916
      weinig@apple.com authored
      2008-07-06  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Cameron Zwarich.
      
              Second step in broad cleanup effort.
      
              [ File list elided ]
      
      WebCore:
      
      2008-07-06  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Cameron Zwarich.
      
              Add #include for kjs/protect.h.
      
              * xml/XMLHttpRequest.cpp:
              (WebCore::XMLHttpRequest::loadRequestAsynchronously):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2947a916
  10. 02 Jul, 2008 1 commit
  11. 01 Jul, 2008 1 commit
    • weinig@apple.com's avatar
      JavaScriptCore: · 6a03b4c4
      weinig@apple.com authored
      2008-07-01  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Darin Adler.
      
              Split JSCell and JSNumberCell class declarations out of JSValue.h
      
              * GNUmakefile.am:
              * JavaScriptCore.pri:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * JavaScriptCoreSources.bkl:
              * VM/JSPropertyNameIterator.h:
              * kjs/AllInOneFile.cpp:
              * kjs/JSCell.cpp: Copied from JavaScriptCore/kjs/JSValue.cpp.
              * kjs/JSCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
              (KJS::JSValue::getJSNumber):
              * kjs/JSNumberCell.cpp:
              * kjs/JSNumberCell.h: Copied from JavaScriptCore/kjs/JSValue.h.
              * kjs/JSObject.h:
              * kjs/JSString.cpp:
              (KJS::jsString):
              (KJS::jsOwnedString):
              * kjs/JSString.h:
              (KJS::JSValue::toThisJSString):
              * kjs/JSValue.cpp:
              * kjs/JSValue.h:
      
      WebCore:
      
      2008-07-01  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Darin Adler.
      
              Split JSCell and JSNumberCell class declarations out of JSValue.h
      
              * ForwardingHeaders/kjs/JSNumberCell.h: Added.
              * bindings/scripts/CodeGeneratorJS.pm:
              * bridge/c/c_instance.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6a03b4c4
  12. 26 Jun, 2008 1 commit
    • darin@apple.com's avatar
      2008-06-26 Darin Adler <darin@apple.com> · 59c4d4eb
      darin@apple.com authored
              Reviewed by Geoff.
      
              - https://bugs.webkit.org/show_bug.cgi?id=19721
                speed up JavaScriptCore by not wrapping strings in objects just
                to call functions on them
      
              - optimize UString append and the replace function a bit
      
              SunSpider says 1.8% faster.
      
              * JavaScriptCore.exp: Updated.
      
              * VM/JSPropertyNameIterator.cpp: Added include of JSString.h, now needed
              because jsString returns a JSString*.
      
              * VM/Machine.cpp:
              (KJS::Machine::privateExecute): Removed the toObject call from native
              function calls. Also removed code to put the this value into a register.
      
              * kjs/BooleanObject.cpp:
              (KJS::booleanProtoFuncToString): Rewrite to handle false and true
              separately.
      
              * kjs/FunctionPrototype.cpp:
              (KJS::constructFunction): Use single-character append rather than building
              a string for each character.
              * kjs/JSFunction.cpp:
              (KJS::globalFuncUnescape): Ditto.
      
              * kjs/JSImmediate.cpp:
              (KJS::JSImmediate::prototype): Added. Gets the appropriate prototype for
              use with an immediate value. To be used instead of toObject when doing a
              get on an immediate value.
              * kjs/JSImmediate.h: Added prototype.
      
              * kjs/JSObject.cpp:
              (KJS::JSObject::toString): Tweaked formatting.
      
              * kjs/JSObject.h:
              (KJS::JSValue::get): Use prototype instead of toObject to avoid creating
              an object wrapper just to search for properties. This also saves an
              unnecessary hash table lookup since the object wrappers themselves don't
              have any properties.
      
              * kjs/JSString.h: Added toThisString and toThisJSString.
      
              * kjs/JSValue.cpp:
              (KJS::JSCell::toThisString): Added.
              (KJS::JSCell::toThisJSString): Added.
              (KJS::JSCell::getJSNumber): Added.
              (KJS::jsString): Changed return type to JSString*.
              (KJS::jsOwnedString): Ditto.
      
              * kjs/JSValue.h:
              (KJS::JSValue::toThisString): Added.
              (KJS::JSValue::toThisJSString): Added.
              (KJS::JSValue::getJSNumber): Added.
      
              * kjs/NumberObject.cpp:
              (KJS::NumberObject::getJSNumber): Added.
              (KJS::integer_part_noexp): Append C string directly rather than first
              turning it into a UString.
              (KJS::numberProtoFuncToString): Use getJSNumber to check if the value
              is a number rather than isObject(&NumberObject::info). This works for
              immediate numbers, number cells, and NumberObject instances.
              (KJS::numberProtoFuncToLocaleString): Ditto.
              (KJS::numberProtoFuncValueOf): Ditto.
              (KJS::numberProtoFuncToFixed): Ditto.
              (KJS::numberProtoFuncToExponential): Ditto.
              (KJS::numberProtoFuncToPrecision): Ditto.
              * kjs/NumberObject.h: Added getJSNumber.
      
              * kjs/PropertySlot.cpp: Tweaked comment.
      
              * kjs/internal.cpp:
              (KJS::JSString::toThisString): Added.
              (KJS::JSString::toThisJSString): Added.
              (KJS::JSString::getOwnPropertySlot): Changed code that searches the
              prototype chain to start with the string prototype and not create a
              string object.
              (KJS::JSNumberCell::toThisString): Added.
              (KJS::JSNumberCell::getJSNumber): Added.
      
              * kjs/lookup.cpp:
              (KJS::staticFunctionGetter): Moved here, because there's no point in
              having a function that's only used for a function pointer be inline.
              (KJS::setUpStaticFunctionSlot): New function for getStaticFunctionSlot.
      
              * kjs/lookup.h:
              (KJS::staticValueGetter): Don't mark this inline. It doesn't make sense
              to have a function that's only used for a function pointer be inline.
              (KJS::getStaticFunctionSlot): Changed to get properties from the parent
              first before doing any handling of functions. This is the fastest way
              to return the function once the initial setup is done.
      
              * kjs/string_object.cpp:
              (KJS::StringObject::getPropertyNames): Call value() instead of getString(),
              avoiding an unnecessary virtual function call (the call to the type()
              function in the implementation of the isString() function).
              (KJS::StringObject::toString): Added.
              (KJS::StringObject::toThisString): Added.
              (KJS::StringObject::toThisJSString): Added.
              (KJS::substituteBackreferences): Rewrote to use a appending algorithm
              instead of a the old one that tried to replace in place.
              (KJS::stringProtoFuncReplace): Merged this function and the replace function.
              Replaced the hand-rolled dynamic arrays for source ranges and replacements
              with Vector.
              (KJS::stringProtoFuncToString): Handle JSString as well as StringObject.
              Removed the separate valueOf implementation, since it can just share this.
              (KJS::stringProtoFuncCharAt): Use toThisString, which handles JSString as
              well as StringObject, and is slightly more efficient than the old code too.
              (KJS::stringProtoFuncCharCodeAt): Ditto.
              (KJS::stringProtoFuncConcat): Ditto.
              (KJS::stringProtoFuncIndexOf): Ditto.
              (KJS::stringProtoFuncLastIndexOf): Ditto.
              (KJS::stringProtoFuncMatch): Ditto.
              (KJS::stringProtoFuncSearch): Ditto.
              (KJS::stringProtoFuncSlice): Ditto.
              (KJS::stringProtoFuncSplit): Ditto.
              (KJS::stringProtoFuncSubstr): Ditto.
              (KJS::stringProtoFuncSubstring): Ditto.
              (KJS::stringProtoFuncToLowerCase): Use toThisJSString.
              (KJS::stringProtoFuncToUpperCase): Ditto.
              (KJS::stringProtoFuncToLocaleLowerCase): Ditto.
              (KJS::stringProtoFuncToLocaleUpperCase): Ditto.
              (KJS::stringProtoFuncLocaleCompare): Ditto.
              (KJS::stringProtoFuncBig): Use toThisString.
              (KJS::stringProtoFuncSmall): Ditto.
              (KJS::stringProtoFuncBlink): Ditto.
              (KJS::stringProtoFuncBold): Ditto.
              (KJS::stringProtoFuncFixed): Ditto.
              (KJS::stringProtoFuncItalics): Ditto.
              (KJS::stringProtoFuncStrike): Ditto.
              (KJS::stringProtoFuncSub): Ditto.
              (KJS::stringProtoFuncSup): Ditto.
              (KJS::stringProtoFuncFontcolor): Ditto.
              (KJS::stringProtoFuncFontsize): Ditto.
              (KJS::stringProtoFuncAnchor): Ditto.
              (KJS::stringProtoFuncLink): Ditto.
      
              * kjs/string_object.h: Added toString, toThisString, and toThisJSString.
      
              * kjs/ustring.cpp:
              (KJS::UString::append): Added a version that takes a character pointer and
              size, so we don't have to create a UString just to append to another UString.
              * kjs/ustring.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      59c4d4eb
  13. 23 Jun, 2008 1 commit
    • darin@apple.com's avatar
      JavaScriptCore: · 1edff436
      darin@apple.com authored
      2008-06-23  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              - work toward https://bugs.webkit.org/show_bug.cgi?id=19721
      
              More preparation toward making functions work on primitive types without
              creating wrapper objects. No speedup this time, but prepares for a future
              speedup without slowing things down.
      
              SunSpider reports no change.
      
              - Eliminated the implementsCall, callAsFunction and construct virtual
                functions from JSObject. Instead, the CallData and ConstructData for
                a native function includes a function pointer that the caller can use
                directly. Changed all call sites to use CallData and ConstructData.
      
              - Changed the "this" argument to native functions to be a JSValue rather
                than a JSObject. This prepares us for passing primitives into these
                functions. The conversion to an object now must be done inside the
                function. Critically, if it's a function that can be called on a DOM
                window object, then we have to be sure to call toThisObject on the
                argument before we use it for anything even if it's already an object.
      
              - Eliminated the practice of using constructor objects in the global
                object to make objects of the various basic types. Since these
                constructors can't be replaced by script, there's no reason to involve
                a constructor object at all. Added functions to do the construction
                directly.
      
              - Made some more class members private and protected, including virtual
                function overrides. This can catch code using unnecessarily slow virtual
                function code paths when the type of an object is known statically. If we
                later find a new reason use the members outside the class it's easy to
                make them public again.
      
              - Moved the declarations of the native implementations for functions out
                of header files. These can have internal linkage and be declared inside
                the source file.
      
              - Changed PrototypeFunction to take function pointers with the right
                arguments to be put directly into CallData. This eliminates the
                need to have a separate PrototypeReflexiveFunction, and reveals that the
                real purpose of that class included something else specific to eval --
                storage of a cached global object. So renamed PrototypeReflexiveFunction
                to GlobalEvalFunction.
      
              * API/JSCallbackConstructor.cpp:
              (KJS::constructJSCallback):
              (KJS::JSCallbackConstructor::getConstructData):
              * API/JSCallbackConstructor.h:
              * API/JSCallbackFunction.cpp:
              (KJS::JSCallbackFunction::implementsHasInstance):
              (KJS::JSCallbackFunction::call):
              (KJS::JSCallbackFunction::getCallData):
              * API/JSCallbackFunction.h:
              (KJS::JSCallbackFunction::classInfo):
              * API/JSCallbackObject.h:
              (KJS::JSCallbackObject::classRef):
              (KJS::JSCallbackObject::classInfo):
              * API/JSCallbackObjectFunctions.h:
              (KJS::::getConstructData):
              (KJS::::construct):
              (KJS::::getCallData):
              (KJS::::call):
              * API/JSObjectRef.cpp:
              (JSObjectMakeFunction):
              (JSObjectIsFunction):
              (JSObjectCallAsFunction):
              (JSObjectCallAsConstructor):
              * JavaScriptCore.exp:
              * VM/Machine.cpp:
              (KJS::jsTypeStringForValue):
              (KJS::Machine::privateExecute):
              * kjs/ArrayPrototype.cpp:
              (KJS::arrayProtoFuncToString):
              (KJS::arrayProtoFuncToLocaleString):
              (KJS::arrayProtoFuncJoin):
              (KJS::arrayProtoFuncConcat):
              (KJS::arrayProtoFuncPop):
              (KJS::arrayProtoFuncPush):
              (KJS::arrayProtoFuncReverse):
              (KJS::arrayProtoFuncShift):
              (KJS::arrayProtoFuncSlice):
              (KJS::arrayProtoFuncSort):
              (KJS::arrayProtoFuncSplice):
              (KJS::arrayProtoFuncUnShift):
              (KJS::arrayProtoFuncFilter):
              (KJS::arrayProtoFuncMap):
              (KJS::arrayProtoFuncEvery):
              (KJS::arrayProtoFuncForEach):
              (KJS::arrayProtoFuncSome):
              (KJS::arrayProtoFuncIndexOf):
              (KJS::arrayProtoFuncLastIndexOf):
              (KJS::ArrayConstructor::ArrayConstructor):
              (KJS::constructArrayWithSizeQuirk):
              (KJS::constructWithArrayConstructor):
              (KJS::ArrayConstructor::getConstructData):
              (KJS::callArrayConstructor):
              (KJS::ArrayConstructor::getCallData):
              * kjs/ArrayPrototype.h:
              * kjs/BooleanObject.cpp:
              (KJS::booleanProtoFuncToString):
              (KJS::booleanProtoFuncValueOf):
              (KJS::constructBoolean):
              (KJS::constructWithBooleanConstructor):
              (KJS::BooleanConstructor::getConstructData):
              (KJS::callBooleanConstructor):
              (KJS::BooleanConstructor::getCallData):
              (KJS::constructBooleanFromImmediateBoolean):
              * kjs/BooleanObject.h:
              * kjs/CallData.h:
              (KJS::):
              * kjs/ConstructData.h:
              (KJS::):
              * kjs/FunctionPrototype.cpp:
              (KJS::callFunctionPrototype):
              (KJS::FunctionPrototype::getCallData):
              (KJS::functionProtoFuncToString):
              (KJS::functionProtoFuncApply):
              (KJS::functionProtoFuncCall):
              (KJS::constructWithFunctionConstructor):
              (KJS::FunctionConstructor::getConstructData):
              (KJS::callFunctionConstructor):
              (KJS::FunctionConstructor::getCallData):
              (KJS::constructFunction):
              * kjs/FunctionPrototype.h:
              * kjs/JSArray.cpp:
              (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
              (KJS::JSArray::sort):
              (KJS::constructEmptyArray):
              (KJS::constructArray):
              * kjs/JSArray.h:
              (KJS::JSArray::classInfo):
              * kjs/JSFunction.cpp:
              (KJS::JSFunction::call):
              (KJS::globalFuncEval):
              (KJS::globalFuncParseInt):
              (KJS::globalFuncParseFloat):
              (KJS::globalFuncIsNaN):
              (KJS::globalFuncIsFinite):
              (KJS::globalFuncDecodeURI):
              (KJS::globalFuncDecodeURIComponent):
              (KJS::globalFuncEncodeURI):
              (KJS::globalFuncEncodeURIComponent):
              (KJS::globalFuncEscape):
              (KJS::globalFuncUnescape):
              (KJS::globalFuncKJSPrint):
              (KJS::PrototypeFunction::PrototypeFunction):
              (KJS::PrototypeFunction::getCallData):
              (KJS::GlobalEvalFunction::GlobalEvalFunction):
              (KJS::GlobalEvalFunction::mark):
              * kjs/JSFunction.h:
              (KJS::InternalFunction::classInfo):
              (KJS::InternalFunction::functionName):
              (KJS::JSFunction::classInfo):
              (KJS::GlobalEvalFunction::cachedGlobalObject):
              * kjs/JSGlobalObject.cpp:
              (KJS::JSGlobalObject::reset):
              (KJS::JSGlobalObject::mark):
              * kjs/JSGlobalObject.h:
              (KJS::JSGlobalObject::JSGlobalObject):
              (KJS::JSGlobalObject::evalFunction):
              * kjs/JSImmediate.cpp:
              (KJS::JSImmediate::toObject):
              * kjs/JSNotAnObject.cpp:
              * kjs/JSNotAnObject.h:
              * kjs/JSObject.cpp:
              (KJS::JSObject::put):
              (KJS::callDefaultValueFunction):
              (KJS::JSObject::defaultValue):
              (KJS::JSObject::lookupGetter):
              (KJS::JSObject::lookupSetter):
              (KJS::JSObject::hasInstance):
              (KJS::JSObject::fillGetterPropertySlot):
              (KJS::Error::create):
              (KJS::constructEmptyObject):
              * kjs/JSObject.h:
              (KJS::GetterSetter::GetterSetter):
              (KJS::GetterSetter::getter):
              (KJS::GetterSetter::setGetter):
              (KJS::GetterSetter::setter):
              (KJS::GetterSetter::setSetter):
              * kjs/JSValue.cpp:
              (KJS::JSCell::deleteProperty):
              (KJS::call):
              (KJS::construct):
              * kjs/JSValue.h:
              * kjs/MathObject.cpp:
              (KJS::mathProtoFuncAbs):
              (KJS::mathProtoFuncACos):
              (KJS::mathProtoFuncASin):
              (KJS::mathProtoFuncATan):
              (KJS::mathProtoFuncATan2):
              (KJS::mathProtoFuncCeil):
              (KJS::mathProtoFuncCos):
              (KJS::mathProtoFuncExp):
              (KJS::mathProtoFuncFloor):
              (KJS::mathProtoFuncLog):
              (KJS::mathProtoFuncMax):
              (KJS::mathProtoFuncMin):
              (KJS::mathProtoFuncPow):
              (KJS::mathProtoFuncRandom):
              (KJS::mathProtoFuncRound):
              (KJS::mathProtoFuncSin):
              (KJS::mathProtoFuncSqrt):
              (KJS::mathProtoFuncTan):
              * kjs/MathObject.h:
              * kjs/NumberObject.cpp:
              (KJS::numberProtoFuncToString):
              (KJS::numberProtoFuncToLocaleString):
              (KJS::numberProtoFuncValueOf):
              (KJS::numberProtoFuncToFixed):
              (KJS::numberProtoFuncToExponential):
              (KJS::numberProtoFuncToPrecision):
              (KJS::NumberConstructor::NumberConstructor):
              (KJS::constructWithNumberConstructor):
              (KJS::NumberConstructor::getConstructData):
              (KJS::callNumberConstructor):
              (KJS::NumberConstructor::getCallData):
              (KJS::constructNumber):
              (KJS::constructNumberFromImmediateNumber):
              * kjs/NumberObject.h:
              (KJS::NumberObject::classInfo):
              (KJS::NumberConstructor::classInfo):
              * kjs/PropertySlot.cpp:
              (KJS::PropertySlot::functionGetter):
              * kjs/RegExpObject.cpp:
              (KJS::regExpProtoFuncTest):
              (KJS::regExpProtoFuncExec):
              (KJS::regExpProtoFuncCompile):
              (KJS::regExpProtoFuncToString):
              (KJS::callRegExpObject):
              (KJS::RegExpObject::getCallData):
              (KJS::constructRegExp):
              (KJS::constructWithRegExpConstructor):
              (KJS::RegExpConstructor::getConstructData):
              (KJS::callRegExpConstructor):
              (KJS::RegExpConstructor::getCallData):
              * kjs/RegExpObject.h:
              (KJS::RegExpConstructor::classInfo):
              * kjs/Shell.cpp:
              (GlobalObject::GlobalObject):
              (functionPrint):
              (functionDebug):
              (functionGC):
              (functionVersion):
              (functionRun):
              (functionLoad):
              (functionReadline):
              (functionQuit):
              * kjs/date_object.cpp:
              (KJS::gmtoffset):
              (KJS::formatLocaleDate):
              (KJS::fillStructuresUsingDateArgs):
              (KJS::DateInstance::getTime):
              (KJS::DateInstance::getUTCTime):
              (KJS::DateConstructor::DateConstructor):
              (KJS::constructDate):
              (KJS::DateConstructor::getConstructData):
              (KJS::callDate):
              (KJS::DateConstructor::getCallData):
              (KJS::dateParse):
              (KJS::dateNow):
              (KJS::dateUTC):
              (KJS::dateProtoFuncToString):
              (KJS::dateProtoFuncToUTCString):
              (KJS::dateProtoFuncToDateString):
              (KJS::dateProtoFuncToTimeString):
              (KJS::dateProtoFuncToLocaleString):
              (KJS::dateProtoFuncToLocaleDateString):
              (KJS::dateProtoFuncToLocaleTimeString):
              (KJS::dateProtoFuncValueOf):
              (KJS::dateProtoFuncGetTime):
              (KJS::dateProtoFuncGetFullYear):
              (KJS::dateProtoFuncGetUTCFullYear):
              (KJS::dateProtoFuncToGMTString):
              (KJS::dateProtoFuncGetMonth):
              (KJS::dateProtoFuncGetUTCMonth):
              (KJS::dateProtoFuncGetDate):
              (KJS::dateProtoFuncGetUTCDate):
              (KJS::dateProtoFuncGetDay):
              (KJS::dateProtoFuncGetUTCDay):
              (KJS::dateProtoFuncGetHours):
              (KJS::dateProtoFuncGetUTCHours):
              (KJS::dateProtoFuncGetMinutes):
              (KJS::dateProtoFuncGetUTCMinutes):
              (KJS::dateProtoFuncGetSeconds):
              (KJS::dateProtoFuncGetUTCSeconds):
              (KJS::dateProtoFuncGetMilliSeconds):
              (KJS::dateProtoFuncGetUTCMilliseconds):
              (KJS::dateProtoFuncGetTimezoneOffset):
              (KJS::dateProtoFuncSetTime):
              (KJS::setNewValueFromTimeArgs):
              (KJS::setNewValueFromDateArgs):
              (KJS::dateProtoFuncSetMilliSeconds):
              (KJS::dateProtoFuncSetUTCMilliseconds):
              (KJS::dateProtoFuncSetSeconds):
              (KJS::dateProtoFuncSetUTCSeconds):
              (KJS::dateProtoFuncSetMinutes):
              (KJS::dateProtoFuncSetUTCMinutes):
              (KJS::dateProtoFuncSetHours):
              (KJS::dateProtoFuncSetUTCHours):
              (KJS::dateProtoFuncSetDate):
              (KJS::dateProtoFuncSetUTCDate):
              (KJS::dateProtoFuncSetMonth):
              (KJS::dateProtoFuncSetUTCMonth):
              (KJS::dateProtoFuncSetFullYear):
              (KJS::dateProtoFuncSetUTCFullYear):
              (KJS::dateProtoFuncSetYear):
              (KJS::dateProtoFuncGetYear):
              * kjs/date_object.h:
              (KJS::DateInstance::internalNumber):
              (KJS::DateInstance::classInfo):
              * kjs/error_object.cpp:
              (KJS::errorProtoFuncToString):
              (KJS::constructError):
              (KJS::constructWithErrorConstructor):
              (KJS::ErrorConstructor::getConstructData):
              (KJS::callErrorConstructor):
              (KJS::ErrorConstructor::getCallData):
              (KJS::NativeErrorConstructor::construct):
              (KJS::constructWithNativeErrorConstructor):
              (KJS::NativeErrorConstructor::getConstructData):
              (KJS::callNativeErrorConstructor):
              (KJS::NativeErrorConstructor::getCallData):
              * kjs/error_object.h:
              (KJS::NativeErrorConstructor::classInfo):
              * kjs/internal.cpp:
              (KJS::JSNumberCell::toObject):
              (KJS::JSNumberCell::toThisObject):
              (KJS::GetterSetter::mark):
              (KJS::GetterSetter::toPrimitive):
              (KJS::GetterSetter::toBoolean):
              (KJS::GetterSetter::toNumber):
              (KJS::GetterSetter::toString):
              (KJS::GetterSetter::toObject):
              (KJS::InternalFunction::InternalFunction):
              (KJS::InternalFunction::implementsHasInstance):
              * kjs/lookup.h:
              (KJS::HashEntry::):
              * kjs/nodes.cpp:
              (KJS::FuncDeclNode::makeFunction):
              (KJS::FuncExprNode::makeFunction):
              * kjs/object_object.cpp:
              (KJS::objectProtoFuncValueOf):
              (KJS::objectProtoFuncHasOwnProperty):
              (KJS::objectProtoFuncIsPrototypeOf):
              (KJS::objectProtoFuncDefineGetter):
              (KJS::objectProtoFuncDefineSetter):
              (KJS::objectProtoFuncLookupGetter):
              (KJS::objectProtoFuncLookupSetter):
              (KJS::objectProtoFuncPropertyIsEnumerable):
              (KJS::objectProtoFuncToLocaleString):
              (KJS::objectProtoFuncToString):
              (KJS::ObjectConstructor::ObjectConstructor):
              (KJS::constructObject):
              (KJS::constructWithObjectConstructor):
              (KJS::ObjectConstructor::getConstructData):
              (KJS::callObjectConstructor):
              (KJS::ObjectConstructor::getCallData):
              * kjs/object_object.h:
              * kjs/string_object.cpp:
              (KJS::replace):
              (KJS::stringProtoFuncToString):
              (KJS::stringProtoFuncValueOf):
              (KJS::stringProtoFuncCharAt):
              (KJS::stringProtoFuncCharCodeAt):
              (KJS::stringProtoFuncConcat):
              (KJS::stringProtoFuncIndexOf):
              (KJS::stringProtoFuncLastIndexOf):
              (KJS::stringProtoFuncMatch):
              (KJS::stringProtoFuncSearch):
              (KJS::stringProtoFuncReplace):
              (KJS::stringProtoFuncSlice):
              (KJS::stringProtoFuncSplit):
              (KJS::stringProtoFuncSubstr):
              (KJS::stringProtoFuncSubstring):
              (KJS::stringProtoFuncToLowerCase):
              (KJS::stringProtoFuncToUpperCase):
              (KJS::stringProtoFuncToLocaleLowerCase):
              (KJS::stringProtoFuncToLocaleUpperCase):
              (KJS::stringProtoFuncLocaleCompare):
              (KJS::stringProtoFuncBig):
              (KJS::stringProtoFuncSmall):
              (KJS::stringProtoFuncBlink):
              (KJS::stringProtoFuncBold):
              (KJS::stringProtoFuncFixed):
              (KJS::stringProtoFuncItalics):
              (KJS::stringProtoFuncStrike):
              (KJS::stringProtoFuncSub):
              (KJS::stringProtoFuncSup):
              (KJS::stringProtoFuncFontcolor):
              (KJS::stringProtoFuncFontsize):
              (KJS::stringProtoFuncAnchor):
              (KJS::stringProtoFuncLink):
              (KJS::stringFromCharCode):
              (KJS::StringConstructor::StringConstructor):
              (KJS::constructWithStringConstructor):
              (KJS::StringConstructor::getConstructData):
              (KJS::callStringConstructor):
              (KJS::StringConstructor::getCallData):
              * kjs/string_object.h:
      
      JavaScriptGlue:
      
      2008-06-23  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              * JSValueWrapper.cpp:
              (JSValueWrapper::JSObjectCallFunction): Updated to use getCallData and call instead
              of the old callAsFunction.
      
      WebCore:
      
      2008-06-23  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              Update for JavaScript changes.
      
              - Use CallData and ConstructData instead of the obsolete implementsCall,
                callAsFunction, and construct functions.
      
              - Updated native function arguments, specifically to allow a JSValue
                rather than a JSObject for the this argument, and to call toThisObject
                as needed when treating it as an object.
      
              - Made some more class members private and protected, including virtual
                function overrides.
      
              - Eliminated the use of getCallData in the JavaScript bridging code as
                a way to check if an instance supports invokeDefaultMethod.
      
              - Eliminated unnecessary polymorphism in the NodeIterator and TreeWalker
                classes. They were using virtual functions simply to share an instance
                of the RefCounted template, which was not helpful.
      
              * bindings/js/JSAudioConstructor.cpp:
              (WebCore::constructAudio):
              (WebCore::JSAudioConstructor::getConstructData):
              * bindings/js/JSAudioConstructor.h:
              (WebCore::JSAudioConstructor::document):
              (WebCore::JSAudioConstructor::classInfo):
              * bindings/js/JSClipboardCustom.cpp:
              (WebCore::JSClipboard::types):
              * bindings/js/JSCustomSQLStatementCallback.cpp:
              (WebCore::JSCustomSQLStatementCallback::handleEvent):
              * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
              (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
              * bindings/js/JSCustomSQLTransactionCallback.cpp:
              (WebCore::JSCustomSQLTransactionCallback::handleEvent):
              * bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
              (WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):
              * bindings/js/JSCustomVoidCallback.cpp:
              (WebCore::JSCustomVoidCallback::handleEvent):
              * bindings/js/JSCustomXPathNSResolver.cpp:
              (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
              * bindings/js/JSDOMBinding.h:
              (WebCore::DOMObject::DOMObject):
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::windowProtoFuncAToB):
              (WebCore::windowProtoFuncBToA):
              (WebCore::windowProtoFuncOpen):
              (WebCore::windowProtoFuncSetTimeout):
              (WebCore::windowProtoFuncClearTimeout):
              (WebCore::windowProtoFuncSetInterval):
              (WebCore::windowProtoFuncAddEventListener):
              (WebCore::windowProtoFuncRemoveEventListener):
              (WebCore::windowProtoFuncShowModalDialog):
              (WebCore::windowProtoFuncNotImplemented):
              (WebCore::toJSDOMWindow):
              * bindings/js/JSDOMWindowBase.h:
              * bindings/js/JSDOMWindowShell.h:
              (WebCore::JSDOMWindowShell::classInfo):
              * bindings/js/JSEventListener.cpp:
              (WebCore::JSAbstractEventListener::handleEvent):
              (WebCore::JSLazyEventListener::parseCode):
              * bindings/js/JSEventTargetBase.cpp:
              (WebCore::retrieveEventTargetAndCorrespondingNode):
              (WebCore::jsEventTargetAddEventListener):
              (WebCore::jsEventTargetRemoveEventListener):
              (WebCore::jsEventTargetDispatchEvent):
              * bindings/js/JSEventTargetBase.h:
              * bindings/js/JSHTMLAppletElementCustom.cpp:
              (WebCore::JSHTMLAppletElement::customGetOwnPropertySlot):
              (WebCore::JSHTMLAppletElement::customPut):
              (WebCore::JSHTMLAppletElement::getCallData):
              * bindings/js/JSHTMLCollectionCustom.cpp:
              (WebCore::callHTMLCollection):
              (WebCore::JSHTMLCollection::getCallData):
              * bindings/js/JSHTMLDocumentCustom.cpp:
              (WebCore::JSHTMLDocument::open):
              * bindings/js/JSHTMLEmbedElementCustom.cpp:
              (WebCore::JSHTMLEmbedElement::customGetOwnPropertySlot):
              (WebCore::JSHTMLEmbedElement::customPut):
              (WebCore::JSHTMLEmbedElement::getCallData):
              * bindings/js/JSHTMLInputElementBase.cpp:
              (WebCore::jsHTMLInputElementBaseFunctionSetSelectionRange):
              * bindings/js/JSHTMLInputElementBase.h:
              * bindings/js/JSHTMLObjectElementCustom.cpp:
              (WebCore::JSHTMLObjectElement::customGetOwnPropertySlot):
              (WebCore::JSHTMLObjectElement::customPut):
              (WebCore::JSHTMLObjectElement::getCallData):
              * bindings/js/JSHTMLOptionElementConstructor.cpp:
              (WebCore::constructHTMLOptionElement):
              (WebCore::JSHTMLOptionElementConstructor::getConstructData):
              * bindings/js/JSHTMLOptionElementConstructor.h:
              (WebCore::JSHTMLOptionElementConstructor::document):
              (WebCore::JSHTMLOptionElementConstructor::classInfo):
              * bindings/js/JSImageConstructor.cpp:
              (WebCore::constructImage):
              (WebCore::JSImageConstructor::getConstructData):
              * bindings/js/JSImageConstructor.h:
              (WebCore::JSImageConstructor::document):
              (WebCore::JSImageConstructor::classInfo):
              * bindings/js/JSInspectedObjectWrapper.h:
              (WebCore::JSInspectedObjectWrapper::classInfo):
              * bindings/js/JSInspectorCallbackWrapper.cpp:
              (WebCore::JSInspectorCallbackWrapper::prepareIncomingValue):
              * bindings/js/JSJavaScriptCallFrameCustom.cpp:
              (WebCore::JSJavaScriptCallFrame::scopeChain):
              * bindings/js/JSNodeFilterCondition.cpp:
              (WebCore::JSNodeFilterCondition::JSNodeFilterCondition):
              (WebCore::JSNodeFilterCondition::mark):
              (WebCore::JSNodeFilterCondition::acceptNode):
              * bindings/js/JSNodeFilterCondition.h:
              (WebCore::JSNodeFilterCondition::create):
              * bindings/js/JSNodeFilterCustom.cpp:
              (WebCore::toNodeFilter):
              * bindings/js/JSNodeListCustom.cpp:
              (WebCore::callNodeList):
              (WebCore::JSNodeList::getCallData):
              (WebCore::JSNodeList::canGetItemsForName):
              (WebCore::JSNodeList::nameGetter):
              * bindings/js/JSPluginElementFunctions.cpp:
              (WebCore::runtimeObjectGetter):
              (WebCore::runtimeObjectPropertyGetter):
              (WebCore::runtimeObjectCustomGetOwnPropertySlot):
              (WebCore::runtimeObjectCustomPut):
              (WebCore::runtimeObjectGetCallData):
              (WebCore::pluginInstance):
              (WebCore::getRuntimeObject):
              (WebCore::callPlugin):
              * bindings/js/JSPluginElementFunctions.h:
              * bindings/js/JSQuarantinedObjectWrapper.cpp:
              (WebCore::JSQuarantinedObjectWrapper::put):
              (WebCore::JSQuarantinedObjectWrapper::construct):
              (WebCore::JSQuarantinedObjectWrapper::getConstructData):
              (WebCore::JSQuarantinedObjectWrapper::hasInstance):
              (WebCore::JSQuarantinedObjectWrapper::call):
              (WebCore::JSQuarantinedObjectWrapper::getCallData):
              * bindings/js/JSQuarantinedObjectWrapper.h:
              (WebCore::JSQuarantinedObjectWrapper::className):
              * bindings/js/JSRGBColor.cpp:
              * bindings/js/JSXMLHttpRequestConstructor.cpp:
              (WebCore::constructXMLHttpRequest):
              (WebCore::JSXMLHttpRequestConstructor::getConstructData):
              * bindings/js/JSXMLHttpRequestConstructor.h:
              (WebCore::JSXMLHttpRequestConstructor::document):
              (WebCore::JSXMLHttpRequestConstructor::classInfo):
              * bindings/js/JSXSLTProcessorConstructor.cpp:
              (WebCore::constructXSLTProcessor):
              (WebCore::JSXSLTProcessorConstructor::getConstructData):
              * bindings/js/JSXSLTProcessorConstructor.h:
              (WebCore::JSXSLTProcessorConstructor::classInfo):
              * bindings/js/ScheduledAction.cpp:
              (WebCore::ScheduledAction::ScheduledAction):
              (WebCore::ScheduledAction::execute):
              * bindings/js/ScheduledAction.h:
              * bindings/objc/WebScriptObject.mm:
              (-[WebScriptObject callWebScriptMethod:withArguments:]):
              * bindings/scripts/CodeGeneratorJS.pm:
              * bridge/NP_jsobject.cpp:
              (_NPN_InvokeDefault):
              (_NPN_Invoke):
              * bridge/c/c_instance.cpp:
              (KJS::Bindings::CInstance::supportsInvokeDefaultMethod):
              * bridge/c/c_instance.h:
              * bridge/jni/jni_jsobject.mm:
              (JavaJSObject::call):
              * bridge/objc/objc_instance.h:
              * bridge/objc/objc_instance.mm:
              (ObjcInstance::supportsInvokeDefaultMethod):
              * bridge/objc/objc_runtime.h:
              (KJS::Bindings::ObjcFallbackObjectImp::propertyName):
              (KJS::Bindings::ObjcFallbackObjectImp::classInfo):
              * bridge/objc/objc_runtime.mm:
              (Bindings::webScriptObjectClass):
              (Bindings::webUndefinedClass):
              (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
              (callObjCFallbackObject):
              (ObjcFallbackObjectImp::getCallData):
              * bridge/qt/qt_instance.h:
              * bridge/runtime.cpp:
              (KJS::Bindings::Instance::createRuntimeObject):
              (KJS::Bindings::Instance::getInstance):
              * bridge/runtime.h:
              (KJS::Bindings::Field::~Field):
              (KJS::Bindings::Method::~Method):
              (KJS::Bindings::Class::~Class):
              (KJS::Bindings::Instance::supportsInvokeDefaultMethod):
              * bridge/runtime_method.cpp:
              (KJS::callRuntimeMethod):
              (KJS::RuntimeMethod::getCallData):
              * bridge/runtime_method.h:
              (KJS::RuntimeMethod::methods):
              * bridge/runtime_object.cpp:
              (RuntimeObjectImp::defaultValue):
              (callRuntimeObject):
              (RuntimeObjectImp::getCallData):
              * bridge/runtime_object.h:
              (KJS::RuntimeObjectImp::getInternalInstance):
              (KJS::RuntimeObjectImp::classInfo):
              * dom/NodeIterator.h:
              * dom/Traversal.cpp:
              * dom/Traversal.h:
              * dom/TreeWalker.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1edff436
  14. 19 Jun, 2008 1 commit
  15. 15 Jun, 2008 3 commits
    • darin@apple.com's avatar
      JavaScriptCore: · 5c0863d0
      darin@apple.com authored
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for more JavaScriptCore files
      
              * API/JSCallbackFunction.cpp:
              * API/JSObjectRef.cpp:
              * DerivedSources.make:
              * GNUmakefile.am:
              * JavaScriptCore.exp:
              * JavaScriptCore.pri:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * JavaScriptCoreSources.bkl:
              * VM/Machine.cpp:
              * kjs/AllInOneFile.cpp:
              * kjs/ArrayPrototype.cpp: Copied from JavaScriptCore/kjs/array_object.cpp.
              * kjs/ArrayPrototype.h: Copied from JavaScriptCore/kjs/array_object.h.
              * kjs/BooleanObject.cpp: Copied from JavaScriptCore/kjs/bool_object.cpp.
              * kjs/BooleanObject.h: Copied from JavaScriptCore/kjs/bool_object.h.
              * kjs/ExecState.cpp:
              * kjs/ExecState.h:
              * kjs/FunctionPrototype.cpp: Copied from JavaScriptCore/kjs/function_object.cpp.
              * kjs/FunctionPrototype.h: Copied from JavaScriptCore/kjs/function_object.h.
              * kjs/JSArray.cpp: Copied from JavaScriptCore/kjs/array_instance.cpp.
              * kjs/JSArray.h: Copied from JavaScriptCore/kjs/array_instance.h.
              * kjs/JSFunction.cpp:
              * kjs/JSFunction.h:
              * kjs/JSGlobalObject.cpp:
              * kjs/JSImmediate.cpp:
              * kjs/JSObject.h:
              * kjs/JSString.h:
              * kjs/JSValue.h:
              * kjs/JSVariableObject.cpp:
              * kjs/MathObject.cpp: Copied from JavaScriptCore/kjs/math_object.cpp.
              * kjs/MathObject.h: Copied from JavaScriptCore/kjs/math_object.h.
              * kjs/NumberObject.cpp: Copied from JavaScriptCore/kjs/number_object.cpp.
              * kjs/NumberObject.h: Copied from JavaScriptCore/kjs/number_object.h.
              * kjs/PropertyMap.cpp: Copied from JavaScriptCore/kjs/property_map.cpp.
              * kjs/PropertyMap.h: Copied from JavaScriptCore/kjs/property_map.h.
              * kjs/PropertySlot.cpp: Copied from JavaScriptCore/kjs/property_slot.cpp.
              * kjs/PropertySlot.h: Copied from JavaScriptCore/kjs/property_slot.h.
              * kjs/RegExpObject.cpp: Copied from JavaScriptCore/kjs/regexp_object.cpp.
              * kjs/RegExpObject.h: Copied from JavaScriptCore/kjs/regexp_object.h.
              * kjs/ScopeChain.cpp: Copied from JavaScriptCore/kjs/scope_chain.cpp.
              * kjs/ScopeChain.h: Copied from JavaScriptCore/kjs/scope_chain.h.
              * kjs/ScopeChainMark.h: Copied from JavaScriptCore/kjs/scope_chain_mark.h.
              * kjs/Shell.cpp:
              * kjs/array_instance.cpp: Removed.
              * kjs/array_instance.h: Removed.
              * kjs/array_object.cpp: Removed.
              * kjs/array_object.h: Removed.
              * kjs/bool_object.cpp: Removed.
              * kjs/bool_object.h: Removed.
              * kjs/error_object.h:
              * kjs/function_object.cpp: Removed.
              * kjs/function_object.h: Removed.
              * kjs/internal.cpp:
              * kjs/math_object.cpp: Removed.
              * kjs/math_object.h: Removed.
              * kjs/nodes.cpp:
              * kjs/number_object.cpp: Removed.
              * kjs/number_object.h: Removed.
              * kjs/object_object.cpp:
              * kjs/property_map.cpp: Removed.
              * kjs/property_map.h: Removed.
              * kjs/property_slot.cpp: Removed.
              * kjs/property_slot.h: Removed.
              * kjs/regexp_object.cpp: Removed.
              * kjs/regexp_object.h: Removed.
              * kjs/scope_chain.cpp: Removed.
              * kjs/scope_chain.h: Removed.
              * kjs/scope_chain_mark.h: Removed.
              * kjs/string_object.cpp:
              * kjs/string_object.h:
      
      WebCore:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for more JavaScriptCore files
      
              * ForwardingHeaders/kjs/ArrayPrototype.h: Copied from WebCore/ForwardingHeaders/kjs/array_object.h.
              * ForwardingHeaders/kjs/BooleanObject.h: Copied from WebCore/ForwardingHeaders/kjs/bool_object.h.
              * ForwardingHeaders/kjs/FunctionPrototype.h: Copied from WebCore/ForwardingHeaders/kjs/function_object.h.
              * ForwardingHeaders/kjs/JSArray.h: Copied from WebCore/ForwardingHeaders/kjs/array_instance.h.
              * ForwardingHeaders/kjs/PropertyMap.h: Copied from WebCore/ForwardingHeaders/kjs/property_map.h.
              * ForwardingHeaders/kjs/array_instance.h: Removed.
              * ForwardingHeaders/kjs/array_object.h: Removed.
              * ForwardingHeaders/kjs/bool_object.h: Removed.
              * ForwardingHeaders/kjs/function_object.h: Removed.
              * ForwardingHeaders/kjs/property_map.h: Removed.
              * WebCore.vcproj/WebCore.vcproj:
              * bindings/js/JSClipboardCustom.cpp:
              * bindings/js/JSDatabaseCustom.cpp:
              * bindings/js/JSJavaScriptCallFrameCustom.cpp:
              * bindings/js/kjs_events.cpp:
              * bridge/jni/jni_utility.cpp:
              * bridge/qt/qt_runtime.cpp:
              * bridge/runtime_array.cpp:
      
      WebKit/mac:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for more JavaScriptCore files
      
              * WebView/WebView.mm:
      
      WebKit/qt:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              - new names for more JavaScriptCore files
      
              * WebKit_pch.h:
      
      WebKitTools:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              * Scripts/do-file-rename: Updated.
              * Scripts/do-webcore-rename: Updated for the latest round of renaming.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5c0863d0
    • 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
    • darin@apple.com's avatar
      JavaScriptCore: · 980c614d
      darin@apple.com authored
      2008-06-15  Darin Adler  <darin@apple.com>
      
              Rubber stamped by Sam.
      
              - use JS prefix and simpler names for basic JavaScriptCore types,
                to complement JSValue and JSObject
      
              * JavaScriptCore.exp:
              * VM/Machine.cpp:
              (KJS::jsLess):
              (KJS::jsLessEq):
              (KJS::jsAdd):
              (KJS::callEval):
              (KJS::Machine::execute):
              (KJS::Machine::retrieveArguments):
              (KJS::Machine::retrieveCaller):
              (KJS::Machine::getCallFrame):
              (KJS::Machine::getFunctionAndArguments):
              * VM/Machine.h:
              * VM/Register.h:
              * kjs/DebuggerCallFrame.cpp:
              (KJS::DebuggerCallFrame::functionName):
              * kjs/ExecState.h:
              * kjs/JSActivation.cpp:
              (KJS::JSActivation::createArgumentsObject):
              * kjs/array_instance.cpp:
              (KJS::):
              (KJS::JSArray::checkConsistency):
              (KJS::JSArray::JSArray):
              (KJS::JSArray::~JSArray):
              (KJS::JSArray::getItem):
              (KJS::JSArray::lengthGetter):
              (KJS::JSArray::inlineGetOwnPropertySlot):
              (KJS::JSArray::getOwnPropertySlot):
              (KJS::JSArray::put):
              (KJS::JSArray::deleteProperty):
              (KJS::JSArray::getPropertyNames):
              (KJS::JSArray::increaseVectorLength):
              (KJS::JSArray::setLength):
              (KJS::JSArray::mark):
              (KJS::JSArray::sort):
              (KJS::JSArray::compactForSorting):
              (KJS::JSArray::lazyCreationData):
              (KJS::JSArray::setLazyCreationData):
              * kjs/array_instance.h:
              * kjs/array_object.cpp:
              (KJS::):
              (KJS::ArrayPrototype::ArrayPrototype):
              (KJS::ArrayPrototype::getOwnPropertySlot):
              (KJS::arrayProtoFuncToString):
              (KJS::arrayProtoFuncToLocaleString):
              (KJS::arrayProtoFuncConcat):
              (KJS::arrayProtoFuncSort):
              (KJS::ArrayObjectImp::construct):
              * kjs/array_object.h:
              * kjs/completion.h:
              * kjs/function.cpp:
              (KJS::):
              (KJS::JSFunction::JSFunction):
              (KJS::JSFunction::mark):
              (KJS::JSFunction::getCallData):
              (KJS::JSFunction::callAsFunction):
              (KJS::JSFunction::argumentsGetter):
              (KJS::JSFunction::callerGetter):
              (KJS::JSFunction::lengthGetter):
              (KJS::JSFunction::getOwnPropertySlot):
              (KJS::JSFunction::put):
              (KJS::JSFunction::deleteProperty):
              (KJS::JSFunction::getParameterName):
              (KJS::JSFunction::getConstructData):
              (KJS::JSFunction::construct):
              (KJS::IndexToNameMap::IndexToNameMap):
              (KJS::Arguments::Arguments):
              * kjs/function.h:
              * kjs/function_object.cpp:
              (KJS::functionProtoFuncToString):
              (KJS::functionProtoFuncApply):
              (KJS::FunctionObjectImp::construct):
              * kjs/internal.cpp:
              (KJS::JSString::toPrimitive):
              (KJS::JSString::getPrimitiveNumber):
              (KJS::JSString::toBoolean):
              (KJS::JSString::toNumber):
              (KJS::JSString::toString):
              (KJS::StringInstance::create):
              (KJS::JSString::toObject):
              (KJS::JSString::toThisObject):
              (KJS::JSString::lengthGetter):
              (KJS::JSString::indexGetter):
              (KJS::JSString::indexNumericPropertyGetter):
              (KJS::JSString::getOwnPropertySlot):
              (KJS::JSNumberCell::type):
              (KJS::JSNumberCell::toPrimitive):
              (KJS::JSNumberCell::getPrimitiveNumber):
              (KJS::JSNumberCell::toBoolean):
              (KJS::JSNumberCell::toNumber):
              (KJS::JSNumberCell::toString):
              (KJS::JSNumberCell::toObject):
              (KJS::JSNumberCell::toThisObject):
              (KJS::JSNumberCell::getUInt32):
              (KJS::JSNumberCell::getTruncatedInt32):
              (KJS::JSNumberCell::getTruncatedUInt32):
              (KJS::GetterSetter::mark):
              (KJS::GetterSetter::toPrimitive):
              (KJS::GetterSetter::getPrimitiveNumber):
              (KJS::GetterSetter::toBoolean):
              (KJS::GetterSetter::toNumber):
              (KJS::GetterSetter::toString):
              (KJS::GetterSetter::toObject):
              (KJS::GetterSetter::getOwnPropertySlot):
              (KJS::GetterSetter::put):
              (KJS::GetterSetter::toThisObject):
              * kjs/internal.h:
              (KJS::JSString::JSString):
              (KJS::JSString::getStringPropertySlot):
              * kjs/nodes.cpp:
              (KJS::FuncDeclNode::makeFunction):
              (KJS::FuncExprNode::makeFunction):
              * kjs/nodes.h:
              * kjs/object.cpp:
              (KJS::JSObject::put):
              (KJS::JSObject::deleteProperty):
              (KJS::JSObject::defineGetter):
              (KJS::JSObject::defineSetter):
              (KJS::JSObject::lookupGetter):
              (KJS::JSObject::lookupSetter):
              (KJS::JSObject::fillGetterPropertySlot):
              * kjs/object.h:
              (KJS::):
              (KJS::GetterSetter::GetterSetter):
              * kjs/operations.cpp:
              (KJS::equal):
              (KJS::strictEqual):
              * kjs/property_map.cpp:
              (KJS::PropertyMap::containsGettersOrSetters):
              * kjs/regexp_object.cpp:
              (KJS::RegExpMatchesArray::getOwnPropertySlot):
              (KJS::RegExpMatchesArray::put):
              (KJS::RegExpMatchesArray::deleteProperty):
              (KJS::RegExpMatchesArray::getPropertyNames):
              (KJS::RegExpMatchesArray::RegExpMatchesArray):
              (KJS::RegExpMatchesArray::fillArrayInstance):
              * kjs/string_object.cpp:
              (KJS::StringInstance::StringInstance):
              (KJS::replace):
              (KJS::stringProtoFuncReplace):
              (KJS::stringProtoFuncToLowerCase):
              (KJS::stringProtoFuncToUpperCase):
              (KJS::stringProtoFuncToLocaleLowerCase):
              (KJS::stringProtoFuncToLocaleUpperCase):
              * kjs/string_object.h:
              (KJS::StringInstance::internalValue):
              * kjs/value.cpp:
              (KJS::JSCell::getNumber):
              (KJS::JSCell::getString):
              (KJS::JSCell::getObject):
              (KJS::jsString):
              (KJS::jsOwnedString):
              * kjs/value.h:
              (KJS::JSNumberCell::JSNumberCell):
              (KJS::jsNumberCell):
              (KJS::JSValue::uncheckedGetNumber):
              * profiler/Profiler.cpp:
              (KJS::createCallIdentifier):
              (KJS::createCallIdentifierFromFunctionImp):
      
      WebCore:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              Rubber stamped by Sam.
      
              - use JS prefix and simpler names for basic JavaScriptCore types,
                to complement JSValue and JSObject
      
              * bindings/js/JSNavigatorCustom.cpp:
              (WebCore::needsYouTubeQuirk):
              * bindings/js/kjs_events.cpp:
              (WebCore::JSLazyEventListener::parseCode):
              * bridge/jni/jni_utility.cpp:
              (KJS::Bindings::convertArrayInstanceToJavaArray):
              (KJS::Bindings::convertValueToJValue):
              * bridge/qt/qt_runtime.cpp:
              (KJS::Bindings::valueRealType):
              (KJS::Bindings::convertValueToQVariant):
              (KJS::Bindings::QtConnectionObject::execute):
              * bridge/runtime_array.cpp:
      
      WebKit/mac:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              Rubber stamped by Sam.
      
              - use JS prefix and simpler names for basic JavaScriptCore types,
                to complement JSValue and JSObject
      
              * WebView/WebView.mm:
              (aeDescFromJSValue):
      
      WebKit/win:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              Rubber stamped by Sam.
      
              - use JS prefix and simpler names for basic JavaScriptCore types,
                to complement JSValue and JSObject
      
              * WebScriptCallFrame.cpp:
              (WebScriptCallFrame::functionName):
      
      WebKitTools:
      
      2008-06-15  Darin Adler  <darin@apple.com>
      
              * Scripts/do-webcore-rename: Updated for the latest round of renaming.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      980c614d
  16. 12 Jun, 2008 1 commit
    • darin@apple.com's avatar
      2008-06-12 Darin Adler <darin@apple.com> · 68dbe316
      darin@apple.com authored
              Reviewed by Maciej.
      
              - https://bugs.webkit.org/show_bug.cgi?id=19434
                speed up SunSpider by avoiding some string boxing
      
              Speeds up SunSpider by 1.1%.
      
              Optimized code path for getting built-in properties from strings -- avoid
              boxing with a string object in that case. We can make further changes to avoid
              even more boxing, but this change alone is a win.
      
              * API/JSCallbackObjectFunctions.h:
              (KJS::JSCallbackObject::staticValueGetter): Use isObject instead of inherits
              in asssert, since the type of slotBase() is now JSValue, not JSObject.
              (KJS::JSCallbackObject::staticFunctionGetter): Ditto.
              (KJS::JSCallbackObject::callbackGetter): Ditto.
      
              * kjs/internal.cpp:
              (KJS::StringImp::getPrimitiveNumber): Updated for change of data member name.
              (KJS::StringImp::toBoolean): Ditto.
              (KJS::StringImp::toNumber): Ditto.
              (KJS::StringImp::toString): Ditto.
              (KJS::StringInstance::create): Added; avoids a bit of cut and paste code.
              (KJS::StringImp::toObject): Use StringInstance::create.
              (KJS::StringImp::toThisObject): Ditto.
              (KJS::StringImp::lengthGetter): Added. Replaces the getter that used to live in
              the StringInstance class.
              (KJS::StringImp::indexGetter): Ditto.
              (KJS::StringImp::indexNumericPropertyGetter): Ditto.
              (KJS::StringImp::getOwnPropertySlot): Added. Deals with built in properties of
              the string class without creating a StringInstance.
      
              * kjs/internal.h:
              (KJS::StringImp::getStringPropertySlot): Added. To be used by both the string
              and string object getOwnPropertySlot function.
      
              * kjs/lookup.h:
              (KJS::staticFunctionGetter): Updated since slotBase() is now a JSValue rather
              than a JSObject.
      
              * kjs/object.h: Removed PropertySlot::slotBase() function, which can now move
              back into property_slot.h where it belongs since it doesn't have to cast to
              JSObject*.
      
              * kjs/property_slot.cpp:
              (KJS::PropertySlot::functionGetter): Updated since slot.slotBase() is now a JSValue*
              instead of JSObject*. setGetterSlot still guarantees the base is a JSObject*.
              * kjs/property_slot.h:
              (KJS::PropertySlot::PropertySlot): Changed base to JSValue* intead of JSCell*.
              (KJS::PropertySlot::setStaticEntry): Ditto.
              (KJS::PropertySlot::setCustom): Ditto.
              (KJS::PropertySlot::setCustomIndex): Ditto.
              (KJS::PropertySlot::setCustomNumeric): Ditto.
              (KJS::PropertySlot::slotBase): Moved inline here since it no longer involves a
              downcast to JSObject*.
              (KJS::PropertySlot::setBase): Changed to JSValue*.
      
              * kjs/string_object.cpp:
              (KJS::StringInstance::getOwnPropertySlot): Changed to use getStringPropertySlot
              instead of coding the properties here. This allows sharing the code with StringImp.
      
              * kjs/string_object.h: Removed inlineGetOwnPropertySlot, lengthGetter, and indexGetter.
              Made one of the constructors protected.
      
              * kjs/value.h: Made getOwnPropertySlot private in the JSCell class -- this is better
              since it's not the real JSObject getOwnPropertySlot semantic and most callers shouldn't
              use it.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      68dbe316
  17. 04 Jun, 2008 1 commit
  18. 03 Jun, 2008 1 commit
    • darin@apple.com's avatar
      JavaScriptCore: · 4674e190
      darin@apple.com authored
      2008-06-03  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff.
      
              - https://bugs.webkit.org/show_bug.cgi?id=19269
                speed up SunSpider by eliminating the toObject call for most get/put/delete
      
              Makes standalone SunSpider 1.025x as fast as before.
      
              The getOwnPropertySlot virtual function now takes care of the toObject call
              for get. Similarly, the put function (and later deleteProperty) does the
              same for those operations. To do this, the virtual functions were moved from
              the JSObject class to the JSCell class. Also, since the caller no longer knows
              the identity of the "original object", which is used by JavaScript-function
              based getters, changed the PropertySlot class so the original object is
              already stored in the slot when getOwnPropertySlot is called, if the caller
              intends to call getValue.
      
              This affected the old interpreter code enough that the easiest thing for me
              was to just delete it. While I am not certain the mysterious slowdown is not
              still occurring, the net change is definitely a significant speedup.
      
              * JavaScriptCore.exp: Updated.
      
              * VM/Machine.cpp: Moved the UNLIKELY macro into AlwaysInline.h.
              (KJS::resolve): Set up the originalObject in the PropertySlot before
              calling getPropertySlot. Also removed the originalObject argument from
              getValue.
              (KJS::resolve_skip): Ditto.
              (KJS::resolveBaseAndProperty): Ditto.
              (KJS::resolveBaseAndFunc): Ditto.
              (KJS::Machine::privateExecute): Removed the toObject calls from the get and
              put functions where possible, instead calling directly with JSValue and letting
              the JSValue and JSCell calls handle toObject. Same for toThisObject.
      
              * kjs/ExecState.h: Removed OldInterpreterExecState.
      
              * API/JSBase.cpp: Updated includes.
      
              * kjs/LocalStorageEntry.h: Removed contents. Later we can remove the file too.
      
              * kjs/array_instance.cpp:
              (KJS::ArrayInstance::lengthGetter): Removed originalObject argumet.
              (KJS::ArrayInstance::inlineGetOwnPropertySlot): Don't pass a base value to
              setValueSlot. Also use UNLIKELY around the "getting elements past the end of
              the array" code path; less common than successfully getting an element.
      
              * kjs/array_object.cpp:
              (KJS::getProperty): Initialize the PropertySlot with the original object.
              Don't pass the original object to the get function.
              (KJS::arrayProtoFuncFilter): Ditto.
              (KJS::arrayProtoFuncMap): Ditto.
              (KJS::arrayProtoFuncEvery): Ditto.
              (KJS::arrayProtoFuncForEach): Ditto.
              (KJS::arrayProtoFuncSome): Ditto.
      
              * kjs/function_object.cpp:
              (KJS::FunctionObjectImp::construct): Removed an obsolete comment.
      
              * kjs/grammar.y: Eliminated support for some of the node types that were
              used to optimize executing from the syntax tree.
      
              * kjs/internal.cpp:
              (KJS::StringImp::toThisObject): Added. Same as toObject.
              (KJS::NumberImp::toThisObject): Ditto.
              (KJS::GetterSetterImp::getOwnPropertySlot): Added. Not reached.
              (KJS::GetterSetterImp::put): Ditto.
              (KJS::GetterSetterImp::toThisObject): Ditto.
      
              * kjs/internal.h: Added toThisObject to NumberImp for speed.
      
              * kjs/lexer.cpp:
              (KJS::Lexer::shift): Changed shift to just do a single character, to unroll
              the loop and especially to make the one character case faster.
              (KJS::Lexer::setCode): Call shift multiple times instead of passing a number.
              (KJS::Lexer::lex): Ditto.
              (KJS::Lexer::matchPunctuator): Ditto. Also removed unneeded elses after returns.
              (KJS::Lexer::scanRegExp): Ditto.
              * kjs/lexer.h: Removed the count argument from shift.
      
              * kjs/math_object.cpp:
              (KJS::mathProtoFuncPow): Call jsNaN instead of jsNumber(NaN).
      
              * kjs/nodes.cpp: Removed some of the things needed only for the pre-SquirrelFish
              execution model.
              (KJS::ForNode::emitCode): Handle cases where some expressions are missing by
              not emitting any code at all. The old way was to emit code for "true", but
              this is an unnecessary remnant of the old way of doing things.
      
              * kjs/nodes.h: Removed some of the things needed only for the pre-SquirrelFish
              execution model.
      
              * kjs/object.cpp:
              (KJS::JSObject::fillGetterPropertySlot): Changed to only pass in the getter
              function. The old code passed in a base, but it was never used when
              actually getting the property; the toThisObject call was pointless. Also
              changed to not pass a base for setUndefined.
      
              * kjs/object.h: Added the new JSCell operations to GetterSetterImp.
              Never called.
              (KJS::JSObject::get): Initialize the object in the PropertySlot and don't
              pass it in getValue.
              (KJS::JSObject::getOwnPropertySlotForWrite): Removed the base argument
              in calls to setValueSlot.
              (KJS::JSObject::getOwnPropertySlot): Ditto.
              (KJS::JSValue::get): Added. Here because it calls through to JSObject.
              A version of JSObject::get that also handles the other types of JSValue
              by creating the appropriate wrapper. Saves the virtual call to toObject.
              (KJS::JSValue::put): Ditto.
              (KJS::JSValue::deleteProperty): Ditto.
      
              * kjs/property_slot.cpp:
              (KJS::PropertySlot::undefinedGetter): Removed the originalObject argument.
              (KJS::PropertySlot::ungettableGetter): Ditto.
              (KJS::PropertySlot::functionGetter): Ditto. Use the value in the base
              as the "this" object, which will be set to the original object by the new
              PropertySlot initialization code. Also call toThisObject. The old code did
              not do this, but needed to so we can properly handle the activation object
              like the other similar code paths.
      
              * kjs/property_slot.h:
              (KJS::PropertySlot::PropertySlot): Added a constructor that takes a base
              object. In debug builds, set the base to 0 if you don't pass one.
              (KJS::PropertySlot::getValue): Don't take or pass the originalObject.
              (KJS::PropertySlot::setValueSlot): Don't take a base object, and clear the
              base object in debug builds.
              (KJS::PropertySlot::setGetterSlot): Ditto.
              (KJS::PropertySlot::setUndefined): Ditto.
              (KJS::PropertySlot::setUngettable): Ditto.
              (KJS::PropertySlot::slotBase): Assert that a base object is present.
              This will fire if someone actually calls the get function without having
              passed in a base object and the getter needs it.
              (KJS::PropertySlot::setBase): Added. Used by the code that implements
              toObject so it can supply the original object after the fact.
              (KJS::PropertySlot::clearBase): Added. Clears the base, but is debug-only
              code because it's an error to fetch the base if you don't have a guarantee
              it was set.
      
              * API/JSCallbackObject.h:
              * API/JSCallbackObjectFunctions.h:
              (KJS::JSCallbackObject::cachedValueGetter):
              (KJS::JSCallbackObject::staticValueGetter):
              (KJS::JSCallbackObject::staticFunctionGetter):
              (KJS::JSCallbackObject::callbackGetter):
              * kjs/JSActivation.cpp:
              (KJS::JSActivation::getOwnPropertySlot):
              (KJS::JSActivation::argumentsGetter):
              * kjs/JSActivation.h:
              * kjs/JSVariableObject.h:
              (KJS::JSVariableObject::symbolTableGet):
              * kjs/array_instance.h:
              * kjs/function.cpp:
              (KJS::FunctionImp::argumentsGetter):
              (KJS::FunctionImp::callerGetter):
              (KJS::FunctionImp::lengthGetter):
              (KJS::Arguments::mappedIndexGetter):
              * kjs/function.h:
              * kjs/lookup.h:
              (KJS::staticFunctionGetter):
              (KJS::staticValueGetter):
              * kjs/string_object.cpp:
              (KJS::StringInstance::lengthGetter):
              (KJS::StringInstance::indexGetter):
              (KJS::stringInstanceNumericPropertyGetter):
              * kjs/string_object.h:
              Removed originalObject arguments from getters. Don't pass base values to
              the various PropertySlot functions that no longer take them.
      
              * kjs/value.cpp:
              (KJS::JSCell::getOwnPropertySlot): Added. Calls toObject and then sets the slot.
              This function has to always return true, because the caller can't walk the prototype
              chain. Because of that, we do a getPropertySlot, not getOwnPropertySlot, which works
              for the caller. This is private, only called by getOwnPropertySlotInternal.
              (KJS::JSCell::put): Added. Calls toObject and then put.
              (KJS::JSCell::toThisObject): Added. Calls toObject.
      
              * kjs/value.h: Added get, put, and toThisObject to both JSValue
              and JSCell. These take care of the toObject operation without an additional virtual
              function call, and so make the common "already an object" case faster.
      
              * wtf/AlwaysInline.h: Moved the UNLIKELY macro here for now. Maybe we can find a
              better place later, or rename this header.
      
      JavaScriptGlue:
      
      2008-06-03  Darin Adler  <darin@apple.com>
      
              - update for JavaScriptCore changes for https://bugs.webkit.org/show_bug.cgi?id=19269
                speed up SunSpider by eliminating the toObject call for most get/put/delete
      
              * UserObjectImp.cpp:
              (UserObjectImp::userObjectGetter): Removed originalObject argument.
              * UserObjectImp.h: Ditto.
      
      WebCore:
      
      2008-06-03  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by John.
      
              <rdar://problem/5763082> GMail: Hang when removing indent from nested list
              <rdar://problem/5775449> In Gmail and GoogleDocs, a hang occurs when I attempt to apply a list style to a large selection of text
              <rdar://problem/5937624> 9D32: Hang in Safari. Using 100% of processor
      
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::modifyRange): doApply() may operate on and remove 
              the last paragraph of the selection from the document if it's in the same list 
              item as startOfCurrentParagraph.  Return early to avoid an infinite loop and 
              because there is no more work to be done.  Added a FIXME (<rdar://problem/5983974>)
              about the incorrect endingSelection()s.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4674e190
  19. 23 May, 2008 1 commit
    • mrowe@apple.com's avatar
      2008-05-23 Darin Adler <darin@apple.com> · 6ef23cde
      mrowe@apple.com authored
              Reviewed by Mark Rowe.
      
              As allocateNumber is used via jsNumberCell outside of JavaScriptCore,
              we need to provide a non-inlined version of it to avoid creating a
              weak external symbol.
      
              * JavaScriptCore.exp:
              * kjs/AllInOneFile.cpp:
              * kjs/collector.cpp:
              (KJS::Collector::allocate):
              (KJS::Collector::allocateNumber):
              * kjs/collector.h:
              (KJS::Collector::allocate):
              (KJS::Collector::inlineAllocateNumber):
              * kjs/value.h:
              (KJS::NumberImp::operator new):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6ef23cde
  20. 21 May, 2008 1 commit
  21. 12 May, 2008 1 commit
  22. 02 May, 2008 1 commit
  23. 21 Mar, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Oliver Hunt. · 944d1900
      ap@webkit.org authored
              Consolidate static identifier initializers within CommonIdentifiers.
      
              No reliably measurable change on SunSpider; maybe a tiny improvement (within 0.2%).
      
              * kjs/CommonIdentifiers.h: Added static identifiers that were lazily initialized
              throughout the code.
      
              * kjs/date_object.cpp:
              (KJS::DateObjectImp::DateObjectImp):
              * kjs/function_object.cpp:
              (KJS::FunctionPrototype::FunctionPrototype):
              * kjs/object_object.cpp:
              (KJS::ObjectPrototype::ObjectPrototype):
              * kjs/regexp_object.cpp:
              (KJS::RegExpPrototype::RegExpPrototype):
              Use the values from CommonIdentifiers. 
      
              * kjs/lookup.h: Caching the identifier in a static wasn't a win on SunSpider, removed it.
      
              * kjs/value.h:
              (KJS::jsNaN): We already have a shared NaN value, no need for a duplicate here.
      
              * wtf/MathExtras.h:
              (wtf_atan2): Having local variables for numeric_limits constants is good for readability,
              but there is no reason to keep them static.
      
              * JavaScriptCore.exp: Don't needlessly export JSGlobalObject::s_head.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      944d1900
  24. 28 Nov, 2007 2 commits
    • mrowe@apple.com's avatar
      Roll out r28106 and r28108. These introduced a frequent assertion failure on... · 397036ad
      mrowe@apple.com authored
      Roll out r28106 and r28108.  These introduced a frequent assertion failure on page load and broke all non-Mac builds.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      397036ad
    • mjs@apple.com's avatar
      JavaScriptCore: · d342e879
      mjs@apple.com authored
              Reviewed by Darin and Geoff.
      
              - Fixed "Stack overflow crash in JavaScript garbage collector mark pass"
              http://bugs.webkit.org/show_bug.cgi?id=12216
              
              Implement mark stack. This version is not suitable for prime time because it makes a
              huge allocation on every collect, and potentially makes marking of detached subtrees
              slow. But it is an 0.4% SunSpider speedup even without much tweaking.
              
              The basic approach is to replace mark() methods with
              markChildren(MarkStack&) methods. Reachable references are pushed
              onto a mark stack (which encapsulates ignoring already-marked
              references). 
              
              Objects are no longer responsible for actually setting their own
              mark bits, the collector does that. This means that for objects on
              the number heap we don't have to call markChildren() at all since
              we know there aren't any.
              
              The mark phase of collect pushes roots onto the mark stack
              and drains it as often as possible.
              
              To make this approach viable requires a constant-size mark stack
              and a slow fallback approach for when the stack size is exceeded,
              plus optimizations to make the required stack small in common
              cases. This should be doable.
      
              * JavaScriptCore.exp: Export new symbols.
              * JavaScriptCore.xcodeproj/project.pbxproj: Add new file.
              * kjs/collector.cpp:
              (KJS::Collector::heapAllocate):
              (KJS::drainMarkStack): Helper for all of the below.
              (KJS::Collector::markStackObjectsConservatively): Use mark stack.
              (KJS::Collector::markCurrentThreadConservatively): ditto
              (KJS::Collector::markOtherThreadConservatively): ditto
              (KJS::Collector::markProtectedObjects): ditto
              (KJS::Collector::markMainThreadOnlyObjects): ditto
              (KJS::Collector::collect): ditto
              * kjs/collector.h:
              (KJS::Collector::cellMayHaveRefs): Helper for MarkStack.
      
              * kjs/MarkStack.h: Added. The actual mark stack implementation.
              (KJS::MarkStack::push):
              (KJS::MarkStack::pushAtom):
              (KJS::MarkStack::pop):
              (KJS::MarkStack::isEmpty):
              (KJS::MarkStack::reserveCapacity):
      
              Changed mark() methods to markChildren() methods:
              
              * kjs/ExecState.cpp:
              (KJS::ExecState::markChildren):
              * kjs/ExecState.h:
              * kjs/JSWrapperObject.cpp:
              (KJS::JSWrapperObject::markChildren):
              * kjs/JSWrapperObject.h:
              * kjs/array_instance.cpp:
              (KJS::ArrayInstance::markChildren):
              * kjs/array_instance.h:
              * kjs/bool_object.cpp:
              (BooleanInstance::markChildren):
              * kjs/bool_object.h:
              * kjs/error_object.cpp:
              * kjs/error_object.h:
              * kjs/function.cpp:
              (KJS::FunctionImp::markChildren):
              (KJS::Arguments::Arguments):
              (KJS::Arguments::markChildren):
              (KJS::ActivationImp::markChildren):
              * kjs/function.h:
              * kjs/internal.cpp:
              (KJS::GetterSetterImp::markChildren):
              * kjs/interpreter.cpp:
              (KJS::Interpreter::markRoots):
              * kjs/interpreter.h:
              * kjs/list.cpp:
              (KJS::List::markProtectedListsSlowCase):
              * kjs/list.h:
              (KJS::List::markProtectedLists):
              * kjs/object.cpp:
              (KJS::JSObject::markChildren):
              * kjs/object.h:
              (KJS::ScopeChain::markChildren):
              * kjs/property_map.cpp:
              (KJS::PropertyMap::markChildren):
              * kjs/property_map.h:
              * kjs/scope_chain.h:
              * kjs/string_object.cpp:
              (KJS::StringInstance::markChildren):
              * kjs/string_object.h:
      
      JavaScriptGlue:
      
              Reviewed by Darin and Geoff.
      
              Fixups for JavaScriptCore mark stack.
      
              * JSObject.cpp:
              (JSUserObject::Mark):
              * JSObject.h:
              * JSValueWrapper.cpp:
              (JSValueWrapper::JSObjectMark):
              * JSValueWrapper.h:
              * UserObjectImp.cpp:
              * UserObjectImp.h:
      
      WebCore:
      
              Reviewed by Darin and Geoff.
      
              Implement mark stack. This version is not suitable for prime time because it makes a
              huge allocation on every collect, and potentially makes marking of detached subtrees
              slow. But it is a .2% - .4% speedup even without much tweaking.
      
              I replaced mark() methods with markChildren() as usual. One
              optimization that is lost is avoiding walking detached DOM
              subtrees more than once to mark them; since marking is not
              recursive there's no obvious way to bracket operation on the tree
              any more.
      
              * bindings/js/JSDocumentCustom.cpp:
              (WebCore::JSDocument::markChildren):
              * bindings/js/JSNodeCustom.cpp:
              (WebCore::JSNode::markChildren):
              * bindings/js/JSNodeFilterCondition.cpp:
              * bindings/js/JSNodeFilterCondition.h:
              * bindings/js/JSNodeFilterCustom.cpp:
              (WebCore::JSNodeFilter::markChildren):
              * bindings/js/JSNodeIteratorCustom.cpp:
              (WebCore::JSNodeIterator::markChildren):
              * bindings/js/JSTreeWalkerCustom.cpp:
              (WebCore::JSTreeWalker::markChildren):
              * bindings/js/JSXMLHttpRequest.cpp:
              (KJS::JSXMLHttpRequest::markChildren):
              * bindings/js/JSXMLHttpRequest.h:
              * bindings/js/kjs_binding.cpp:
              (KJS::ScriptInterpreter::markDOMNodesForDocument):
              * bindings/js/kjs_binding.h:
              * bindings/js/kjs_events.cpp:
              (WebCore::JSUnprotectedEventListener::markChildren):
              * bindings/js/kjs_events.h:
              * bindings/js/kjs_window.cpp:
              (KJS::Window::markChildren):
              * bindings/js/kjs_window.h:
              * bindings/scripts/CodeGeneratorJS.pm:
              * dom/Node.cpp:
              (WebCore::Node::Node):
              * dom/Node.h:
              * dom/NodeFilter.h:
              * dom/NodeFilterCondition.h:
      
      LayoutTests:
      
              Not reviewed.
              
              - Test cases for "Stack overflow crash in JavaScript garbage collector mark pass"
              http://bugs.webkit.org/show_bug.cgi?id=12216
      
              I have fixed this with the mark stack work.
              
              * fast/js/gc-breadth-2-expected.txt: Added.
              * fast/js/gc-breadth-2.html: Added.
              * fast/js/gc-breadth-expected.txt: Added.
              * fast/js/gc-breadth.html: Added.
              * fast/js/gc-depth-expected.txt: Added.
              * fast/js/gc-depth.html: Added.
              * fast/js/resources/gc-breadth-2.js: Added.
              * fast/js/resources/gc-breadth.js: Added.
              * fast/js/resources/gc-depth.js: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d342e879
  25. 13 Nov, 2007 1 commit
    • eric@webkit.org's avatar
      2007-11-12 Eric Seidel <eric@webkit.org> · dcb807d9
      eric@webkit.org authored
              Reviewed by Oliver.
      
              Add evaluateToInt32 and evaluateUInt32 methods and deploy them.
              Fix a few missing evaluateToBoolean methods
              Deploy all evaluateTo* functions to more nodes to avoid slowdowns
              http://bugs.webkit.org/show_bug.cgi?id=15950
      
              SunSpider claims this is at least a 1.4% speedup.
      
              * kjs/JSImmediate.h:
              (KJS::JSImmediate::getTruncatedInt32):
              (KJS::JSImmediate::toDouble):
              (KJS::JSImmediate::getUInt32):
              * kjs/nodes.cpp:
              (KJS::ExpressionNode::evaluateToNumber):
              (KJS::ExpressionNode::evaluateToInt32):
              (KJS::ExpressionNode::evaluateToUInt32):
              (KJS::NumberNode::evaluateToInt32):
              (KJS::NumberNode::evaluateToUInt32):
              (KJS::ImmediateNumberNode::evaluateToInt32):
              (KJS::ImmediateNumberNode::evaluateToUInt32):
              (KJS::ResolveNode::evaluate):
              (KJS::ResolveNode::evaluateToNumber):
              (KJS::ResolveNode::evaluateToBoolean):
              (KJS::ResolveNode::evaluateToInt32):
              (KJS::ResolveNode::evaluateToUInt32):
              (KJS::LocalVarAccessNode::evaluateToInt32):
              (KJS::LocalVarAccessNode::evaluateToUInt32):
              (KJS::BracketAccessorNode::evaluateToNumber):
              (KJS::BracketAccessorNode::evaluateToBoolean):
              (KJS::BracketAccessorNode::evaluateToInt32):
              (KJS::BracketAccessorNode::evaluateToUInt32):
              (KJS::DotAccessorNode::inlineEvaluate):
              (KJS::DotAccessorNode::evaluate):
              (KJS::DotAccessorNode::evaluateToNumber):
              (KJS::DotAccessorNode::evaluateToBoolean):
              (KJS::DotAccessorNode::evaluateToInt32):
              (KJS::DotAccessorNode::evaluateToUInt32):
              (KJS::NewExprNode::inlineEvaluate):
              (KJS::NewExprNode::evaluate):
              (KJS::NewExprNode::evaluateToNumber):
              (KJS::NewExprNode::evaluateToBoolean):
              (KJS::NewExprNode::evaluateToInt32):
              (KJS::NewExprNode::evaluateToUInt32):
              (KJS::FunctionCallResolveNode::inlineEvaluate):
              (KJS::FunctionCallResolveNode::evaluate):
              (KJS::FunctionCallResolveNode::evaluateToNumber):
              (KJS::FunctionCallResolveNode::evaluateToBoolean):
              (KJS::FunctionCallResolveNode::evaluateToInt32):
              (KJS::FunctionCallResolveNode::evaluateToUInt32):
              (KJS::LocalVarFunctionCallNode::evaluate):
              (KJS::LocalVarFunctionCallNode::evaluateToNumber):
              (KJS::LocalVarFunctionCallNode::evaluateToBoolean):
              (KJS::LocalVarFunctionCallNode::evaluateToInt32):
              (KJS::LocalVarFunctionCallNode::evaluateToUInt32):
              (KJS::FunctionCallDotNode::evaluate):
              (KJS::FunctionCallDotNode::evaluateToNumber):
              (KJS::FunctionCallDotNode::evaluateToBoolean):
              (KJS::FunctionCallDotNode::evaluateToInt32):
              (KJS::FunctionCallDotNode::evaluateToUInt32):
              (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
              (KJS::PostDecLocalVarNode::evaluateToNumber):
              (KJS::PostDecLocalVarNode::evaluateToBoolean):
              (KJS::PostDecLocalVarNode::evaluateToInt32):
              (KJS::PostDecLocalVarNode::evaluateToUInt32):
              (KJS::typeStringForValue):
              (KJS::UnaryPlusNode::evaluate):
              (KJS::UnaryPlusNode::evaluateToBoolean):
              (KJS::UnaryPlusNode::evaluateToNumber):
              (KJS::UnaryPlusNode::evaluateToInt32):
              (KJS::BitwiseNotNode::inlineEvaluateToInt32):
              (KJS::BitwiseNotNode::evaluate):
              (KJS::BitwiseNotNode::evaluateToNumber):
              (KJS::BitwiseNotNode::evaluateToBoolean):
              (KJS::BitwiseNotNode::evaluateToInt32):
              (KJS::MultNode::evaluateToBoolean):
              (KJS::MultNode::evaluateToInt32):
              (KJS::MultNode::evaluateToUInt32):
              (KJS::DivNode::evaluateToInt32):
              (KJS::DivNode::evaluateToUInt32):
              (KJS::ModNode::evaluateToBoolean):
              (KJS::ModNode::evaluateToInt32):
              (KJS::ModNode::evaluateToUInt32):
              (KJS::AddNode::evaluateToNumber):
              (KJS::AddNode::evaluateToInt32):
              (KJS::AddNode::evaluateToUInt32):
              (KJS::AddNumbersNode::evaluateToInt32):
              (KJS::AddNumbersNode::evaluateToUInt32):
              (KJS::SubNode::evaluateToInt32):
              (KJS::SubNode::evaluateToUInt32):
              (KJS::LeftShiftNode::inlineEvaluateToInt32):
              (KJS::LeftShiftNode::evaluate):
              (KJS::LeftShiftNode::evaluateToNumber):
              (KJS::LeftShiftNode::evaluateToInt32):
              (KJS::RightShiftNode::inlineEvaluateToInt32):
              (KJS::RightShiftNode::evaluate):
              (KJS::RightShiftNode::evaluateToNumber):
              (KJS::RightShiftNode::evaluateToInt32):
              (KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32):
              (KJS::UnsignedRightShiftNode::evaluate):
              (KJS::UnsignedRightShiftNode::evaluateToNumber):
              (KJS::UnsignedRightShiftNode::evaluateToInt32):
              (KJS::LessNode::inlineEvaluateToBoolean):
              (KJS::LessNode::evaluate):
              (KJS::LessNode::evaluateToBoolean):
              (KJS::LessNumbersNode::inlineEvaluateToBoolean):
              (KJS::LessNumbersNode::evaluate):
              (KJS::LessNumbersNode::evaluateToBoolean):
              (KJS::LessStringsNode::inlineEvaluateToBoolean):
              (KJS::LessStringsNode::evaluate):
              (KJS::BitAndNode::evaluate):
              (KJS::BitAndNode::inlineEvaluateToInt32):
              (KJS::BitAndNode::evaluateToNumber):
              (KJS::BitAndNode::evaluateToBoolean):
              (KJS::BitAndNode::evaluateToInt32):
              (KJS::BitXOrNode::inlineEvaluateToInt32):
              (KJS::BitXOrNode::evaluate):
              (KJS::BitXOrNode::evaluateToNumber):
              (KJS::BitXOrNode::evaluateToBoolean):
              (KJS::BitXOrNode::evaluateToInt32):
              (KJS::BitOrNode::inlineEvaluateToInt32):
              (KJS::BitOrNode::evaluate):
              (KJS::BitOrNode::evaluateToNumber):
              (KJS::BitOrNode::evaluateToBoolean):
              (KJS::BitOrNode::evaluateToInt32):
              (KJS::ConditionalNode::evaluateToNumber):
              (KJS::ConditionalNode::evaluateToInt32):
              (KJS::ConditionalNode::evaluateToUInt32):
              (KJS::valueForReadModifyAssignment):
              (KJS::AssignExprNode::evaluate):
              (KJS::AssignExprNode::evaluateToBoolean):
              (KJS::AssignExprNode::evaluateToNumber):
              (KJS::AssignExprNode::evaluateToInt32):
              (KJS::VarDeclNode::handleSlowCase):
              * kjs/nodes.h:
              (KJS::FunctionCallResolveNode::precedence):
              (KJS::AddNode::precedence):
              (KJS::AddNode::):
              (KJS::LessNumbersNode::):
              (KJS::LessStringsNode::):
              * kjs/value.cpp:
              (KJS::JSValue::toInt32SlowCase):
              (KJS::JSValue::toUInt32SlowCase):
              * kjs/value.h:
              (KJS::JSValue::asCell):
              (KJS::JSValue::toInt32):
              (KJS::JSValue::toUInt32):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dcb807d9
  26. 11 Nov, 2007 1 commit
    • eseidel's avatar
      2007-11-10 Eric Seidel <eric@webkit.org> · dc7c497d
      eseidel authored
              Reviewed by darin.
      
              Add simple type inferencing to the parser, and create custom
              AddNode and LessNode subclasses based on inferred types.
              http://bugs.webkit.org/show_bug.cgi?id=15884
      
              SunSpider claims this is at least a 0.5% speedup.
      
              * JavaScriptCore.exp:
              * kjs/grammar.y:
              * kjs/internal.cpp:
              (KJS::NumberImp::getPrimitiveNumber):
              (KJS::GetterSetterImp::getPrimitiveNumber):
              * kjs/internal.h:
              * kjs/lexer.cpp:
              (KJS::Lexer::lex):
              * kjs/nodes.cpp:
              (KJS::Node::Node):
              (KJS::StringNode::evaluate):
              (KJS::StringNode::evaluateToNumber):
              (KJS::StringNode::evaluateToBoolean):
              (KJS::RegExpNode::evaluate):
              (KJS::UnaryPlusNode::optimizeVariableAccess):
              (KJS::AddNode::evaluate):
              (KJS::AddNode::evaluateToNumber):
              (KJS::AddNumbersNode::inlineEvaluateToNumber):
              (KJS::AddNumbersNode::evaluate):
              (KJS::AddNumbersNode::evaluateToNumber):
              (KJS::AddStringsNode::evaluate):
              (KJS::AddStringLeftNode::evaluate):
              (KJS::AddStringRightNode::evaluate):
              (KJS::lessThan):
              (KJS::lessThanEq):
              (KJS::LessNumbersNode::evaluate):
              (KJS::LessStringsNode::evaluate):
              * kjs/nodes.h:
              (KJS::ExpressionNode::):
              (KJS::RegExpNode::):
              (KJS::RegExpNode::precedence):
              (KJS::TypeOfResolveNode::):
              (KJS::LocalVarTypeOfNode::):
              (KJS::UnaryPlusNode::):
              (KJS::UnaryPlusNode::precedence):
              (KJS::AddNode::):
              (KJS::AddNode::precedence):
              (KJS::AddNumbersNode::):
              (KJS::AddStringLeftNode::):
              (KJS::AddStringRightNode::):
              (KJS::AddStringsNode::):
              (KJS::LessNode::):
              (KJS::LessNode::precedence):
              (KJS::LessNumbersNode::):
              (KJS::LessStringsNode::):
              * kjs/nodes2string.cpp:
              (KJS::StringNode::streamTo):
              * kjs/object.cpp:
              * kjs/object.h:
              * kjs/value.h:
              (KJS::JSValue::getPrimitiveNumber):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dc7c497d
  27. 09 Nov, 2007 1 commit
  28. 08 Nov, 2007 3 commits
    • darin@apple.com's avatar
      Reviewed by Oliver. · 6a95834c
      darin@apple.com authored
              - http://bugs.webkit.org/show_bug.cgi?id=15904
                more speed-ups possible by tightening up int version of JSImmediate
      
              1% improvement of SunSpider
      
              * kjs/JSImmediate.h: Eliminate the now-unneeded FPBitValues struct template.
              (KJS::JSImmediate::from): Overload for most numeric types; many types can
              do fewer branches and checks.
              (KJS::JSImmediate::getUInt32): Removed unneeded check for undefined.
              (KJS::JSImmediate::getTruncatedInt32): Ditto.
              (KJS::JSImmediate::getTruncatedUInt32): Ditto. There's no difference any more
              between getUInt32 and getTruncatedUInt32, so that's worth a rename and merge later.
      
              * kjs/grammar.y: Update since fromDouble is now just from.
              * kjs/nodes.h: Ditto.
      
              * kjs/value.h: (KJS::jsNumber): Overload for most numeric types.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6a95834c
    • oliver's avatar
      Add a fast path for bitwise-and of two immediate numbers for a 0.7%... · 678e6b8c
      oliver authored
      Add a fast path for bitwise-and of two immediate numbers for a 0.7% improvement in SunSpider (4% bitop improvement).
      
      Reviewed by Sam.
      
      This only improves bitwise-and performance, as the additional logic required
      for similar code paths on or, xor, and shifting requires additional operations
      and branches that negate (and in certain cases, regress) any advantage we might
      otherwise receive.
      
      This improves performance on all bitop tests, the cryptography tests, as well as
      the string-base64 and string-unpack-code tests.  No significant degradation on
      any other tests.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      678e6b8c
    • oliver's avatar
      Replace the use of floats for immediate values with the use of integers for a... · a1fe5a42
      oliver authored
      Replace the use of floats for immediate values with the use of integers for a 4.5% improvement in SunSpider.
      
      Reviewed by Darin.
      
      Unfortunately this change results in NaN, +Inf, -Inf, and -0 being heap allocated now, but
      we should now have faster array access, faster immediate to double conversion, and the
      potential to further improve bitwise operators in future.
      
      This also removes the need for unions to avoid strict aliasing problems when extracting
      a value from immediates.
      
      * kjs/JSImmediate.h:
      (KJS::):
      (KJS::JSImmediate::trueImmediate):
      (KJS::JSImmediate::falseImmediate):
      (KJS::JSImmediate::undefinedImmediate):
      (KJS::JSImmediate::nullImmediate):
      (KJS::JSImmediate::toBoolean):
      * kjs/value.h:
      (KJS::jsNaN):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a1fe5a42
  29. 06 Nov, 2007 1 commit
    • ggaren@apple.com's avatar
      Reviewed by Eric Seidel. · 2954278c
      ggaren@apple.com authored
              
              Added toJSNumber, a fast path for converting a JSValue to a JS number,
              and deployed it in postfix expressions. In the fast case this 
              eliminates a call to jsNumber.
              
              0.4% speedup on SunSpider.
      
              * ChangeLog:
              * kjs/nodes.cpp:
              (KJS::PostIncResolveNode::evaluate):
              (KJS::PostIncLocalVarNode::evaluate):
              (KJS::PostDecResolveNode::evaluate):
              (KJS::PostDecLocalVarNode::evaluate):
              (KJS::PostIncBracketNode::evaluate):
              (KJS::PostDecBracketNode::evaluate):
              (KJS::PostIncDotNode::evaluate):
              (KJS::PostDecDotNode::evaluate):
              (KJS::UnaryPlusNode::evaluate):
              * kjs/value.h:
              (KJS::JSValue::toJSNumber):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2954278c
  30. 02 Nov, 2007 1 commit
  31. 27 Oct, 2007 1 commit
  32. 26 Oct, 2007 2 commits
    • mjs's avatar
      Reviewed by Oliver. · 098cbb41
      mjs authored
              
              - encourage GCC a little harder to inline a few hot functions for 1.5% improvement on SunSpider.
      
              * kjs/value.h:
              (KJS::JSValue::getUInt32):
              (KJS::JSValue::getTruncatedInt32):
              (KJS::JSValue::toNumber):
              * wtf/PassRefPtr.h:
              (WTF::PassRefPtr::~PassRefPtr):
              * wtf/RefPtr.h:
              (WTF::RefPtr::operator->):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      098cbb41
    • darin's avatar
      JavaScriptCore: · 1622f9e8
      darin authored
              Reviewed by Maciej.
      
              - http://bugs.webkit.org/show_bug.cgi?id=15703
                fix numeric functions -- improve correctness and speed
      
              Gives about 1% gain on SunSpider.
      
              * kjs/value.h: Added toIntegerPreserveNan, removed toUInt16.
              (KJS::JSValue::toInt32): Changed to call getTruncatedInt32 in a way that works
              with both immediate and number values.
              (KJS::JSValue::toUInt32): Ditto.
              * kjs/value.cpp:
              (KJS::JSValue::toInteger): Moved the logic from roundValue here, with a couple
              differences. One is that it now correctly returns 0 for NaN, and another is that
              there's no special case for 0 or infinity, since the general case already handles
              those correctly.
              (KJS::JSValue::toIntegerPreserveNaN): Added. Like toInteger, but without the
              check for NaN.
              (KJS::JSValue::toInt32SlowCase): Call toNumber instead of roundValue. The
              truncation done by the typecast already does the necessary truncation that
              roundValue was doing.
              (KJS::JSValue::toUInt32SlowCase): Ditto.
              (KJS::JSValue::toUInt16): Removed.
      
              * kjs/internal.h: Removed roundValue.
              * kjs/internal.cpp: Ditto.
      
              * kjs/array_object.cpp: (KJS::ArrayProtoFunc::callAsFunction): Remove unneeded
              code to handle NaN in Array.slice; toInteger now never returns NaN as specified.
      
              * kjs/date_object.cpp:
              (KJS::fillStructuresUsingTimeArgs): Replaced call to roundValue with a call to
              toNumber as specified.
              (KJS::DateProtoFunc::callAsFunction): In SetTime case, replaced call to roundValue
              with a call to toNumber and timeClip as specified.
              (KJS::DateObjectImp::construct): Removed unnecessary checks of numArgs in cases
              where the default behavior of toInt32 (returning 0) was already correct. Replaced
              call to roundValue with a call to toNumber as specified.
              (KJS::DateObjectFuncImp::callAsFunction): Ditto.
      
              * kjs/math_object.cpp: (MathFuncImp::callAsFunction): Removed unnecessary special
              cases for the pow function that the library already handles correctly.
      
              * kjs/number_object.cpp: (NumberProtoFunc::callAsFunction): Changed ToString to
              call toIntegerPreserveNaN, so we can continue to handle the NaN case differently.
              The real toInteger now returns 0 for NaN. Took out unneeded special case in
              ToFixed for undefined; was only needed because our toInteger was wrong. Same
              thing in ToExponential. Changed ToPrecision to call toIntegerPreserveNaN.
      
              * kjs/string_object.cpp:
              (KJS::StringProtoFunc::callAsFunction): Took out CharAt and CharCodeAt special
              cases for undefined that were only needed because toInteger was wrong. Same in
              IndexOf, and was able to remove some special cases. In LastIndexOf, used
              toIntegerPreserveNaN, but was able to remove some special cases there too.
              Changed Substr implementation to preserve correct behavior with the change
              to toInteger and match the specification. Also made sure we weren't converting
              an out of range double to an int.
              (KJS::StringObjectFuncImp::callAsFunction): Changed constructor to just use
              toUInt32, because truncating toUInt32 to 16 bits is the same thing and there's
              no reason to have toUInt16 as a second, less-optimized function that's only
              called at this one call site.
      
              * wtf/MathExtras.h: Added trunc function for Windows.
      
      LayoutTests:
      
              Reviewed by Maciej.
      
              - test changes for http://bugs.webkit.org/show_bug.cgi?id=15703
                fix numeric functions -- improve correctness and speed
      
              * fast/js/resources/char-at.js: Updated test to expect that we get the first
              character if we pass NaN to charAt and charCodeAt; it's what the specification
              asks for and matches other browsers too.
              * fast/js/char-at-expected.txt: Updated.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27095 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1622f9e8
  33. 25 Oct, 2007 1 commit
    • mjs's avatar
      Reviewed by Oliver. · df5526f8
      mjs authored
              - fold together toPrimitive() and toNumber() conversions for 0.5% gain on SunSpider
      
              * kjs/nodes.cpp:
              (KJS::SubNode::evaluate): Subtract directly, since toPrimitive() is not
              adding any value over toNumber() here.
              (KJS::valueForReadModifyAssignment): Ditto.
              (KJS::lessThan): Use new getPrimitiveNumber() method to avoid some virtual calls
              and branches.
              (KJS::lessThanEq): Ditto.
              * JavaScriptCore.exp: Export new functions as needed.
              * kjs/value.h:
              (KJS::JSValue::toPrimitive): Fixed formatting.
              (KJS::JSValue::getPrimitiveNumber): New method - this simultaneously converts
              to number and tells you whether a toPrimitive() conversion with a Number hint
              would have given a string.
              * kjs/internal.cpp:
              (KJS::StringImp::getPrimitiveNumber): Implemented. 
              (KJS::NumberImp::getPrimitiveNumber): ditto
              (KJS::GetterSetterImp::getPrimitiveNumber): ditto
              (KJS::StringImp::toPrimitive): Fixed formatting.
              (KJS::NumberImp::toPrimitive): ditto
              (KJS::GetterSetterImp::toPrimitive): ditto
              * kjs/internal.h:
              * kjs/object.cpp:
              (KJS::JSObject::getPrimitiveNumber): Implemented.
              * kjs/object.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      df5526f8