2011-01-07 Gavin Barraclough Reviewed by Geoff Garen. Bug 26276 - Need a mechanism to determine stack extent on WINDOWS, SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE platforms Fix for win32. The base of the stack is stored in the "deallocation stack" field of the Thread Information Block - see: http://en.wikipedia.org/wiki/Win32_Thread_Information_Block for more information! * wtf/StackBounds.cpp: (WTF::StackBounds::initialize): 2011-01-07 Adam Roben Update react-to-vsprops-changes.py after r74855 * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py: 2011-01-07 Carlos Garcia Campos Reviewed by Martin Robinson. [GTK] Port scrollbar painting to GtkStyleContext https://bugs.webkit.org/show_bug.cgi?id=52051 * wtf/gobject/GTypedefs.h: Add GtkStyleContext forward declaration. 2011-01-07 Daniel Bates Reviewed by Martin Robinson. Enable PCRE computed gotos when compiling with RCVT 4.0 or greater in GNU mode https://bugs.webkit.org/show_bug.cgi?id=52034 Derived from a patch by Eli Fidler. RVCT 4 or greater in GNU mode supports the computed goto GNU language extension as per . * pcre/pcre_exec.cpp: Modified to check for feature, HAVE(COMPUTED_GOTO), instead of hardcoding the GCC compiler. * wtf/Platform.h: Define WTF_COMPILER_RVCT4_OR_GREATER if __ARMCC_VERSION >= 400000. 2011-01-06 Gavin Barraclough Reviewed by Geoff Garen. Bug 52035 - Unregistering DOMWrapperWorlds is unsafe The method DOMWrapperWorld::unregisterWorld() effectively calls the DOMWrapperWorld's destructor early, in order to release wrappers once we know we no longer intend to use them. Whilst it is okay to have a method to throw away wrappers (assuming we know we're willing to lose any state stored on them) it is not okay to deregister the world from the JSGlobalData. A sequence of events that triggers the bug would look like this: (1) Create a DOMWrapperWorld. (2) Register a timer in the world. (3) Call unregisterWorld() on the world. (4) Timer goes off, code is executed in the world, creates a Node not attached to a Document. (5) We attempt to lookup a wrapper map for the world on the JSGlobalData, but because we've called forgetWorld() none exists. (6) Attempt to add a wrapper to a NULL map. Fix the problem by not removing the JSGlobalData's wrapper map until the world really goes away. * runtime/WeakGCMap.h: (JSC::WeakGCMap::clear): 2011-01-06 Gavin Barraclough Reviewed by Darin Adler. Bug 52021 - zeroDouble broken on ARMv7 The bug here is that zeroDouble was working incorrectly, leading to op_loop_if_true failing - specifically in the case where the value being checked is 0.0 encoded as a double (rather than an integer immediate). Additionally this patch removes a redundant duplicate compare in some (many) case. * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::vcmp_F64): (JSC::ARMv7Assembler::vcmpz_F64): * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::branchDoubleNonZero): (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::branchDouble): (JSC::MacroAssemblerARMv7::branchDoubleNonZero): (JSC::MacroAssemblerARMv7::branchDoubleZeroOrNaN): (JSC::MacroAssemblerARMv7::compare32): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::branchDoubleNonZero): (JSC::MacroAssemblerMIPS::branchDoubleZeroOrNaN): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::branchDoubleNonZero): (JSC::MacroAssemblerX86Common::branchDoubleZeroOrNaN): * jit/JITOpcodes32_64.cpp: (JSC::JIT::emit_op_jfalse): (JSC::JIT::emit_op_jtrue): 2011-01-06 Michael Saboff Reviewed by Gavin Barraclough. Added debug code to compare the results of JIT regexp with interpreted regexp and displays discrepencies. This debug code is controlled by the ENABLE_YARR_JIT_DEBUG macro in wtf/Platform.h and is only valid if ENABLE_YARR_JIT is enabled. Fixed a discovered problem in RegExp::printTraceData, changing m_pattern to the getter pattern(). Also deleted an extraneous semicolon. Enhancement: Add Regexp Debug Compare between JIT and Interpreter https://bugs.webkit.org/show_bug.cgi?id=51834 * runtime/RegExp.cpp: (JSC::RegExp::compile): (JSC::RegExp::match): (JSC::RegExp::printTraceData): * wtf/Platform.h: 2011-01-06 Patrick Gansterer Reviewed by Eric Seidel. [WINCE] Remove JSC::g_stackBase https://bugs.webkit.org/show_bug.cgi?id=51779 * wtf/StackBounds.cpp: 2011-01-06 Joone Hur Reviewed by Eric Seidel. WML Parser should treat line/column number in a consistent way https://bugs.webkit.org/show_bug.cgi?id=51601 Add the equality operators to TextPosition class. * wtf/text/TextPosition.h: (WTF::TextPosition::operator==): Added. (WTF::TextPosition::operator!=): Added. (WTF::TextPosition::belowRangePosition): Use belowBase() instead of base(). (WTF::ZeroBasedNumber::operator==): Added. (WTF::ZeroBasedNumber::operator!=): Added. (WTF::OneBasedNumber::operator==): Added. (WTF::OneBasedNumber::operator!=): Added. 2011-01-06 Patrick Gansterer Reviewed by Gavin Barraclough. [WINCE] Determine stack extent https://bugs.webkit.org/show_bug.cgi?id=26276 Scan the stack for writeable pages and use the limits. * wtf/StackBounds.cpp: (WTF::detectGrowingDownward): (WTF::isPageWritable): (WTF::getLowerStackBound): (WTF::getUpperStackBound): (WTF::StackBounds::initialize): 2011-01-05 Steve Falkenburg Windows build fix. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Revert change to additional library search path needed to find ICU. 2011-01-05 Steve Falkenburg Reviewed by Darin Adler. Debug and Release builds on Windows clobber each other https://bugs.webkit.org/show_bug.cgi?id=49185 Changes the structure of WebKitBuild build products directory so we completely separate each build configuration into independent directories. Although we previously had per-configuration directories for obj, this change adds per-configuration directories for bin, lib, obj, and include. Each configuration's build products are stored within a directory inside of WebKitBuild. Most use of $(WebKitOutputDir) in the build files has been replaced by $(ConfigurationBuildDir), defined in common.vsprops to be $(WebKitOutputDir)\$(ConfigurationName). For PGO, $(ConfigurationBuildDir) points to the same directory (Release_PGO) to allow for proper operation of the instrumentation/optimization scripts. * JavaScriptCore.vcproj/JavaScriptCore.make: * JavaScriptCore.vcproj/JavaScriptCore.sln: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePGOOptimize.vsprops: Added. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePostBuild.cmd: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCorePreBuild.cmd: * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: * JavaScriptCore.vcproj/JavaScriptCore/react-to-vsprops-changes.py: * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: * JavaScriptCore.vcproj/WTF/WTFPostBuild.cmd: * JavaScriptCore.vcproj/WTF/WTFPreBuild.cmd: * JavaScriptCore.vcproj/jsc/jsc.vcproj: * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: * JavaScriptCore.vcproj/jsc/jscPostBuild.cmd: * JavaScriptCore.vcproj/jsc/jscPreBuild.cmd: * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: * JavaScriptCore.vcproj/testapi/testapiPostBuild.cmd: * JavaScriptCore.vcproj/testapi/testapiPreBuild.cmd: 2011-01-05 Brent Fulgham Unreviewed build fix. * wtf/Encoder.h: Add include for systems that do not natively know about uint8_t, etc. 2011-01-05 Patrick Gansterer Reviewed by Andreas Kling. [CMake] Fix the usage of SOURCE_GROUP https://bugs.webkit.org/show_bug.cgi?id=51739 * CMakeLists.txt: 2011-01-05 Andras Becsi Reviewed by Csaba Osztrogonác. [Qt][V8] Fix the build after recent changes. * pcre/pcre.pri: Correct the path after Source was introduced. 2011-01-04 Steve Falkenburg Build fix. Update path to FindSafari after source code reorganization. * JavaScriptCore.vcproj/JavaScriptCore.sln: 2011-01-04 Daniel Bates Fix the Android build after changeset 74975 (https://bugs.webkit.org/show_bug.cgi?id=51855). * wtf/ThreadingPthreads.cpp: Add include of PassOwnPtr.h. (WTF::runThreadWithRegistration): Use -> instead of . to dereference pointer. 2011-01-04 Martin Robinson Try to fix the EFL build. * wtf/CMakeLists.txt: Remove PlatformRefPtr from the CMake source list. 2011-01-04 James Robinson Reviewed by Darin Adler. StackBounds initialization in WTFThreadData should be guarded by #if USE(JSC) https://bugs.webkit.org/show_bug.cgi?id=51881 The StackBounds class is only used by JavaScriptCore. * wtf/WTFThreadData.cpp: (WTF::WTFThreadData::WTFThreadData): * wtf/WTFThreadData.h: (WTF::WTFThreadData::resetCurrentIdentifierTable): 2011-01-03 Martin Robinson Reviewed by Darin Adler. Remove the last non-GObject usage of PlatformRefPtr and move the code to GRefPtr https://bugs.webkit.org/show_bug.cgi?id=51846 * GNUmakefile.am: Remove PlatformRefPtr.h from the sources list. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto. * jit/ExecutableAllocator.h: Change references to PlatformRefPtr to RefPtr. (JSC::ExecutableAllocator::cacheFlush): Ditto. * wtf/PlatformRefPtr.h: Removed. * wtf/RandomNumber.cpp: Change references to PlatformRefPtr to RefPtr. (WTF::randomNumber): Ditto. * wtf/brew/RefPtrBrew.h: Ditto. (WTF::refIfNotNull): Added. (WTF::derefIfNotNull): Added. * wtf/brew/ShellBrew.h: Change references to PlatformRefPtr to RefPtr. (WTF::createRefPtrInstance): Modified to return a RefPtr. * wtf/gobject/GRefPtr.cpp: (WTF::refGPtr): Moved from PlatformRefPtr here. (WTF::derefGPtr): Ditto. * wtf/gobject/GRefPtr.h: Ditto. (WTF::GRefPtr::GRefPtr): Ditto. (WTF::GRefPtr::~GRefPtr): Ditto. (WTF::GRefPtr::clear): Ditto. (WTF::GRefPtr::isHashTableDeletedValue): Ditto. (WTF::GRefPtr::get): Ditto. (WTF::GRefPtr::operator*): Ditto. (WTF::GRefPtr::operator->): Ditto. (WTF::GRefPtr::operator!): Ditto. (WTF::GRefPtr::operator UnspecifiedBoolType): Ditto. (WTF::GRefPtr::hashTableDeletedValue): Ditto. (WTF::::operator): Ditto. (WTF::::swap): Ditto. (WTF::swap): Ditto. (WTF::operator==): Ditto. (WTF::operator!=): Ditto. (WTF::static_pointer_cast): Ditto. (WTF::const_pointer_cast): Ditto. (WTF::getPtr): Ditto. (WTF::adoptGRef): Ditto. (WTF::refGPtr): Ditto. (WTF::derefGPtr): Ditto. 2011-01-04 Daniel Bates Reviewed by Adam Roben. LEAK: Deallocate instance of ThreadFunctionInvocation if thread creation fails https://bugs.webkit.org/show_bug.cgi?id=51860 * wtf/ThreadingWin.cpp: (WTF::createThreadInternal): 2011-01-04 Laszlo Gombos Reviewed by Ariya Hidayat. [Qt][Symbian] Make sure that WebKit headers are included before platform headers on Symbian https://bugs.webkit.org/show_bug.cgi?id=31273 On Symbian PREPEND_INCLUDEPATH is the best way to make sure that WebKit headers are included before platform headers. On all other platforms continue to use INCLUDEPATH (as before). This is a continuation of r65877. No new tests as there is no new functionality. * JavaScriptCore.pri: 2011-01-04 Darin Adler Try to fix Windows build. * wtf/ThreadingWin.cpp: Added include of PassOwnPtr.h. Fixed paragraphing of conditional includes. (WTF::wtfThreadEntryPoint): Use -> instead of . to dereference pointer. (WTF::createThreadInternal): Tweaked #if to not need separate macro. 2011-01-04 Daniel Bates Reviewed by Adam Roben. Extract ThreadFunctionInvocation into separate file and share between Apple Windows and Android https://bugs.webkit.org/show_bug.cgi?id=51855 Both the Apple Windows and Android ports implement a similar adapter structure, called ThreadFunctionInvocation and ThreadData respectively, as part of their thread creation process. Instead, we should share such an adapter structure and remove duplicate code. * JavaScriptCore.gypi: Added header wtf/ThreadFunctionInvocation.h. * wtf/ThreadFunctionInvocation.h: Added. (WTF::ThreadFunctionInvocation::ThreadFunctionInvocation): * wtf/ThreadingPthreads.cpp: Removed Android-specific structure ThreadData; Instead, use ThreadFunctionInvocation. (WTF::runThreadWithRegistration): (WTF::createThreadInternal): * wtf/ThreadingWin.cpp: Moved structure ThreadFunctionInvocation to its own file so that it can be shared with the Android implementation of createThreadInternal(). (WTF::wtfThreadEntryPoint): Use OwnPtr to hold passed instance of ThreadFunctionInvocation. 2011-01-04 Daniel Bates Reviewed by Darin Adler. Use __builtin_expect when compiling using RVCT in GNU mode https://bugs.webkit.org/show_bug.cgi?id=51866 Derived from a patch by Dave Tapuska. * wtf/AlwaysInline.h: 2011-01-03 Darin Adler Reviewed by Brady Eidson. * wtf/Forward.h: Added Decoder and Encoder. 2011-01-03 Brady Eidson Reviewed by Darin Adler. Add Encode/Decode machinery Darin and I plan to work with for back/forward stuff in WebKit2. Starting out with a pure virtual interface to be implemented in WK2, but we might change that later. * GNUmakefile.am: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Decoder.h: Added. * wtf/Encoder.h: Added. 2011-01-03 Laszlo Gombos Unreviewed build fix. [Qt] Add NullPtr.cpp introduced in r71155 to the Qt build system. This fix is required for builds where HAVE(NULLPTR) is false (e.g. some MSVC and Symbian builds). * wtf/wtf.pri: 2011-01-02 Dan Bernstein Rubber-stamped by Simon Fraser. Update copyright strings * Info.plist: 2011-01-02 Csaba Osztrogonác Fix GTK+ build after r74855. Reviewed by Xan Lopez. * GNUmakefile.am: Fix include pathes. 2011-01-02 Adam Barth One more .. missing in the Qt build. * jsc.pro: 2011-01-02 Xan Lopez Fix GTK+ build. * GNUmakefile.am: add -I$(srcdir)/Source to the JSC cppflags so that anyone can include its headers without adding the prefix 'Source/'. 2011-01-02 Carl Lobo Reviewed by Adam Barth. Fix Windows Build for non-production where VSPropsRedirectionDir is not defined. https://bugs.webkit.org/show_bug.cgi?id=51797 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.vcproj/jsc/jsc.vcproj: * JavaScriptCore.vcproj/testapi/testapi.vcproj: 2011-01-01 Adam Barth Fix relative include paths in an attempt to fix the Qt build. * JavaScriptCore.pri: * JavaScriptCore.pro: 2011-01-01 Adam Barth Another speculative build fix for GTK. * GNUmakefile.am: 2011-01-01 Adam Barth Speculative build fix for GTK. Update the paths in GNUmakefile to include "Source". * GNUmakefile.am: 2011-01-01 Adam Barth Update relative paths in JavaScriptCore.gyp to account for the extra level of directories. * JavaScriptCore.gyp/JavaScriptCore.gyp: 2010-12-31 Patrick Gansterer Reviewed by Darin Adler. Add a fast case for ASCII strings in HashAndUTF8CharactersTranslator::equal https://bugs.webkit.org/show_bug.cgi?id=50517 This change shows about 2% performance win on the xml-parser benchmark. * wtf/text/AtomicString.cpp: (WTF::HashAndUTF8CharactersTranslator::equal): 2010-12-30 Patrick Gansterer Reviewed by Ariya Hidayat. [CMake] Add WTF_HEADERS https://bugs.webkit.org/show_bug.cgi?id=51741 Add the WTF headers to show them in Visual Studio. * wtf/CMakeLists.txt: * wtf/CMakeListsWinCE.txt: 2010-12-30 Konstantin Tokarev Reviewed by David Kilzer. [Qt] Don't build wtf/TCSystemAlloc.cpp if --system-malloc option is used https://bugs.webkit.org/show_bug.cgi?id=51672 * wtf/wtf.pri: Replaced USE_SYSTEM_MALLOC with USE_SYSTEM_MALLOC=1 2010-12-30 Patrick Gansterer Reviewed by Darin Adler. Use OS(WINDOWS) instead of COMPILER(MSVC) in FastMalloc.cpp https://bugs.webkit.org/show_bug.cgi?id=51743 Most of the ifdefs belong to windows and not to the MSVC compiler. * wtf/FastMalloc.cpp: 2010-12-29 Gavin Barraclough Reviewed by Sam Weinig. Bug 51724 - In strict mode string literals should allow \0, but disallow \8 and \9. * parser/Lexer.cpp: (JSC::Lexer::parseString): 2010-12-29 Helder Correia Reviewed by Eric Seidel. and are not valid JSON whitespace characters https://bugs.webkit.org/show_bug.cgi?id=51671 Vertical Tab and Form Feed are not allowed white spaces by the JSON RFC 4627: http://www.ietf.org/rfc/rfc4627.txt (2. JSON Grammar). Tests: ietestcenter/Javascript/15.12.1.1-0-2.html ietestcenter/Javascript/15.12.1.1-0-3.html * runtime/LiteralParser.cpp: (JSC::isJSONWhiteSpace): (JSC::LiteralParser::Lexer::lex): 2010-12-28 Helder Correia Reviewed by Eric Seidel. JSON.stringify must exist as a function taking 3 parameters https://bugs.webkit.org/show_bug.cgi?id=51667 The reported function length is 1 instead. Test: ietestcenter/Javascript/15.12.3-0-2.html * runtime/JSONObject.cpp: 2010-12-28 Helder Correia Reviewed by Sam Weinig. JSON.parse must exist as a function taking 2 parameters https://bugs.webkit.org/show_bug.cgi?id=51666 Support for revivers was introduced in bug 26591, but the function length has since remained unchanged. Test: ietestcenter/Javascript/15.12.2-0-2.html * runtime/JSONObject.cpp: 2010-12-27 Jake Helfert Reviewed and reworked by Darin Adler. Building WebKit with Visual Studio 2010 fails due to ambiguous assignment operator errors. https://bugs.webkit.org/show_bug.cgi?id=51116 * wtf/NullPtr.h: Added a HAVE(NULLPTR) definition for use with Platform.h HAVE macro, and included the Visual Studio 2010 compiler as one of the ones that has nullptr. * wtf/NullPtr.cpp: Updated condition to match. * wtf/PassOwnArrayPtr.h: Don't include the operator=(nullptr_t) overload if we are compiling in loose mode and the compiler has nullptr, because assignment of 0 will otherwise encounter ambiguitity with this overload and the overload for loose mode that takes a raw pointer. The conditional can be removed when we get rid of loose mode. * wtf/PassOwnPtr.h: Ditto. * wtf/PassRefPtr.h: Don't include the operator=(nullptr_t) overload if the compiler has nullptr, because assignment of 0 would be ambiguous with the overload that takes a raw pointer. The conditional can be removed if we ever decide we no longer need to support assigning 0, but might need a way to catch that usage on older compilers. * wtf/RefPtr.h: Ditto. * wtf/RetainPtr.h: Ditto * JavaScriptCore.xcodeproj/project.pbxproj: Added NullPtr.cpp, accidentally omitted when the file was first added. 2010-12-26 Xan Lopez Reviewed by Eric Seidel. [GTK] Add standalone target for JSC https://bugs.webkit.org/show_bug.cgi?id=51607 * GNUmakefile.am: add convenience target to only build jsc and its dependencies. 2010-12-24 Patrick Gansterer Reviewed by Eric Seidel. [WINCE] Add CPU(MIPS) detection https://bugs.webkit.org/show_bug.cgi?id=51342 WinCE usually defines MIPS and _MIPS_. * wtf/Platform.h: 2010-12-23 Gavin Barraclough Reviewed by Sam Weinig. Rename RegexCompiler.cpp to RegexPattern.cpp. Implicitly call compileRegex from RegexPattern's constructor. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * runtime/RegExp.cpp: (JSC::RegExp::compile): * yarr/RegexCompiler.cpp: Removed. * yarr/RegexCompiler.h: Removed. * yarr/RegexInterpreter.cpp: * yarr/RegexJIT.cpp: * yarr/RegexPattern.cpp: Copied from JavaScriptCore/yarr/RegexCompiler.cpp. (JSC::Yarr::compileRegex): (JSC::Yarr::RegexPattern::RegexPattern): * yarr/RegexPattern.h: 2010-12-23 Patrick Gansterer Unreviewed build fix for WinCE after r74360. Move the OS(WINDOWS) section after the OS(WINCE) section and add missing argument to the getStackMax call. * wtf/StackBounds.cpp: (WTF::StackBounds::initialize): 2010-12-22 Laszlo Gombos Unreviewed build fix. [Symbian] Make sure OSAllocatorSymbian builds This patch only addresses the build problem. https://bugs.webkit.org/show_bug.cgi?id=51128 tracks the full (re)implementation of the Symbian allocator. * wtf/OSAllocatorSymbian.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): (WTF::OSAllocator::commit): 2010-12-22 Dan Bernstein Changed WebKitTools to Tools. * JavaScriptCore.vcproj/JavaScriptCore.sln: 2010-12-22 Dan Bernstein Rubber-stamped by Mark Rowe. Changed WebKitTools to Tools in script build phases. * JavaScriptCore.xcodeproj/project.pbxproj: 2010-12-22 Andrei Popescu Unreviewed build fix. Fix Chromium Linux shared library build. [Chromium] r74431 broke the Chromium Linux shared library build https://bugs.webkit.org/show_bug.cgi?id=51462 * JavaScriptCore.gyp/JavaScriptCore.gyp: * JavaScriptCore.gypi: 2010-12-21 Sheriff Bot Unreviewed, rolling out r74462. http://trac.webkit.org/changeset/74462 https://bugs.webkit.org/show_bug.cgi?id=51449 broke chromium win (Requested by tonyg-cr on #webkit). * JavaScriptCore.gypi: 2010-12-21 Tony Gentilcore Unreviewed build fix. [chromium] Build fix after r74431 https://bugs.webkit.org/show_bug.cgi?id=51447 * JavaScriptCore.gypi: 2010-12-21 Gavin Barraclough Windows build fix. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 2010-12-21 Gavin Barraclough Windows build fix. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 2010-12-21 Gavin Barraclough Speculative build fix. * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::underMemoryPressure): 2010-12-21 Gavin Barraclough Reviewed by Oliver Hunt. Bug 26276 - Need a mechanism to determine stack extent This patch adds accurate stack size calculation for: DARWIN, QNX, UNIX We still need to fix: WINDOWS, SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE * wtf/StackBounds.cpp: (WTF::StackBounds::initialize): 2010-12-21 Gavin Barraclough Reviewed by Geoff Garen. CRASH running out of executable memory, loading io9.com https://bugs.webkit.org/show_bug.cgi?id=51443 The problem here is that each page uses a reasonable amount of memory, (~4Mb), and that when miultiple pages are open we keep all JIT code for all functions in all pages alive. Add a check to detect high memory pressure situations in the executable allocator (>50% of available memory allocated), and upon a top level entry into JSC (no code running on the stack) in this situation throw away all JIT code. * JavaScriptCore.exp: * debugger/Debugger.cpp: (JSC::Debugger::recompileAllJSFunctions): stop passing exec to recompile. * jit/ExecutableAllocator.h: * jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::ExecutablePool::systemAlloc): Count allocations. (JSC::ExecutablePool::systemRelease): Count deallocations. (JSC::ExecutablePool::underMemoryPressure): Check memory pressure. * jit/ExecutableAllocatorPosix.cpp: (JSC::ExecutablePool::underMemoryPressure): Stub out; only meaningful with FixedVMPool. * jit/ExecutableAllocatorWin.cpp: (JSC::ExecutablePool::underMemoryPressure): Stub out; only meaningful with FixedVMPool. * runtime/Executable.cpp: (JSC::FunctionExecutable::recompile): Remove ExecState argument to recompile. * runtime/Executable.h: * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::recompileAllJSFunctions): throws away all JIT code. * runtime/JSGlobalData.h: * runtime/JSGlobalObject.h: (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): add check / call to throw away. 2010-12-21 Gavin Barraclough Reviewed by Geoff Garen. JIT executable memory excessive usage due to regex caching https://bugs.webkit.org/show_bug.cgi?id=51434 Reduce the amount of memory the RegExpCache can hold on to on iOS. Currently the RegExpCache can hold 256 RegExp objects. If each falls into a separate ExecutablePool, with a common size of 16Kb, this means we end up holding onto 4Mb of memory. Firstly, we can reduce this by simply reducing the size of the cache to 32 entries. Secondly, we can use a separate set of ExecutablePools for JIT code generated from RegExp objects. This helps in two ways (1) it increases the probability that RegExps in the cache share the same pool, and (2) it means that a RegExp can't end up holding on to a large ExecutablePool containing a translation of JS code. (A RegExp could end up keeping a larger RegExp alive that happened to be sharing the same pool, but large RegExp patterns are less common). * runtime/JSGlobalData.h: * runtime/RegExpCache.h: * yarr/RegexJIT.cpp: (JSC::Yarr::RegexGenerator::compile): 2010-12-21 Gavin Barraclough Windows build fix. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 2010-12-21 Gavin Barraclough Eeeep! build fix! * wtf/OSAllocator.h: (WTF::OSAllocator::decommitAndRelease): 2010-12-21 Gavin Barraclough Ooops, fixed typo in comment. * wtf/OSAllocator.h: 2010-12-21 Geoffrey Garen Reviewed by Gavin Barraclough & Oliver Hunt. Added PageAllocationAligned, a cross-platform abstraction for memory allocations with arbitrary alignment requirements https://bugs.webkit.org/show_bug.cgi?id=51359 I think this patch fixes [5.0.1] WER crash in Heap::allocateBlock (1902752929), and some other leaks and crashes as well. * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: Updated build files. * runtime/AlignedMemoryAllocator.h: Removed. Supplanted by PageAllocationAligned. * runtime/Collector.cpp: (JSC::Heap::destroy): (JSC::Heap::allocateBlock): (JSC::Heap::freeBlock): (JSC::Heap::addWeakGCHandle): * runtime/Collector.h: Switched from AlignedMemoryAllocator to PageAllocationAligned. * runtime/GCHandle.cpp: * runtime/GCHandle.h: Ditto. * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): Removed aligned memory allocation functions. Supplanted by PageAllocationAligned. * wtf/PageAllocationAligned.cpp: Added. (WTF::PageAllocationAligned::allocate): (WTF::PageAllocationAligned::deallocate): * wtf/PageAllocationAligned.h: Added. (WTF::PageAllocationAligned::PageAllocationAligned): New cross-platform class for doing aligned memory allocation. This class properly matches allocation and deallocation library calls, fixing a long-standing bug in PageAllocation. * wtf/Platform.h: Removed some defunction VM platform defines. * wtf/wtf.pri: Updated build files. 2010-12-21 Oliver Hunt Reviewed by Gavin Barraclough. ASSERTION FAILED: base->index() == m_codeBlock->argumentsRegister() while loading taobao.com https://bugs.webkit.org/show_bug.cgi?id=49006 This problem was caused by having a parameter named 'arguments'. The fix is to treat parameters named 'arguments' as shadowing the actual arguments property, and so logically turn the function into one that doesn't "use" arguments. This required a bit of fiddling in the parser to ensure we correctly propagate the 'feature' of shadowing is set correctly. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::createArgumentsIfNecessary): Change assertion to an early return as we may now reference a property named 'arguments' without being in a function that has the ArgumentsFeature * parser/JSParser.cpp: (JSC::JSParser::Scope::Scope): (JSC::JSParser::Scope::declareParameter): (JSC::JSParser::Scope::shadowsArguments): (JSC::JSParser::parseProgram): (JSC::JSParser::parseFormalParameters): (JSC::JSParser::parseFunctionInfo): * parser/Nodes.h: (JSC::ScopeNode::usesArguments): 2010-12-21 Daniel Bates Reviewed by Eric Seidel and Darin Adler. Deallocate GregorianDateTime.timeZone (if allocated) when copying so that we don't leak memory. https://bugs.webkit.org/show_bug.cgi?id=51367 Inspired by a patch by George Staikos. * wtf/DateMath.cpp: (JSC::msToGregorianDateTime): Modified to set timeZone to nullptr since timeZone is now of type OwnPtrArray. * wtf/DateMath.h: Change timeZone to type OwnArrayPtr; Removed destructor since it is no longer needed. (JSC::GregorianDateTime::GregorianDateTime): Modified to use OwnPtrArray semantics for timeZone. (JSC::GregorianDateTime::operator tm): Ditto. (JSC::GregorianDateTime::copyFrom): Ditto. 2010-12-21 Sheriff Bot Unreviewed, rolling out r74402. http://trac.webkit.org/changeset/74402 https://bugs.webkit.org/show_bug.cgi?id=51402 This patch broke the Windows 7 Release Layout Tests (Requested by jessieberlin on #webkit). * wtf/StackBounds.cpp: (WTF::estimateStackBound): (WTF::StackBounds::initialize): 2010-12-21 Peter Varga Reviewed by Csaba Osztrogonác. Unify the name of parentheses in YARR: rename parenthesis to parentheses. * yarr/RegexCompiler.cpp: (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd): 2010-12-21 Laszlo Gombos Reviewed by Andreas Kling. [Qt] Set BUILDING_QT__ consistently https://bugs.webkit.org/show_bug.cgi?id=51341 * JavaScriptCore.pri: Remove the definition of BUILDING_QT__ as it is already defined in WebKit.pri. 2010-12-20 Gavin Barraclough Reviewed by Oliver Hunt. Bug 26276 - Need a mechanism to determine stack extent This patch adds accurate stack size calculation for: DARWIN, WINDOWS, QNX, UNIX We still need to fix: SOLARIS, OPENBSD, SYMBIAN, HAIKU, WINCE * wtf/StackBounds.cpp: (WTF::StackBounds::initialize): 2010-12-20 Gavin Barraclough PPC build fix; stop using std::swap on PageAllocation/PageReservation, this was failing on some compilers since the lack of default construction for the m_executable/m_writable fields meant the value being swapped may not have been fully initialized. * wtf/PageAllocation.h: (WTF::PageAllocation::deallocate): * wtf/PageBlock.h: * wtf/PageReservation.h: (WTF::PageReservation::deallocate): 2010-12-20 Oliver Hunt Reviewed by Geoffrey Garen. |delete name| in strict mode code should be an early error https://bugs.webkit.org/show_bug.cgi?id=50431 Disallow the |delete IDENTIFIER| production in strict mode, and removed a bunch of now unnecessary code. * parser/JSParser.cpp: (JSC::JSParser::Scope::collectFreeVariables): (JSC::jsParse): (JSC::JSParser::parseProgram): (JSC::JSParser::parseUnaryExpression): * parser/JSParser.h: * parser/Parser.cpp: (JSC::Parser::parse): * parser/Parser.h: (JSC::Parser::parse): 2010-12-20 Gavin Barraclough Reviewed by Olver Hunt. Bug 51358 - Should check stack depth rather than using recursion limits in byte compilation The current implementation of recursion limit checking is not safe on smaller stacks. Switch to using a common mechanism, shared with the parser, to check recursion limits. Make bytecompiler use StackBounds. Empirical testing shows emitStrcat to have the largest footprint on the stack, at just under 1k on x86-64. Given this, the default recursion check (requiring 4k of available space to recurse) seems reasonable. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): * bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::emitNode): (JSC::BytecodeGenerator::emitNodeInConditionContext): * bytecompiler/NodesCodegen.cpp: (JSC::BinaryOpNode::emitStrcat): 2010-12-20 Tony Gentilcore Unreviewed build fix. Include pthread to fix chromium mac build (broken by r74360) https://bugs.webkit.org/show_bug.cgi?id=51356 * wtf/StackBounds.cpp: 2010-12-20 Xan Lopez Reviewed by Gustavo Noronha. * GNUmakefile.am: add missing files. 2010-12-18 Gavin Barraclough Reviewed by Oliver Hunt. Bug 26276 - Need a mechanism to determine stack extent This patch adds a class 'StackBounds', to hold information about the machine stack. The implementation of this class broadly adheres to the current implmentation of stack limit checking, and as such does not solve the problem of determining stack extent, but gives us a common place to do so. Currently two mechanism are provided to determine the stack origin (the point the stack is growing away from). currentThreadStackBase() in Collector provides a more accurate determination of the stack origin, so use this to calculate StackBounds::m_origin; WTFThreadData::approximatedStackStart is less accurate, and as such can be removed. Cache the StackBounds on WTFThreadData such that they need only be determined once per thread, and for non-API contexts cache this information in JSGlobalData, to save a thread-specific access. For the time being retain the estimate of stack size used by JSC's parser (128 * sizeof(void*) * 1024), with a view to replacing this with something more accurate in the near future. * parser/JSParser.cpp: (JSC::JSParser::canRecurse): (JSC::JSParser::JSParser): Change to use StackBounds. * runtime/Collector.cpp: (JSC::Heap::registerThread): (JSC::Heap::markCurrentThreadConservativelyInternal): Change to use StackBounds, cached on JSGlobalData. * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSC::JSGlobalData::stack): Add a cached copy of StackBounds. * wtf/StackBounds.cpp: Copied from JavaScriptCore/runtime/Collector.cpp. (WTF::estimateStackBound): (WTF::StackBounds::initialize): (WTF::getStackMax): Copy code from Collector.cpp to determine stack origin. * wtf/StackBounds.h: Added. (WTF::StackBounds::StackBounds): No argument constructor; returns a null StackBounds. (WTF::StackBounds::currentThreadStackBounds): Returns a StackBounds object representing the stack limits of the current thread. (WTF::StackBounds::origin): Returns to stack origin (the point the stack is growing away from; the highest extent of the stack on machines where the stack grows downwards. (WTF::StackBounds::recursionLimit): Returns a limit value that is 'a comfortable distance from the end of the stack'. Our concept of this is currently 1 page away from the end, however the default value may be tuned in the future, and clients may override passing a larger delta; should only be called on StackBounds object representing the stack of the thread this method is called on (checked by checkConsistency). (WTF::StackBounds::recursionCheck): Checks whether we are currently 'a comfortable distance from the end of the stack'. Our concept of this is currently 1 page away from the end, however the default value may be tuned in the future, and clients may override passing a larger delta to apply when checking, if they wish to do so. This method should only be called on StackBounds object representing the stack of the thread this method is called on (checked by checkConsistency). (WTF::StackBounds::current): Approximate current stack position. On machines where the stack is growing downwards this is the lowest address that might need conservative collection. (WTF::StackBounds::isGrowingDownward): True for all platforms other than WINCE, which has to check. (WTF::StackBounds::checkConsistency): This is called in methods that shoulds only be operating on a valid set of bounds; as such we expect m_origin != m_bounds (i.e. stack size != zero) - we're really testing that this object is not null (the constructor initializes both fields to zero). Also checks that current() is within the stack's bounds. * wtf/WTFThreadData.cpp: (WTF::WTFThreadData::WTFThreadData): * wtf/WTFThreadData.h: (WTF::WTFThreadData::stack): Add the StackBounds member variable. 2010-12-17 Geoffrey Garen Reviewed by Sam Weinig. Factored common page set management into a new PageBlock base class https://bugs.webkit.org/show_bug.cgi?id=51285 * Android.mk: * CMakeLists.txt: * GNUmakefile.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile): * jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::intializePageSize): * wtf/PageAllocation.cpp: Removed. * wtf/PageAllocation.h: (WTF::PageAllocation::deallocate): (WTF::PageAllocation::PageAllocation): * wtf/PageReservation.h: (WTF::PageReservation::commit): (WTF::PageReservation::decommit): (WTF::PageReservation::deallocate): (WTF::PageReservation::PageReservation): * wtf/wtf.pri: 2010-12-17 Michael Saboff Reviewed by Oliver Hunt. RegExp Jit'ed expression crashes clicking link on yelp.com https://bugs.webkit.org/show_bug.cgi?id=51284 When transitioning between an non-repeating beginning of line anchored expression and the remaining refactored repeating expression, we should not clear any residual datalabel in state's m_backtrack. It will be resolved and cleared in subsequent code when linkAlternativeBacktracks() is called for the repeating alternative(s). * yarr/RegexJIT.cpp: (JSC::Yarr::RegexGenerator::BacktrackDestination::clear): (JSC::Yarr::RegexGenerator::TermGenerationState::clearBacktrack): 2010-12-17 Dan Bernstein Rubber-stamped by Mark Rowe. Updated for the renaming of WebKitTools to Tools * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: 2010-12-17 Ariya Hidayat Reviewed by Oliver Hunt. [JSC] parseAssignmentExpression should use TreeBuilder::CreatesAST https://bugs.webkit.org/show_bug.cgi?id=51268 * parser/JSParser.cpp: (JSC::JSParser::parseAssignmentExpression): 2010-12-17 Geoffrey Garen Reviewed by Oliver Hunt. Removed RChunk from PageAllocation/PageReservation, since it's now unused. https://bugs.webkit.org/show_bug.cgi?id=51276 * wtf/PageAllocation.h: (WTF::PageAllocation::PageAllocation): * wtf/PageReservation.h: (WTF::PageReservation::PageReservation): 2010-12-17 Oliver Hunt Reviewed by Gavin Barraclough. Incorrect encoding of some constants in ARMv7 JIT https://bugs.webkit.org/show_bug.cgi?id=51273 When using immediate encoding 3 we need to write the byte that holds a duplicated value. * assembler/ARMv7Assembler.h: (JSC::ARMThumbImmediate::makeEncodedImm): 2010-12-16 Evan Martin Reviewed by Darin Fisher. [chromium] useless warnings when building on Windows https://bugs.webkit.org/show_bug.cgi?id=50985 Disable some compiler warnings that aren't indicative of real problems. * JavaScriptCore.gyp/JavaScriptCore.gyp: 2010-12-16 Pratik Solanki Reviewed by Geoffrey Garen. https://bugs.webkit.org/show_bug.cgi?id=51166 ExecutableAllocator::cacheFlush should call sys_cache_control * jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::cacheFlush): Use the more correct and forward looking API - sys_cache_control(kCacheFunctionPrepareForExecution,...). 2010-12-16 Ariya Hidayat Reviewed by Andreas Kling. [JSC] Const correctness in ASTBuilder and SyntaxChecker https://bugs.webkit.org/show_bug.cgi?id=51141 * parser/ASTBuilder.h: (JSC::ASTBuilder::getName): (JSC::ASTBuilder::getType): (JSC::ASTBuilder::isResolve): * parser/SyntaxChecker.h: (JSC::SyntaxChecker::operatorStackPop): 2010-12-15 Kenneth Russell Reviewed by James Robinson. Web Audio API: port FFTFrame to MKL https://bugs.webkit.org/show_bug.cgi?id=50986 Fixed bug in log2 emulation function provided for Windows port of Web Audio API. * wtf/MathExtras.h: (log2): 2010-12-14 Mark Rowe Reviewed by Sam Weinig. Reproducible crash inside WebCore::MediaPlayerPrivateQTKit::createQTMovie when loading