1. 08 Apr, 2008 1 commit
    • 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
  2. 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
  3. 02 Apr, 2008 4 commits
  4. 31 Mar, 2008 1 commit
  5. 29 Mar, 2008 2 commits
  6. 28 Mar, 2008 3 commits
    • ap@webkit.org's avatar
      Reviewed by Sam Weinig. · 8027278e
      ap@webkit.org authored
              Fix a dtoa thread safety issue.
      
              WebCore can call kjs_strtod without holding JS lock, but we didn't have thread safety
              compiled in for dtoa.
      
              This is a 0.5% regression on SunSpider, which Sam Weinig has volunteered to cover with
              his recent improvement.
      
              * kjs/dtoa.cpp:
              (Bigint::Balloc):
              (Bigint::Bfree):
              Changed to use fastMalloc/fastDelete - they are much faster than the dtoa custom version was
              in the presence of locking (but somewhat slower in single-threaded case).
              (Bigint::pow5mult): Got rid of the dreaded double-checked locking anti-pattern (had to
              restructure the code to avoid significant performance implications).
              (Bigint::lshift): Rewrote to avoid an allocation, if possible.
      
              (Bigint::rv_alloc):
              (Bigint::kjs_freedtoa):
              (Bigint::kjs_dtoa):
              Check for USE(MULTIPLE_THREADS), not dtoa legacy MULTIPLE_THREADS.
      
              * kjs/InitializeThreading.cpp: Added.
              (KJS::initializeThreading):
              * kjs/InitializeThreading.h: Added.
              Initialize threading at KJS level, if enabled.
      
              * kjs/dtoa.h: Expose dtoa mutex for KJS::initializeThreading.
      
              * kjs/testkjs.cpp: (kjsmain): Call initializeThreading.
      
              * JavaScriptCore.exp: Export KJS::initializeThreading.
      
              * GNUmakefile.am:
              * JavaScriptCore.exp:
              * JavaScriptCore.pri:
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
              * JavaScriptCoreSources.bkl:
              * JavaScriptCore.xcodeproj/project.pbxproj:
              Added InitializeThreading.{h,cpp}.
      
              * wtf/Threading.h: Removed a using directive for WTF::initializeThreading - it is only
              to be called from KJS::initializeThreading, and having it in the global namespace is useless.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8027278e
    • beidson@apple.com's avatar
      JavaScriptCore: · 347c0326
      beidson@apple.com authored
      2008-03-28  Brady Eidson  <beidson@apple.com>
      
              Reviewed by Darin
      
              Export Unicode/UTF8.h and convertUTF16ToUTF8() for more flexible conversion in WebCore
      
              * JavaScriptCore.exp:
              * JavaScriptCore.xcodeproj/project.pbxproj:
      
      WebCore:
      
      2008-03-28  Brady Eidson  <beidson@apple.com>
      
              Reviewed by Darin
      
              Using convertUTF16ToUTF8() from WTF, add a helper function that gives you a UTF8 SharedBuffer
              created from a String.
      
              * ForwardingHeaders/wtf/unicode/UTF8.h: Added.
              * platform/text/PlatformString.h:
              * platform/text/String.cpp:
              (WebCore::utf8Buffer):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      347c0326
    • mrowe@apple.com's avatar
      2008-03-27 Darin Adler <darin@apple.com> · cb17bd09
      mrowe@apple.com authored
              Reviewed by Mark Rowe.
      
              <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
              compiled length calculated incorrectly.
      
              * pcre/pcre_compile.cpp:
              (multiplyWithOverflowCheck):
              (calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts
              and bail with an error rather than returning incorrect results.
      
      2008-03-27  Mark Rowe  <mrowe@apple.com>
      
              Reviewed by Adam Roben.
      
              Tests for <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
              compiled length calculated incorrectly.
      
              * fast/js/regexp-overflow-expected.txt:
              * fast/js/resources/regexp-overflow.js:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cb17bd09
  7. 26 Mar, 2008 8 commits
  8. 25 Mar, 2008 5 commits
    • aroben@apple.com's avatar
      Fix Bug 18077: Integrate testapi.c into the Windows build · c7d2e7ef
      aroben@apple.com authored
      JavaScriptCore:
      
              Fix Bug 18077: Integrate testapi.c into the Windows build
      
              <http://bugs.webkit.org/show_bug.cgi?id=18077>
      
              Reviewed by Steve Falkenburg.
      
              * JavaScriptCore.vcproj/testapi/testapi.vcproj: Added.
      
      WebCore:
      
              Add an UnusedParam.h forwarding header for use by testapi
      
              Reviewed by Steve Falkenburg.
      
              * ForwardingHeaders/wtf/UnusedParam.h: Added.
      
      WebKit/win:
      
              Fix Bug 18077: Integrate testapi.c into the Windows build
      
              <http://bugs.webkit.org/show_bug.cgi?id=18077>
      
              Reviewed by Steve Falkenburg.
      
              * WebKit.vcproj/WebKit.sln: Added testapi.vcproj to the solution.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c7d2e7ef
    • aroben@apple.com's avatar
      Make testapi.c compile under MSVC · 9c907cfc
      aroben@apple.com authored
               Currently you must compile testapi.c as C++ code since MSVC does not
               support many C features that GCC does.
      
               Reviewed by Steve Falkenburg.
      
               * API/testapi.c:
               (nan): Added an implementation of this for MSVC.
               (assertEqualsAsUTF8String): Use malloc instead of dynamically-sized
               stack arrays.
               (assertEqualsAsCharactersPtr): Ditto.
               (print_callAsFunction): Ditto.
               (main): Ditto, and explicitly cast from UniChar* to JSChar*.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9c907cfc
    • aroben@apple.com's avatar
      Stop using JavaScriptCore's custom stdbool.h and stdint.h on Windows · eb58f072
      aroben@apple.com authored
               We can't remove the os-win32 directory yet because other ports (at
               least wx) are still relying on it.
      
               Reviewed by Steve Falkenburg.
      
               * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
                 - Made all the include paths match the one for the Debug
                   configuration (these got out of sync in r30797)
                 - Removed os-win32 from the include path
                 - Removed os-win32 from the directories we copy to $WebKitOutputDir.
                 - Removed stdint.h from the project
               * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
               Delete the files that we may have previously copied from the os-win32
               directory.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eb58f072
    • ap@webkit.org's avatar
      Windows build fix. · b47ed1e3
      ap@webkit.org authored
              * kjs/dtoa.cpp: Include stdint.h.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b47ed1e3
    • ap@webkit.org's avatar
      Rubber-stamped by Darin. · 05e93564
      ap@webkit.org authored
              Cleanup dtoa.cpp style.
      
              * kjs/dtoa.cpp:
              (Bigint::Balloc):
              (Bigint::Bfree):
              (Bigint::multadd):
              (Bigint::s2b):
              (Bigint::hi0bits):
              (Bigint::lo0bits):
              (Bigint::i2b):
              (Bigint::mult):
              (Bigint::pow5mult):
              (Bigint::lshift):
              (Bigint::cmp):
              (Bigint::diff):
              (Bigint::ulp):
              (Bigint::b2d):
              (Bigint::d2b):
              (Bigint::ratio):
              (Bigint::):
              (Bigint::match):
              (Bigint::hexnan):
              (Bigint::kjs_strtod):
              (Bigint::quorem):
              (Bigint::rv_alloc):
              (Bigint::nrv_alloc):
              (Bigint::kjs_freedtoa):
              (Bigint::kjs_dtoa):
              * kjs/dtoa.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      05e93564
  9. 24 Mar, 2008 2 commits
    • darin@apple.com's avatar
      2008-03-24 Darin Adler <darin@apple.com> · baa2a4bf
      darin@apple.com authored
              Reviewed by Sam.
      
              - convert a JavaScript immediate number to a string more efficiently
      
              2% speedup of Acid3 test 26
      
              * kjs/JSImmediate.cpp:
              (KJS::JSImmediate::toString): Take advantage of the fact that all immediate
              numbers are integers, and use the faster UString function for formatting integers
              instead of the slower one that works for floating point. I think this is a leftover
              from when immediate numbers were floating point.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      baa2a4bf
    • weinig@apple.com's avatar
      JavaScriptCore: · 9aa392a8
      weinig@apple.com authored
      2008-03-23  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Darin Adler.
      
              Fix http://bugs.webkit.org/show_bug.cgi?id=18048
              The "thisObject" parameter to JSEvaluateScript is not used properly
      
              Making passing a thisObject to JSEvaluateScript actually set the thisObject of the created
              ExecState.
      
              * API/testapi.c:
              (main): Add tests for setting the thisObject when calling JSEvaluateScript.
      
              * kjs/ExecState.cpp:
              (KJS::ExecState::ExecState): Assign the thisObject to m_thisValue and remove the comment. 
      
      WebCore:
      
      2008-03-24  Sam Weinig  <sam@webkit.org>
      
              Reviewed by Darin Adler.
      
              Fix http://bugs.webkit.org/show_bug.cgi?id=18048
              The "thisObject" parameter to JSEvaluateScript is not used properly
      
              * bindings/js/kjs_proxy.cpp:
              (WebCore::KJSProxy::evaluate): No need to pass a thisObject since we want the global object to be used.
              * bridge/jni/jni_jsobject.mm:
              (JavaJSObject::eval): To avoid any change to this function, don't pass a thisObject to keep the same
              behavior.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9aa392a8
  10. 22 Mar, 2008 2 commits
  11. 21 Mar, 2008 5 commits
  12. 20 Mar, 2008 3 commits