1. 16 Apr, 2008 11 commits
    • kmccullough@apple.com's avatar
      2008-04-16 Kevin McCullough <kmccullough@apple.com> · ac769767
      kmccullough@apple.com authored
              Reviewed by Sam and Geoff.
      
              -<rdar://problem/5770054> JavaScript profiler (10928)
              Inital profiler prototype
      
              * GNUmakefile.am: Added new files to project
              * JavaScriptCore.pri: Ditto
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto
              * JavaScriptCore.xcodeproj/project.pbxproj: Ditto
              * JavaScriptCoreSources.bkl: Ditto
              * kjs/config.h: Put compiling flag in here.
              * kjs/function.cpp: Instrument calling the function eval().
              (KJS::eval):
              * kjs/interpreter.cpp: Instrument evaluating global scopes.
              (KJS::Interpreter::evaluate):
              * kjs/object.cpp: Instrument JS function calls.
              (KJS::JSObject::call):
              * profiler: Added.
              * profiler/FunctionCallProfile.cpp: Added.
              (KJS::FunctionCallProfile::FunctionCallProfile):
              (KJS::FunctionCallProfile::~FunctionCallProfile):
              (KJS::FunctionCallProfile::willExecute): Call right before the JS function or executing context is executed to start the profiler's timer.
              (KJS::FunctionCallProfile::didExecute): Call right after the JS function or executing context is executed to stop the profiler's timer.
              (KJS::FunctionCallProfile::addChild): Add a child to the current FunctionCallProfile if it isn't already a child of the current FunctionalCallProfile.
              (KJS::FunctionCallProfile::findChild): Return the child that matches the given name if there is one.
              (KJS::FunctionCallProfile::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
              * profiler/FunctionCallProfile.h: Added.
              (KJS::FunctionCallProfile::FunctionCallProfile):
              (KJS::FunctionCallProfile::~FunctionCallProfile):
              (KJS::FunctionCallProfile::functionName):
              (KJS::FunctionCallProfile::microSecs):
              * profiler/Profiler.cpp: Added.
              (KJS::Profiler::profiler):
              (KJS::Profiler::sharedProfiler): Return global singleton (may change due to multi-threading concerns)
              (KJS::Profiler::startProfiling): Don't start collecting profiling information until the user starts the profiler. Also don't clear old prfiled data until the profiler is restarted.
              (KJS::Profiler::stopProfiling): Stop collecting profile information.
              (KJS::Profiler::willExecute): Same as above. 
              (KJS::Profiler::didExecute): Same as above.
              (KJS::Profiler::insertStackNamesInTree): Follow the stack of the given names and if a sub-stack is not in the current tree, add it.
              (KJS::Profiler::getStackNames): Get the names from the different passed in parameters and order them as a stack.
              (KJS::Profiler::getFunctionName): Get the function name from the given parameter.
              (KJS::Profiler::printDataSampleStyle): Print the current profiled information in a format that matches sample's output.
              (KJS::Profiler::debugLog):
              * profiler/Profiler.h: Added.
              (KJS::Profiler::Profiler):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ac769767
    • weinig@apple.com's avatar
      JavaScriptCore: · 843df6f3
      weinig@apple.com authored
      2008-04-16  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Darin Adler.
      
              - Remove kjs_ prefix from strtod, dtoa, and freedtoa and put it
                in the KJS namespace.
              - Make strtod, dtoa, and freedtoa c++ functions instead of extern "C".
              - Remove mode switching from dtoa.  ~2% improvement on test 26. 
              - Removes all unnecessary #defines from dtoa code.
      
              * JavaScriptCore.exp:
              * kjs/dtoa.cpp:
              (KJS::ulp):
              (KJS::b2d):
              (KJS::d2b):
              (KJS::ratio):
              (KJS::):
              (KJS::strtod):
              (KJS::freedtoa):
              (KJS::dtoa):
              * kjs/dtoa.h:
              * kjs/function.cpp:
              (KJS::parseInt):
              * kjs/lexer.cpp:
              (KJS::Lexer::lex):
              * kjs/number_object.cpp:
              (KJS::integer_part_noexp):
              (KJS::numberProtoFuncToExponential):
              * kjs/ustring.cpp:
              (KJS::UString::from):
              (KJS::UString::toDouble):
      
      WebCore:
      
      2008-04-16  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Darin Adler.
      
              Rename kjs_strtod to KJS::strtod.
      
              * platform/text/String.cpp:
              (WebCore::charactersToDouble):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      843df6f3
    • ap@webkit.org's avatar
      Reviewed by Darin. · 7a274f51
      ap@webkit.org authored
              Get rid of static execForCompareByStringForQSort in array_instance.cpp.
      
              No change on SunSpider, CelticKane or iBench JavaScript.
      
              * kjs/array_instance.cpp:
              (KJS::ArraySortComparator::ArraySortComparator):
              (KJS::ArraySortComparator::operator()):
              (KJS::ArrayInstance::sort):
              Switch slow case to std::sort, so that ExecState can be passed in a comparator.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7a274f51
    • ap@webkit.org's avatar
      Reviewed by Adam Roben. · af12b541
      ap@webkit.org authored
              MSVC build fix.
      
              * kjs/CommonIdentifiers.cpp:
              * kjs/CommonIdentifiers.h:
              * kjs/Parser.cpp:
              * kjs/Parser.h:
              * kjs/identifier.cpp:
              * kjs/lexer.h:
              * wtf/ThreadSpecific.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      af12b541
    • ap@webkit.org's avatar
      Build fix. · a80d17d5
      ap@webkit.org authored
              * kjs/date_object.cpp:
              * kjs/date_object.h:
              Don't include DateMath.h from date_object.h, as the latter is used from WebCore, while
              where the former is not available.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a80d17d5
    • zecke@webkit.org's avatar
      2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org> · 8df9625e
      zecke@webkit.org authored
              Unreviewed build fix for MSVC. It does not want to have
              WTF in the KJS namespace.
      
              * kjs/CommonIdentifiers.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8df9625e
    • zecke@webkit.org's avatar
      2008-04-16 Holger Hans Peter Freyther <zecke@selfish.org> · d1d85a93
      zecke@webkit.org authored
              Unreviewed build fix for gcc.
      
              ::msToGregorianDateTime  is not known to it.
      
              * kjs/date_object.cpp:
              (KJS::DateInstance::msToGregorianDateTime):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d1d85a93
    • ap@webkit.org's avatar
      Reviewed by Oliver Hunt. · 5e626b00
      ap@webkit.org authored
              Initialize threadMapMutex safely (as already done in ThreadingWin).
      
              * wtf/ThreadingGtk.cpp:
              (WTF::threadMapMutex):
              (WTF::initializeThreading):
              * wtf/ThreadingPthreads.cpp:
              (WTF::threadMapMutex):
              (WTF::initializeThreading):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31939 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5e626b00
    • ap@webkit.org's avatar
      Fix ChangeLog spelling. · f4a595bd
      ap@webkit.org authored
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f4a595bd
    • ap@webkit.org's avatar
      Reviewed by Adam Roben. · 0fe258b0
      ap@webkit.org authored
              Cache Gregorian date/time structure on DateInstance objects for 1.027x SunSpider speedup
              (1.65x on date-format-xparb, 1.13x on date-format-tofte).
      
              * kjs/DateMath.h:
              (KJS::GregorianDateTime::copyFrom): Added. It presumably makes sense to keep GregorianDateTime
              Noncopiable, so it's not just operator=.
      
              * kjs/date_object.h: Added a per-object cache.
      
              * kjs/date_object.cpp:
              (KJS::DateInstance::DateInstance):
              (KJS::DateInstance::msToGregorianDateTime):
              (KJS::dateProtoFuncToString):
              (KJS::dateProtoFuncToUTCString):
              (KJS::dateProtoFuncToDateString):
              (KJS::dateProtoFuncToTimeString):
              (KJS::dateProtoFuncToLocaleString):
              (KJS::dateProtoFuncToLocaleDateString):
              (KJS::dateProtoFuncToLocaleTimeString):
              (KJS::dateProtoFuncGetFullYear):
              (KJS::dateProtoFuncGetUTCFullYear):
              (KJS::dateProtoFuncToGMTString):
              (KJS::dateProtoFuncGetMonth):
              (KJS::dateProtoFuncGetUTCMonth):
              (KJS::dateProtoFuncGetDate):
              (KJS::dateProtoFuncGetUTCDate):
              (KJS::dateProtoFuncGetDay):
              (KJS::dateProtoFuncGetUTCDay):
              (KJS::dateProtoFuncGetHours):
              (KJS::dateProtoFuncGetUTCHours):
              (KJS::dateProtoFuncGetMinutes):
              (KJS::dateProtoFuncGetUTCMinutes):
              (KJS::dateProtoFuncGetSeconds):
              (KJS::dateProtoFuncGetUTCSeconds):
              (KJS::dateProtoFuncGetTimezoneOffset):
              (KJS::setNewValueFromTimeArgs):
              (KJS::setNewValueFromDateArgs):
              (KJS::dateProtoFuncSetYear):
              (KJS::dateProtoFuncGetYear):
              Use the cache when converting.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0fe258b0
    • ap@webkit.org's avatar
      Reviewed by Darin. · 3bfd7d04
      ap@webkit.org authored
              Implement an abstraction for thread-specific storage, use it to get rid of some static objects.
      
              SunSpider results were not conclusive, possibly up to 0.2% slowdown.
      
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * JavaScriptCore.vcproj/WTF/WTF.vcproj:
              Added ThreadSpecific.h
      
              * wtf/ThreadSpecific.h: Added.
              (WTF::::ThreadSpecific):
              (WTF::::~ThreadSpecific):
              (WTF::::get):
              (WTF::::set):
              (WTF::::destroy):
              (WTF::T):
              (WTF::::operator):
              Only implemented for platforms that use pthreads.
      
              * kjs/CommonIdentifiers.cpp:
              (KJS::CommonIdentifiers::shared):
              * kjs/CommonIdentifiers.h:
              * kjs/InitializeThreading.cpp:
              (KJS::initializeThreading):
              * kjs/Parser.cpp:
              (KJS::parser):
              * kjs/Parser.h:
              * kjs/identifier.cpp:
              (KJS::identifierTable):
              (KJS::literalIdentifierTable):
              (KJS::Identifier::initializeIdentifierThreading):
              * kjs/identifier.h:
              * kjs/lexer.cpp:
              (KJS::lexer):
              * kjs/lexer.h:
              Make static instances per-thread.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3bfd7d04
  2. 15 Apr, 2008 2 commits
    • andersca@apple.com's avatar
      JavaScriptCore: · b8666938
      andersca@apple.com authored
      2008-04-15  Anders Carlsson  <andersca@apple.com>
      
              Reviewed by Adam.
      
              Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
              
              * Configurations/JavaScriptCore.xcconfig:
      
      WebCore:
      
      2008-04-15  Anders Carlsson  <andersca@apple.com>
      
              Reviewed by Adam.
      
              Add empty files for the application cache.
              
              * Configurations/WebCore.xcconfig:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.vcproj/build-generated-files.sh:
              Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
              
              * WebCore.xcodeproj/project.pbxproj:
              * loader/appcache: Added.
              * loader/appcache/ApplicationCache.cpp: Added.
              * loader/appcache/ApplicationCache.h: Added.
              * loader/appcache/ApplicationCacheGroup.cpp: Added.
              * loader/appcache/ApplicationCacheGroup.h: Added.
              * loader/appcache/ApplicationCacheResource.cpp: Added.
              * loader/appcache/ApplicationCacheResource.h: Added.
              * loader/appcache/DOMApplicationCache.cpp: Added.
              * loader/appcache/DOMApplicationCache.h: Added.
              * loader/appcache/DOMApplicationCache.idl: Added.
              * loader/appcache/ManifestParser.cpp: Added.
              * loader/appcache/ManifestParser.h: Added.
      
      WebKit/mac:
      
      2008-04-15  Anders Carlsson  <andersca@apple.com>
      
              Reviewed by Adam.
      
              Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
      
              * Configurations/WebKit.xcconfig:
      
      WebKit/win:
      
      2008-04-15  Anders Carlsson  <andersca@apple.com>
      
              Reviewed by Adam.
      
              Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
      
              * WebKit.vcproj/WebKit.vcproj:
      
      WebKitTools:
      
      2008-04-15  Anders Carlsson  <andersca@apple.com>
      
              Reviewed by Adam.
      
              Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
      
              * Scripts/build-webkit:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b8666938
    • hausmann@webkit.org's avatar
      Fix compilation with Qt namespaces · 511b001e
      hausmann@webkit.org authored
      Qt can be configured to have all of its classes inside a specified namespaces.
      This is for example used in plugin/component environments like Eclipse.
      
      This change makes it possible to let the Qt port compile against a namespaced
      Qt by the use of macros Qt provides to properly forward declare Qt classes in
      the namespace.
      
      Signed-off-by: Simon
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      511b001e
  3. 14 Apr, 2008 5 commits
  4. 11 Apr, 2008 6 commits
    • antti@apple.com's avatar
      2008-04-11 Antti Koivisto <antti@apple.com> · bc2160f6
      antti@apple.com authored
              Reviewed by Maciej.
              
              Add default hash for pairs of hashable types.
      
              * wtf/HashFunctions.h:
              (WTF::PairHash::hash):
              (WTF::PairHash::equal):
              (WTF::):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bc2160f6
    • ap@webkit.org's avatar
      Reviewed by Geoff. · 7d34b911
      ap@webkit.org authored
              Make DateMath.cpp thread safe.
      
              No measurable change on SunSpider (should be a very small speedup).
      
              * kjs/DateMath.cpp:
              (KJS::mimimumYearForDST): (KJS::equivalentYearForDST): Got rid of double caching of the
              same precomputed value.
              (KJS::calculateUTCOffset): (KJS::getUTCOffset): Factored actual UTC offset calculation code
              out of getUTCOffset(), and notification setup into initDateMath().
      
              (KJS::initDateMath): Added.
      
              * kjs/DateMath.h:
              * kjs/InitializeThreading.cpp:
              (KJS::initializeThreading):
              Added initDateMath().
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7d34b911
    • ap@webkit.org's avatar
      Windows build fix. · 14218046
      ap@webkit.org authored
              * kjs/grammar.y:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      14218046
    • ap@webkit.org's avatar
      Tiger build fix. Forward declaring a union didn't work for whatever reason, make the · d4a69f91
      ap@webkit.org authored
              parameters void*.
      
              * kjs/grammar.y:
              * kjs/lexer.cpp:
              (kjsyylex):
              (KJS::Lexer::lex):
              * kjs/lexer.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d4a69f91
    • ap@webkit.org's avatar
      Reviewed by Geoff. · c6ee1e99
      ap@webkit.org authored
              Generate a pure (re-entrant) parser with Bison.
      
              No change on SunSpider.
      
              * kjs/Parser.cpp:
              (KJS::Parser::parse):
              * kjs/grammar.y:
              * kjs/lexer.cpp:
              (kjsyylex):
              (KJS::Lexer::lex):
              * kjs/lexer.h:
              Pass state as function arguments, instead of global data. Don't call lexer() as often as
              before, as this function is about to become slower due to thread-specific storage.
      
              * kjs/function.cpp:
              (KJS::isStrWhiteSpace): Don't call isSeparatorSpace() for 8-bit characters, as these are
              already taken care of. This is a small speedup, compensating for a small slowdown caused
              by switching Bison mode.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c6ee1e99
    • ap@webkit.org's avatar
      Reviewed by Geoff. · a06bb654
      ap@webkit.org authored
              https://bugs.webkit.org/show_bug.cgi?id=18402
              REGRESSION: visited element handling is incorrect in nested join/toString calls
      
              No change on SunSpider total, possibly a tiny improvement (about 0.1%).
      
              Test: fast/js/array-tostring-and-join.html
      
              * kjs/JSGlobalObject.h:
              (KJS::JSGlobalObject::visitedElements): Store visited elements HashSet here, making it
              common to toString/toLocalizedString/join again.
      
              * kjs/array_object.cpp:
              (KJS::arrayProtoFuncToString):
              (KJS::arrayProtoFuncToLocaleString):
              (KJS::arrayProtoFuncJoin):
              Got rid of static variables. Replaced UString with Vector to avoid O(n^2) behavior and
              regain performance.
      
              * wtf/Vector.h:
              (WTF::::resize):
              (WTF::::grow):
              (WTF::::reserveCapacity):
              (WTF::::append):
              (WTF::::insert):
              Added null checks, so that Vector methods don't crash when out of memory. The caller should
              check that data pointer is not null before proceeding.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31807 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a06bb654
  5. 10 Apr, 2008 3 commits
    • mrowe@apple.com's avatar
      Fix https://bugs.webkit.org/show_bug.cgi?id=18367 and the many dupes. · 837db6e2
      mrowe@apple.com authored
      Bug 18367: Crash during celtic kane js speed 2007 test
      
      Reviewed by Maciej Stachowiak.
      
      GCC 4.2 on x86_64 Linux decided to reorder the local variables in markCurrentThreadConservatively's
      stack frame.  This lead to the range of addresses the collector treated as stack to exclude the
      contents of volatile registers that markCurrentThreadConservatively forces onto the stack.  This was
      leading to objects being prematurely collected if the only reference to them was via a register at
      the time a collection occurred.
      
      The fix for this is to move the calculation of the top of the stack into a NEVER_INLINE function
      that is called from markCurrentThreadConservatively.  This forces the dummy variable we use for
      determining the top of stack to be in a different stack frame which prevents the compiler from
      reordering it relative to the registers that markCurrentThreadConservatively forces onto the stack.
      
      * kjs/collector.cpp:
      (KJS::Collector::markCurrentThreadConservativelyInternal):
      (KJS::Collector::markCurrentThreadConservatively):
      * kjs/collector.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      837db6e2
    • aroben@apple.com's avatar
      Touch a file to force WTF.vcproj to build · f716e15f
      aroben@apple.com authored
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f716e15f
    • aroben@apple.com's avatar
      VC++ Express build fix · db5c58d3
      aroben@apple.com authored
              * JavaScriptCore.vcproj/WTF/WTF.vcproj: Link against user32.lib so
              that anyone who links against WTF.lib will get user32.lib
              automatically.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      db5c58d3
  6. 09 Apr, 2008 4 commits
  7. 08 Apr, 2008 5 commits
    • weinig@apple.com's avatar
      JavaScriptCore: · 41dbaab8
      weinig@apple.com authored
      2008-04-04  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Geoffrey Garen.
      
              First step in implementing the "split window"
      
              - Add a GlobalThisValue to ExecState which should be used 
                in places that used to implement the "use the global object
                as this if null" rule.
              - Factor out lookupGetter/lookupSetter into virtual methods 
                on JSObject so that they can be forwarded.
              - Make defineGetter/defineSetter virtual methods for the same
                reason.
              - Have PrototypeReflexiveFunction store the globalObject used
                to create it so that it can be used to get the correct thisObject
                for eval.
      
              * API/JSObjectRef.cpp:
              (JSObjectCallAsFunction):
              * JavaScriptCore.exp:
              * kjs/Activation.h:
              * kjs/ExecState.cpp:
              (KJS::ExecState::ExecState):
              (KJS::GlobalExecState::GlobalExecState):
              * kjs/ExecState.h:
              (KJS::ExecState::globalThisValue):
              * kjs/ExecStateInlines.h:
              (KJS::ExecState::ExecState):
              (KJS::FunctionExecState::FunctionExecState):
              * kjs/JSGlobalObject.cpp:
              (KJS::JSGlobalObject::reset):
              (KJS::JSGlobalObject::toGlobalObject):
              * kjs/JSGlobalObject.h:
              (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
              (KJS::JSGlobalObject::JSGlobalObject):
              * kjs/array_instance.cpp:
              (KJS::CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
              (KJS::compareWithCompareFunctionForQSort):
              * kjs/array_object.cpp:
              (KJS::arrayProtoFuncSort):
              (KJS::arrayProtoFuncFilter):
              (KJS::arrayProtoFuncMap):
              (KJS::arrayProtoFuncEvery):
              (KJS::arrayProtoFuncForEach):
              (KJS::arrayProtoFuncSome):
              * kjs/function.cpp:
              (KJS::FunctionImp::callAsFunction):
              (KJS::ActivationImp::toThisObject):
              (KJS::globalFuncEval):
              (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
              (KJS::PrototypeReflexiveFunction::mark):
              * kjs/function.h:
              (KJS::PrototypeReflexiveFunction::cachedGlobalObject):
              * kjs/function_object.cpp:
              (KJS::functionProtoFuncApply):
              (KJS::functionProtoFuncCall):
              * kjs/nodes.cpp:
              (KJS::ExpressionNode::resolveAndCall):
              (KJS::FunctionCallValueNode::evaluate):
              (KJS::LocalVarFunctionCallNode::inlineEvaluate):
              (KJS::ScopedVarFunctionCallNode::inlineEvaluate):
              (KJS::FunctionCallBracketNode::evaluate):
              (KJS::FunctionCallDotNode::inlineEvaluate):
              * kjs/object.cpp:
              (KJS::JSObject::call):
              (KJS::JSObject::put):
              (KJS::tryGetAndCallProperty):
              (KJS::JSObject::lookupGetter):
              (KJS::JSObject::lookupSetter):
              (KJS::JSObject::toThisObject):
              (KJS::JSObject::toGlobalObject):
              (KJS::JSObject::fillGetterPropertySlot):
              * kjs/object.h:
              * kjs/object_object.cpp:
              (KJS::objectProtoFuncLookupGetter):
              (KJS::objectProtoFuncLookupSetter):
              * kjs/string_object.cpp:
              (KJS::replace):
      
      WebCore:
      
      2008-04-04  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Geoffrey Garen.
      
              First step in implementing the "split window"
      
              - This patch takes the first step in changing the window navigation model
                from clearing the window properties on navigation, to replacing
                an inner window.  This is necessary to safely perform security checks
                using the lexical global object.
      
                This first step adds a new class called JSDOMWindowWrapper, which wraps
                the real window object.  All JS calls that would go to the window object
                now go to it, which it forwards to the current inner window.  To accomplish
                this, the wrapper window is used as the ThisValue wherever the window was used
                before.
      
              * WebCore.base.exp:
              * WebCore.xcodeproj/project.pbxproj:
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::JSDOMWindowBase):
              (WebCore::JSDOMWindowBase::clear): Reset the wrapper windows prototype too.
              (WebCore::JSDOMWindowBase::toThisObject):
              (WebCore::JSDOMWindowBase::wrapper):
              (WebCore::windowProtoFuncAToB):
              (WebCore::windowProtoFuncBToA):
              (WebCore::windowProtoFuncOpen):
              (WebCore::windowProtoFuncSetTimeout):
              (WebCore::windowProtoFuncClearTimeout):
              (WebCore::windowProtoFuncSetInterval):
              (WebCore::windowProtoFuncAddEventListener):
              (WebCore::windowProtoFuncRemoveEventListener):
              (WebCore::windowProtoFuncShowModalDialog):
              (WebCore::windowProtoFuncNotImplemented):
              (WebCore::toJS):
              * bindings/js/JSDOMWindowBase.h:
              Fix to expect the wrapper as the thisObj.
              * bindings/js/JSDOMWindowCustom.cpp:
              (WebCore::JSDOMWindow::postMessage):
              (WebCore::toDOMWindow):
              * bindings/js/JSDOMWindowWrapper.cpp: Added.
              (WebCore::):
              (WebCore::JSDOMWindowWrapper::JSDOMWindowWrapper):
              (WebCore::JSDOMWindowWrapper::~JSDOMWindowWrapper):
              (WebCore::JSDOMWindowWrapper::mark):
              (WebCore::JSDOMWindowWrapper::className):
              (WebCore::JSDOMWindowWrapper::getOwnPropertySlot):
              (WebCore::JSDOMWindowWrapper::put):
              (WebCore::JSDOMWindowWrapper::deleteProperty):
              (WebCore::JSDOMWindowWrapper::getPropertyNames):
              (WebCore::JSDOMWindowWrapper::getPropertyAttributes):
              (WebCore::JSDOMWindowWrapper::defineGetter):
              (WebCore::JSDOMWindowWrapper::defineSetter):
              (WebCore::JSDOMWindowWrapper::lookupGetter):
              (WebCore::JSDOMWindowWrapper::lookupSetter):
              (WebCore::JSDOMWindowWrapper::toGlobalObject):
              (WebCore::JSDOMWindowWrapper::impl):
              (WebCore::JSDOMWindowWrapper::disconnectFrame):
              (WebCore::JSDOMWindowWrapper::clear):
              (WebCore::toJS):
              * bindings/js/JSDOMWindowWrapper.h: Added.
              (WebCore::JSDOMWindowWrapper::innerWindow):
              (WebCore::JSDOMWindowWrapper::setInnerWindow):
              (WebCore::JSDOMWindowWrapper::classInfo):
              Forward methods to the innerWindow.
              * bindings/js/JSHTMLDocumentCustom.cpp:
              (WebCore::JSHTMLDocument::open):
              * bindings/js/ScheduledAction.cpp:
              (WebCore::ScheduledAction::execute):
              * bindings/js/kjs_events.cpp:
              (WebCore::JSAbstractEventListener::handleEvent):
              * bindings/js/kjs_proxy.cpp:
              (WebCore::KJSProxy::~KJSProxy):
              (WebCore::KJSProxy::evaluate):
              (WebCore::KJSProxy::clear):
              (WebCore::KJSProxy::initScript):
              (WebCore::KJSProxy::clearDocumentWrapper):
              (WebCore::KJSProxy::processingUserGesture):
              (WebCore::KJSProxy::attachDebugger):
              * bindings/js/kjs_proxy.h:
              (WebCore::KJSProxy::haveWindowWrapper):
              (WebCore::KJSProxy::windowWrapper):
              (WebCore::KJSProxy::globalObject):
              (WebCore::KJSProxy::initScriptIfNeeded):
              Hold onto the wrapper window instead of global object.  As a convenience,
              keep the globalObject() as a forward to the inner window.
              * bindings/objc/DOMUtility.mm:
              (KJS::createDOMWrapper):
              * bindings/scripts/CodeGeneratorJS.pm:
              * dom/Document.cpp:
              (WebCore::Document::domWindow):
              * dom/Document.h:
              (WebCore::Document::defaultView):
              * loader/FrameLoader.cpp:
              (WebCore::FrameLoader::dispatchWindowObjectAvailable):
              * page/DOMWindow.idl:
              * page/Frame.cpp:
              (WebCore::Frame::~Frame):
              (WebCore::Frame::pageDestroyed):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      41dbaab8
    • beidson@apple.com's avatar
      JavaScriptCore: · 38797c1b
      beidson@apple.com authored
      2008-04-08  Brady Eidson  <beidson@apple.com>
      
              Encourage Windows to rebuild - AGAIN...
      
              * kjs/DateMath.cpp:
      
      WebCore:
      
      2008-04-08  Brady Eidson  <beidson@apple.com>
      
              Encourage Windows to rebuild - AGAIN...
      
              * WebCore.vcproj/build-generated-files.sh:
              * bindings/scripts/CodeGenerator.pm:
              * bindings/scripts/CodeGeneratorJS.pm:
              * config.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      38797c1b
    • aroben@apple.com's avatar
      Mac build fix · 4fa6ca4a
      aroben@apple.com authored
              * JavaScriptCore.exp: Add callOnMainThread, and sorted the list.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4fa6ca4a
    • beidson@apple.com's avatar
      b3c7b2b4
    • aroben@apple.com's avatar
      Move callOnMainThread to WTF · 614f946c
      aroben@apple.com authored
      JavaScriptCore:
      
              Move callOnMainThread to WTF
      
              Reviewed by Alexey Proskuryakov.
      
              * GNUmakefile.am:
              * JavaScriptCore.pri:
              * JavaScriptCore.vcproj/WTF/WTF.vcproj:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              * JavaScriptCoreSources.bkl:
              Added new files.
      
              * wtf/MainThread.cpp:
              * wtf/MainThread.h:
              * wtf/gtk/MainThreadGtk.cpp:
              * wtf/mac/MainThreadMac.mm:
              * wtf/qt/MainThreadQt.cpp:
              * wtf/win/MainThreadWin.cpp:
              * wtf/wx/MainThreadWx.cpp:
              Moved here from WebCore/platform. Replaced all instances of "WebCore"
              with "WTF".
      
              * kjs/bool_object.cpp: Touched to force JavaScriptCore.vcproj to
              build.
              to the WTF namespace.
              * wtf/ThreadingWin.cpp:
              (WTF::initializeThreading): Call initializeMainThread.
      
      WebCore:
      
              Move callOnMainThread to WTF
      
              Reviewed by Alexey Proskuryakov.
      
              * GNUmakefile.am:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCoreSources.bkl:
              Removed MainThread files.
      
              * bindings/js/JSCustomSQLTransactionCallback.cpp:
              * loader/icon/IconDatabase.cpp:
              (WebCore::iconDatabase):
              * storage/Database.cpp:
              (WebCore::Database::Database):
              * storage/DatabaseTracker.cpp:
              Updated #includes and replaced calls to
              WebCore::initializeThreadingAndMainThread with calls to
              KJS::initializeThreading.
      
              * platform/MainThread.cpp: Removed.
              * platform/MainThread.h: Removed.
              * platform/gtk/MainThreadGtk.cpp: Removed.
              * platform/mac/MainThreadMac.mm: Removed.
              * platform/qt/MainThreadQt.cpp: Removed.
              * platform/win/MainThreadWin.cpp: Removed.
              * platform/wx/MainThreadWx.cpp: Removed.
      
      WebKit/gtk:
      
              Move callOnMainThread to WTF
      
              Reviewed by Alexey Proskuryakov.
      
              * webkit/webkitprivate.cpp: Updated #include.
              (webkit_init): Changed to call KJS::initializeThreading.
      
      WebKit/win:
      
              Move callOnMainThread to WTF
      
              Reviewed by Alexey Proskuryakov.
      
              * WebIconDatabase.cpp: Updated #include
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      614f946c
  8. 07 Apr, 2008 4 commits
    • beidson@apple.com's avatar
      JavaScriptCore: · 4d5283d4
      beidson@apple.com authored
      2008-04-07  Brady Eidson  <beidson@apple.com>
      
              Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project
      
              * Configurations/JavaScriptCore.xcconfig:
      
      WebKit/mac:
      
      2008-04-07  Brady Eidson  <beidson@apple.com>
      
              Add "ENABLE_DOM_STORAGE" to keep in sync with the rest of the project
      
              * Configurations/WebKit.xcconfig:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4d5283d4
    • aroben@apple.com's avatar
      Windows build fix · 1527713a
      aroben@apple.com authored
              * wtf/ThreadingWin.cpp: Back out some changes I didn't mean to land.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1527713a
    • aroben@apple.com's avatar
      Add WTF::isMainThread · a3af6a64
      aroben@apple.com authored
              Reviewed by Alexey Proskuryakov.
      
              * wtf/Threading.h: Declare the new function.
              * wtf/ThreadingGtk.cpp:
              (WTF::initializeThreading): Initialize the main thread identifier.
              (WTF::isMainThread): Added.
              * wtf/ThreadingNone.cpp: Ditto ThreadingGtk.cpp.
              (WTF::initializeThreading):
              (WTF::isMainThread):
              * wtf/ThreadingPthreads.cpp: Ditto.
              (WTF::initializeThreading):
              (WTF::isMainThread):
              * wtf/ThreadingWin.cpp: Ditto.
              (WTF::initializeThreading):
              (WTF::isMainThread):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a3af6a64
    • ap@webkit.org's avatar
      Reviewed by Darin. · 11f3871c
      ap@webkit.org authored
              Make UString thread-safe.
      
              No change on SunSpider total, although individual tests have changed a lot, up to 3%.
      
              * kjs/InitializeThreading.cpp: (KJS::initializeThreading): Call UString::null() to initialize
              a static.
              
              * kjs/identifier.cpp:
              (KJS::CStringTranslator::translate):
              (KJS::UCharBufferTranslator::translate):
              Use "true" for a boolean value instead of 1, because it's C++.
      
              * kjs/ustring.h:
              (KJS::CString::adopt): Added a method to create from a char* buffer without copying.
              (KJS::UString::Rep::ref): Removed an assertion for JSLock::lockCount, as it's no longer
              necessary to hold JSLock when working with strings.
              (KJS::UString::Rep::deref): Ditto.
              (KJS::UString::Rep::isStatic): Added a field to quickly determine that this is an empty
              or null static string.
      
              * kjs/ustring.cpp:
              (KJS::): Removed normalStatBufferSize and statBufferSize, as there is no reason to have such
              an advanced implementation of a debug-only ascii() method. Removed a long-obsolete comment
              about UChar.
              (KJS::UString::Rep::createCopying): Removed an assertion for JSLock::lockCount.
              (KJS::UString::Rep::create): Ditto.
              (KJS::UString::Rep::destroy): Ditto. Do not do anything for static null and empty strings,
              as refcounting is not reliable for those. Reordered branches for a noticeable speed gain -
              apparently this functiton is hot enough for SunSpider to see an effect from this!
              (KJS::UString::null): Moved a star, added a comment.
              (KJS::UString::cstring): Reimplemented to not call ascii(), which is not thread-safe.
              (KJS::UString::ascii): Simplified statBuffer handling logic.
              (KJS::UString::toDouble): Use cstring() instead of ascii().
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      11f3871c