2011-12-06 Filip Pizlo GC zapping logic could benefit from some more assertions https://bugs.webkit.org/show_bug.cgi?id=73947 Reviewed by Gavin Barraclough. - If you're in a zapped block and you're zapped, then your mark bit should never be set. - If you're being marked, then you should never be zapped. * heap/MarkedBlock.h: (JSC::MarkedBlock::isLive): * runtime/Structure.h: (JSC::MarkStack::internalAppend): 2011-12-06 Oliver Hunt Don't allocate register in typedarray control flow https://bugs.webkit.org/show_bug.cgi?id=73944 Reviewed by Gavin Barraclough. Move a temporary allocation outside of control flow. * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): 2011-12-06 Gavin Barraclough https://bugs.webkit.org/show_bug.cgi?id=68328 The generator and intrinsic fields in HashTableValue/HashEntry and associated structures and methods are redundant Reviewed by Geoff Garen. Move the instrinsic enum out of the DFG, into runtime. Add entires for all host functions that have an intrinsic in the form of a generated thunk. Remove the thunk pointer from the hashtable, and make Intrinsic field no longer ifdef on JIT/DFG. In getHostFunction select a thunk genertaor to use based on the Intrinsic. * JavaScriptCore.xcodeproj/project.pbxproj: * create_hash_table: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleCall): (JSC::DFG::ByteCodeParser::handleIntrinsic): * dfg/DFGCapabilities.h: * dfg/DFGIntrinsic.h: Removed. * jit/JITStubs.cpp: (JSC::JITThunks::hostFunctionStub): * jit/JITStubs.h: * runtime/Executable.cpp: (JSC::ExecutableBase::intrinsic): (JSC::NativeExecutable::intrinsic): * runtime/Executable.h: (JSC::ExecutableBase::intrinsicFor): (JSC::NativeExecutable::create): (JSC::NativeExecutable::finishCreation): * runtime/Intrinsic.h: Copied from Source/JavaScriptCore/dfg/DFGIntrinsic.h. * runtime/JSGlobalData.cpp: (JSC::thunkGeneratorForIntrinsic): (JSC::JSGlobalData::getHostFunction): * runtime/JSGlobalData.h: * runtime/Lookup.cpp: (JSC::HashTable::createTable): (JSC::setUpStaticFunctionSlot): * runtime/Lookup.h: (JSC::HashEntry::initialize): (JSC::HashEntry::intrinsic): 2011-12-06 Michael Saboff Add 8 bit paths to global object functions https://bugs.webkit.org/show_bug.cgi?id=73875 Added 8 bit paths for converions methods. This is worth 1.5% on kraken audio-oscillator, 1.6% on stanford-crypto-ccm and 2.5% on stanford-crypto-sha256-iterative. See bug for a full report. Reviewed by Oliver Hunt. * runtime/JSGlobalObjectFunctions.cpp: (JSC::decode): Split into a templated helper. (JSC::parseInt): Split into a templated helper. (JSC::parseFloat): Added an 8 bit path (JSC::globalFuncEscape): Added 8 bit path (JSC::globalFuncUnescape): Added 8 bit path * runtime/JSStringBuilder.h: (JSC::JSStringBuilder::append): New append for LChar * wtf/text/StringBuilder.h: (WTF::StringBuilder::append): New append for LChar 2011-11-21 Balazs Kelemen Enable ParallelJobs by default https://bugs.webkit.org/show_bug.cgi?id=70032 Reviewed by Zoltan Herczeg. According to measurements on Mac and Linux it is a considerable speedup for SVG on multicore. Remove the ENABLE(PARALLEL_JOBS) guard. Fix build on Windows and Chromium. * JavaScriptCore.gypi: Add the files to the build. It was missing for the gyp build system. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export symbols. * wtf/ParallelJobs.h: * wtf/ParallelJobsGeneric.cpp: (WTF::ParallelEnvironment::ParallelEnvironment): (WTF::ParallelEnvironment::execute): Deinline these to avoid exporting a lot of symbols. These are non-trivial and called only once on a given object so it doesn't seems to be worthwile to inline them. Additionally fix a signed-unsigned comparison in the constructor. * wtf/ParallelJobsGeneric.h: * wtf/Platform.h: 2011-12-06 Simon Hausmann [Qt] build-jsc script doesn't work https://bugs.webkit.org/show_bug.cgi?id=73910 Reviewed by Tor Arne Vestbø. * JavaScriptCore.pro: Build WTF before JavaScriptCore and JSC (moved from top-level WebKit.pro). Also add v8 scopes to only build WTF during v8 builds. 2011-12-05 Anders Carlsson Add HashMap::keys() and HashMap::values() for easy iteration of hash map keys and values in C++11. Reviewed by Darin Adler. * wtf/HashMap.h: 2011-12-05 Michael Saboff Create StringImpl::empty() as an 8 bit string https://bugs.webkit.org/show_bug.cgi?id=73871 Reviewed by Oliver Hunt. * wtf/text/StringStatics.cpp: (WTF::StringImpl::empty): Changed to be an 8 bit string. 2011-12-05 Darin Adler Convert JSClassRef to use HashMap https://bugs.webkit.org/show_bug.cgi?id=73780 Reviewed by Andreas Kling. * API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject::getOwnPropertyNames): Use get() on the hash map entries because the hash map now has an OwnPtr instead of a raw pointer. * API/JSClassRef.cpp: (OpaqueJSClass::OpaqueJSClass): No need to initialize m_staticValues and m_staticFunctions since they are now OwnPtr. Use adoptPtr when allocating. Removed the code that gets and deletes existing entries, and just use set, which now handles deletion automatically due to it being OwnPtr. (OpaqueJSClass::~OpaqueJSClass): Replaced code to do all the deletion with assertion-only NDEBUG-only code. (OpaqueJSClassContextData::OpaqueJSClassContextData): Use adoptPtr when allocating. Use OwnPtr when adding. Removed unneeded code to set staticValues and staticFunctions to 0. Removed unneeded destructor. (OpaqueJSClass::staticValues): Added get call. Also removed unneeded local. (OpaqueJSClass::staticFunctions): Ditto. (OpaqueJSClass::prototype): Added use of adoptPtr. * API/JSClassRef.h: Made the static values and static functions tables use OwnPtr for the entries. Also used OwnPtr for the pointers to the tables themselves. Also removed ~OpaqueJSClassContextData(), letting the compiler generate it. 2011-12-05 Oliver Hunt Land uncommitted bit of float array support https://bugs.webkit.org/show_bug.cgi?id=73873 Reviewed by Filip Pizlo. * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): 2011-12-05 Benjamin Poulain Update String::containsOnlyASCII() to handle 8 bits strings https://bugs.webkit.org/show_bug.cgi?id=73799 Reviewed by Darin Adler. Implement String::containsOnlyASCII() so that it does not call String::characters(). * wtf/text/WTFString.h: (WTF::String::containsOnlyASCII): 2011-12-05 Filip Pizlo Unreviewed build fix for non-DFG platforms. * dfg/DFGRepatch.h: 2011-12-05 Filip Pizlo Old JIT emits 32-bit offsets for put_by_id but sometimes patches them as if they were compact offsets https://bugs.webkit.org/show_bug.cgi?id=73861 Reviewed by Gavin Barraclough. * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::resetPatchPutById): 2011-12-05 Filip Pizlo Unreviewed, build fixes for ARM. * assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::unreachableForPlatform): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::loadDouble): (JSC::MacroAssemblerARMv7::loadFloat): (JSC::MacroAssemblerARMv7::storeFloat): (JSC::MacroAssemblerARMv7::convertFloatToDouble): (JSC::MacroAssemblerARMv7::convertDoubleToFloat): 2011-12-05 Benjamin Poulain Update String::containsOnlyLatin1() to avoid converting to 16 bits https://bugs.webkit.org/show_bug.cgi?id=73797 Reviewed by Andreas Kling. When the String use 8bits StringImpl, there is no need to iterate over the string. The function charactersAreAllLatin1() is removed because it is not used anywhere. * wtf/text/WTFString.h: (WTF::String::containsOnlyLatin1): 2011-12-05 Michael Saboff 8 bit string work slows down Kraken json-stringify-tinderbox https://bugs.webkit.org/show_bug.cgi?id=73457 Added 8 bit path to StringBuilder. StringBuilder starts assuming 8 bit contents and gets converted to 16 bit upon seeing the first 16 bit character or string. Split appendUninitialiezed into an inlined fast and function call slow case. Factored out the processing of the UString argument from Stringifier::appendQuotedString() to a static templated function based on character size. This change eliminates 5% of the 7% slowdown to json-stringify-tinderbox. This change introduces a 4.8% slowdown to json-parse-financial. This slowdown will be addressed in a subsequent patch to StringImpl::equal. Reviewed by Oliver Hunt. * runtime/JSONObject.cpp: (JSC::appendStringToUStringBuilder): (JSC::Stringifier::appendQuotedString): * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::resize): (WTF::StringBuilder::allocateBuffer): (WTF::StringBuilder::allocateBufferUpConvert): (WTF::LChar): (WTF::UChar): (WTF::StringBuilder::reserveCapacity): (WTF::StringBuilder::appendUninitialized): (WTF::StringBuilder::appendUninitializedSlow): (WTF::StringBuilder::append): (WTF::StringBuilder::shrinkToFit): * wtf/text/StringBuilder.h: (WTF::StringBuilder::StringBuilder): (WTF::StringBuilder::append): (WTF::StringBuilder::operator[]): (WTF::StringBuilder::characters8): (WTF::StringBuilder::characters16): (WTF::StringBuilder::charactersBlah): (WTF::LChar): (WTF::UChar): 2011-12-01 Gavin Barraclough https://bugs.webkit.org/show_bug.cgi?id=73624 JIT + INTERPRETER builds are broken Reviewed by Geoff Garen, Sam Weinig. These don't fallback to the interpreter correctly. Thunk creation assumes that is the JIT is compiled in, then it is enabled. * jit/JITStubs.cpp: (JSC::JITThunks::JITThunks): * runtime/Executable.h: (JSC::NativeExecutable::create): (JSC::NativeExecutable::finishCreation): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::getHostFunction): 2011-12-05 Zoltan Herczeg MacroAssemblerSH4 does not implement readCallTarget https://bugs.webkit.org/show_bug.cgi?id=73434 Reviewed by Csaba Osztrogonác. * assembler/MacroAssemblerSH4.h: Support for SH4. (JSC::MacroAssemblerSH4::readCallTarget): * assembler/SH4Assembler.h: (JSC::SH4Assembler::readCallTarget): 2011-12-04 Filip Pizlo DFG should optimize strict equality https://bugs.webkit.org/show_bug.cgi?id=73764 Reviewed by Oliver Hunt. 1% speed-up on V8. * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compare): (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant): (JSC::DFG::SpeculativeJIT::compileStrictEq): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compileIntegerCompare): (JSC::DFG::SpeculativeJIT::compileDoubleCompare): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compileIntegerCompare): (JSC::DFG::SpeculativeJIT::compileDoubleCompare): (JSC::DFG::SpeculativeJIT::compile): 2011-12-03 Darin Adler Use HashMap for ScriptSampleRecordMap https://bugs.webkit.org/show_bug.cgi?id=73758 Reviewed by Andreas Kling. * bytecode/SamplingTool.cpp: (JSC::SamplingTool::notifyOfScope): Added adoptPtr. (JSC::SamplingTool::dump): Added get. * bytecode/SamplingTool.h: Changed the value type of ScriptSampleRecordMap to be OwnPtr. 2011-12-03 Darin Adler Use HashMap for the opaqueJSClassData map https://bugs.webkit.org/show_bug.cgi?id=73759 Reviewed by Andreas Kling. * API/JSClassRef.cpp: (OpaqueJSClass::contextData): Update types. * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::~JSGlobalData): Add an explicit clear of opaqueJSClassData to keep the timing the same. If we didn't care about the order of operations, we could remove this, too. * runtime/JSGlobalData.h: Use OwnPtr instead of raw pointer for the mapped type in the opaqueJSClassData map. 2011-12-03 Darin Adler Change HashMap implementation to use the pass type and peek type from traits for the mapped value https://bugs.webkit.org/show_bug.cgi?id=72474 Reviewed by Anders Carlsson. * wtf/HashMap.h: Added ReferenceTypeMaker struct template. Get PassInType, PassOutType, and PeekType from the traits of the mapped value instead of hard-coding them here. Changed inlineAdd to take a reference to the PassInType instead of the PassInType itself, to accomodate a PassInType that can't be copied. Use the store, peek, and passOut functions from the traits as well. * wtf/HashTraits.h: Updated GenericHashTraits and HashTraits for OwnPtr to include PassInType, PassOutType, PeekType, store, passOut, and peek. Before this, the file had an earlier version that was just PassType, PeekType, pass, and peek. Also commented the HashTraits for RefPtr to foreshadow some work we can do there. * wtf/RefPtrHashMap.h: Same changes as HashMap.h. 2011-12-02 David Levin Rename WTF class from TemporarilyChange to TemporaryChange. https://bugs.webkit.org/show_bug.cgi?id=73479 Reviewed by Eric Seidel. * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * wtf/TemporaryChange.h: Renamed from Source/JavaScriptCore/wtf/TemporarilyChange.h. (WTF::TemporaryChange::TemporaryChange): (WTF::TemporaryChange::~TemporaryChange): 2011-12-02 Mark Hahnenberg REGRESSION (r99754): All layout tests crash on Windows https://bugs.webkit.org/show_bug.cgi?id=72305 Reviewed by Geoffrey Garen. Fixes a crash in release builds on Windows. Windows was optimizing the out-of-line virtual destructor in JSFunction away, which left it with no virtual functions. Its vtable ptr was then identical to that of a different class, therefore the optimization in the visitChildren helper function in MarkedStack.cpp was calling an incorrect version of visitChildren on the object, which left its children unmarked, causing them to be collected when they were still reachable. * runtime/JSFunction.cpp: (JSC::JSFunction::vtableAnchor): Add a virtual function to JSFunction that Visual Studio can't optimize away. * runtime/JSFunction.h: * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::storeVPtrs): Add checks to make sure that all virtual pointers that we rely on for optimization purposes are distinct from one another. 2011-12-02 Oliver Hunt Improve float array support in the DFG JIT https://bugs.webkit.org/show_bug.cgi?id=73722 Reviewed by Gavin Barraclough. Add basic support for float typed arrays in JSC. This is currently less optimal than it could be in the following ways: * float32Array1[0] = float32Array2[0] (eg. an element by element copy) promotes float to double and then back to float. * float64Array[0] will always perform NaN tests in order to prevent signalling NaNs from entering the engine. We also don't support Float32Array on ARMv7 * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::loadDouble): (JSC::MacroAssemblerARMv7::loadFloat): (JSC::MacroAssemblerARMv7::storeDouble): (JSC::MacroAssemblerARMv7::storeFloat): (JSC::MacroAssemblerARMv7::convertFloatToDouble): (JSC::MacroAssemblerARMv7::convertDoubleToFloat): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::loadDouble): (JSC::MacroAssemblerX86Common::loadFloat): (JSC::MacroAssemblerX86Common::storeDouble): (JSC::MacroAssemblerX86Common::storeFloat): (JSC::MacroAssemblerX86Common::convertDoubleToFloat): (JSC::MacroAssemblerX86Common::convertFloatToDouble): * assembler/X86Assembler.h: (JSC::X86Assembler::cvtsd2ss_rr): (JSC::X86Assembler::cvtss2sd_rr): (JSC::X86Assembler::movsd_rm): (JSC::X86Assembler::movss_rm): (JSC::X86Assembler::movsd_mr): (JSC::X86Assembler::movss_mr): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::execute): * dfg/DFGNode.h: (JSC::DFG::Node::shouldSpeculateFloat32Array): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::propagateNodePredictions): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray): (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::compile): 2011-12-02 Sheriff Bot Unreviewed, rolling out r101801. http://trac.webkit.org/changeset/101801 https://bugs.webkit.org/show_bug.cgi?id=73667 Build is still broken (Requested by Ossy on #webkit). * assembler/SH4Assembler.h: 2011-12-01 Darin Adler Prepare to deploy pass and peek types in the HashMap class https://bugs.webkit.org/show_bug.cgi?id=73477 Reviewed by Adam Roben. This patch adds private typedefs inside the HashMap class, and uses them as appropriate. A future patch will actually tie those typedefs to hash traits, which will allow us to make HashMap work with OwnPtr mapped values and to optimize how HashMap works with RefPtr mapped values. Also changed the hash translator and adapter struct templates to use template functions to simplify them and make them more flexible. Also removed some unused template arguments. This goes out of its way to not change behavior. Future patches will change the peek type to be a reference type, which will reduce reference count churn a bit for hash tables with RefPtr mapped values, and then do further optimizations for RefPtr and OwnPtr by getting types from the hash traits. * wtf/HashMap.h: Added MappedPassInType, MappedPassOutType, and MappedPeekType typedefs, and used them for the arguments and return types of the get, set, add, take, and inlineAdd functions. (WTF::HashMapTranslator): Changed this struct template to take fewer arguments, and changed its member functions to be function templates instead. This allows the compiler to determine types more flexibly and also simplifies use of it. (WTF::HashMapTranslatorAdapter): Ditto. (WTF::HashMap::find): Updated to use new HashMapTranslatorAdapter. Also reduced the arguments passed to the HashTable function template. (WTF::HashMap::contains): Ditto. (WTF::HashMap::inlineAdd): Ditto. Also take MappedPassInType. (WTF::HashMap::set): Ditto. (WTF::HashMap::add): Ditto. (WTF::HashMap::inlineGet): Ditto, but return MappedPeekType. (WTF::HashMap::get): Ditto. (WTF::HashMap::take): Ditto, but return MappedPassOutType and use that type in the implementation. (WTF::deleteAllValues): Removed unneeded template arguments from call to deleteAllPairSeconds. (WTF::deleteAllKeys): Removed unneeded template arguments from call to deleteAllPairFirsts. * wtf/HashSet.h: (WTF::IdentityExtractor): Changed this to be a struct rather than a struct template, and replaced the extract function with a function template. This allows the compiler to deduce the type. (WTF::HashSetTranslatorAdapter): Changed this struct template to take fewer arguments, and changed its member functions to be function templates instead. This allows the compiler to determine types more flexibly and also simplifies use of it. (WTF::HashSet::find): Updated to use new HashSetTranslatorAdapter. Also reduced the arguments passed to the HashTable function template. (WTF::HashSet::contains): Ditto. (WTF::HashSet::add): Ditto. * wtf/HashTable.h: (WTF::IdentityHashTranslator): Changed this struct template to take fewer arguments, and changed its member functions to be function templates instead. This allows the compiler to determine types more flexibly and also simplifies use of it. (WTF::HashTable::add): Reduced arguments passed to the function template. (WTF::HashTable::find): Ditto, also reversed the template arguments so the translator comes first so the compiler can deduce the other type. (WTF::HashTable::contains): Ditto. (WTF::HashTable::lookup): Ditto. (WTF::HashTable::lookupForWriting): Ditto. (WTF::HashTable::checkKey): Ditto. (WTF::HashTable::fullLookupForWriting): Ditto. (WTF::HashTable::add): Ditto. (WTF::HashTable::addPassingHashCode): Ditto. (WTF::HashTable::find): Ditto. (WTF::HashTable::contains): Ditto. * wtf/ListHashSet.h: (WTF::ListHashSetNodeHashFunctions): Changed this struct template to take fewer arguments, and changed its member functions to be function templates instead. This allows the compiler to determine types more flexibly and also simplifies use of it. (WTF::ListHashSet::find): Reduced the arguments passed to the HashTable functon template. (WTF::ListHashSetTranslatorAdapter): Changed this struct template in the same way we changed ListHashSetNodeHashFunctions above. (WTF::ListHashSetTranslatorAdapter::equal): (WTF::::contains): (WTF::::add): (WTF::::insertBefore): * wtf/RefPtrHashMap.h: Updated comments. Removed the RefPtrHashMapRawKeyTranslator struct template; we can use the HashMapTranslator struct template from HashMap.h instead now that it is more flexible. Added MappedPassInType, MappedPassOutType, and MappedPeekType typedefs, and used them for the arguments and return types of the get, inlineGet, set, add, take, and inlineAdd functions. Changed the name of the RawKeyTranslator type to Translator since it's now a class that can handle both raw keys and conventional keys. (WTF::HashMap::find): Changed to use Translator instead of RawKeyTranslator. Reduced the arguments passed to the HashTable function template. (WTF::HashMap::contains): Ditto. (WTF::HashMap::inlineAdd): Ditto. Also take MappedPassInType. (WTF::HashMap::set): Ditto. (WTF::HashMap::add): Ditto. (WTF::HashMap::inlineGet): Ditto, but return MappedPeekType. (WTF::HashMap::get): Ditto. (WTF::HashMap::take): Ditto, but return MappedPassOutType and use that type in the implementation. (WTF::deleteAllValues): Removed unneeded template arguments from call to deleteAllPairSeconds. (WTF::deleteAllKeys): Removed unneeded template arguments from call to deleteAllPairFirsts. 2011-12-02 Zoltan Herczeg MacroAssemblerSH4 does not implement readCallTarget https://bugs.webkit.org/show_bug.cgi?id=73434 Reviewed by Csaba Osztrogonác. * assembler/SH4Assembler.h: (JSC::SH4Assembler::readCallTarget): Support for SH4. 2011-12-02 Hajime Morrita Unreviewed, rolling out r101751 and r101775. http://trac.webkit.org/changeset/101751 http://trac.webkit.org/changeset/101775 https://bugs.webkit.org/show_bug.cgi?id=73191 breaks Windows build * JavaScriptCore.xcodeproj/project.pbxproj: * config.h: * runtime/JSExportMacros.h: Removed. * wtf/ExportMacros.h: * wtf/Platform.h: * wtf/WTFThreadData.h: * wtf/text/AtomicString.h: * wtf/text/StringStatics.cpp: 2011-12-01 Hajime Morrita JS_INLINE and WTF_INLINE should be visible from WebCore https://bugs.webkit.org/show_bug.cgi?id=73191 - Moved Export related macro definitions from config.h to ExportMacros.h and JSExportMacros.h. - Moved WTF_USE_JSC and WTF_USE_V8 from various config.h family to Platform.h. - Replaced JS_EXPORTDATA in wtf moudule with newly introduced WTF_EXPORTDATA. Reviewed by Kevin Ollivier. * JavaScriptCore.xcodeproj/project.pbxproj: * config.h: * runtime/JSExportMacros.h: Added. * wtf/ExportMacros.h: * wtf/Platform.h: * wtf/WTFThreadData.h: * wtf/text/AtomicString.h: * wtf/text/StringStatics.cpp: 2011-12-01 Michael Saboff Changes proposed for 73457 slow down Kraken json-parse-financial https://bugs.webkit.org/show_bug.cgi?id=73584 Restructured StringImpl::equal to take advantage of 8 or 4 bytes at a time when possible. This is worth ~3% on Kraken json-parse-financial. It provides ~2% on SunSpider string-unpack-code. Reviewed by Sam Weinig. * wtf/text/StringImpl.cpp: (WTF::equal): 2011-12-01 Oliver Hunt Support integer typed arrays in the DFG JIT https://bugs.webkit.org/show_bug.cgi?id=73608 Reviewed by Filip Pizlo. Add support for all the integral typed arrays in the DFG JIT. Currently this loads the contents of Uint32 arrays as doubles, which is clearly not as efficient as it could be, but this is still in the order of 10-20x faster than the existing behaviour. This needed us to add support for writing 16bit values to the macroassembler, and also to support double<->unsigned conversion. * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::strh): (JSC::ARMv7Assembler::vcvt_floatingPointToUnsigned): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::store16): (JSC::MacroAssemblerARMv7::truncateDoubleToUint32): * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::store16): (JSC::MacroAssemblerX86Common::truncateDoubleToUint32): * assembler/X86Assembler.h: (JSC::X86Assembler::movw_rm): (JSC::X86Assembler::cvttsd2siq_rr): * bytecode/PredictedType.cpp: (JSC::predictionToString): (JSC::predictionFromClassInfo): * bytecode/PredictedType.h: (JSC::isInt8ArrayPrediction): (JSC::isInt16ArrayPrediction): (JSC::isInt32ArrayPrediction): (JSC::isUint8ArrayPrediction): (JSC::isUint16ArrayPrediction): (JSC::isUint32ArrayPrediction): (JSC::isFloat32ArrayPrediction): (JSC::isFloat64ArrayPrediction): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::initialize): (JSC::DFG::AbstractState::execute): * dfg/DFGNode.h: (JSC::DFG::Node::shouldSpeculateInt8Array): (JSC::DFG::Node::shouldSpeculateInt16Array): (JSC::DFG::Node::shouldSpeculateInt32Array): (JSC::DFG::Node::shouldSpeculateUint8Array): (JSC::DFG::Node::shouldSpeculateUint16Array): (JSC::DFG::Node::shouldSpeculateUint32Array): (JSC::DFG::Node::shouldSpeculateFloat32Array): (JSC::DFG::Node::shouldSpeculateFloat64Array): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::propagateNodePredictions): (JSC::DFG::Propagator::fixupNode): (JSC::DFG::Propagator::performNodeCSE): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::checkArgumentTypes): (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength): (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * runtime/JSGlobalData.h: 2011-12-01 Benjamin Poulain URLs are encoded in UTF-8, then decoded as if they are Latin1 https://bugs.webkit.org/show_bug.cgi?id=71758 Reviewed by Darin Adler. Add the operator == between a String and a Vector of char. The implementation is the same as the comparison of String and char* but adds the length as a parameter for comparing the strings. * JavaScriptCore.exp: * wtf/text/StringImpl.h: (WTF::equal): * wtf/text/WTFString.h: (WTF::operator==): (WTF::operator!=): 2011-12-01 Martin Robinson [GTK] Read fonts from the jhbuild root https://bugs.webkit.org/show_bug.cgi?id=73487 Reviewed by Gustavo Noronha Silva. Read fonts from the jhbuild root instead of from the system. This will ensure that all testers use the same fonts instead of leaving this up to luck. * wtf/gobject/GlibUtilities.h: Add Assertions.h which was required for the WebKit2TestRunner. 2011-12-01 Martin Robinson [GTK] Add a helper function to find the current executable's path https://bugs.webkit.org/show_bug.cgi?id=73473 Reviewed by Gustavo Noronha Silva. Add a WTF helper which gets the binary path. This is currently only used in WebKit2. * GNUmakefile.list.am: Add the new file to the source list. * wtf/gobject/GlibUtilities.cpp: Added. (getCurrentExecutablePath): * wtf/gobject/GlibUtilities.h: Added. 2011-12-01 Sheriff Bot Unreviewed, rolling out r101691. http://trac.webkit.org/changeset/101691 https://bugs.webkit.org/show_bug.cgi?id=73588 Tests fail on Chromium bots, early warning system warned committer, please adjust test_expectations in patch (Requested by scheib on #webkit). * JavaScriptCore.exp: * wtf/text/StringImpl.h: * wtf/text/WTFString.h: 2011-12-01 Filip Pizlo ARMv7 only allows for one-shot patching of compact offsets, while the JIT expects to be able to repatch https://bugs.webkit.org/show_bug.cgi?id=73548 Reviewed by Oliver Hunt. * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::setUInt7ForLoad): 2011-11-30 Benjamin Poulain URLs are encoded in UTF-8, then decoded as if they are Latin1 https://bugs.webkit.org/show_bug.cgi?id=71758 Reviewed by Darin Adler. Add the operator == between a String and a Vector of char. The implementation is the same as the comparison of String and char* but adds the length as a parameter for comparing the strings. * JavaScriptCore.exp: * wtf/text/StringImpl.h: (WTF::equal): * wtf/text/WTFString.h: (WTF::operator==): (WTF::operator!=): 2011-11-30 Dmitry Lomov https://bugs.webkit.org/show_bug.cgi?id=73503 [Chromium][V8] Implement ArrayBuffer transfer in chromium. Portions of this patch come from Luke Zarko. Reviewed by David Levin. * wtf/ArrayBuffer.cpp: (WTF::ArrayBuffer::transfer): Changed prototype from pointers to RefPtr. * wtf/ArrayBuffer.h: (WTF::ArrayBufferContents::transfer): Changed prototype from pointers to RefPtr. (WTF::ArrayBuffer::isNeutered): * wtf/TypedArrayBase.h: (WTF::TypedArrayBase::neuter): 2011-12-01 Chao-ying Fu MacroAssemblerMIPS does not implement readCallTarget https://bugs.webkit.org/show_bug.cgi?id=73432 Reviewed by Zoltan Herczeg. * assembler/MIPSAssembler.h: (JSC::MIPSAssembler::readCallTarget): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::readCallTarget): 2011-12-01 Noel Gordon [chromium] Remove wtf/qt/ThreadingQt.cpp from the gyp projects https://bugs.webkit.org/show_bug.cgi?id=73527 Reviewed by Simon Hausmann. wtf/qt/ThreadingQt.cpp was removed in r101477 * JavaScriptCore.gypi: remove wtf/qt/ThreadingQt.cpp 2011-12-01 Filip Pizlo BitVector isInline check could fail https://bugs.webkit.org/show_bug.cgi?id=70691 Reviewed by Gavin Barraclough. Switch back to using the high bit as the inline marker, to make all of the bit indexing operations simpler. Computing the size in words and in bytes of a bitvector, using the number of bits as input is error-prone enough; and with the current approach to solving the X86 bug we end up getting it wrong. Making it right seems hard. So instead, to solve the original problem (the high bit may be meaningful on 32-bit systems), the out-of-line storage pointer is right-shifted by 1. Compared to the original BitVector code, this is a much smaller change (just three lines). This solves a bug where the DFG was corrupting its call frame because BitVector lost track of some bits. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): * wtf/BitVector.h: (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::makeInlineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): 2011-11-30 Filip Pizlo DFG should make it easier to notice node boundaries in disassembly https://bugs.webkit.org/show_bug.cgi?id=73509 Rubber-stamped by Gavin Barraclough If you set XOR_DEBUG_AID to 1 in DFGCommon.h, a pair of xor's will be emitted at node boundaries, where the immediate being xor'd is the node index. * dfg/DFGCommon.h: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): 2011-11-30 Geoffrey Garen Removed ArgList iterators. Reviewed by Gavin Barraclough. Another step toward reversing the argument order. * interpreter/Interpreter.cpp: (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): Switched from iterator to int. * runtime/ArgList.h: (JSC::ArgList::ArgList): (JSC::ArgList::isEmpty): Removed iterators. * runtime/JSArray.cpp: (JSC::JSArray::finishCreation): Switched from iterator to int. 2011-11-30 Yuqiang Xian 32 bit DFG should handle logicalNot slow case instead of simply bailing out https://bugs.webkit.org/show_bug.cgi?id=73515 Reviewed by Filip Pizlo. This improves Kraken performance by 14%, mainly due to ~3X improvement on imaging-desaturate. * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compileLogicalNot): 2011-11-30 Max Vujovic Some date values not handled consistently with IE/Firefox https://bugs.webkit.org/show_bug.cgi?id=14176 Reviewed by Gavin Barraclough. Changed time zone offset parsing behavior to match IE/Firefox/Opera's in implementation dependent cases like "GMT-4". * wtf/DateMath.cpp: (WTF::parseDateFromNullTerminatedCharacters): 2011-11-30 Mark Hahnenberg toStringCallback and valueOfCallback do not check the entire prototype chain for convertToType callback https://bugs.webkit.org/show_bug.cgi?id=73368 Reviewed by Darin Adler. We need to search the entire prototype chain for the convertToType callback, rather than just calling whatever happens to be in the first class of the chain, which potentially could be null. * API/JSCallbackFunction.cpp: (JSC::JSCallbackFunction::toStringCallback): (JSC::JSCallbackFunction::valueOfCallback): 2011-11-29 Sam Weinig Add adoptCF and adoptNS convenience functions to RetainPtr.h https://bugs.webkit.org/show_bug.cgi?id=73399 Reviewed by Anders Carlsson. * wtf/RetainPtr.h: (WTF::adoptCF): (WTF::adoptNS): These adoption functions match the pattern we use in other smart pointer classes. 2011-11-30 Adam Roben Fix RetainPtr's move assignment operators Fixes RetainPtr's move assignment operators don't modify the pointer being assigned to I didn't write a test for this because we don't have a way of unit testing C++11 code (see ). Reviewed by Anders Carlsson. * wtf/RetainPtr.h: (WTF::RetainPtr::operator=): Adopt the passed-in RetainPtr's underlying pointer, not our own pointer. 2011-11-30 Csaba Osztrogonác Unreviewed rolling out incorrect r101481. * assembler/MIPSAssembler.h: * assembler/MacroAssemblerMIPS.h: 2011-11-30 Simon Hausmann Fix compilation with MingW. Reviewed by Csaba Osztrogonác. * wtf/ThreadingWin.cpp: (WTF::initializeCurrentThreadInternal): MingW doesn't support MSVC exception handling, so for the time being make the thread name setting unimplemented for MingW. 2011-11-30 Simon Hausmann Unreviewed propective build fix for Qt/Windows part 2 after r101477. * wtf/ThreadSpecific.h: Fix the OS(WINDOWS) defines for the friend declaration for ThreadSpecific::Data 2011-11-30 Simon Hausmann Unreviewed propective build fix for Qt/Windows after r101477. * wtf/ThreadSpecific.h: Use OS(WINDOWS) for declaring "destructor", as it's only referenced from within another OS(WINDOWS) section. 2011-11-30 Csaba Osztrogonác Unreviewed speculative buildfix after r101457. * assembler/MIPSAssembler.h: (JSC::MIPSAssembler::readCallTarget): * assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::readCallTarget): 2011-11-30 Andrew Wason Replace Qt QThread threading back-end with pthread/Win32 threading back-ends https://bugs.webkit.org/show_bug.cgi?id=72155 Reviewed by Simon Hausmann. Use ThreadingPthreads and ThreadingWin instead of ThreadingQt. * heap/MachineStackMarker.cpp: * wtf/MainThread.cpp: (WTF::initializeMainThread): * wtf/Platform.h: * wtf/ThreadSpecific.h: Drop QThreadStorage related code. (WTF::::destroy): * wtf/ThreadingPrimitives.h: * wtf/qt/MainThreadQt.cpp: Drop Qt specific isMainThread(). (WTF::initializeMainThreadPlatform): Initialize MainThreadInvoker on main thread to avoid infecting secondary thread with QAdoptedThread. (WTF::scheduleDispatchFunctionsOnMainThread): * wtf/qt/ThreadingQt.cpp: Removed. * wtf/wtf.pro: 2011-11-30 Csaba Osztrogonác MacroAssemblerARM does not implement readCallTarget https://bugs.webkit.org/show_bug.cgi?id=73413 Based on Filip Pizlo's patch. Buildfix. Rubber-stamped by Gabor Loki. * assembler/ARMAssembler.h: (JSC::ARMAssembler::readCallTarget): * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::readCallTarget): 2011-11-29 Filip Pizlo Resetting a put_by_id inline cache should preserve the "isDirect" bit https://bugs.webkit.org/show_bug.cgi?id=73375 Reviewed by Gavin Barraclough. For the replace case, we can find out if it was direct by looking at the slow call. For the transition case, we explicitly remember if it was direct. * bytecode/CodeBlock.cpp: (JSC::printStructureStubInfo): * bytecode/StructureStubInfo.cpp: (JSC::StructureStubInfo::deref): (JSC::StructureStubInfo::visitWeakReferences): * bytecode/StructureStubInfo.h: (JSC::isPutByIdAccess): (JSC::StructureStubInfo::initPutByIdTransition): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGRepatch.cpp: (JSC::DFG::tryCachePutByID): * jit/JIT.h: * jit/JITPropertyAccess.cpp: (JSC::JIT::resetPatchPutById): (JSC::JIT::isDirectPutById): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::resetPatchPutById): * jit/JITStubs.cpp: (JSC::JITThunks::tryCachePutByID): 2011-11-29 Sam Weinig Remove RetainPtr::releaseRef https://bugs.webkit.org/show_bug.cgi?id=73396 Reviewed by Dan Bernstein. * wtf/RetainPtr.h: Be gone releaseRef! Long live leakRef! 2011-11-29 Sam Weinig Add move semantics to RetainPtr https://bugs.webkit.org/show_bug.cgi?id=73393 Reviewed by Anders Carlsson. * wtf/RetainPtr.h: (WTF::RetainPtr::RetainPtr): Add a move constructor and move enabled assignment operators to RetainPtr if the compiler being used supports rvalue references. If the compiler does not support it, we fallback to the copy semantics we have always had. 2011-11-29 Yuqiang Xian DFG local CSE may cause incorrect reference counting for a node https://bugs.webkit.org/show_bug.cgi?id=73390 Reviewed by Filip Pizlo. When performing a node substitution, the ref count of the replaced child will be increased, no matter whether the user node is skipped in code generation or not. This will cause the reference count of the replaced child never get the chance to become zero and so the registers occupied by it cannot be reused simply without spilling, if it's used by a "skipped" node. This is a 1% gain on V8 benchmark, tested on IA32 Linux. * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::performSubstitution): (JSC::DFG::Propagator::performNodeCSE): 2011-11-29 David Levin Add a way to revert a variable to its previous value after leaving a scope. https://bugs.webkit.org/show_bug.cgi?id=73371 Reviewed by Adam Barth. In case anyone from Chromium sees this, it is nearly identical to AutoReset but if the same name were used, it causes unnecessary ambiguity. * JavaScriptCore.xcodeproj/project.pbxproj: * wtf/TemporarilyChange.h: Added. (WTF::TemporarilyChange::TemporarilyChange): (WTF::TemporarilyChange::~TemporarilyChange): 2011-11-29 Sam Weinig Add COMPILER_SUPPORTS macro to allow for compiler feature testing https://bugs.webkit.org/show_bug.cgi?id=73386 Reviewed by Anders Carlsson. * wtf/Compiler.h: Add COMPILER_SUPPORTS and #defines for C++11 variadic templates and rvalue references for Clang. 2011-11-29 Oliver Hunt Allow WebCore to describe typed arrays to JSC https://bugs.webkit.org/show_bug.cgi?id=73355 Reviewed by Gavin Barraclough. Allow globaldata to track the structure of typed arrays. * runtime/JSGlobalData.h: (JSC::TypedArrayDescriptor::TypedArrayDescriptor): 2011-11-28 Filip Pizlo DFG debugCall() mechanism only works on X86 and X86-64 https://bugs.webkit.org/show_bug.cgi?id=73282 Reviewed by Oliver Hunt. * dfg/DFGAssemblyHelpers.h: (JSC::DFG::AssemblyHelpers::debugCall): 2011-11-28 Filip Pizlo DFG non-X86 ArithDiv does speculation failure after mutating state, without a value recovery https://bugs.webkit.org/show_bug.cgi?id=73286 Reviewed by Gavin Barraclough. * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): 2011-11-28 Filip Pizlo Unreviewed build fixes for ARM. * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::readCallTarget): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::setupArgumentsWithExecState): 2011-11-20 Roland Steiner