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. 05 Oct, 2008 1 commit
    • mjs@apple.com's avatar
      2008-10-05 Maciej Stachowiak <mjs@apple.com> · 05456d94
      mjs@apple.com authored
              Reviewed by Oliver Hunt.
              
              - fixed "REGRESSION (r37297): fast/js/deep-recursion-test takes too long and times out"
              https://bugs.webkit.org/show_bug.cgi?id=21375
              
              The problem is that dynamicGlobalObject had become O(N) in number
              of call frames, but unwinding the stack for an exception called it
              for every call frame, resulting in O(N^2) behavior for an
              exception thrown from inside deep recursion.
      
              Instead of doing it that way, stash the dynamic global object in JSGlobalData.
              
              * JavaScriptCore.exp:
              * VM/Machine.cpp:
              (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Helper class to temporarily
              store and later restore a dynamicGlobalObject in JSGlobalData.
              (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
              (JSC::Machine::execute): In each version, establish a DynamicGlobalObjectScope.
              For ProgramNode, always establish set new dynamicGlobalObject, for FunctionBody and Eval,
              only if none is currently set.
              * VM/Machine.h:
              * kjs/ExecState.h:
              * kjs/JSGlobalData.cpp:
              (JSC::JSGlobalData::JSGlobalData): Ininitalize new dynamicGlobalObject field to 0.
              * kjs/JSGlobalData.h:
              * kjs/JSGlobalObject.h:
              (JSC::ExecState::dynamicGlobalObject): Moved here from ExecState for benefit of inlining.
              Return lexical global object if this is a globalExec(), otherwise look in JSGlobalData
              for the one stashed there.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      05456d94
  3. 03 Oct, 2008 2 commits
    • mjs@apple.com's avatar
      2008-10-03 Maciej Stachowiak <mjs@apple.com> · 43625524
      mjs@apple.com authored
              Reviewed by Cameron Zwarich.
              
              - Some code cleanup to how we handle code features.
              
              1) Rename FeatureInfo typedef to CodeFeatures.
              2) Rename NodeFeatureInfo template to NodeInfo.
              3) Keep CodeFeature bitmask in ScopeNode instead of trying to break it out into individual bools.
              4) Rename misleadingly named "needsClosure" method to "containsClosures", which better describes the meaning
              of ClosureFeature.
              5) Make setUsersArguments() not take an argument since it only goes one way.
      
              * JavaScriptCore.exp:
              * VM/CodeBlock.h:
              (JSC::CodeBlock::CodeBlock):
              * kjs/NodeInfo.h:
              * kjs/Parser.cpp:
              (JSC::Parser::didFinishParsing):
              * kjs/Parser.h:
              (JSC::Parser::parse):
              * kjs/grammar.y:
              * kjs/nodes.cpp:
              (JSC::ScopeNode::ScopeNode):
              (JSC::ProgramNode::ProgramNode):
              (JSC::ProgramNode::create):
              (JSC::EvalNode::EvalNode):
              (JSC::EvalNode::create):
              (JSC::FunctionBodyNode::FunctionBodyNode):
              (JSC::FunctionBodyNode::create):
              * kjs/nodes.h:
              (JSC::ScopeNode::usesEval):
              (JSC::ScopeNode::containsClosures):
              (JSC::ScopeNode::usesArguments):
              (JSC::ScopeNode::setUsesArguments):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      43625524
    • darin@apple.com's avatar
      JavaScriptCore: · 3d73fee8
      darin@apple.com authored
      2008-10-03  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff Garen.
      
              - next step of https://bugs.webkit.org/show_bug.cgi?id=21295
                Turn ExecState into a call frame pointer.
      
              Remove m_globalObject and m_globalData from ExecState.
      
              SunSpider says this is a wash (slightly faster but not statistically
              significant); which is good enough since it's a preparation step and
              not supposed to be a spedup.
      
              * API/JSCallbackFunction.cpp:
              (JSC::JSCallbackFunction::JSCallbackFunction):
              * kjs/ArrayConstructor.cpp:
              (JSC::ArrayConstructor::ArrayConstructor):
              * kjs/BooleanConstructor.cpp:
              (JSC::BooleanConstructor::BooleanConstructor):
              * kjs/DateConstructor.cpp:
              (JSC::DateConstructor::DateConstructor):
              * kjs/ErrorConstructor.cpp:
              (JSC::ErrorConstructor::ErrorConstructor):
              * kjs/FunctionPrototype.cpp:
              (JSC::FunctionPrototype::FunctionPrototype):
              * kjs/JSFunction.cpp:
              (JSC::JSFunction::JSFunction):
              * kjs/NativeErrorConstructor.cpp:
              (JSC::NativeErrorConstructor::NativeErrorConstructor):
              * kjs/NumberConstructor.cpp:
              (JSC::NumberConstructor::NumberConstructor):
              * kjs/ObjectConstructor.cpp:
              (JSC::ObjectConstructor::ObjectConstructor):
              * kjs/PrototypeFunction.cpp:
              (JSC::PrototypeFunction::PrototypeFunction):
              * kjs/RegExpConstructor.cpp:
              (JSC::RegExpConstructor::RegExpConstructor):
              * kjs/StringConstructor.cpp:
              (JSC::StringConstructor::StringConstructor):
              Pass JSGlobalData* instead of ExecState* to the InternalFunction
              constructor.
      
              * API/OpaqueJSString.cpp: Added now-needed include.
      
              * JavaScriptCore.exp: Updated.
      
              * VM/CTI.cpp:
              (JSC::CTI::emitSlowScriptCheck): Changed to use ARGS_globalData
              instead of ARGS_exec.
      
              * VM/CTI.h: Added a new argument to the CTI, the global data pointer.
              While it's possible to get to the global data pointer using the
              ExecState pointer, it's slow enough that it's better to just keep
              it around in the CTI arguments.
      
              * VM/CodeBlock.h: Moved the CodeType enum here from ExecState.h.
      
              * VM/Machine.cpp:
              (JSC::Machine::execute): Pass fewer arguments when constructing
              ExecState, and pass the global data pointer when invoking CTI.
              (JSC::Machine::firstCallFrame): Added. Used to get the dynamic global
              object, which is in the scope chain of the first call frame.
              (JSC::Machine::cti_op_add): Use globalData instead of exec when
              possible, to keep fast cases fast, since it's now more expensive to
              get to it through the exec pointer.
              (JSC::Machine::cti_timeout_check): Ditto.
              (JSC::Machine::cti_op_put_by_id_second): Ditto.
              (JSC::Machine::cti_op_get_by_id_second): Ditto.
              (JSC::Machine::cti_op_mul): Ditto.
              (JSC::Machine::cti_vm_compile): Ditto.
              (JSC::Machine::cti_op_get_by_val): Ditto.
              (JSC::Machine::cti_op_sub): Ditto.
              (JSC::Machine::cti_op_put_by_val): Ditto.
              (JSC::Machine::cti_op_put_by_val_array): Ditto.
              (JSC::Machine::cti_op_negate): Ditto.
              (JSC::Machine::cti_op_div): Ditto.
              (JSC::Machine::cti_op_pre_dec): Ditto.
              (JSC::Machine::cti_op_post_inc): Ditto.
              (JSC::Machine::cti_op_lshift): Ditto.
              (JSC::Machine::cti_op_bitand): Ditto.
              (JSC::Machine::cti_op_rshift): Ditto.
              (JSC::Machine::cti_op_bitnot): Ditto.
              (JSC::Machine::cti_op_mod): Ditto.
              (JSC::Machine::cti_op_post_dec): Ditto.
              (JSC::Machine::cti_op_urshift): Ditto.
              (JSC::Machine::cti_op_bitxor): Ditto.
              (JSC::Machine::cti_op_bitor): Ditto.
              (JSC::Machine::cti_op_call_eval): Ditto.
              (JSC::Machine::cti_op_throw): Ditto.
              (JSC::Machine::cti_op_is_string): Ditto.
              (JSC::Machine::cti_op_debug): Ditto.
              (JSC::Machine::cti_vm_throw): Ditto.
      
              * VM/Machine.h: Added firstCallFrame.
      
              * kjs/DebuggerCallFrame.cpp:
              (JSC::DebuggerCallFrame::evaluate): Pass fewer arguments when
              constructing ExecState.
      
              * kjs/ExecState.cpp: Deleted contents. Later we'll remove the
              file altogether.
      
              * kjs/ExecState.h: Removed m_globalObject and m_globalData.
              Moved CodeType into another header.
              (JSC::ExecState::ExecState): Take only a single argument, a
              call frame pointer.
              (JSC::ExecState::dynamicGlobalObject): Get the object from
              the first call frame since it's no longer stored.
              (JSC::ExecState::globalData): Get the global data from the
              scope chain, since we no longer store a pointer to it here.
              (JSC::ExecState::identifierTable): Ditto.
              (JSC::ExecState::propertyNames): Ditto.
              (JSC::ExecState::emptyList): Ditto.
              (JSC::ExecState::lexer): Ditto.
              (JSC::ExecState::parser): Ditto.
              (JSC::ExecState::machine): Ditto.
              (JSC::ExecState::arrayTable): Ditto.
              (JSC::ExecState::dateTable): Ditto.
              (JSC::ExecState::mathTable): Ditto.
              (JSC::ExecState::numberTable): Ditto.
              (JSC::ExecState::regExpTable): Ditto.
              (JSC::ExecState::regExpConstructorTable): Ditto.
              (JSC::ExecState::stringTable): Ditto.
              (JSC::ExecState::heap): Ditto.
      
              * kjs/FunctionConstructor.cpp:
              (JSC::FunctionConstructor::FunctionConstructor): Pass
              JSGlobalData* instead of ExecState* to the InternalFunction
              constructor.
              (JSC::constructFunction): Pass the global data pointer when
              constructing a new scope chain.
      
              * kjs/InternalFunction.cpp:
              (JSC::InternalFunction::InternalFunction): Take a JSGlobalData*
              instead of an ExecState*. Later we can change more places to
              work this way -- it's more efficient to take the type you need
              since the caller might already have it.
              * kjs/InternalFunction.h: Ditto.
      
              * kjs/JSCell.h:
              (JSC::JSCell::operator new): Added an overload that takes a
              JSGlobalData* so you can construct without an ExecState*.
      
              * kjs/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::init): Moved creation of the global scope
              chain in here, since it now requires a pointer to the global data.
              Moved the initialization of the call frame in here since it requires
              the global scope chain node. Removed the extra argument to ExecState
              when creating the global ExecState*.
              * kjs/JSGlobalObject.h: Removed initialization of globalScopeChain
              and the call frame from the JSGlobalObjectData constructor. Added
              a thisValue argument to the init function.
      
              * kjs/JSNumberCell.cpp: Added versions of jsNumberCell that take
              JSGlobalData* rather than ExecState*.
              * kjs/JSNumberCell.h:
              (JSC::JSNumberCell::operator new): Added a version that takes
              JSGlobalData*.
              (JSC::JSNumberCell::JSNumberCell): Ditto.
              (JSC::jsNumber): Ditto.
              * kjs/JSString.cpp:
              (JSC::jsString): Ditto.
              (JSC::jsSubstring): Ditto.
              (JSC::jsOwnedString): Ditto.
              * kjs/JSString.h:
              (JSC::JSString::JSString): Changed to take JSGlobalData*.
              (JSC::jsEmptyString): Added a version that takes JSGlobalData*.
              (JSC::jsSingleCharacterString): Ditto.
              (JSC::jsSingleCharacterSubstring): Ditto.
              (JSC::jsNontrivialString): Ditto.
              (JSC::JSString::getIndex): Ditto.
              (JSC::jsString): Ditto.
              (JSC::jsSubstring): Ditto.
              (JSC::jsOwnedString): Ditto.
      
              * kjs/ScopeChain.h: Added a globalData pointer to each node.
              (JSC::ScopeChainNode::ScopeChainNode): Initialize the globalData
              pointer.
              (JSC::ScopeChainNode::push): Set the global data pointer in the
              new node.
              (JSC::ScopeChain::ScopeChain): Take a globalData argument.
      
              * kjs/SmallStrings.cpp:
              (JSC::SmallStrings::createEmptyString): Take JSGlobalData* instead of
              ExecState*.
              (JSC::SmallStrings::createSingleCharacterString): Ditto.
              * kjs/SmallStrings.h:
              (JSC::SmallStrings::emptyString): Ditto.
              (JSC::SmallStrings::singleCharacterString): Ditto.
      
      WebCore:
      
      2008-10-03  Darin Adler  <darin@apple.com>
      
              Reviewed by Geoff Garen.
      
              - next step of https://bugs.webkit.org/show_bug.cgi?id=21295
                Turn ExecState into a call frame pointer.
      
              Remove m_globalObject and m_globalData from ExecState.
      
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::JSDOMWindowBaseData::JSDOMWindowBaseData):
              Removed an argument now that JSGlobalObject doesn't need it any more.
              (WebCore::JSDOMWindowBase::JSDOMWindowBase): Removed the argument from
              the JSDOMWindowBaseData constructor, and added the this argument to the
              JSGlobalObject constructor. This is because a couple key bits of
              initialization moved from the data constructor to the JSGlobalObject
              constructor.
              * bindings/js/JSDOMWindowBase.h: Ditto.
      
              * bridge/qt/qt_runtime.cpp:
              (JSC::Bindings::QtRuntimeMethod::QtRuntimeMethod):
              * bridge/runtime_method.cpp:
              (JSC::RuntimeMethod::RuntimeMethod):
              Pass JSGlobalData* instead of ExecState* to the InternalFunction
              constructor.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3d73fee8
  4. 02 Oct, 2008 2 commits
    • ap@webkit.org's avatar
      Forgot to land JavaScriptCore.exp with the previous check-in. · 62103473
      ap@webkit.org authored
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62103473
    • ggaren@apple.com's avatar
      JavaScriptCore: · 69e9ccfb
      ggaren@apple.com authored
      2008-10-01  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Darin Adler and Cameron Zwarich.
      
              Preliminary step toward dynamic recompilation: Standardized and
              simplified the parsing interface.
              
              The main goal in this patch is to make it easy to ask for a duplicate
              compilation, and get back a duplicate result -- same source URL, same
              debugger / profiler ID, same toString behavior, etc.
              
              The basic unit of compilation and evaluation is now SourceCode, which
              encompasses a SourceProvider, a range in that provider, and a starting
              line number.
      
              A SourceProvider now encompasses a source URL, and *is* a source ID,
              since a pointer is a unique identifier.
      
              * API/JSBase.cpp:
              (JSEvaluateScript):
              (JSCheckScriptSyntax): Provide a SourceCode to the Interpreter, since
              other APIs are no longer supported.
              
              * VM/CodeBlock.h:
              (JSC::EvalCodeCache::get): Provide a SourceCode to the Interpreter, since
              other APIs are no longer supported.
              (JSC::CodeBlock::CodeBlock): ASSERT something that used to be ASSERTed
              by our caller -- this is a better bottleneck.
      
              * VM/CodeGenerator.cpp:
              (JSC::CodeGenerator::CodeGenerator): Updated for the fact that
              FunctionBodyNode's parameters are no longer a WTF::Vector.
      
              * kjs/Arguments.cpp:
              (JSC::Arguments::Arguments): ditto
      
              * kjs/DebuggerCallFrame.cpp:
              (JSC::DebuggerCallFrame::evaluate): Provide a SourceCode to the Parser,
              since other APIs are no longer supported.
      
              * kjs/FunctionConstructor.cpp:
              (JSC::constructFunction): Provide a SourceCode to the Parser, since
              other APIs are no longer supported. Adopt FunctionBodyNode's new
              "finishParsing" API.
      
              * kjs/JSFunction.cpp:
              (JSC::JSFunction::lengthGetter):
              (JSC::JSFunction::getParameterName): Updated for the fact that
              FunctionBodyNode's parameters are no longer a wtf::Vector.
      
              * kjs/JSFunction.h: Nixed some cruft.
      
              * kjs/JSGlobalObjectFunctions.cpp:
              (JSC::globalFuncEval): Provide a SourceCode to the Parser, since
              other APIs are no longer supported. 
      
              * kjs/Parser.cpp:
              (JSC::Parser::parse): Require a SourceCode argument, instead of a bunch
              of broken out parameters. Stop tracking sourceId as an integer, since we
              use the SourceProvider pointer for this now. Don't clamp the
              startingLineNumber, since SourceCode does that now.
      
              * kjs/Parser.h:
              (JSC::Parser::parse): Standardized the parsing interface to require a
              SourceCode.
      
              * kjs/Shell.cpp:
              (functionRun):
              (functionLoad):
              (prettyPrintScript):
              (runWithScripts):
              (runInteractive): Provide a SourceCode to the Interpreter, since
              other APIs are no longer supported.
      
              * kjs/SourceProvider.h:
              (JSC::SourceProvider::SourceProvider):
              (JSC::SourceProvider::url):
              (JSC::SourceProvider::asId):
              (JSC::UStringSourceProvider::create):
              (JSC::UStringSourceProvider::UStringSourceProvider): Added new
              responsibilities described above.
      
              * kjs/SourceRange.h:
              (JSC::SourceCode::SourceCode):
              (JSC::SourceCode::toString):
              (JSC::SourceCode::provider):
              (JSC::SourceCode::firstLine):
              (JSC::SourceCode::data):
              (JSC::SourceCode::length): Added new responsibilities described above.
              Renamed SourceRange to SourceCode, based on review feedback. Added
              a makeSource function for convenience.
      
              * kjs/debugger.h: Provide a SourceCode to the client, since other APIs
              are no longer supported.
      
              * kjs/grammar.y: Provide startingLineNumber when creating a SourceCode.
      
              * kjs/debugger.h: Treat sourceId as intptr_t to avoid loss of precision
              on 64bit platforms.
      
              * kjs/interpreter.cpp:
              (JSC::Interpreter::checkSyntax):
              (JSC::Interpreter::evaluate):
              * kjs/interpreter.h: Require a SourceCode instead of broken out arguments.
      
              * kjs/lexer.cpp:
              (JSC::Lexer::setCode):
              * kjs/lexer.h:
              (JSC::Lexer::sourceRange): Fold together the SourceProvider and line number
              into a SourceCode. Fixed a bug where the Lexer would accidentally keep
              alive the last SourceProvider forever.
      
              * kjs/nodes.cpp:
              (JSC::ScopeNode::ScopeNode):
              (JSC::ProgramNode::ProgramNode):
              (JSC::ProgramNode::create):
              (JSC::EvalNode::EvalNode):
              (JSC::EvalNode::generateCode):
              (JSC::EvalNode::create):
              (JSC::FunctionBodyNode::FunctionBodyNode):
              (JSC::FunctionBodyNode::finishParsing):
              (JSC::FunctionBodyNode::create):
              (JSC::FunctionBodyNode::generateCode):
              (JSC::ProgramNode::generateCode):
              (JSC::FunctionBodyNode::paramString):
              * kjs/nodes.h:
              (JSC::ScopeNode::):
              (JSC::ScopeNode::sourceId):
              (JSC::FunctionBodyNode::):
              (JSC::FunctionBodyNode::parameterCount):
              (JSC::FuncExprNode::):
              (JSC::FuncDeclNode::): Store a SourceCode in all ScopeNodes, since
              SourceCode is now responsible for tracking URL, ID, etc. Streamlined
              some ad hoc FunctionBodyNode fixups into a "finishParsing" function, to
              help make clear what you need to do in order to finish parsing a
              FunctionBodyNode.
      
              * wtf/Vector.h:
              (WTF::::releaseBuffer): Don't ASSERT that releaseBuffer() is only called
              when buffer is not 0, since FunctionBodyNode is more than happy
              to get back a 0 buffer, and other functions like RefPtr::release() allow
              for 0, too.
      
      JavaScriptGlue:
      
      2008-10-01  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Darin Adler and Cameron Zwarich.
      
              * JSRun.cpp:
              (JSRun::Evaluate):
              (JSRun::CheckSyntax): Provide a SourceCode to the Interpreter, since
              other APIs are no longer supported.
      
      WebCore:
      
      2008-10-01  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Darin Adler and Cameron Zwarich.
      
              Updated for JavaScriptCore API changes: use a SourceCode instead of
              broken out parameters; treat sourceId as intptr_t.
      
              * ForwardingHeaders/kjs/SourceRange.h: Copied from ForwardingHeaders/kjs/SourceProvider.h.
              * bindings/js/JSXMLHttpRequestCustom.cpp:
              (WebCore::JSXMLHttpRequest::send):
              * bindings/js/ScriptController.cpp:
              (WebCore::ScriptController::evaluate):
              * bindings/js/StringSourceProvider.h:
              (WebCore::StringSourceProvider::create):
              (WebCore::StringSourceProvider::StringSourceProvider):
      
              (WebCore::makeSource): Added a makeSource function for convenience.
      
              * bindings/objc/WebScriptObject.mm:
              (-[WebScriptObject evaluateWebScript:]):
              * bridge/NP_jsobject.cpp:
              (_NPN_Evaluate):
              * bridge/jni/jni_jsobject.mm:
              (JavaJSObject::call):
              (JavaJSObject::eval):
              (JavaJSObject::getMember):
              (JavaJSObject::setMember):
              (JavaJSObject::removeMember):
      
              * bridge/jni/jni_runtime.h:
              (JSC::Bindings::JavaString::operator UString): Replaced the explicit
              ustring() function with an implicit operator because this class already
              holds a UString::rep.
      
              * page/Console.cpp:
              (WebCore::retrieveLastCaller):
              (WebCore::Console::trace):
              * page/InspectorController.cpp:
              (WebCore::jsStringRef):
              (WebCore::InspectorController::addBreakpoint):
              (WebCore::InspectorController::removeBreakpoint):
              (WebCore::InspectorController::didParseSource):
              (WebCore::InspectorController::failedToParseSource):
              * page/InspectorController.h:
              * page/JavaScriptCallFrame.cpp:
              (WebCore::JavaScriptCallFrame::JavaScriptCallFrame):
              * page/JavaScriptCallFrame.h:
              (WebCore::JavaScriptCallFrame::create):
              (WebCore::JavaScriptCallFrame::sourceIdentifier):
              (WebCore::JavaScriptCallFrame::update):
              * page/JavaScriptDebugListener.h:
              * page/JavaScriptDebugServer.cpp:
              (WebCore::JavaScriptDebugServer::addBreakpoint):
              (WebCore::JavaScriptDebugServer::removeBreakpoint):
              (WebCore::JavaScriptDebugServer::hasBreakpoint):
              (WebCore::dispatchDidParseSource):
              (WebCore::dispatchFailedToParseSource):
              (WebCore::JavaScriptDebugServer::sourceParsed):
              (WebCore::JavaScriptDebugServer::callEvent):
              (WebCore::JavaScriptDebugServer::atStatement):
              (WebCore::JavaScriptDebugServer::returnEvent):
              (WebCore::JavaScriptDebugServer::exception):
              (WebCore::JavaScriptDebugServer::willExecuteProgram):
              (WebCore::JavaScriptDebugServer::didExecuteProgram):
              (WebCore::JavaScriptDebugServer::didReachBreakpoint):
              * page/JavaScriptDebugServer.h:
              * page/inspector/ScriptsPanel.js: Renamed internal uses of sourceId and 
              sourceIdentifier to sourceID.
      
      WebKit/mac:
      
      2008-10-01  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Darin Adler and Cameron Zwarich.
      
              Updated for JavaScriptCore API changes: use a SourceCode instead of
              broken out parameters; treat sourceId as intptr_t.
              
              We still treat sourceId as int in some cases because of DashCode. See
              <rdar://problem/6263293> WebScriptDebugDelegate should use intptr_t for
              sourceId, not int.
      
              * WebView/WebScriptDebugger.h:
              * WebView/WebScriptDebugger.mm:
              (toNSString):
              (WebScriptDebugger::sourceParsed):
              (WebScriptDebugger::callEvent):
              (WebScriptDebugger::atStatement):
              (WebScriptDebugger::returnEvent):
              (WebScriptDebugger::exception):
              (WebScriptDebugger::willExecuteProgram):
              (WebScriptDebugger::didExecuteProgram):
              (WebScriptDebugger::didReachBreakpoint):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      69e9ccfb
  5. 30 Sep, 2008 1 commit
  6. 29 Sep, 2008 1 commit
    • darin@apple.com's avatar
      JavaScriptCore: · 8d35fe02
      darin@apple.com authored
      2008-09-29  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam Weinig.
      
              - https://bugs.webkit.org/show_bug.cgi?id=21214
                work on getting rid of ExecState
      
              * JavaScriptCore.exp: Updated since JSGlobalObject::init
              no longer takes a parameter.
      
              * VM/Machine.cpp:
              (JSC::Machine::execute): Removed m_registerFile argument
              for ExecState constructors.
      
              * kjs/DebuggerCallFrame.cpp:
              (JSC::DebuggerCallFrame::evaluate): Removed globalThisValue
              argument for ExecState constructor.
      
              * kjs/ExecState.cpp:
              (JSC::ExecState::ExecState): Removed globalThisValue and
              registerFile arguments to constructors.
      
              * kjs/ExecState.h: Removed m_globalThisValue and
              m_registerFile data members.
      
              * kjs/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::init): Removed globalThisValue
              argument for ExecState constructor.
      
              * kjs/JSGlobalObject.h:
              (JSC::JSGlobalObject::JSGlobalObject): Got rid of parameter
              for the init function.
      
      WebCore:
      
      2008-09-29  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam Weinig.
      
              - https://bugs.webkit.org/show_bug.cgi?id=21214
                work on getting rid of ExecState
      
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::JSDOMWindowBase): Removed globalThisValue argument
              for base class constructor.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8d35fe02
  7. 28 Sep, 2008 1 commit
    • cwzwarich@webkit.org's avatar
      2008-09-28 Cameron Zwarich <cwzwarich@uwaterloo.ca> · 9e464cad
      cwzwarich@webkit.org authored
              Reviewed by Maciej Stachowiak.
      
              Bug 21200: Allow direct access to 'arguments' without using op_resolve
              <https://bugs.webkit.org/show_bug.cgi?id=21200>
      
              Allow fast access to the 'arguments' object by adding an extra slot to
              the callframe to store it.
      
              * JavaScriptCore.exp:
              * VM/CTI.cpp:
              (JSC::CTI::privateCompileMainPass):
              * VM/CodeBlock.cpp:
              (JSC::CodeBlock::dump):
              * VM/CodeGenerator.cpp:
              (JSC::CodeGenerator::CodeGenerator):
              (JSC::CodeGenerator::registerFor):
              * VM/CodeGenerator.h:
              (JSC::CodeGenerator::registerFor):
              * VM/Machine.cpp:
              (JSC::Machine::initializeCallFrame):
              (JSC::Machine::dumpRegisters):
              (JSC::Machine::privateExecute):
              (JSC::Machine::retrieveArguments):
              (JSC::Machine::cti_op_call_JSFunction):
              (JSC::Machine::cti_op_create_arguments):
              (JSC::Machine::cti_op_construct_JSConstruct):
              * VM/Machine.h:
              * VM/Opcode.h:
              * VM/RegisterFile.h:
              (JSC::RegisterFile::):
              * kjs/JSActivation.cpp:
              (JSC::JSActivation::mark):
              (JSC::JSActivation::argumentsGetter):
              * kjs/JSActivation.h:
              (JSC::JSActivation::JSActivationData::JSActivationData):
              * kjs/NodeInfo.h:
              * kjs/Parser.cpp:
              (JSC::Parser::didFinishParsing):
              * kjs/Parser.h:
              (JSC::Parser::parse):
              * kjs/grammar.y:
              * kjs/nodes.cpp:
              (JSC::ScopeNode::ScopeNode):
              (JSC::ProgramNode::ProgramNode):
              (JSC::ProgramNode::create):
              (JSC::EvalNode::EvalNode):
              (JSC::EvalNode::create):
              (JSC::FunctionBodyNode::FunctionBodyNode):
              (JSC::FunctionBodyNode::create):
              * kjs/nodes.h:
              (JSC::ScopeNode::usesArguments):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9e464cad
  8. 27 Sep, 2008 1 commit
    • timothy@apple.com's avatar
      Added support for console.trace. · 345f1afa
      timothy@apple.com authored
      JavaScriptCore:
      
      2008-09-27  Keishi Hattori  <casey.hattori@gmail.com>
      
              Added Machine::retrieveCaller to the export list.
      
              Reviewed by Kevin McCullough and Tim Hatcher.
      
              * JavaScriptCore.exp: Added Machine::retrieveCaller.
      
      WebCore:
      
      2008-09-27  Keishi Hattori  <casey.hattori@gmail.com>
      
              Added support for console.trace.
      
              https://bugs.webkit.org/show_bug.cgi?id=19157
      
              Reviewed by Kevin McCullough and Tim Hatcher.
      
              * bindings/js/JSConsoleCustom.cpp:
              (WebCore::JSConsole::trace):
              * page/Console.cpp:
              (WebCore::Console::trace): Calls Machine::retrieveCaller to
              get a stack trace.
              * page/Console.h:
              (WebCore::): Added TraceMessageLevel.
              * page/Console.idl: Added console.trace.
              * page/inspector/Console.js:
              (ConsoleMessage): Added case for TraceMessageLevel.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      345f1afa
  9. 24 Sep, 2008 4 commits
    • weinig@apple.com's avatar
      JavaScriptCore: · acfb9e11
      weinig@apple.com authored
      2008-09-24  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Maciej Stachowiak.
      
              Remove staticFunctionGetter.  There is only one remaining user of
              staticFunctionGetter and it can be converted to use setUpStaticFunctionSlot.
      
              * JavaScriptCore.exp:
              * kjs/lookup.cpp:
              * kjs/lookup.h:
      
      WebCore:
      
      2008-09-24  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Maciej Stachowiak.
      
              Remove staticFunctionGetter.  There is only one remaining user of
              staticFunctionGetter and it can be converted to use setUpStaticFunctionSlot.
      
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::getOwnPropertySlot):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      acfb9e11
    • ggaren@apple.com's avatar
      2008-09-24 Geoffrey Garen <ggaren@apple.com> · 7cfde8b9
      ggaren@apple.com authored
              Reviewed by Darin Adler.
              
              Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of
              the objects it retains
      
              * API/JSBase.h: Filled in some missing function names.
      
              * API/tests/testapi.c: Test the new SPI a little.
      
              * API/JSSPI.cpp: Add the new SPI.
              * API/JSSPI.h: Add the new SPI.
              * JavaScriptCore.exp: Add the new SPI.
              * JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7cfde8b9
    • darin@apple.com's avatar
      2008-09-24 Darin Adler <darin@apple.com> · 4b66e457
      darin@apple.com authored
              Reviewed by Sam Weinig.
      
              - https://bugs.webkit.org/show_bug.cgi?id=21047
                speed up ret_activation with inlining
      
              About 1% on v8-raytrace.
      
              * JavaScriptCore.exp: Removed JSVariableObject::setRegisters.
      
              * kjs/JSActivation.cpp: Moved copyRegisters to the header to make it inline.
              * kjs/JSActivation.h:
              (JSC::JSActivation::copyRegisters): Moved here. Also removed the registerArraySize
              argument to setRegisters, since the object doesn't need to store the number of
              registers.
      
              * kjs/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::reset): Removed unnecessary clearing left over from when we
              used this on objects that weren't brand new. These days, this function is really
              just part of the constructor.
      
              * kjs/JSGlobalObject.h: Added registerArraySize to JSGlobalObjectData, since
              JSVariableObjectData no longer needs it. Added a setRegisters override here
              that handles storing the size.
      
              * kjs/JSStaticScopeObject.h: Removed code to set registerArraySize, since it
              no longer exists.
      
              * kjs/JSVariableObject.cpp: Moved copyRegisterArray and setRegisters to the
              header to make them inline.
              * kjs/JSVariableObject.h: Removed registerArraySize from JSVariableObjectData,
              since it was only used for the global object.
              (JSC::JSVariableObject::copyRegisterArray): Moved here ot make it inline.
              (JSC::JSVariableObject::setRegisters): Moved here to make it inline. Also
              removed the code to set registerArraySize and changed an if statement into
              an assert to save an unnnecessary branch.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4b66e457
    • mjs@apple.com's avatar
      2008-09-24 Maciej Stachowiak <mjs@apple.com> · 66de85be
      mjs@apple.com authored
              Reviewed by Oliver Hunt.
              
              - inline PropertyMap::getOffset to speed up polymorphic lookups
              
              ~1.5% speedup on v8 benchmark
              no effect on SunSpider
      
              * JavaScriptCore.exp:
              * kjs/PropertyMap.cpp:
              * kjs/PropertyMap.h:
              (JSC::PropertyMap::getOffset):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      66de85be
  10. 23 Sep, 2008 1 commit
    • ggaren@apple.com's avatar
      2008-09-23 Geoffrey Garen <ggaren@apple.com> · 107bd0eb
      ggaren@apple.com authored
              Reviewed by Darin Adler.
              
              Changed the layout of the call frame from
              
              { header, parameters, locals | constants, temporaries }
              
              to
              
              { parameters, header | locals, constants, temporaries }
              
              This simplifies function entry+exit, and enables a number of future
              optimizations.
              
              13.5% speedup on empty call benchmark for bytecode; 23.6% speedup on
              empty call benchmark for CTI.
              
              SunSpider says no change. SunSpider --v8 says 1% faster.
      
              * VM/CTI.cpp:
              
              Added a bit of abstraction for calculating whether a register is a
              constant, since this patch changes that calculation:
              (JSC::CTI::isConstant):
              (JSC::CTI::getConstant):
              (JSC::CTI::emitGetArg):
              (JSC::CTI::emitGetPutArg):
              (JSC::CTI::getConstantImmediateNumericArg):
      
              Updated for changes to callframe header location:
              (JSC::CTI::emitPutToCallFrameHeader):
              (JSC::CTI::emitGetFromCallFrameHeader):
              (JSC::CTI::printOpcodeOperandTypes):
              
              Renamed to spite Oliver:
              (JSC::CTI::emitInitRegister):
              
              Added an abstraction for emitting a call through a register, so that
              calls through registers generate exception info, too:
              (JSC::CTI::emitCall):
      
              Updated to match the new callframe header layout, and to support calls
              through registers, which have no destination address:
              (JSC::CTI::compileOpCall):
              (JSC::CTI::privateCompileMainPass):
              (JSC::CTI::privateCompileSlowCases):
              (JSC::CTI::privateCompile):
      
              * VM/CTI.h:
      
              More of the above:
              (JSC::CallRecord::CallRecord):
      
              * VM/CodeBlock.cpp:
      
              Updated for new register layout:
              (JSC::registerName):
              (JSC::CodeBlock::dump):
      
              * VM/CodeBlock.h:
              
              Updated CodeBlock to track slightly different information about the
              register frame, and tweaked the style of an ASSERT_NOT_REACHED.
              (JSC::CodeBlock::CodeBlock):
              (JSC::CodeBlock::getStubInfo):
      
              * VM/CodeGenerator.cpp:
              
              Added some abstraction around constant register allocation, since this
              patch changes it, changed codegen to account for the new callframe
              layout, and added abstraction around register fetching code
              that used to assume that all local registers lived at negative indices,
              since vars now live at positive indices:
              (JSC::CodeGenerator::generate):
              (JSC::CodeGenerator::addVar):
              (JSC::CodeGenerator::addGlobalVar):
              (JSC::CodeGenerator::allocateConstants):
              (JSC::CodeGenerator::CodeGenerator):
              (JSC::CodeGenerator::addParameter):
              (JSC::CodeGenerator::registerFor):
              (JSC::CodeGenerator::constRegisterFor):
              (JSC::CodeGenerator::newRegister):
              (JSC::CodeGenerator::newTemporary):
              (JSC::CodeGenerator::highestUsedRegister):
              (JSC::CodeGenerator::addConstant):
              
              ASSERT that our caller referenced the registers it passed to us.
              Otherwise, we might overwrite them with parameters:
              (JSC::CodeGenerator::emitCall):
              (JSC::CodeGenerator::emitConstruct):
      
              * VM/CodeGenerator.h:
              
              Added some abstraction for getting a RegisterID for a given index,
              since the rules are a little weird:
              (JSC::CodeGenerator::registerFor):
      
              * VM/Machine.cpp:
      
              Utility function to transform a machine return PC to a virtual machine
              return VPC, for the sake of stack unwinding, since both PCs are stored
              in the same location now:
              (JSC::vPCForPC):
      
              Tweaked to account for new call frame:
              (JSC::Machine::initializeCallFrame):
              
              Tweaked to account for registerOffset supplied by caller:
              (JSC::slideRegisterWindowForCall):
      
              Tweaked to account for new register layout:
              (JSC::scopeChainForCall):
              (JSC::Machine::callEval):
              (JSC::Machine::dumpRegisters):
              (JSC::Machine::unwindCallFrame):
              (JSC::Machine::execute):
      
              Changed op_call and op_construct to implement the new calling convention:
              (JSC::Machine::privateExecute):
      
              Tweaked to account for the new register layout:
              (JSC::Machine::retrieveArguments):
              (JSC::Machine::retrieveCaller):
              (JSC::Machine::retrieveLastCaller):
              (JSC::Machine::callFrame):
              (JSC::Machine::getArgumentsData):
      
              Changed CTI call helpers to implement the new calling convention:
              (JSC::Machine::cti_op_call_JSFunction):
              (JSC::Machine::cti_op_call_NotJSFunction):
              (JSC::Machine::cti_op_ret_activation):
              (JSC::Machine::cti_op_ret_profiler):
              (JSC::Machine::cti_op_construct_JSConstruct):
              (JSC::Machine::cti_op_construct_NotJSConstruct):
              (JSC::Machine::cti_op_call_eval):
      
              * VM/Machine.h:
      
              * VM/Opcode.h:
              
              Renamed op_initialise_locals to op_init, because this opcode
              doesn't initialize all locals, and it doesn't initialize only locals.
              Also, to spite Oliver.
              
              * VM/RegisterFile.h:
              
              New call frame enumeration values:
              (JSC::RegisterFile::):
      
              Simplified the calculation of whether a RegisterID is a temporary,
              since we can no longer assume that all positive non-constant registers
              are temporaries:
              * VM/RegisterID.h:
              (JSC::RegisterID::RegisterID):
              (JSC::RegisterID::setTemporary):
              (JSC::RegisterID::isTemporary):
      
              Renamed firstArgumentIndex to firstParameterIndex because the assumption
              that this variable pertained to the actual arguments supplied by the
              caller caused me to write some buggy code:
              * kjs/Arguments.cpp:
              (JSC::ArgumentsData::ArgumentsData):
              (JSC::Arguments::Arguments):
              (JSC::Arguments::fillArgList):
              (JSC::Arguments::getOwnPropertySlot):
              (JSC::Arguments::put):
      
              Updated for new call frame layout:
              * kjs/DebuggerCallFrame.cpp:
              (JSC::DebuggerCallFrame::functionName):
              (JSC::DebuggerCallFrame::type):
              * kjs/DebuggerCallFrame.h:
      
              Changed the activation object to account for the fact that a call frame
              header now sits between parameters and local variables. This change
              requires all variable objects to do their own marking, since they
              now use their register storage differently:
              * kjs/JSActivation.cpp:
              (JSC::JSActivation::mark):
              (JSC::JSActivation::copyRegisters):
              (JSC::JSActivation::createArgumentsObject):
              * kjs/JSActivation.h:
      
              Updated global object to use the new interfaces required by the change
              to JSActivation above:
              * kjs/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::reset):
              (JSC::JSGlobalObject::mark):
              (JSC::JSGlobalObject::copyGlobalsFrom):
              (JSC::JSGlobalObject::copyGlobalsTo):
              * kjs/JSGlobalObject.h:
              (JSC::JSGlobalObject::addStaticGlobals):
      
              Updated static scope object to use the new interfaces required by the 
              change to JSActivation above:
              * kjs/JSStaticScopeObject.cpp:
              (JSC::JSStaticScopeObject::mark):
              (JSC::JSStaticScopeObject::~JSStaticScopeObject):
              * kjs/JSStaticScopeObject.h:
              (JSC::JSStaticScopeObject::JSStaticScopeObject):
              (JSC::JSStaticScopeObject::d):
      
              Updated variable object to use the new interfaces required by the 
              change to JSActivation above:
              * kjs/JSVariableObject.cpp:
              (JSC::JSVariableObject::copyRegisterArray):
              (JSC::JSVariableObject::setRegisters):
              * kjs/JSVariableObject.h:
      
              Changed the bit twiddling in symbol table not to assume that all indices
              are negative, since they can be positive now:
              * kjs/SymbolTable.h:
              (JSC::SymbolTableEntry::SymbolTableEntry):
              (JSC::SymbolTableEntry::isNull):
              (JSC::SymbolTableEntry::getIndex):
              (JSC::SymbolTableEntry::getAttributes):
              (JSC::SymbolTableEntry::setAttributes):
              (JSC::SymbolTableEntry::isReadOnly):
              (JSC::SymbolTableEntry::pack):
              (JSC::SymbolTableEntry::isValidIndex):
      
              Changed call and construct nodes to ref their functions and/or bases,
              so that emitCall/emitConstruct doesn't overwrite them with parameters.
              Also, updated for rename to registerFor:
              * kjs/nodes.cpp:
              (JSC::ResolveNode::emitCode):
              (JSC::NewExprNode::emitCode):
              (JSC::EvalFunctionCallNode::emitCode):
              (JSC::FunctionCallValueNode::emitCode):
              (JSC::FunctionCallResolveNode::emitCode):
              (JSC::FunctionCallBracketNode::emitCode):
              (JSC::FunctionCallDotNode::emitCode):
              (JSC::PostfixResolveNode::emitCode):
              (JSC::DeleteResolveNode::emitCode):
              (JSC::TypeOfResolveNode::emitCode):
              (JSC::PrefixResolveNode::emitCode):
              (JSC::ReadModifyResolveNode::emitCode):
              (JSC::AssignResolveNode::emitCode):
              (JSC::ConstDeclNode::emitCodeSingle):
              (JSC::ForInNode::emitCode):
      
              Added abstraction for getting exception info out of a call through a
              register:
              * masm/X86Assembler.h:
              (JSC::X86Assembler::emitCall):
              
              Removed duplicate #if:
              * wtf/Platform.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      107bd0eb
  11. 22 Sep, 2008 2 commits
    • weinig@apple.com's avatar
      2008-09-22 Kelvin Sherlock <ksherlock@gmail.com> · 087f6eca
      weinig@apple.com authored
              Updated and tweaked by Sam Weinig.
      
              Reviewed by Geoffrey Garen.
      
              Bug 20020: Proposed enhancement to JavaScriptCore API
              <https://bugs.webkit.org/show_bug.cgi?id=20020>
      
              Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
              functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
      
              * API/JSObjectRef.cpp: The functions
              * API/JSObjectRef.h: Function prototype and documentation
              * JavaScriptCore.exp: Added functions to exported function list
              * API/tests/testapi.c: Added basic functionality tests.
      
              * kjs/DateConstructor.cpp:
              Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
              with JSObject* constructDate(ExecState* exec, const ArgList& args).
              Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
      
              * kjs/DateConstructor.h:
              added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
      
              * kjs/ErrorConstructor.cpp:
              removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
      
              * kjs/ErrorConstructor.h:
              added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
      
              * kjs/RegExpConstructor.cpp:
              removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
      
              * kjs/RegExpConstructor.h:
              added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      087f6eca
    • mjs@apple.com's avatar
      JavaScriptCore: · 221b4757
      mjs@apple.com authored
      2008-09-22  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Cameron Zwarich.
              
              - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
      
              Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
              
              2.2% speedup on EarleyBoyer benchmark.
      
              * API/JSCallbackConstructor.cpp:
              * API/JSCallbackConstructor.h:
              (JSC::JSCallbackConstructor::createStructureID):
              * API/JSCallbackFunction.cpp:
              * API/JSCallbackFunction.h:
              (JSC::JSCallbackFunction::createStructureID):
              * API/JSCallbackObject.h:
              (JSC::JSCallbackObject::createStructureID):
              * API/JSCallbackObjectFunctions.h:
              (JSC::::hasInstance):
              * API/JSValueRef.cpp:
              (JSValueIsInstanceOfConstructor):
              * JavaScriptCore.exp:
              * VM/Machine.cpp:
              (JSC::Machine::privateExecute):
              (JSC::Machine::cti_op_instanceof):
              * kjs/InternalFunction.cpp:
              * kjs/InternalFunction.h:
              (JSC::InternalFunction::createStructureID):
              * kjs/JSObject.cpp:
              * kjs/JSObject.h:
              * kjs/TypeInfo.h:
              (JSC::TypeInfo::implementsHasInstance):
      
      WebCore:
      
      2008-09-22  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Cameron Zwarich.
      
              - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
      
              Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
              
              2.2% speedup on EarleyBoyer benchmark.
      
              * bindings/js/JSQuarantinedObjectWrapper.cpp:
              * bindings/js/JSQuarantinedObjectWrapper.h:
              (WebCore::JSQuarantinedObjectWrapper::createStructureID):
              * bindings/scripts/CodeGeneratorJS.pm:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      221b4757
  12. 21 Sep, 2008 1 commit
    • mjs@apple.com's avatar
      JavaScriptCore: · 52b6760c
      mjs@apple.com authored
      2008-09-21  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Darin.
              
              - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
              https://bugs.webkit.org/show_bug.cgi?id=20981
      
              * JavaScriptCore.exp:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * VM/CTI.cpp:
              (JSC::CTI::privateCompileMainPass):
              (JSC::CTI::privateCompilePutByIdTransition):
              * VM/Machine.cpp:
              (JSC::jsIsObjectType):
              (JSC::Machine::Machine):
              * kjs/AllInOneFile.cpp:
              * kjs/JSCell.h:
              (JSC::JSCell::isObject):
              (JSC::JSCell::isString):
              * kjs/JSGlobalData.cpp:
              (JSC::JSGlobalData::JSGlobalData):
              * kjs/JSGlobalObject.cpp:
              (JSC::JSGlobalObject::reset):
              * kjs/JSGlobalObject.h:
              (JSC::StructureID::prototypeForLookup):
              * kjs/JSNumberCell.h:
              (JSC::JSNumberCell::createStructureID):
              * kjs/JSObject.cpp:
              (JSC::JSObject::createInheritorID):
              * kjs/JSObject.h:
              (JSC::JSObject::createStructureID):
              * kjs/JSString.h:
              (JSC::JSString::createStructureID):
              * kjs/NativeErrorConstructor.cpp:
              (JSC::NativeErrorConstructor::NativeErrorConstructor):
              * kjs/RegExpConstructor.cpp:
              * kjs/RegExpMatchesArray.h: Added.
              (JSC::RegExpMatchesArray::getOwnPropertySlot):
              (JSC::RegExpMatchesArray::put):
              (JSC::RegExpMatchesArray::deleteProperty):
              (JSC::RegExpMatchesArray::getPropertyNames):
              * kjs/StructureID.cpp:
              (JSC::StructureID::StructureID):
              (JSC::StructureID::addPropertyTransition):
              (JSC::StructureID::toDictionaryTransition):
              (JSC::StructureID::changePrototypeTransition):
              (JSC::StructureID::getterSetterTransition):
              * kjs/StructureID.h:
              (JSC::StructureID::create):
              (JSC::StructureID::typeInfo):
              * kjs/TypeInfo.h: Added.
              (JSC::TypeInfo::TypeInfo):
              (JSC::TypeInfo::type):
      
      WebCore:
      
      2008-09-21  Maciej Stachowiak  <mjs@apple.com>
      
              Reviewed by Darin.
      
              - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
              https://bugs.webkit.org/show_bug.cgi?id=20981
              
              * bindings/js/JSAudioConstructor.cpp:
              (WebCore::JSAudioConstructor::JSAudioConstructor):
              * bindings/js/JSCSSStyleDeclarationCustom.cpp:
              (WebCore::JSCSSStyleDeclaration::nameGetter):
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::createDOMStructure):
              * bindings/js/JSDOMBinding.h:
              (WebCore::getDOMStructure):
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::JSDOMWindowShell):
              (WebCore::JSDOMWindowShell::setWindow):
              * bindings/js/JSEventTargetNode.cpp:
              (WebCore::JSEventTargetNode::createPrototype):
              * bindings/js/JSHTMLOptionElementConstructor.cpp:
              (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
              * bindings/js/JSImageConstructor.cpp:
              (WebCore::JSImageConstructor::JSImageConstructor):
              * bindings/js/JSXMLHttpRequestConstructor.cpp:
              (WebCore::JSXMLHttpRequestConstructor::JSXMLHttpRequestConstructor):
              * bindings/js/JSXSLTProcessorConstructor.cpp:
              (WebCore::JSXSLTProcessorConstructor::JSXSLTProcessorConstructor):
              * bindings/scripts/CodeGeneratorJS.pm:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      52b6760c
  13. 20 Sep, 2008 1 commit
    • darin@apple.com's avatar
      JavaScriptCore: · 8281d838
      darin@apple.com authored
      2008-09-20  Darin Adler  <darin@apple.com>
      
              Reviewed by Maciej Stachowiak.
      
              - finish https://bugs.webkit.org/show_bug.cgi?id=20858
                make each distinct C++ class get a distinct JSC::Structure
      
              This also includes some optimizations that make the change an overall
              small speedup. Without those it was a bit of a slowdown.
      
              * API/JSCallbackConstructor.cpp:
              (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
              * API/JSCallbackConstructor.h: Ditto.
              * API/JSCallbackFunction.cpp:
              (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
              * API/JSCallbackObject.h: Take a structure.
              * API/JSCallbackObjectFunctions.h:
              (JSC::JSCallbackObject::JSCallbackObject): Ditto.
      
              * API/JSClassRef.cpp:
              (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
              if there's a custom prototype involved.
              * API/JSObjectRef.cpp:
              (JSObjectMake): Ditto.
              (JSObjectMakeConstructor): Pass in a structure.
      
              * JavaScriptCore.exp: Updated.
      
              * VM/Machine.cpp:
              (JSC::jsLess): Added a special case for when both arguments are strings.
              This avoids converting both strings to with UString::toDouble.
              (JSC::jsLessEq): Ditto.
              (JSC::Machine::privateExecute): Pass in a structure.
              (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
              (JSC::Machine::cti_op_new_regexp): Ditto.
              (JSC::Machine::cti_op_is_string): Ditto.
              * VM/Machine.h: Made isJSString public so it can be used in the CTI.
      
              * kjs/Arguments.cpp:
              (JSC::Arguments::Arguments): Pass in a structure.
      
              * kjs/JSCell.h: Mark constructor explicit.
      
              * kjs/JSGlobalObject.cpp:
              (JSC::markIfNeeded): Added an overload for marking structures.
              (JSC::JSGlobalObject::reset): Eliminate code to set data members to
              zero. We now do that in the constructor, and we no longer use this
              anywhere except in the constructor. Added code to create structures.
              Pass structures rather than prototypes when creating objects.
              (JSC::JSGlobalObject::mark): Mark the structures.
      
              * kjs/JSGlobalObject.h: Removed unneeded class declarations.
              Added initializers for raw pointers in JSGlobalObjectData so
              everything starts with a 0. Added structure data and accessor
              functions.
      
              * kjs/JSImmediate.cpp:
              (JSC::JSImmediate::nonInlineNaN): Added.
              * kjs/JSImmediate.h:
              (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
      
              * kjs/JSNumberCell.cpp:
              (JSC::jsNumberCell): Made non-inline to avoid PIC branches
              in functions that call this one.
              (JSC::jsNaN): Ditto.
              * kjs/JSNumberCell.h: Ditto.
      
              * kjs/JSObject.h: Removed constructor that takes a prototype.
              All callers now pass structures.
      
              * kjs/ArrayConstructor.cpp:
              (JSC::ArrayConstructor::ArrayConstructor):
              (JSC::constructArrayWithSizeQuirk):
              * kjs/ArrayConstructor.h:
              * kjs/ArrayPrototype.cpp:
              (JSC::ArrayPrototype::ArrayPrototype):
              * kjs/ArrayPrototype.h:
              * kjs/BooleanConstructor.cpp:
              (JSC::BooleanConstructor::BooleanConstructor):
              (JSC::constructBoolean):
              (JSC::constructBooleanFromImmediateBoolean):
              * kjs/BooleanConstructor.h:
              * kjs/BooleanObject.cpp:
              (JSC::BooleanObject::BooleanObject):
              * kjs/BooleanObject.h:
              * kjs/BooleanPrototype.cpp:
              (JSC::BooleanPrototype::BooleanPrototype):
              * kjs/BooleanPrototype.h:
              * kjs/DateConstructor.cpp:
              (JSC::DateConstructor::DateConstructor):
              (JSC::constructDate):
              * kjs/DateConstructor.h:
              * kjs/DateInstance.cpp:
              (JSC::DateInstance::DateInstance):
              * kjs/DateInstance.h:
              * kjs/DatePrototype.cpp:
              (JSC::DatePrototype::DatePrototype):
              * kjs/DatePrototype.h:
              * kjs/ErrorConstructor.cpp:
              (JSC::ErrorConstructor::ErrorConstructor):
              (JSC::constructError):
              * kjs/ErrorConstructor.h:
              * kjs/ErrorInstance.cpp:
              (JSC::ErrorInstance::ErrorInstance):
              * kjs/ErrorInstance.h:
              * kjs/ErrorPrototype.cpp:
              (JSC::ErrorPrototype::ErrorPrototype):
              * kjs/ErrorPrototype.h:
              * kjs/FunctionConstructor.cpp:
              (JSC::FunctionConstructor::FunctionConstructor):
              * kjs/FunctionConstructor.h:
              * kjs/FunctionPrototype.cpp:
              (JSC::FunctionPrototype::FunctionPrototype):
              (JSC::FunctionPrototype::addFunctionProperties):
              * kjs/FunctionPrototype.h:
              * kjs/GlobalEvalFunction.cpp:
              (JSC::GlobalEvalFunction::GlobalEvalFunction):
              * kjs/GlobalEvalFunction.h:
              * kjs/InternalFunction.cpp:
              (JSC::InternalFunction::InternalFunction):
              * kjs/InternalFunction.h:
              (JSC::InternalFunction::InternalFunction):
              * kjs/JSArray.cpp:
              (JSC::JSArray::JSArray):
              (JSC::constructEmptyArray):
              (JSC::constructArray):
              * kjs/JSArray.h:
              * kjs/JSFunction.cpp:
              (JSC::JSFunction::JSFunction):
              (JSC::JSFunction::construct):
              * kjs/JSObject.cpp:
              (JSC::constructEmptyObject):
              * kjs/JSString.cpp:
              (JSC::StringObject::create):
              * kjs/JSWrapperObject.h:
              * kjs/MathObject.cpp:
              (JSC::MathObject::MathObject):
              * kjs/MathObject.h:
              * kjs/NativeErrorConstructor.cpp:
              (JSC::NativeErrorConstructor::NativeErrorConstructor):
              (JSC::NativeErrorConstructor::construct):
              * kjs/NativeErrorConstructor.h:
              * kjs/NativeErrorPrototype.cpp:
              (JSC::NativeErrorPrototype::NativeErrorPrototype):
              * kjs/NativeErrorPrototype.h:
              * kjs/NumberConstructor.cpp:
              (JSC::NumberConstructor::NumberConstructor):
              (JSC::constructWithNumberConstructor):
              * kjs/NumberConstructor.h:
              * kjs/NumberObject.cpp:
              (JSC::NumberObject::NumberObject):
              (JSC::constructNumber):
              (JSC::constructNumberFromImmediateNumber):
              * kjs/NumberObject.h:
              * kjs/NumberPrototype.cpp:
              (JSC::NumberPrototype::NumberPrototype):
              * kjs/NumberPrototype.h:
              * kjs/ObjectConstructor.cpp:
              (JSC::ObjectConstructor::ObjectConstructor):
              (JSC::constructObject):
              * kjs/ObjectConstructor.h:
              * kjs/ObjectPrototype.cpp:
              (JSC::ObjectPrototype::ObjectPrototype):
              * kjs/ObjectPrototype.h:
              * kjs/PrototypeFunction.cpp:
              (JSC::PrototypeFunction::PrototypeFunction):
              * kjs/PrototypeFunction.h:
              * kjs/RegExpConstructor.cpp:
              (JSC::RegExpConstructor::RegExpConstructor):
              (JSC::RegExpMatchesArray::RegExpMatchesArray):
              (JSC::constructRegExp):
              * kjs/RegExpConstructor.h:
              * kjs/RegExpObject.cpp:
              (JSC::RegExpObject::RegExpObject):
              * kjs/RegExpObject.h:
              * kjs/RegExpPrototype.cpp:
              (JSC::RegExpPrototype::RegExpPrototype):
              * kjs/RegExpPrototype.h:
              * kjs/Shell.cpp:
              (GlobalObject::GlobalObject):
              * kjs/StringConstructor.cpp:
              (JSC::StringConstructor::StringConstructor):
              (JSC::constructWithStringConstructor):
              * kjs/StringConstructor.h:
              * kjs/StringObject.cpp:
              (JSC::StringObject::StringObject):
              * kjs/StringObject.h:
              * kjs/StringObjectThatMasqueradesAsUndefined.h:
              (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
              * kjs/StringPrototype.cpp:
              (JSC::StringPrototype::StringPrototype):
              * kjs/StringPrototype.h:
              Take and pass structures.
      
      WebCore:
      
      2008-09-20  Darin Adler  <darin@apple.com>
      
              Reviewed by Maciej Stachowiak.
      
              - finish https://bugs.webkit.org/show_bug.cgi?id=20858
                make each distinct C++ class get a distinct JSC::Structure
      
              * bindings/js/JSCSSStyleDeclarationCustom.cpp:
              (WebCore::JSCSSStyleDeclaration::nameGetter): Pass in a structure
              ID. Note that this makes a new structure every time -- we could
              optimize this slightly be caching and reusing a single one.
      
              * bridge/runtime_method.cpp:
              (JSC::RuntimeMethod::RuntimeMethod): Create a unique structure using
              getDOMStructure.
              * bridge/runtime_method.h:
              (JSC::RuntimeMethod::createPrototype): Added createPrototype so
              getDOMStructure will work.
      
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::JSDOMWindowShell): Initialize m_window to
              0; needed in case garbage collection happens while creating the
              JSDOMWindow.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8281d838
  14. 19 Sep, 2008 4 commits
    • weinig@apple.com's avatar
      2008-09-19 Sam Weinig <sam@webkit.org> · 18b17a64
      weinig@apple.com authored
              Roll r36694 back in.  It did not cause the crash.
      
              * JavaScriptCore.exp:
              * VM/JSPropertyNameIterator.cpp:
              (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
              (JSC::JSPropertyNameIterator::invalidate):
              * VM/JSPropertyNameIterator.h:
              (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
              (JSC::JSPropertyNameIterator::create):
              * kjs/JSObject.cpp:
              (JSC::JSObject::getPropertyNames):
              * kjs/PropertyMap.cpp:
              (JSC::PropertyMap::getEnumerablePropertyNames):
              * kjs/PropertyMap.h:
              * kjs/PropertyNameArray.cpp:
              (JSC::PropertyNameArray::add):
              * kjs/PropertyNameArray.h:
              (JSC::PropertyNameArrayData::create):
              (JSC::PropertyNameArrayData::propertyNameVector):
              (JSC::PropertyNameArrayData::setCachedPrototypeChain):
              (JSC::PropertyNameArrayData::cachedPrototypeChain):
              (JSC::PropertyNameArrayData::begin):
              (JSC::PropertyNameArrayData::end):
              (JSC::PropertyNameArrayData::PropertyNameArrayData):
              (JSC::PropertyNameArray::PropertyNameArray):
              (JSC::PropertyNameArray::addKnownUnique):
              (JSC::PropertyNameArray::size):
              (JSC::PropertyNameArray::operator[]):
              (JSC::PropertyNameArray::begin):
              (JSC::PropertyNameArray::end):
              (JSC::PropertyNameArray::setData):
              (JSC::PropertyNameArray::data):
              (JSC::PropertyNameArray::releaseData):
              * kjs/StructureID.cpp:
              (JSC::structureIDChainsAreEqual):
              (JSC::StructureID::getEnumerablePropertyNames):
              (JSC::StructureID::clearEnumerationCache):
              (JSC::StructureID::createCachedPrototypeChain):
              * kjs/StructureID.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      18b17a64
    • weinig@apple.com's avatar
      2008-09-19 Sam Weinig <sam@webkit.org> · da05197a
      weinig@apple.com authored
              Roll out r36694.
      
              * JavaScriptCore.exp:
              * VM/JSPropertyNameIterator.cpp:
              (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
              (JSC::JSPropertyNameIterator::invalidate):
              * VM/JSPropertyNameIterator.h:
              (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
              (JSC::JSPropertyNameIterator::create):
              * kjs/JSObject.cpp:
              (JSC::JSObject::getPropertyNames):
              * kjs/PropertyMap.cpp:
              (JSC::PropertyMap::getEnumerablePropertyNames):
              * kjs/PropertyMap.h:
              * kjs/PropertyNameArray.cpp:
              (JSC::PropertyNameArray::add):
              * kjs/PropertyNameArray.h:
              (JSC::PropertyNameArray::PropertyNameArray):
              (JSC::PropertyNameArray::addKnownUnique):
              (JSC::PropertyNameArray::begin):
              (JSC::PropertyNameArray::end):
              (JSC::PropertyNameArray::size):
              (JSC::PropertyNameArray::operator[]):
              (JSC::PropertyNameArray::releaseIdentifiers):
              * kjs/StructureID.cpp:
              (JSC::StructureID::getEnumerablePropertyNames):
              * kjs/StructureID.h:
              (JSC::StructureID::clearEnumerationCache):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      da05197a
    • weinig@apple.com's avatar
      2008-09-19 Sam Weinig <sam@webkit.org> · ba6fae8a
      weinig@apple.com authored
              Reviewed by Darin Adler.
      
              Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
              Speed up JS property enumeration by caching entire PropertyNameArray
      
              1.3% speedup on Sunspider, 30% on string-fasta.
      
              * JavaScriptCore.exp:
              * VM/JSPropertyNameIterator.cpp:
              (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
              (JSC::JSPropertyNameIterator::invalidate):
              * VM/JSPropertyNameIterator.h:
              (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
              (JSC::JSPropertyNameIterator::create):
              * kjs/JSObject.cpp:
              (JSC::JSObject::getPropertyNames):
              * kjs/PropertyMap.cpp:
              (JSC::PropertyMap::getEnumerablePropertyNames):
              * kjs/PropertyMap.h:
              * kjs/PropertyNameArray.cpp:
              (JSC::PropertyNameArray::add):
              * kjs/PropertyNameArray.h:
              (JSC::PropertyNameArrayData::create):
              (JSC::PropertyNameArrayData::propertyNameVector):
              (JSC::PropertyNameArrayData::setCachedPrototypeChain):
              (JSC::PropertyNameArrayData::cachedPrototypeChain):
              (JSC::PropertyNameArrayData::begin):
              (JSC::PropertyNameArrayData::end):
              (JSC::PropertyNameArrayData::PropertyNameArrayData):
              (JSC::PropertyNameArray::PropertyNameArray):
              (JSC::PropertyNameArray::addKnownUnique):
              (JSC::PropertyNameArray::size):
              (JSC::PropertyNameArray::operator[]):
              (JSC::PropertyNameArray::begin):
              (JSC::PropertyNameArray::end):
              (JSC::PropertyNameArray::setData):
              (JSC::PropertyNameArray::data):
              (JSC::PropertyNameArray::releaseData):
              * kjs/ScopeChain.cpp:
              (JSC::ScopeChainNode::print):
              * kjs/StructureID.cpp:
              (JSC::structureIDChainsAreEqual):
              (JSC::StructureID::getEnumerablePropertyNames):
              (JSC::StructureID::clearEnumerationCache):
              (JSC::StructureID::createCachedPrototypeChain):
              * kjs/StructureID.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ba6fae8a
    • darin@apple.com's avatar
      JavaScriptCore: · 39a180f1
      darin@apple.com authored
      2008-09-19  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam Weinig.
      
              - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
                make each distinct C++ class get a distinct JSC::Structure
      
              * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
      
              * kjs/JSGlobalObject.h: Changed the protected constructor to take a
              structure instead of a prototype.
      
              * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
      
      WebCore:
      
      2008-09-19  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam Weinig.
      
              - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
                make each distinct C++ class get a distinct JSC::Structure
      
                + Fixed all cases where we were using a shared structure for multiple
                  C++ classes in WebCore. This still has to be done in JavaScriptCore.
      
                + Got rid of cacheGlobalObject.
      
                + Improved use of PassRefPtr in bindings code.
      
                + Removed a couple cases where we were potentially allocating prototypes
                  inside a JSObject's construction process -- this can lead to trouble if
                  we do a garbage collection while an object is only partly constructed.
      
              * bindings/js/JSAudioConstructor.cpp:
              (WebCore::JSAudioConstructor::JSAudioConstructor): Create a structure explicitly
              so we don't implicitly share the structure with other objects that use the object
              prototype.
      
              * bindings/js/JSDOMBinding.cpp:
              (WebCore::getCachedDOMConstructor): Added. To be used for constructors so we
              don't need cacheGlobalObject any more.
              (WebCore::cacheDOMConstructor): Ditto.
      
              * bindings/js/JSDOMBinding.h: Removed DOMObject constructor that takes a prototype.
              Added functions and a function template for getting cached DOM constructors.
              Removed cacheGlobalObject function template.
      
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::JSDOMWindowBase): Take a PassRefPtr<DOMWindow> since
              we're taking ownership.
              * bindings/js/JSDOMWindowBase.h: Changed constructor to take PassRefPtr, since
              we're taking ownership. Added constructor map.
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::mark): Mark the constructors in the map.
      
              * bindings/js/JSDOMWindowShell.cpp:
              (WebCore::JSDOMWindowShell::JSDOMWindowShell): Take a PassRefPtr<DOMWindow> since
              we're taking ownership. Use the new setWindow function to create the JSDOMWindow;
              this is now done in only that one place.
              (WebCore::JSDOMWindowShell::setWindow): Added. Creates the JSDOMWindow based on
              the passed-in DOMWindow. Code was moved here and changed to allocate unique
              structures for both the window prototype and the window.
              * bindings/js/JSDOMWindowShell.h: Ditto.
      
              * bindings/js/JSEventTargetBase.h: Changed class template argument so it doesn't
              have the same name (JSEventTarget) as an actual class. Removed unhelpful use of
              private/friend in JSEventTargetBase. Removed comments referring to defunct
              macros. Changed JSEventTargetBasePrototype to get the prototype with the new
              rather than its own copy of cacheGlobalObject (I missed this during pass 1).
              Changed JSEventTargetBasePrototype so it doesn't have so many template arguments.
      
              * bindings/js/JSEventTargetNode.cpp: Added s_info; needed for the new scheme
              for caching structures and prototypes.
              (WebCore::JSEventTargetNode::JSEventTargetNode): Use PassRefPtr.
              (WebCore::JSEventTargetNode::createPrototype): Added.
              * bindings/js/JSEventTargetNode.h: Updated for above changes.
      
              * bindings/js/JSHTMLAllCollection.h:
              (WebCore::JSHTMLAllCollection::JSHTMLAllCollection): Use PassRefPtr.
              * bindings/js/JSHTMLCollectionCustom.cpp:
              (WebCore::getNamedItems): Pass ExecState instead of prototype.
              * bindings/js/JSHTMLFormElementCustom.cpp:
              (WebCore::JSHTMLFormElement::nameGetter): Ditto.
              * bindings/js/JSHTMLInputElementBase.cpp:
              (WebCore::JSHTMLInputElementBase::JSHTMLInputElementBase): Use PassRefPtr.
              * bindings/js/JSHTMLInputElementBase.h: Ditto.
              * bindings/js/JSHTMLOptionElementConstructor.cpp:
              (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
              Create a unique structure instead of sharing.
              * bindings/js/JSImageConstructor.cpp:
              (WebCore::JSImageConstructor::JSImageConstructor): Ditto.
      
              * bindings/js/JSInspectedObjectWrapper.cpp:
              (WebCore::JSInspectedObjectWrapper::wrap): Removed overload that takes
              a prototype rather than a structure. Made the use of inheritorID() here
              explicit.
              * bindings/js/JSInspectedObjectWrapper.h: Ditto.
              * bindings/js/JSInspectorCallbackWrapper.cpp:
              (WebCore::JSInspectorCallbackWrapper::wrap): Ditto.
              * bindings/js/JSInspectorCallbackWrapper.h: Ditto.
      
              * bindings/js/JSNamedNodesCollection.cpp:
              (WebCore::JSNamedNodesCollection::JSNamedNodesCollection): Changed to
              take an ExecState argument instead of a prototype. Create a unique
              StructureID instead of sharing.
              * bindings/js/JSNamedNodesCollection.h: Ditto.
      
              * bindings/js/JSQuarantinedObjectWrapper.cpp: Removed overloaded
              constructor that takes a prototype instead of a structure.
              * bindings/js/JSQuarantinedObjectWrapper.h: Ditto.
      
              * bindings/js/JSRGBColor.cpp:
              (WebCore::JSRGBColor::JSRGBColor): Take ExecState instead of a
              prototype; create a unique structure.
              (WebCore::getJSRGBColor): Ditto.
              * bindings/js/JSRGBColor.h: Ditto.
      
              * bindings/js/JSSQLResultSetRowListCustom.cpp:
              (WebCore::JSSQLResultSetRowList::item): Use constructEmptyObject instead
              of explicit coding the idiom for making a new object.
      
              * bindings/js/JSXMLHttpRequestConstructor.cpp:
              (WebCore::JSXMLHttpRequestConstructor::JSXMLHttpRequestConstructor):
              Create a unique structure instead of the shared one.
              * bindings/js/JSXSLTProcessorConstructor.cpp:
              (WebCore::JSXSLTProcessorConstructor::JSXSLTProcessorConstructor):
              Ditto.
      
              * bindings/js/ScriptController.cpp:
              (WebCore::ScriptController::clearWindowShell): Let the window shell's
              setWindow function create the JSDOMWindow instead of doing it here.
      
              * bindings/scripts/CodeGeneratorJS.pm: Changed to use PassRefPtr for
              the structure and the wrapped object when creating wrappers.
              Simplified some of the special cases for DOMWindow so they are
              different only in ways the need to be. Eliminated the
              JSDOMWindow::createPrototype and JSDOMWindowPrototype::self
              functions. Moved responsibility for creating the structure and
              parent prototype out of the prototype constructor into the
              createPrototype function. Removed the unused "DoNotCache" flag for
              objects other than DOMWindow. Use getDOMConstructor instead of
              cacheGlobalObject for constructors. Make each constructor have
              a unique structure ID.
      
              * bridge/objc/objc_runtime.h: Added createPrototype and changed the
              name of the info member to s_info so we can use the standard DOM
              binding macros to handl the prototype.
              * bridge/objc/objc_runtime.mm: Fixed namespacing a bit.
              (JSC::Bindings::ObjcFallbackObjectImp::ObjcFallbackObjectImp):
              Create a unique structure using getDOMStructure.
      
              * bridge/runtime_array.cpp: Fixed namespacing a bit.
              (JSC::RuntimeArray::RuntimeArray): Create a unique structure using
              getDOMStructure.
              * bridge/runtime_array.h: Added createPrototype so getDOMStructure
              will work.
      
              * bridge/runtime_object.cpp:
              (JSC::RuntimeObjectImp::RuntimeObjectImp): Create a unique structure using
              getDOMStructure.
              * bridge/runtime_object.h: Added createPrototype so getDOMStructure
              will work.
      
              * history/CachedPage.cpp:
              (WebCore::CachedPage::restore): Let the window shell's
              setWindow function create the JSDOMWindow instead of doing it here.
      
              * page/DOMWindow.idl: Removed DoNotCache, which is no longer used.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      39a180f1
  15. 18 Sep, 2008 1 commit
    • darin@apple.com's avatar
      2008-09-18 Darin Adler <darin@apple.com> · 1d103ae8
      darin@apple.com authored
              Reviewed by Sam Weinig.
      
              - fix https://bugs.webkit.org/show_bug.cgi?id=20925
                LEAK messages appear every time I quit
      
              * JavaScriptCore.exp: Updated, and also added an export
              needed for future WebCore use of JSC::StructureID.
      
              * wtf/RefCountedLeakCounter.cpp:
              (WTF::RefCountedLeakCounter::suppressMessages): Added.
              (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
              (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
              (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
              log the reason there was no leak checking done.
              (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
              (WTF::RefCountedLeakCounter::decrement): Ditto.
      
              * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
              new functions, suppressMessages and cancelMessageSuppression. Also
              added m_ prefixes to the data member names.
      
      2008-09-18  Darin Adler  <darin@apple.com>
      
              Reviewed by Sam Weinig.
      
              - fix https://bugs.webkit.org/show_bug.cgi?id=20925
                LEAK messages appear every time I quit
      
              * WebView/WebPreferences.mm:
              (-[WebPreferences setFullDocumentTeardownEnabled:]): Removed unneeded call
              to setLogLeakMessages.
              * WebView/WebView.mm:
              (-[WebView _closeWithFastTeardown]): Call RefCountedLeakCounter::suppressMessages,
              telling it that we can't track leaks because at least one WebView was closed with
              fast teardown.
              (-[WebView _close]): Removed unneeded call to setLogLeakMessages. Added a call to
              cancelMessageSuppression since the WebView is no longer open.
              Added an explicit garbage collect to help with the case where we're closing during
              the quit process -- the garbageCollectSoon() calls done inside WebCore won't help
              us in that case.
              (-[WebView initWithFrame:frameName:groupName:]): Call
              RefCountedLeakCounter::suppressMessages telling it that we can't track leaks
              because at least one WebView is currently open.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1d103ae8
  16. 14 Sep, 2008 1 commit
    • mjs@apple.com's avatar
      2008-09-14 Maciej Stachowiak <mjs@apple.com> · 988df6c1
      mjs@apple.com authored
              Reviewed by Cameron Zwarich.
              
              - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
              
              ~5% speedup on v8 earley-boyer test
      
              * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
              * API/JSCallbackObjectFunctions.h:
              (JSC::::hasInstance): Ditto.
              * API/JSValueRef.cpp:
              (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
              * JavaScriptCore.exp:
              * VM/CTI.cpp:
              (JSC::CTI::privateCompileMainPass): Pass along prototype.
              * VM/CodeBlock.cpp:
              (JSC::CodeBlock::dump): Print third arg.
              * VM/CodeGenerator.cpp:
              (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
              is a third argument.
              * VM/CodeGenerator.h:
              * VM/Machine.cpp:
              (JSC::Machine::privateExecute): Pass along the prototype.
              (JSC::Machine::cti_op_instanceof): ditto
              * kjs/JSObject.cpp:
              (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
              * kjs/JSObject.h:
              * kjs/nodes.cpp:
              (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
              property and pass that register to instanceof.
              * kjs/nodes.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      988df6c1
  17. 12 Sep, 2008 1 commit
  18. 10 Sep, 2008 2 commits
    • weinig@apple.com's avatar
      2008-09-10 Sam Weinig <sam@webkit.org> · 529e3d55
      weinig@apple.com authored
              Reviewed by Geoff Garen.
      
              Add inline property storage for JSObject.
      
              1.2% progression on Sunspider. .5% progression on the v8 test suite.
      
              * JavaScriptCore.exp:
              * VM/CTI.cpp:
              (JSC::CTI::privateCompileGetByIdProto):
              (JSC::CTI::privateCompileGetByIdChain):
              * kjs/JSObject.cpp:
              (JSC::JSObject::mark): There is no reason to check storageSize now that
              we start from 0.
              (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
              * kjs/JSObject.h:
              (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
              now so there is no reason to .get()
              (JSC::JSObject::usingInlineStorage):
              (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
              inline storage.
              (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
              storage.
              (JSC::JSObject::putDirect): Switch to the heap storage only when we know
              we know that we are about to add a property that will overflow the inline
              storage.
              * kjs/PropertyMap.cpp:
              (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
              now handled by JSObject.
              (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
              * kjs/PropertyMap.h:
              (JSC::PropertyMap::storageSize): Rename from markingCount.
              * kjs/StructureID.cpp:
              (JSC::StructureID::addPropertyTransition): Don't resize the property storage
              if we are using inline storage.
              * kjs/StructureID.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      529e3d55
    • weinig@apple.com's avatar
      2008-09-09 Sam Weinig <sam@webkit.org> · 8ea1c1f4
      weinig@apple.com authored
              Reviewed by Mark Rowe.
      
              Remove unnecessary override of getOffset.
      
              Sunspider reports this as a .6% progression.
      
              * JavaScriptCore.exp:
              * kjs/JSObject.h:
              (JSC::JSObject::getDirectLocation):
              (JSC::JSObject::getOwnPropertySlotForWrite):
              (JSC::JSObject::putDirect):
              * kjs/PropertyMap.cpp:
              * kjs/PropertyMap.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8ea1c1f4
  19. 09 Sep, 2008 3 commits
    • weinig@apple.com's avatar
      2008-09-09 Sam Weinig <sam@webkit.org> · 0d878bff
      weinig@apple.com authored
              Reviewed by Geoffrey Garen.
      
              Replace uses of PropertyMap::get and PropertyMap::getLocation with
              PropertyMap::getOffset.
      
              Sunspider reports this as a .6% improvement.
      
              * JavaScriptCore.exp:
              * kjs/JSObject.cpp:
              (JSC::JSObject::put):
              (JSC::JSObject::deleteProperty):
              (JSC::JSObject::getPropertyAttributes):
              * kjs/JSObject.h:
              (JSC::JSObject::getDirect):
              (JSC::JSObject::getDirectLocation):
              (JSC::JSObject::locationForOffset):
              * kjs/PropertyMap.cpp:
              (JSC::PropertyMap::remove):
              (JSC::PropertyMap::getOffset):
              * kjs/PropertyMap.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0d878bff
    • mrowe@apple.com's avatar
      Fix builds using the "debug" variant. · 69cb579c
      mrowe@apple.com authored
      Rubber-stamped by Oliver Hunt.
      
      This reverts r36130 and tweaks Identifier to export the same symbols for Debug
      and Release configurations.
      
      * Configurations/JavaScriptCore.xcconfig:
      * DerivedSources.make:
      * JavaScriptCore.Debug.exp: Removed.
      * JavaScriptCore.base.exp: Removed.
      * JavaScriptCore.exp: Added.
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * kjs/identifier.cpp:
      (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
      there is no overhead in Release builds.
      (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
      * kjs/identifier.h:
      (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
      no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      69cb579c
    • weinig@apple.com's avatar
      JavaScriptCore: · 22294303
      weinig@apple.com authored
      2008-09-08  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Maciej Stachowiak and Oliver Hunt.
      
              Split storage of properties out of the PropertyMap and into the JSObject
              to allow sharing PropertyMap on the StructureID.  In order to get this
              function correctly, the StructureID's transition mappings were changed to
              transition based on property name and attribute pairs, instead of just
              property name.
      
              - Removes the single property optimization now that the PropertyMap is shared.
                This will be replaced by in-lining some values on the JSObject.
      
              This is a wash on Sunspider and a 6.7% win on the v8 test suite.
      
              * JavaScriptCore.base.exp:
              * VM/CTI.cpp:
              (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
              (JSC::CTI::privateCompileGetByIdProto): Ditto.
              (JSC::CTI::privateCompileGetByIdChain): Ditto.
              (JSC::CTI::privateCompilePutByIdReplace): Ditto.
              * kjs/JSObject.cpp:
              (JSC::JSObject::mark): Mark the PropertyStorage.
              (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
              (JSC::JSObject::deleteProperty): Ditto.
              (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
              (JSC::JSObject::defineSetter): Ditto.
              (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
              (JSC::JSObject::getPropertyNames): Ditto.
              (JSC::JSObject::removeDirect): Ditto.
              * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
              (JSC::JSObject::propertyStorage): return the PropertyStorage.
              (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
              (JSC::JSObject::getDirectLocation): Ditto.
              (JSC::JSObject::offsetForLocation): Compute location directly.
              (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
              (JSC::JSObject::hasGetterSetterProperties): Ditto.
              (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
              (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
              (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
              (JSC::JSObject::getOwnPropertySlot): Ditto.
              (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
              * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
              (JSC::PropertyMap::checkConsistency): 
              (JSC::PropertyMap::operator=):
              (JSC::PropertyMap::~PropertyMap):
              (JSC::PropertyMap::get):
              (JSC::PropertyMap::getLocation):
              (JSC::PropertyMap::put):
              (JSC::PropertyMap::getOffset):
              (JSC::PropertyMap::insert):
              (JSC::PropertyMap::expand):
              (JSC::PropertyMap::rehash):
              (JSC::PropertyMap::createTable):
              (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
              (JSC::PropertyMap::remove):
              (JSC::PropertyMap::getEnumerablePropertyNames):
              * kjs/PropertyMap.h: 
              (JSC::PropertyMapEntry::PropertyMapEntry):
              (JSC::PropertyMap::isEmpty):
              (JSC::PropertyMap::size):
              (JSC::PropertyMap::makingCount):
              (JSC::PropertyMap::PropertyMap):
      
              * kjs/StructureID.cpp: 
              (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
              and attributes. 
              (JSC::StructureID::toDictionaryTransition): Copy the map.
              (JSC::StructureID::changePrototypeTransition): Copy the map.
              (JSC::StructureID::getterSetterTransition): Copy the map.
              (JSC::StructureID::~StructureID): 
              * kjs/StructureID.h:
              (JSC::TransitionTableHash::hash): Custom hash for transition map.
              (JSC::TransitionTableHash::equal): Ditto.
              (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
              (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
              (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
              (JSC::StructureID::propertyMap): Added.
      
      JavaScriptGlue:
      
      2008-09-08  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Maciej Stachowiak and Oliver Hunt.
      
              Add forwarding headers.
      
              * ForwardingHeaders/wtf/HashFunctions.h: Added.
              * ForwardingHeaders/wtf/HashTraits.h: Added.
      
      WebCore:
      
      2008-09-08  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Maciej Stachowiak and Oliver Hunt.
      
              Add forwarding headers.
      
              * ForwardingHeaders/wtf/HashFunctions.h: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      22294303
  20. 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
  21. 06 Sep, 2008 1 commit
  22. 05 Sep, 2008 3 commits
    • timothy@apple.com's avatar
      Build fix. · 1567b422
      timothy@apple.com authored
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1567b422
    • timothy@apple.com's avatar
      Build fix. · 1434ade9
      timothy@apple.com authored
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1434ade9
    • darin@apple.com's avatar
      2008-09-05 Darin Adler <darin@apple.com> · 8339ff2b
      darin@apple.com authored
              Reviewed by Geoff Garen.
      
              - fix https://bugs.webkit.org/show_bug.cgi?id=20673
                single-character strings are churning in the Identifier table
      
              1.007x as fast on SunSpider overall
              1.167x as fast on SunSpider string/fasta
      
              * JavaScriptCore.exp: Updated.
              * kjs/SmallStrings.cpp:
              (KJS::SmallStrings::singleCharacterStringRep): Added.
              * kjs/SmallStrings.h: Added singleCharacterStringRep for clients that
              need just a UString, not a JSString.
              * kjs/identifier.cpp:
              (KJS::Identifier::add): Added special cases for single character strings
              so that the UString::Rep that ends up in the identifier table is the one
              from the single-character string optimization; otherwise we end up having
              to look it up in the identifier table over and over again.
              (KJS::Identifier::addSlowCase): Ditto.
              (KJS::Identifier::checkSameIdentifierTable): Made this function an empty
              inline in release builds so that callers don't have to put #ifndef NDEBUG
              at each call site.
              * kjs/identifier.h:
              (KJS::Identifier::add): Removed #ifndef NDEBUG around the calls to
              checkSameIdentifierTable.
              (KJS::Identifier::checkSameIdentifierTable): Added. Empty inline version
              for NDEBUG builds.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8339ff2b
  23. 03 Sep, 2008 2 commits
    • kmccullough@apple.com's avatar
      JavaScriptCore: · b0f4c622
      kmccullough@apple.com authored
      2008-09-03  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Tim.
      
              Remove the rest of the "zombie" code from the profiler.
              - There is no longer a need for the ProfilerClient callback mechanism.
      
              * API/JSProfilerPrivate.cpp:
              (JSStartProfiling):
              * JavaScriptCore.exp:
              * profiler/HeavyProfile.h:
              * profiler/ProfileGenerator.cpp:
              (KJS::ProfileGenerator::create):
              (KJS::ProfileGenerator::ProfileGenerator):
              * profiler/ProfileGenerator.h:
              (KJS::ProfileGenerator::profileGroup):
              * profiler/Profiler.cpp:
              (KJS::Profiler::startProfiling):
              (KJS::Profiler::stopProfiling): Immediately return the profile when
              stopped instead of using a callback.
              * profiler/Profiler.h:
              * profiler/TreeProfile.h:
      
      WebCore:
      
      2008-09-03  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Tim.
      
              Remove the rest of the "zombie" code from the profiler.
              - There is no longer a need for the ProfilerClient callback mechanism.
      
              * page/Console.cpp: 
              (WebCore::Console::Console):
              (WebCore::Console::profile):
              (WebCore::Console::profileEnd): Move the variables from the header to
              here since we don't have to wait for a callback to use them.
              * page/Console.h:
              * page/InspectorController.cpp:
              (WebCore::InspectorController::startUserInitiatedProfiling):
              (WebCore::InspectorController::stopUserInitiatedProfiling):
              * page/InspectorController.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b0f4c622
    • kmccullough@apple.com's avatar
      JavaScriptCore: · 70168ee9
      kmccullough@apple.com authored
      2008-09-02  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Darin and Tim.
      
              Remove most of the "zombie" mode from the profiler.  Next we will need
              to remove the client callback mechanism in profiles.
      
              - This simplifies the code, leverages the recent changes I've made in
              getting line numbers from SquirrelFish, and is a slight speed
              improvement on SunSpider.
              - Also the "zombie" mode was a constant source of odd edge cases and
              obscure bugs so it's good to remove since all of its issues may not have
              been found.
      
              * API/JSProfilerPrivate.cpp: No need to call didFinishAllExecution() any
              more.
              (JSEndProfiling):
              * JavaScriptCore.exp: Export the new signature of retrieveLastCaller()
              * VM/Machine.cpp:
              (KJS::Machine::execute): No need to call didFinishAllExecution() any
              more.
              (KJS::Machine::retrieveCaller): Now operates on InternalFunctions now
              since the RegisterFile is no longer guaranteeded to store only
              JSFunctions
              (KJS::Machine::retrieveLastCaller): Now also retrieve the function's
              name
              (KJS::Machine::callFrame): A result of changing retrieveCaller()
              * VM/Machine.h:
              * VM/Register.h: 
              * kjs/JSGlobalObject.cpp:
              (KJS::JSGlobalObject::~JSGlobalObject):
              * kjs/nodes.h:
              * profiler/ProfileGenerator.cpp:
              (KJS::ProfileGenerator::create): Now pass the original exec and get the
              global exec and client when necessary.  We need the original exec so we
              can have the stack frame where profiling started.
              (KJS::ProfileGenerator::ProfileGenerator): ditto.
              (KJS::ProfileGenerator::addParentForConsoleStart): This is where the 
              parent to star of the profile is added, if there is one.
              (KJS::ProfileGenerator::willExecute): Remove uglyness!
              (KJS::ProfileGenerator::didExecute): Ditto!
              (KJS::ProfileGenerator::stopProfiling):
              (KJS::ProfileGenerator::removeProfileStart): Use a better way to find
              and remove the function we are looking for.
              (KJS::ProfileGenerator::removeProfileEnd): Ditto.
              * profiler/ProfileGenerator.h:
              (KJS::ProfileGenerator::client):
              * profiler/ProfileNode.cpp:
              (KJS::ProfileNode::removeChild): Add a better way to remove a child from
              a ProfileNode.
              (KJS::ProfileNode::stopProfiling):
              (KJS::ProfileNode::debugPrintData): Modified a debug-only diagnostic
              function to be sane.
              * profiler/ProfileNode.h:
              * profiler/Profiler.cpp: Change to pass the original exec state.
              (KJS::Profiler::startProfiling):
              (KJS::Profiler::stopProfiling):
              (KJS::Profiler::willExecute):
              (KJS::Profiler::didExecute):
              (KJS::Profiler::createCallIdentifier):
              * profiler/Profiler.h:
      
      WebCore:
      
      2008-09-03  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Darin and Tim.
      
              Remove most of the "zombie" mode from the profiler.  Next we will need
              to remove the client callback mechanism in profiles.
              - These changes are a result of changes to JSCore.
      
              * manual-tests/inspector/profiler-test-nested-start-and-stop-profiler.html:
              * page/Console.cpp:
              (WebCore::retrieveLastCaller):
              (WebCore::Console::profileEnd):
              * page/InspectorController.cpp:
              (WebCore::InspectorController::stopUserInitiatedProfiling):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      70168ee9
  24. 02 Sep, 2008 1 commit
    • ggaren@apple.com's avatar
      JavaScriptCore: · 8d8ff6a5
      ggaren@apple.com authored
      2008-09-02  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Sam Weinig.
              
              Implemented the rest of Darin's review comments for the 09-01 inline
              caching patch.
              
              SunSpider says 0.5% faster, but that seems like noise.
      
              * JavaScriptCore.xcodeproj/project.pbxproj: Put PutPropertySlot into
              its own file, and added BatchedTransitionOptimizer.
      
              * VM/CodeBlock.cpp:
              (KJS::CodeBlock::~CodeBlock): Use array indexing instead of a pointer
              iterator.
      
              * VM/CodeGenerator.cpp:
              (KJS::CodeGenerator::CodeGenerator): Used BatchedTransitionOptimizer to
              make batched put and remove for declared variables fast, without forever
              pessimizing the global object. Removed the old getDirect/removeDirect hack
              that tried to do the same in a more limited way.
      
              * VM/CodeGenerator.h: Moved IdentifierRepHash to the KJS namespace since
              it doesn't specialize anything in WTF.
      
              * VM/Machine.cpp:
              (KJS::Machine::Machine): Nixed the DummyConstruct tag because it was
              confusingly named.
      
              (KJS::Machine::execute):  Used BatchedTransitionOptimizer, as above. Fixed
              up some comments.
      
              (KJS::cachePrototypeChain): Cast to JSObject*, since it's more specific.
      
              (KJS::Machine::tryCachePutByID): Use isNull() instead of comparing to
              jsNull(), since isNull() leaves more options open for the future.
              (KJS::Machine::tryCacheGetByID): ditto
              (KJS::Machine::privateExecute): ditto
      
              * VM/SamplingTool.cpp:
              (KJS::SamplingTool::dump): Use C++-style cast, to match our style
              guidelines.
      
              * kjs/BatchedTransitionOptimizer.h: Added. New class that allows host
              code to add a batch of properties to an object in an efficient way.
      
              * kjs/JSActivation.cpp: Use isNull(), as above.
      
              * kjs/JSArray.cpp: Get rid of DummyConstruct tag, as above.
              * kjs/JSArray.h:
      
              * kjs/JSGlobalData.cpp: Nixed two unused StructureIDs.
              * kjs/JSGlobalData.h:
      
              * kjs/JSImmediate.cpp: Use isNull(), as above.
      
              * kjs/JSObject.cpp:
              (KJS::JSObject::mark): Moved mark tracing code elsewhere, to make this
              function more readable.
      
              (KJS::JSObject::put): Use isNull(), as above.
      
              (KJS::JSObject::createInheritorID): Return a raw pointer, since the
              object is owned by a data member, not necessarily the caller.
              * kjs/JSObject.h:
      
              * kjs/JSString.cpp: Use isNull(), as above.
      
              * kjs/PropertyMap.h: Updated to use PropertySlot::invalidOffset.
      
              * kjs/PropertySlot.h: Changed KJS_INVALID_OFFSET to WTF::notFound
              because C macros are so 80's.
      
              * kjs/PutPropertySlot.h: Added. Split out of PropertySlot.h. Also renamed
              PutPropertySlot::SlotType to PutPropertySlot::Type, and slotBase to base,
              since "slot" was redundant.
      
              * kjs/StructureID.cpp: Added a new transition *away* from dictionary
              status, to support BatchedTransitionOptimizer.
      
              (KJS::StructureIDChain::StructureIDChain): No need to store m_size as
              a data member, so keep it in a local, which might be faster.
              * kjs/StructureID.h:
      
              * kjs/SymbolTable.h: Moved IdentifierRepHash to KJS namespace, as above.
              * kjs/ustring.h:
      
      JavaScriptGlue:
      
      2008-09-02  Geoffrey Garen  <ggaren@apple.com>
      
              Reviewed by Sam Weinig.
              
              Implemented the rest of Darin's review comments for the 09-01 inline
              caching patch.
              
              * ForwardingHeaders/kjs/PutPropertySlot.h: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8d8ff6a5