From 21939df44de1705786c545cd1bf519d47250322d Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Tue, 11 May 2010 18:35:50 +0100 Subject: Merge Webkit at r58956: Initial merge by Git. Change-Id: I1d9fb60ea2c3f2ddc04c17a871acdb39353be228 --- JavaScriptCore/API/APIShims.h | 2 +- JavaScriptCore/API/JSBase.cpp | 1 + JavaScriptCore/API/JSCallbackObject.cpp | 1 + JavaScriptCore/API/JSContextRef.cpp | 4 +- JavaScriptCore/API/JSStringRef.h | 2 +- JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp | 1 + JavaScriptCore/ChangeLog | 1510 ++++++++++++++++++++ JavaScriptCore/Configurations/Version.xcconfig | 2 +- JavaScriptCore/GNUmakefile.am | 10 + JavaScriptCore/JavaScriptCore.exp | 5 + .../JavaScriptCore.gyp/JavaScriptCore.gyp | 1 + JavaScriptCore/JavaScriptCore.gypi | 8 +- JavaScriptCore/JavaScriptCore.pri | 21 +- JavaScriptCore/JavaScriptCore.pro | 23 +- .../JavaScriptCore/JavaScriptCore.def | 12 +- .../JavaScriptCore/JavaScriptCore.vcproj | 20 + .../JavaScriptCore.vcproj/WTF/WTF.vcproj | 28 +- .../JavaScriptCore.xcodeproj/project.pbxproj | 44 + JavaScriptCore/assembler/ARMAssembler.cpp | 2 +- JavaScriptCore/assembler/ARMAssembler.h | 54 +- JavaScriptCore/assembler/AbstractMacroAssembler.h | 4 +- JavaScriptCore/assembler/MacroAssemblerARM.h | 87 +- JavaScriptCore/assembler/MacroAssemblerARMv7.h | 30 + JavaScriptCore/assembler/MacroAssemblerX86.h | 3 +- JavaScriptCore/assembler/MacroAssemblerX86Common.h | 36 + JavaScriptCore/assembler/MacroAssemblerX86_64.h | 3 +- JavaScriptCore/assembler/X86Assembler.h | 29 +- JavaScriptCore/bytecode/CodeBlock.cpp | 19 +- JavaScriptCore/bytecode/Opcode.h | 1 + JavaScriptCore/bytecode/SamplingTool.cpp | 2 +- JavaScriptCore/bytecompiler/BytecodeGenerator.cpp | 9 +- JavaScriptCore/config.h | 2 +- JavaScriptCore/create_hash_table | 23 +- JavaScriptCore/debugger/DebuggerCallFrame.cpp | 8 +- JavaScriptCore/interpreter/Interpreter.cpp | 23 + JavaScriptCore/interpreter/RegisterFile.cpp | 17 + JavaScriptCore/interpreter/RegisterFile.h | 9 +- JavaScriptCore/jit/ExecutableAllocator.h | 4 +- JavaScriptCore/jit/ExecutableAllocatorPosix.cpp | 15 + JavaScriptCore/jit/JIT.cpp | 5 +- JavaScriptCore/jit/JIT.h | 143 +- JavaScriptCore/jit/JITArithmetic.cpp | 1465 ++++--------------- JavaScriptCore/jit/JITArithmetic32_64.cpp | 1411 ++++++++++++++++++ JavaScriptCore/jit/JITInlineMethods.h | 34 +- JavaScriptCore/jit/JITOpcodes.cpp | 14 +- JavaScriptCore/jit/JITStubCall.h | 4 +- JavaScriptCore/jit/JITStubs.cpp | 16 + JavaScriptCore/jit/JITStubs.h | 14 +- JavaScriptCore/jit/JSInterfaceJIT.h | 302 ++++ JavaScriptCore/jit/SpecializedThunkJIT.h | 174 +++ JavaScriptCore/jit/ThunkGenerators.cpp | 159 +++ JavaScriptCore/jit/ThunkGenerators.h | 46 + JavaScriptCore/qt/api/qscriptengine_p.h | 2 +- JavaScriptCore/qt/api/qscriptstring_p.h | 2 +- JavaScriptCore/qt/api/qscriptvalue.cpp | 35 +- JavaScriptCore/qt/api/qscriptvalue_p.h | 115 +- JavaScriptCore/qt/api/qtscriptglobal.h | 27 +- JavaScriptCore/runtime/ArrayPrototype.cpp | 19 +- .../runtime/CachedTranscendentalFunction.h | 103 ++ JavaScriptCore/runtime/Collector.cpp | 26 +- JavaScriptCore/runtime/Executable.h | 7 +- JavaScriptCore/runtime/JSActivation.h | 1 - JavaScriptCore/runtime/JSFunction.cpp | 19 +- JavaScriptCore/runtime/JSFunction.h | 2 + JavaScriptCore/runtime/JSGlobalData.cpp | 19 +- JavaScriptCore/runtime/JSGlobalData.h | 26 +- JavaScriptCore/runtime/JSGlobalObject.cpp | 4 +- JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp | 3 + JavaScriptCore/runtime/JSImmediate.h | 4 +- JavaScriptCore/runtime/JSLock.cpp | 8 +- JavaScriptCore/runtime/JSString.h | 2 + JavaScriptCore/runtime/JSValue.h | 14 +- JavaScriptCore/runtime/Lookup.cpp | 14 +- JavaScriptCore/runtime/Lookup.h | 19 +- JavaScriptCore/runtime/MathObject.cpp | 2 +- JavaScriptCore/runtime/SmallStrings.h | 4 +- JavaScriptCore/runtime/StringConstructor.cpp | 5 +- JavaScriptCore/runtime/Structure.cpp | 4 +- JavaScriptCore/runtime/UString.cpp | 9 + JavaScriptCore/runtime/WeakGCPtr.h | 11 +- JavaScriptCore/wtf/Assertions.h | 12 +- JavaScriptCore/wtf/Atomics.h | 117 ++ JavaScriptCore/wtf/CurrentTime.cpp | 21 +- JavaScriptCore/wtf/CurrentTime.h | 2 +- JavaScriptCore/wtf/FastMalloc.cpp | 96 +- JavaScriptCore/wtf/MD5.cpp | 304 ++++ JavaScriptCore/wtf/MD5.h | 61 + JavaScriptCore/wtf/MainThread.cpp | 57 +- JavaScriptCore/wtf/MainThread.h | 28 +- JavaScriptCore/wtf/MathExtras.h | 8 +- JavaScriptCore/wtf/OwnPtrBrew.cpp | 53 - JavaScriptCore/wtf/OwnPtrWin.cpp | 76 - JavaScriptCore/wtf/Platform.h | 36 +- JavaScriptCore/wtf/RandomNumber.h | 3 + JavaScriptCore/wtf/RefPtr.h | 4 +- JavaScriptCore/wtf/StaticConstructors.h | 4 +- JavaScriptCore/wtf/StringExtras.h | 2 +- JavaScriptCore/wtf/ThreadSafeShared.h | 148 ++ JavaScriptCore/wtf/Threading.h | 256 +--- JavaScriptCore/wtf/ThreadingPrimitives.h | 157 ++ JavaScriptCore/wtf/ThreadingPthreads.cpp | 28 +- JavaScriptCore/wtf/ThreadingWin.cpp | 21 +- JavaScriptCore/wtf/Vector.h | 2 +- JavaScriptCore/wtf/WTFThreadData.cpp | 7 +- JavaScriptCore/wtf/brew/OwnPtrBrew.cpp | 53 + JavaScriptCore/wtf/chromium/ChromiumThreading.h | 3 +- JavaScriptCore/wtf/chromium/MainThreadChromium.cpp | 32 +- JavaScriptCore/wtf/gobject/GRefPtr.h | 3 + JavaScriptCore/wtf/gtk/ThreadingGtk.cpp | 9 - JavaScriptCore/wtf/mac/MainThreadMac.mm | 61 +- JavaScriptCore/wtf/qt/MainThreadQt.cpp | 7 +- JavaScriptCore/wtf/qt/ThreadingQt.cpp | 12 - JavaScriptCore/wtf/text/AtomicString.cpp | 15 +- JavaScriptCore/wtf/text/AtomicStringImpl.h | 2 + JavaScriptCore/wtf/text/StringImpl.cpp | 4 +- JavaScriptCore/wtf/text/StringImpl.h | 15 +- JavaScriptCore/wtf/text/StringImplBase.h | 2 +- JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h | 2 +- JavaScriptCore/wtf/url/src/URLComponent.h | 71 + JavaScriptCore/wtf/url/src/URLSegments.cpp | 110 ++ JavaScriptCore/wtf/url/src/URLSegments.h | 105 ++ JavaScriptCore/wtf/url/wtfurl.gyp | 58 + JavaScriptCore/wtf/win/MainThreadWin.cpp | 2 + JavaScriptCore/wtf/win/OwnPtrWin.cpp | 76 + JavaScriptCore/wtf/wx/MainThreadWx.cpp | 24 + 125 files changed, 6377 insertions(+), 2160 deletions(-) create mode 100644 JavaScriptCore/jit/JITArithmetic32_64.cpp create mode 100644 JavaScriptCore/jit/JSInterfaceJIT.h create mode 100644 JavaScriptCore/jit/SpecializedThunkJIT.h create mode 100644 JavaScriptCore/jit/ThunkGenerators.cpp create mode 100644 JavaScriptCore/jit/ThunkGenerators.h create mode 100644 JavaScriptCore/runtime/CachedTranscendentalFunction.h create mode 100644 JavaScriptCore/wtf/Atomics.h create mode 100644 JavaScriptCore/wtf/MD5.cpp create mode 100644 JavaScriptCore/wtf/MD5.h delete mode 100644 JavaScriptCore/wtf/OwnPtrBrew.cpp delete mode 100644 JavaScriptCore/wtf/OwnPtrWin.cpp create mode 100644 JavaScriptCore/wtf/ThreadSafeShared.h create mode 100644 JavaScriptCore/wtf/ThreadingPrimitives.h create mode 100644 JavaScriptCore/wtf/brew/OwnPtrBrew.cpp create mode 100644 JavaScriptCore/wtf/url/src/URLComponent.h create mode 100644 JavaScriptCore/wtf/url/src/URLSegments.cpp create mode 100644 JavaScriptCore/wtf/url/src/URLSegments.h create mode 100644 JavaScriptCore/wtf/url/wtfurl.gyp create mode 100644 JavaScriptCore/wtf/win/OwnPtrWin.cpp (limited to 'JavaScriptCore') diff --git a/JavaScriptCore/API/APIShims.h b/JavaScriptCore/API/APIShims.h index 3d42ca2..892068d 100644 --- a/JavaScriptCore/API/APIShims.h +++ b/JavaScriptCore/API/APIShims.h @@ -66,7 +66,7 @@ public: // JSPropertyNameAccumulator only has a globalData. APIEntryShim(JSGlobalData* globalData, bool registerThread = true) : APIEntryShimWithoutLock(globalData, registerThread) - , m_lock(globalData->isSharedInstance ? LockForReal : SilenceAssertionsOnly) + , m_lock(globalData->isSharedInstance() ? LockForReal : SilenceAssertionsOnly) { } diff --git a/JavaScriptCore/API/JSBase.cpp b/JavaScriptCore/API/JSBase.cpp index ebfeafa..c5f1b15 100644 --- a/JavaScriptCore/API/JSBase.cpp +++ b/JavaScriptCore/API/JSBase.cpp @@ -38,6 +38,7 @@ #include #include #include +#include using namespace JSC; diff --git a/JavaScriptCore/API/JSCallbackObject.cpp b/JavaScriptCore/API/JSCallbackObject.cpp index 2fde0f8..b36c194 100644 --- a/JavaScriptCore/API/JSCallbackObject.cpp +++ b/JavaScriptCore/API/JSCallbackObject.cpp @@ -28,6 +28,7 @@ #include "JSCallbackObject.h" #include "Collector.h" +#include namespace JSC { diff --git a/JavaScriptCore/API/JSContextRef.cpp b/JavaScriptCore/API/JSContextRef.cpp index 06f9274..b97ceda 100644 --- a/JavaScriptCore/API/JSContextRef.cpp +++ b/JavaScriptCore/API/JSContextRef.cpp @@ -46,7 +46,7 @@ using namespace JSC; JSContextGroupRef JSContextGroupCreate() { initializeThreading(); - return toRef(JSGlobalData::createNonDefault(ThreadStackTypeSmall).releaseRef()); + return toRef(JSGlobalData::createContextGroup(ThreadStackTypeSmall).releaseRef()); } JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group) @@ -84,7 +84,7 @@ JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClass initializeThreading(); JSLock lock(LockForReal); - RefPtr globalData = group ? PassRefPtr(toJS(group)) : JSGlobalData::createNonDefault(ThreadStackTypeSmall); + RefPtr globalData = group ? PassRefPtr(toJS(group)) : JSGlobalData::createContextGroup(ThreadStackTypeSmall); APIEntryShim entryShim(globalData.get(), false); diff --git a/JavaScriptCore/API/JSStringRef.h b/JavaScriptCore/API/JSStringRef.h index 92135b1..51871b1 100644 --- a/JavaScriptCore/API/JSStringRef.h +++ b/JavaScriptCore/API/JSStringRef.h @@ -38,7 +38,7 @@ extern "C" { #endif #if !defined(WIN32) && !defined(_WIN32) && !defined(__WINSCW__) \ - && !(defined(__CC_ARM) || defined(__ARMCC__)) /* RVCT */ + && !((defined(__CC_ARM) || defined(__ARMCC__)) && defined(__SYMBIAN32__)) /* RVCT */ /*! @typedef JSChar @abstract A Unicode character. diff --git a/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp index e377ea0..7e6bb63 100644 --- a/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp +++ b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp @@ -33,6 +33,7 @@ #include "JSWeakObjectMapRefInternal.h" #include #include +#include using namespace WTF; using namespace JSC; diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index 11f02e3..eb2f97d 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,3 +1,1513 @@ +2010-05-06 Fumitoshi Ukai + + Reviewed by Alexey Proskuryakov. + + JavaScriptCore/wtf/RandomNumber.h should provide using WTF::* + https://bugs.webkit.org/show_bug.cgi?id=38719 + + * wtf/RandomNumber.h: + Add using directives. + +2010-05-06 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Enable YARR_JIT for X86 Mac for QtWebKit + https://bugs.webkit.org/show_bug.cgi?id=38668 + + * wtf/Platform.h: + +2010-05-06 Gavin Barraclough + + Reviewed by Geoff Garen. + + Bug 38714 - Add result caching for Math.sin + + Math.sin is frequently called with the same operand, caching the result should + improve performance. CachedTranscendentalFunction adds a generic mechanism to + cache results for pure functions with the signature "double func(double)", and + where NaN maps to NaN. + + CachedTranscendentalFunction uses a very simple hash function designed to be + fast to execute since we cannot cache the result, and trivial to JIT generate, + should we wish to do so. + + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/CachedTranscendentalFunction.h: Added. + (JSC::CachedTranscendentalFunction::CachedTranscendentalFunction): + (JSC::CachedTranscendentalFunction::~CachedTranscendentalFunction): + (JSC::CachedTranscendentalFunction::operator()): + (JSC::CachedTranscendentalFunction::initialize): + (JSC::CachedTranscendentalFunction::hash): + * runtime/JSGlobalData.h: + * runtime/MathObject.cpp: + (JSC::mathProtoFuncSin): + * wtf/Platform.h: + +2010-05-06 Geoffrey Garen + + Windows build fix. + + * bytecode/SamplingTool.cpp: + (JSC::SamplingFlags::sample): Use a cast, so Windows will be happy when + this code is enabled. + * wtf/Platform.h: Reverted last change to this file, which seems to have + been accidental. + +2010-05-06 Gavin Barraclough + + Reviewed by Oliver Hunt. + + Add compile switch to make debugger keyword plant breakpoint instructions. + + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitDebugHook): + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_debug): + * wtf/Platform.h: + +2010-05-06 Oliver Hunt + + Build fix + + Fix ARM builds + + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::load16): + * assembler/MacroAssemblerARMv7.h: + (JSC::MacroAssemblerARMv7::load16): + +2010-05-06 Oliver Hunt + + Reviewed by Geoffrey Garen. + + Improve performance of single character string compares + https://bugs.webkit.org/show_bug.cgi?id=38659 + + Add logic to the jit to identify comparisons to single character string literals + and then just perform the comparison inline, rather than ignoring the evidence + and attempting to perform an integer comparison. + + Multiple changes required -- add jnlesseq opcode, add helper function to identify + single character string constants, add a helper to load single character strings. + Then add the 32_64 and normal codepaths to the JIT. + + * assembler/MacroAssemblerX86Common.h: + (JSC::MacroAssemblerX86Common::load16): + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::dump): + * bytecode/Opcode.h: + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitJumpIfTrue): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * jit/JIT.cpp: + (JSC::JIT::privateCompileMainPass): + (JSC::JIT::privateCompileSlowCases): + * jit/JIT.h: + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_jnless): + (JSC::JIT::emitSlow_op_jnless): + (JSC::JIT::emit_op_jless): + (JSC::JIT::emitSlow_op_jless): + (JSC::JIT::emit_op_jlesseq): + (JSC::JIT::emit_op_jnlesseq): + (JSC::JIT::emitSlow_op_jlesseq): + (JSC::JIT::emitSlow_op_jnlesseq): + * jit/JITArithmetic32_64.cpp: + (JSC::JIT::emit_op_jnless): + (JSC::JIT::emitSlow_op_jnless): + (JSC::JIT::emit_op_jless): + (JSC::JIT::emitSlow_op_jless): + (JSC::JIT::emit_op_jlesseq): + (JSC::JIT::emit_op_jnlesseq): + (JSC::JIT::emitSlow_op_jlesseq): + (JSC::JIT::emitSlow_op_jnlesseq): + (JSC::JIT::emitBinaryDoubleOp): + * jit/JITInlineMethods.h: + (JSC::JIT::emitLoadCharacterString): + (JSC::JIT::isOperandConstantImmediateChar): + * jit/JSInterfaceJIT.h: + (JSC::ThunkHelpers::stringImplDataOffset): + (JSC::ThunkHelpers::jsStringLengthOffset): + (JSC::ThunkHelpers::jsStringValueOffset): + Moved from ThunkGenerators to make it possible to share. + * jit/ThunkGenerators.cpp: + +2010-05-06 Martin Robinson + + Reviewed by Gustavo Noronha Silva. + + [GTK] Enable DOM clipboard and drag-and-drop access + https://bugs.webkit.org/show_bug.cgi?id=30623 + + Convert dragging portion of drag-and-drop to use DataObjectGtk. + + * wtf/gobject/GRefPtr.h: Add forward declarations for GObject functions. + +2010-05-06 Steve Block + + Reviewed by Eric Seidel. + + MAC_JAVA_BRIDGE should be renamed JAVA_BRIDGE + https://bugs.webkit.org/show_bug.cgi?id=38544 + + * wtf/Platform.h: + +2010-05-06 Adam Barth + + Reviewed by Maciej Stachowiak. + + [WTFURL] Add a class to represent the segments of a URL + https://bugs.webkit.org/show_bug.cgi?id=38566 + + When paired with a string, this class represents a parsed URL. + + * wtf/url/src/URLSegments.cpp: Added. + (WTF::URLSegments::length): + (WTF::URLSegments::charactersBefore): + * wtf/url/src/URLSegments.h: Added. + (WTF::URLSegments::): + (WTF::URLSegments::URLSegments): + * wtf/url/wtfurl.gyp: + +2010-05-05 Tony Gentilcore + + Reviewed by Adam Barth. + + Adding comment with link to RefPtr documentation. + https://bugs.webkit.org/show_bug.cgi?id=38601 + + * wtf/RefPtr.h: + +2010-05-05 Gavin Barraclough + + Reviewed by Darin Adler. + + Bug 38604 - workers-gc2 crashing on Qt + + This appears to be due to a couple of issues. + (1) When the atomic string table is deleted it does not clear the 'inTable' bit + on AtomicStrings - it implicitly assumes that all AtomicStrings have already + been deleted at this point (otherwise they will crash in their destructor when + they try to remove themselves from the atomic string table). + (2) We don't fix the ordering in which WTF::WTFThreadData and + WebCore::ThreadGlobalData are destructed. + + We should make sure that ThreadGlobalData is cleaned up before worker threads + terminate and WTF::WTFThreadData is destroyed, and we should clear the inTable + bit of members on atomic string table destruction. + + WTF changes (fix issue 1, above) - ensure inTable property is cleared when the + atomic string table is destroyed (also, rename InTable to IsAtomic, to make it + clear which table we are refering to!) + + * wtf/text/AtomicString.cpp: + (WebCore::AtomicStringTable::destroy): + (WebCore::CStringTranslator::translate): + (WebCore::UCharBufferTranslator::translate): + (WebCore::HashAndCharactersTranslator::translate): + (WebCore::AtomicString::add): + * wtf/text/StringImpl.cpp: + (WebCore::StringImpl::~StringImpl): + * wtf/text/StringImpl.h: + (WebCore::StringImpl::isAtomic): + (WebCore::StringImpl::setIsAtomic): + * wtf/text/StringImplBase.h: + +2010-05-05 Oliver Hunt + + Reviewed by Geoffrey Garen. + + Make Array.join specialised for actual arrays + https://bugs.webkit.org/show_bug.cgi?id=38592 + + Bring Array.join in line with the other array methods by specialising for + this === an array. + + * runtime/ArrayPrototype.cpp: + (JSC::arrayProtoFuncJoin): + +2010-05-04 Yongjun Zhang + + Reviewed by Darin Adler. + + WebKit crashes at DebuggerCallFrame::functionName() if m_callFrame is the top global callframe. + https://bugs.webkit.org/show_bug.cgi?id=38535 + + Don't call asFunction if callee is not a FunctionType to prevent assertion failure + in JSCell::isObject(). + + * debugger/DebuggerCallFrame.cpp: + (JSC::DebuggerCallFrame::functionName): + (JSC::DebuggerCallFrame::calculatedFunctionName): + +2010-05-04 Steve Falkenburg + + Remove redundant exports to fix Windows build warnings. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-05-04 Jedrzej Nowacki + + Reviewed by Holger Freyther. + + Fix a memory leak inside the QScriptValue. + + QSciptValuePrivate::toString should release all temporary variables. + + [Qt] QScriptValue::toString have a memory leak. + https://bugs.webkit.org/show_bug.cgi?id=38112 + + * qt/api/qscriptvalue_p.h: + (QScriptValuePrivate::toString): + +2010-05-04 Gustavo Noronha Silva + + Reviewed by Darin Adler. + + Does not work on SPARC because of alignment issues + https://bugs.webkit.org/show_bug.cgi?id=38455 + + Use AllocAlignmentInteger instead of void* on pageheap_memory to + avoid crashing at runtime in some architectures. Investigated by + Mike Hommey , change suggested by Darin Adler. + + * wtf/FastMalloc.cpp: + +2010-05-04 Adam Barth + + Reviewed by Maciej Stachowiak. + + Add first WTFURL file + https://bugs.webkit.org/show_bug.cgi?id=38470 + + This class represents a component of a URL, such as the scheme or path. + Essentially, the class is an index into a string buffer. + + * wtf/url: Added. + - There was some discussion about where to put the URL library. + There are a number of reasonable options, but putting the library + in the WTF directory seems like a reasonable alternative. This + location will make more sense once WTF is moved out of + JavaScriptCore and into a top-level directory. + * wtf/url/src: Added. + - I've added this extra directory to the usual structure because we + eventually want a "public" folder that defines the public + interface to this library that clients outside of svn.webkit.org + can rely upon, much like the various subfolders of the WebKit + directory often define a public API. + * wtf/url/src/URLComponent.h: Added. + - I've added this somewhat trivial class to get the ball rolling. + (WTF::URLComponent::URLComponent): + (WTF::URLComponent::isValid): + (WTF::URLComponent::isNonempty): + (WTF::URLComponent::reset): + (WTF::URLComponent::operator==): + (WTF::URLComponent::begin): + (WTF::URLComponent::setBegin): + (WTF::URLComponent::length): + (WTF::URLComponent::setLength): + (WTF::URLComponent::end): + * wtf/url/wtfurl.gyp: Added. + - WTFURL will be an independently buildable library, hence the + beginnings of a wtfurl.gyp file. + +2010-05-03 Stephanie Lewis + + Reviewed by Geoff Garen. + + https://bugs.webkit.org/show_bug.cgi?id=38368 + REGRESSSION: 1.5% PLT regression due to 56028 + (return memory quicker). + Instead of returning everything but the smallest spans spread out + the spans kept over several size lists. + + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_PageHeap::scavenge): + +2010-05-03 James Robinson + + Reviewed by Eric Seidel. + + Clean up a few compiler warnings + https://bugs.webkit.org/show_bug.cgi?id=38073 + + * wtf/text/StringImpl.cpp: + (WebCore::StringImpl::ascii): + +2010-05-03 Gavin Barraclough + + Reviewed by NOBODY (reverting previous commit). + + Rolling out r58114 - this introduced memory leaks of + AtomicStrings then workers terminated. + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * jit/ThunkGenerators.cpp: + (JSC::ThunkHelpers::stringImplDataOffset): + * runtime/Identifier.cpp: + (JSC::IdentifierTable::~IdentifierTable): + (JSC::IdentifierTable::add): + (JSC::IdentifierCStringTranslator::hash): + (JSC::IdentifierCStringTranslator::equal): + (JSC::IdentifierCStringTranslator::translate): + (JSC::Identifier::add): + (JSC::IdentifierUCharBufferTranslator::hash): + (JSC::IdentifierUCharBufferTranslator::equal): + (JSC::IdentifierUCharBufferTranslator::translate): + (JSC::Identifier::addSlowCase): + * runtime/Identifier.h: + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + (JSC::JSGlobalData::~JSGlobalData): + * runtime/JSGlobalData.h: + * wtf/WTFThreadData.cpp: + (WTF::WTFThreadData::WTFThreadData): + (WTF::WTFThreadData::~WTFThreadData): + * wtf/WTFThreadData.h: + (JSC::IdentifierTable::remove): + (JSC::IdentifierTable::literalTable): + (WTF::WTFThreadData::atomicStringTable): + * wtf/text/AtomicString.cpp: + (WebCore::AtomicStringTable::create): + (WebCore::AtomicStringTable::table): + (WebCore::AtomicStringTable::destroy): + (WebCore::stringTable): + (WebCore::CStringTranslator::hash): + (WebCore::CStringTranslator::equal): + (WebCore::CStringTranslator::translate): + (WebCore::operator==): + (WebCore::AtomicString::add): + (WebCore::equal): + (WebCore::UCharBufferTranslator::hash): + (WebCore::UCharBufferTranslator::equal): + (WebCore::UCharBufferTranslator::translate): + (WebCore::HashAndCharactersTranslator::hash): + (WebCore::HashAndCharactersTranslator::equal): + (WebCore::HashAndCharactersTranslator::translate): + (WebCore::AtomicString::find): + (WebCore::AtomicString::remove): + * wtf/text/AtomicStringTable.h: Removed. + * wtf/text/StringImpl.cpp: + (WebCore::StringImpl::~StringImpl): + * wtf/text/StringImpl.h: + (WebCore::StringImpl::inTable): + (WebCore::StringImpl::setInTable): + (WebCore::equal): + * wtf/text/StringImplBase.h: + (WTF::StringImplBase::StringImplBase): + +2010-05-03 Kevin Watters + + Reviewed by Kevin Ollivier. + + [wx] Implement scheduleDispatchFunctionsOnMainThread for wx port. + https://bugs.webkit.org/show_bug.cgi?id=38480 + + * wtf/wx/MainThreadWx.cpp: + (wxCallAfter::wxCallAfter): + (wxCallAfter::OnCallback): + (WTF::scheduleDispatchFunctionsOnMainThread): + +2010-05-03 Kevin Watters + + Reviewed by Kevin Ollivier. + + [wx] Build and use Mac's ComplexTextController to support complex text in wx. + https://bugs.webkit.org/show_bug.cgi?id=38482 + + * wtf/Platform.h: + +2010-05-03 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + Interpreter crashes due to incorrect refcounting of cached structures. + https://bugs.webkit.org/show_bug.cgi?id=38491 + rdar://problem/7926160 + + Make sure we ref/deref structures used for cached custom property getters + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::derefStructures): + (JSC::CodeBlock::refStructures): + +2010-05-02 Laszlo Gombos + + Reviewed by Eric Seidel. + + [Qt] Enable JIT for QtWebKit on Symbian + https://bugs.webkit.org/show_bug.cgi?id=38339 + + JIT on Symbian has been stable for quite some time, it + is time to turn it on by default. + + * wtf/Platform.h: + +2010-04-29 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Add codegen support for unsigned right shift + https://bugs.webkit.org/show_bug.cgi?id=38375 + + Expose unsigned right shift in the macro assembler, and make use of it + from the jit. Currently if the result is outside the range 0..2^31-1 + we simply fall back to the slow case, even in JSVALUE64 and JSVALUE32_64 + where technically we could still return an immediate value. + + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::urshift32): + * assembler/MacroAssemblerARMv7.h: + (JSC::MacroAssemblerARMv7::urshift32): + * assembler/MacroAssemblerX86Common.h: + (JSC::MacroAssemblerX86Common::urshift32): + * assembler/X86Assembler.h: + (JSC::X86Assembler::): + (JSC::X86Assembler::shrl_i8r): + (JSC::X86Assembler::shrl_CLr): + Add unsigned right shift to the x86 assembler + * jit/JIT.cpp: + (JSC::JIT::privateCompileMainPass): + (JSC::JIT::privateCompileSlowCases): + op_rshift no longer simply get thrown to a stub function + * jit/JIT.h: + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_urshift): + (JSC::JIT::emitSlow_op_urshift): + JSVALUE32 and JSVALUE64 implementation. Only supports + double lhs in JSVALUE64. + * jit/JITArithmetic32_64.cpp: + (JSC::JIT::emit_op_rshift): + (JSC::JIT::emitSlow_op_rshift): + (JSC::JIT::emit_op_urshift): + (JSC::JIT::emitSlow_op_urshift): + Refactor right shift code to have shared implementation between signed + and unsigned versions. + +2010-04-29 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Handle double on righthand side of a right shift + https://bugs.webkit.org/show_bug.cgi?id=38363 + + In 64-bit we support right shift of a double, and there's no + reason not to in 32-bit either. This is a 1.1% sunspider + improvement in 32bit. + + Given high performance javascript code frequently makes + use of bit operators to perform double->int conversion i'll + follow this patch up with similar patches for bitwise 'and' + and 'or'. + + * jit/JITArithmetic32_64.cpp: + (JSC::JIT::emit_op_rshift): + (JSC::JIT::emitSlow_op_rshift): + +2010-04-29 Oliver Hunt + + Reviewed by Geoff Garen. + + Hoist JSVALUE32_64 arithmetic implementations into a separate file. + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.pro: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * jit/JITArithmetic.cpp: + (JSC::JIT::emitSlow_op_jnless): + (JSC::JIT::emitSlow_op_jless): + (JSC::JIT::emitSlow_op_jnlesseq): + (JSC::JIT::emit_op_mod): + (JSC::JIT::compileBinaryArithOpSlowCase): + (JSC::JIT::emit_op_div): + (JSC::JIT::compileBinaryArithOp): + * jit/JITArithmetic32_64.cpp: Added. + (JSC::JIT::emit_op_negate): + (JSC::JIT::emitSlow_op_negate): + (JSC::JIT::emit_op_jnless): + (JSC::JIT::emitSlow_op_jnless): + (JSC::JIT::emit_op_jless): + (JSC::JIT::emitSlow_op_jless): + (JSC::JIT::emit_op_jnlesseq): + (JSC::JIT::emitSlow_op_jnlesseq): + (JSC::JIT::emit_op_lshift): + (JSC::JIT::emitSlow_op_lshift): + (JSC::JIT::emit_op_rshift): + (JSC::JIT::emitSlow_op_rshift): + (JSC::JIT::emit_op_bitand): + (JSC::JIT::emitSlow_op_bitand): + (JSC::JIT::emit_op_bitor): + (JSC::JIT::emitSlow_op_bitor): + (JSC::JIT::emit_op_bitxor): + (JSC::JIT::emitSlow_op_bitxor): + (JSC::JIT::emit_op_bitnot): + (JSC::JIT::emitSlow_op_bitnot): + (JSC::JIT::emit_op_post_inc): + (JSC::JIT::emitSlow_op_post_inc): + (JSC::JIT::emit_op_post_dec): + (JSC::JIT::emitSlow_op_post_dec): + (JSC::JIT::emit_op_pre_inc): + (JSC::JIT::emitSlow_op_pre_inc): + (JSC::JIT::emit_op_pre_dec): + (JSC::JIT::emitSlow_op_pre_dec): + (JSC::JIT::emit_op_add): + (JSC::JIT::emitAdd32Constant): + (JSC::JIT::emitSlow_op_add): + (JSC::JIT::emit_op_sub): + (JSC::JIT::emitSub32Constant): + (JSC::JIT::emitSlow_op_sub): + (JSC::JIT::emitBinaryDoubleOp): + (JSC::JIT::emit_op_mul): + (JSC::JIT::emitSlow_op_mul): + (JSC::JIT::emit_op_div): + (JSC::JIT::emitSlow_op_div): + (JSC::JIT::emit_op_mod): + (JSC::JIT::emitSlow_op_mod): + +2010-04-29 Zoltan Herczeg + + Reviewed by Oliver Hunt + + Add sqrt() instruction support for ARM assembler (using VFP) + https://bugs.webkit.org/show_bug.cgi?id=38312 + + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::): + (JSC::ARMAssembler::fsqrtd_r): + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::supportsFloatingPointSqrt): + (JSC::MacroAssemblerARM::sqrtDouble): + +2010-04-29 Laszlo Gombos + + Reviewed by Simon Hausmann. + + [Qt] Refactor qtscriptglobal.h + https://bugs.webkit.org/show_bug.cgi?id=37953 + + Use the same pattern in qtscriptglobal.h as in + qwebkitglobal.h without checking for specific OSs. + + * qt/api/qtscriptglobal.h: + +2010-04-29 Jedrzej Nowacki + + Reviewed by Simon Hausmann. + + Small cleanup. + + QScriptValuePrivate constructor shouldn't take QScriptEngine pointer + as a parameter, because it breaks a private / public separation rule. + QScriptEnginePrivate::get(QScriptEngine*) should return + a QScriptEnginePrivate pointer instead of a QScriptEnginePtr, it simplifies + implementation. + + [Qt] QScriptValuePrivate class needs some cleanup. + https://bugs.webkit.org/show_bug.cgi?id=37729 + + * qt/api/qscriptengine_p.h: + (QScriptEnginePrivate::get): + * qt/api/qscriptvalue.cpp: + (QScriptValue::QScriptValue): + * qt/api/qscriptvalue_p.h: + (QScriptValuePrivate::QScriptValuePrivate): + +2010-04-29 Kwang Yul Seo + + Reviewed by Simon Hausmann. + + [WINCE] Export g_stackBase with JS_EXPORTDATA + https://bugs.webkit.org/show_bug.cgi?id=37437 + + Export g_stackBase with JS_EXPORTDATA as it is used by SharedTimerWince.cpp. + + * runtime/Collector.cpp: + +2010-04-28 Oliver Hunt + + Do an unordered compare so that we don't treat NaN incorrectly. + + RS=Gavin Barraclough + + * jit/ThunkGenerators.cpp: + (JSC::powThunkGenerator): + +2010-04-28 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Add fast paths for Math.pow and Math.sqrt + https://bugs.webkit.org/show_bug.cgi?id=38294 + + Add specialized thunks for Math.pow and Math.sqrt. + This requires adding a sqrtDouble function to the MacroAssembler + and sqrtsd to the x86 assembler. + + Math.pow is slightly more complicated, in that we have + to implement exponentiation ourselves rather than relying + on hardware support. The inline exponentiation is restricted + to positive integer exponents on a numeric base. Exponentiation + is finally performed through the "Exponentiation by Squaring" + algorithm. + + * assembler/AbstractMacroAssembler.h: + (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr): + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::supportsFloatingPointSqrt): + (JSC::MacroAssemblerARM::loadDouble): + (JSC::MacroAssemblerARM::sqrtDouble): + * assembler/MacroAssemblerARMv7.h: + (JSC::MacroAssemblerARMv7::supportsFloatingPointSqrt): + (JSC::MacroAssemblerARMv7::sqrtDouble): + * assembler/MacroAssemblerX86.h: + (JSC::MacroAssemblerX86::loadDouble): + (JSC::MacroAssemblerX86::supportsFloatingPointSqrt): + * assembler/MacroAssemblerX86Common.h: + (JSC::MacroAssemblerX86Common::sqrtDouble): + * assembler/MacroAssemblerX86_64.h: + (JSC::MacroAssemblerX86_64::loadDouble): + (JSC::MacroAssemblerX86_64::supportsFloatingPointSqrt): + * assembler/X86Assembler.h: + (JSC::X86Assembler::): + (JSC::X86Assembler::movsd_mr): + (JSC::X86Assembler::sqrtsd_rr): + (JSC::X86Assembler::X86InstructionFormatter::twoByteOp): + (JSC::X86Assembler::X86InstructionFormatter::memoryModRM): + * create_hash_table: + * jit/JIT.h: + * jit/JITInlineMethods.h: + * jit/JITOpcodes.cpp: + * jit/JITStubs.h: + (JSC::JITThunks::ctiNativeCallThunk): + * jit/JSInterfaceJIT.h: + (JSC::JSInterfaceJIT::emitLoadDouble): + (JSC::JSInterfaceJIT::emitJumpIfImmediateNumber): + (JSC::JSInterfaceJIT::emitJumpIfNotImmediateNumber): + (JSC::JSInterfaceJIT::emitLoadInt32): + * jit/SpecializedThunkJIT.h: + (JSC::SpecializedThunkJIT::loadDoubleArgument): + (JSC::SpecializedThunkJIT::loadInt32Argument): + (JSC::SpecializedThunkJIT::returnJSValue): + (JSC::SpecializedThunkJIT::returnDouble): + (JSC::SpecializedThunkJIT::finalize): + * jit/ThunkGenerators.cpp: + (JSC::sqrtThunkGenerator): + (JSC::powThunkGenerator): + * jit/ThunkGenerators.h: + * runtime/Executable.h: + (JSC::NativeExecutable::NativeExecutable): + * runtime/JSFunction.cpp: + (JSC::JSFunction::JSFunction): + +2010-04-28 Mike Thole + + Reviewed by Mark Rowe. + + Reenable WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK now that an + exports file for it has been added. + + * wtf/Platform.h: + +2010-04-28 Mike Thole + + Build fix, not reviewed. + + * wtf/Platform.h: + Disable WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK until an exports file is created. + +2010-04-28 Mike Thole + + Reviewed by David Kilzer. + + Add canAuthenticateAgainstProtectionSpace() to frame loader so that a protection space + can be inspected before attempting to authenticate against it + https://bugs.webkit.org/show_bug.cgi?id=38271 + + * wtf/Platform.h: Add WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK define. + +2010-04-28 Darin Adler + + Reviewed by Sam Weinig. + + Don't use CFAbsoluteTimeGetCurrent on Mac OS X, since it's just a cover + for gettimeofday anyway. + + * wtf/CurrentTime.cpp: + (WTF::currentTime): Remove the CF version of this. Change the "other POSIX" + version to pass 0 for the time zone instead of ignoring a return value. + Also get rid of unneeded type casts, since operations involving both + integers and doubles are always evaluated as doubles in C without explicit + type casting. + +2010-04-28 Darin Fisher + + Reviewed by David Levin. + + [Chromium] callOnMainThread should equate to MessageLoop::PostTask + https://bugs.webkit.org/show_bug.cgi?id=38276 + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + * wtf/MainThread.cpp: + * wtf/chromium/ChromiumThreading.h: + * wtf/chromium/MainThreadChromium.cpp: + (WTF::initializeMainThread): + (WTF::callOnMainThread): + (WTF::callOnMainThreadAndWait): + (WTF::setMainThreadCallbacksPaused): + (WTF::isMainThread): + +2010-04-28 Simon Hausmann , Kent Hansen + + Reviewed by Darin Adler. + + JSC's currentThreadStackBase is not reentrant on some platforms + https://bugs.webkit.org/show_bug.cgi?id=37195 + + This function needs to be reentrant to avoid memory corruption on platforms where + the implementation uses global variables. + + This patch adds a mutex lock where necessary and makes the Symbian implementation + reentrant. + + * runtime/Collector.cpp: + (JSC::currentThreadStackBaseMutex): + (JSC::currentThreadStackBase): + +2010-04-28 Thiago Macieira + + Reviewed by Simon Hausmann. + + Fix compilation with gcc 3.4. + + AtomicStringImpl.h:29: error: base `WebCore::StringImpl' with only + non-default constructor in class without a constructor + + * wtf/text/AtomicStringImpl.h: + (WebCore::AtomicStringImpl::AtomicStringImpl): Provide a default constructor. + * wtf/text/StringImpl.h: Allow AtomicStringImpl to call a StringImpl constructor through a friend declaration. + +2010-04-27 Stephanie Lewis + + Fix Tiger build. + + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_PageHeap::Carve): + +2010-04-26 Stephanie Lewis + + Reviewed by Geoff Garen. + + https://bugs.webkit.org/show_bug.cgi?id=38154 FastMalloc calls madvise too often. + REGRESSSION: 1.5% PLT regression due to 56028 (return memory quicker). + To save on madvise calls when recommitting memory recommit the entire span and then carve it + instead of carving the span up and only committing the part that will be used immediately. + + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_PageHeap::New): + (WTF::TCMalloc_PageHeap::AllocLarge): + (WTF::TCMalloc_PageHeap::Carve): + +2010-04-26 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + Add specialized thunks for a char code related string functions + https://bugs.webkit.org/show_bug.cgi?id=38177 + + This is a simple extension to my prior patch. Basically hoist the + existing character loading logic from the charCodeAt thunk and into + a helper function, then add a helper to load strings from the small + string cache. This allows trivial implementations of fromCharCode + and charAt. + + * create_hash_table: + * jit/SpecializedThunkJIT.h: + (JSC::SpecializedThunkJIT::returnJSCell): + (JSC::SpecializedThunkJIT::tagReturnAsJSCell): + * jit/ThunkGenerators.cpp: + (JSC::stringCharLoad): + (JSC::charToString): + (JSC::charCodeAtThunkGenerator): + (JSC::charAtThunkGenerator): + (JSC::fromCharCodeThunkGenerator): + * jit/ThunkGenerators.h: + * runtime/SmallStrings.h: + (JSC::SmallStrings::singleCharacterStrings): + * runtime/StringConstructor.cpp: + (JSC::StringConstructor::StringConstructor): + +2010-04-27 Thomas Zander + + Reviewed by Simon Hausmann. + + [Qt] Fix the build on Symbian on Linux using the Makefile based mkspec + + * JavaScriptCore.pri: It is necessary to specify the library search path + when linking against JavaScriptCore. + +2010-04-21 Jocelyn Turcotte + + Reviewed by Simon Hausmann. + + Compile fix for Visual Studio 2010 + https://bugs.webkit.org/show_bug.cgi?id=37867 + + Patch by Prasanth Ullattil + + * runtime/Structure.cpp: + (JSC::Structure::transitionTableAdd): + * wtf/MathExtras.h: + * wtf/Platform.h: + +2010-04-27 Jocelyn Turcotte + + Reviewed by Simon Hausmann. + + Rename COMPILER(MSVC7) to COMPILER(MSVC7_OR_LOWER) + + * config.h: + (JSC::Structure::transitionTableAdd): + * wtf/Assertions.h: + * wtf/Atomics.h: + * wtf/CurrentTime.h: + (WTF::getLocalTime): + * wtf/Platform.h: + * wtf/StaticConstructors.h: + * wtf/StringExtras.h: + * wtf/Vector.h: + (WTF::::append): + +2010-04-15 Jocelyn Turcotte + + Reviewed by Tor Arne Vestbø. + + [Qt] Fix Mac build break. + + https://bugs.webkit.org/show_bug.cgi?id=37867 + - Make sure JavaScriptCore's debug_and_release config follows that + of WebCore. + - Use different name for JavaScriptCore target in debug and release + since they might be written in the same path at the same time on + parallel builds + - Consolidate the DESTDIR determination logic in JavaScriptCore.pri + + * JavaScriptCore.pri: + * JavaScriptCore.pro: + +2010-04-21 Jocelyn Turcotte + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Make sure WebKit is not compiled using C++0x. + https://bugs.webkit.org/show_bug.cgi?id=37867 + + As the rest of Qt compiles in the C++0x mode, people might start + compiling it in this mode. WebKit don't support this yet. + + Patch by Thiago Macieira + + * JavaScriptCore.pro: + +2010-04-26 Oliver Hunt + + Fix windows + + * jit/SpecializedThunkJIT.h: + (JSC::SpecializedThunkJIT::argumentToVirtualRegister): + +2010-04-26 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Need to support more efficient dispatch of lightweight builtins + https://bugs.webkit.org/show_bug.cgi?id=38155 + + The problem with calling lightweight builtins is that marshalling + the call from the nitro calling convention to the system calling + convention is very expensive relative to the cost of the actually + evaluating the function. To work around this problem this patch + adds the ability to define a custom thunk for a builtin. + + This allows us to use high performance custom implementations of + the common and sensible versions of simple builtins. This patch + includes a simple (use of which is currently hardcoded) thunk for + charCodeAt. + + This adds a JSInterfaceJIT subclass called SpecializedThunkJIT + that has helper functions to remove (or at least reduce) the need + to have separate thunk implementations for each JSValue encoding. + + * GNUmakefile.am: + * JavaScriptCore.pro: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + Many project file updates + + * create_hash_table: + Add thunk generation callbacks to the hash tables, currently + we hardcode the script to only support charCodeAt + + * jit/JITStubCall.h: + * jit/JITStubs.cpp: + (JSC::JITThunks::~JITThunks): + (JSC::JITThunks::specializedThunk): + * jit/JITStubs.h: + * jit/SpecializedThunkJIT.h: Added. + (JSC::SpecializedThunkJIT::SpecializedThunkJIT): + (JSC::SpecializedThunkJIT::loadCellArgument): + (JSC::SpecializedThunkJIT::loadJSStringArgument): + (JSC::SpecializedThunkJIT::loadInt32Argument): + (JSC::SpecializedThunkJIT::appendFailure): + (JSC::SpecializedThunkJIT::returnInt32): + (JSC::SpecializedThunkJIT::finalize): + (JSC::SpecializedThunkJIT::argumentToVirtualRegister): + (JSC::SpecializedThunkJIT::tagReturnAsInt32): + * jit/ThunkGenerators.cpp: Added. + (JSC::ThunkHelpers::stringImplDataOffset): + (JSC::ThunkHelpers::jsStringLengthOffset): + (JSC::ThunkHelpers::jsStringValueOffset): + (JSC::charCodeAtThunkGenerator): + * jit/ThunkGenerators.h: Added. + * runtime/Executable.h: + (JSC::NativeExecutable::NativeExecutable): + * runtime/JSFunction.cpp: + (JSC::JSFunction::JSFunction): + * runtime/JSFunction.h: + * runtime/JSGlobalData.h: + (JSC::JSGlobalData::getThunk): + * runtime/JSString.h: + (JSC::): + * runtime/JSValue.h: + Protect some of the JSVALUE32 and JSVALUE32_64 only constants + and function behind appropriate USE() guards to make it harder + to use the wrong flags for the target build. + * runtime/Lookup.cpp: + (JSC::HashTable::createTable): + (JSC::setUpStaticFunctionSlot): + * runtime/Lookup.h: + (JSC::HashEntry::initialize): + (JSC::HashEntry::generator): + (JSC::HashEntry::): + Make the lookup tables use a specialized thunkGenerator + if present + * wtf/text/StringImpl.h: + +2010-04-26 Oliver Hunt + + Build fix + + * runtime/JSImmediate.h: + * runtime/JSValue.h: + +2010-04-26 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Factor some basic JS interface logic out of JIT and into a superclass + https://bugs.webkit.org/show_bug.cgi?id=38163 + + Create JSInterfaceJIT to hold some common low level functions for + interacting with the JS RegisterFile. Doing this separately from + https://bugs.webkit.org/show_bug.cgi?id=38155 to ease reviewing. + + * JavaScriptCore.xcodeproj/project.pbxproj: + * jit/JIT.h: + * jit/JITInlineMethods.h: + (JSC::JIT::emitJumpSlowCaseIfNotJSCell): + * jit/JSInterfaceJIT.h: Added. + (JSC::JSInterfaceJIT::emitLoadJSCell): + (JSC::JSInterfaceJIT::emitJumpIfNotJSCell): + (JSC::JSInterfaceJIT::emitLoadInt32): + (JSC::JSInterfaceJIT::tagFor): + (JSC::JSInterfaceJIT::payloadFor): + (JSC::JSInterfaceJIT::addressFor): + +2010-04-26 Sam Weinig + + Fix Tiger build. + + * wtf/mac/MainThreadMac.mm: + (WTF::isMainThread): + +2010-04-26 Geoffrey Garen + + Reviewed by Sam Weinig. + + + + Fixed a crash seen when using the JavaScriptCore API with WebKit. + + No layout test because DumpRenderTree doesn't use the JavaScriptCore API + in this way. + + * interpreter/RegisterFile.cpp: + (JSC::RegisterFile::setGlobalObject): + (JSC::RegisterFile::clearGlobalObject): + (JSC::RegisterFile::globalObject): + * interpreter/RegisterFile.h: + (JSC::RegisterFile::RegisterFile): Use WeakGCPtr for managing m_globalObject, + since it's a weak pointer. (We never noticed this error before because, + in WebKit, global objects always have a self-reference in a global variable, + so marking the register file's global variables would keep m_globalObject + alive. In the JavaScriptCore API, you can allocate a global object with + no self-reference.) + + * runtime/JSActivation.h: Removed unneeded #include. + + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::~JSGlobalObject): Don't use ==, since a weak + pointer is 0 when the object it points to runs its destructor. + + * runtime/WeakGCPtr.h: + (JSC::WeakGCPtr::clear): Changed to return a bool indicating whether the + clear actually happened. + (JSC::WeakGCPtr::assign): Changed to forbid assignment of 0 as a shorthand + for calling clear(). A client should never clear by assigning 0, since + clear() should be conditional on whether the object doing the clearing + is still pointed to by the weak pointer. (Otherwise, a zombie object might + clear a pointer to a new, valid object.) + +2010-04-25 Sam Weinig + + Reviewed by Maciej Stachowiak. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=38097 + Disentangle initializing the main thread from initializing threading + + This is the first step in getting rid of the WEB_THREAD #define and + paving the way to allowing mac both WebKit and WebKit2 to use the same + WebCore. + + * JavaScriptCore.exp: Export initializeMainThread and initializeMainThreadToProcessMainThread. + * JavaScriptCore.xcodeproj/project.pbxproj: Sort files. + + * wtf/MainThread.cpp: + (WTF::mainThreadInitializationMutex): + (WTF::mainThreadFunctionQueueMutex): + (WTF::initializeMainThread): + (WTF::deprecatedInitializeMainThread): + * wtf/MainThread.h: + Added Mac only initializeMainThreadToProcessMainThread which sets up callOnMainThread + and isMainThead calls to assume that WebCore's main thread is also the + process's main thread. Since it is possible that both initializeMainThread + and initializeMainThreadToProcessMainThread could be called, the first one called + wins (either will work). + + * wtf/Threading.h: Moved to top of file. + + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): Remove call to initializeMainThread. + * wtf/ThreadingWin.cpp: + (WTF::initializeThreading): Ditto. + * wtf/gtk/ThreadingGtk.cpp: + (WTF::initializeThreading): Ditto. + + * wtf/mac/MainThreadMac.mm: + (WTF::initializeMainThreadPlatform): + (WTF::initializeMainThreadToProcessMainThread): + (WTF::scheduleDispatchFunctionsOnMainThread): + (WTF::isMainThread): + Add runtime switch between the old behavior of using the system's main + thread and a stored pointer to the main thread. Tiger always uses the + system's main thread. + + * wtf/qt/ThreadingQt.cpp: + (WTF::initializeThreading): Remove call to initializeMainThread. + * wtf/win/MainThreadWin.cpp: + (WTF::initializeMainThreadPlatform): Add call to initializeCurrentThreadInternal + removed from initializeThreading. + +2010-04-26 Jedrzej Nowacki + + Reviewed by Kenneth Rohde Christiansen. + + Fix a memory leak in the QScriptString. + + QScriptStringPrivate's constructor shouldn't call JSStringRetain as + QScriptConverter implicitly pass a JSStringRef ownership. + + [Qt] QScriptStringPrivate c'tor problem + https://bugs.webkit.org/show_bug.cgi?id=38110 + + * qt/api/qscriptstring_p.h: + (QScriptStringPrivate::QScriptStringPrivate): + +2010-04-24 Darin Adler + + Reviewed by Dan Bernstein. + + REGRESSION (r56560): Crash in parseFloat if passed invalid UTF-16 data + https://bugs.webkit.org/show_bug.cgi?id=38083 + rdar://problem/7901044 + + Tests: fast/js/ToNumber.html + fast/js/parseFloat.html + + * runtime/JSGlobalObjectFunctions.cpp: + (JSC::parseInt): Added a FIXME comment about a problem I noticed. + (JSC::parseFloat): Added a FIXME comment about a problem I noticed; + covered by test cases in the test I added. + * runtime/UString.cpp: + (JSC::UString::toDouble): Added FIXME comments about two problems I + noticed; covered by test cases in the tests I added. Added a return + statement so we don't crash when illegal UTF-16 sequences are present. + +2010-04-24 Anton Muhin + + Reviewed by Darin Adler. + + Allow to construct HashTraits::constructDeletedValue + + Former implementation attempted to use AtomicString(HashTableDeletedValue) + however those values cannot be used that way: one cannot construct + QualifiedNameImpl out of such AtomicString as we'll try to lookup this string + in the table, for example. + https://bugs.webkit.org/show_bug.cgi?id=37722 + + * wtf/RefPtr.h: expose hash table deleted value + +2010-04-23 Sam Weinig + + Reviewed by David Levin. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=38060 + Split up Threading.h + + Move bits for of Threading.h into 3 new files. + - Atomics.h for atomic operations. + - ThreadSafeShared.h for the ThreadSafeShared class. + - ThreadingPrimitives.h for the primitives and platform types. + + Basic threading operations (creation, etc.) remain in Threading.h. + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * wtf/Atomics.h: Copied from wtf/Threading.h. + * wtf/ThreadSafeShared.h: Copied from wtf/Threading.h. + * wtf/Threading.h: + * wtf/ThreadingPrimitives.h: Copied from wtf/Threading.h. + +2010-04-23 Sam Weinig + + Fix Qt build. + + * wtf/qt/MainThreadQt.cpp: #include + +2010-04-22 Sam Weinig + + Reviewed by Anders Carlsson. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=38022 + Move isMainThread predicate function to MainThread.h + + * wtf/MainThread.cpp: + (WTF::initializeMainThread): + (WTF::isMainThread): + * wtf/MainThread.h: + * wtf/Threading.h: + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + * wtf/ThreadingWin.cpp: + (WTF::initializeThreading): + * wtf/gtk/ThreadingGtk.cpp: + (WTF::initializeThreading): + * wtf/mac/MainThreadMac.mm: + (WTF::initializeMainThreadPlatform): + (WTF::isMainThread): + * wtf/qt/MainThreadQt.cpp: + (WTF::isMainThread): + * wtf/qt/ThreadingQt.cpp: + (WTF::initializeThreading): + * wtf/text/AtomicString.cpp: + +2010-04-23 Gabor Rapcsanyi + + Reviewed by Laszlo Gombos. + + Add RVCT support for Linux + + Developed in cooperation with Gabor Loki. + + * API/JSStringRef.h: + * jit/ExecutableAllocator.h: + * jit/ExecutableAllocatorPosix.cpp: + (JSC::ExecutableAllocator::cacheFlush): + * jit/JITStubs.cpp: + * wtf/MathExtras.h: + * wtf/unicode/qt4/UnicodeQt4.h: + +2010-04-23 Patrick Gansterer + + Reviewed by Laszlo Gombos. + + [WIN] Move OwnPtrWin.cpp into platform specific folder. + https://bugs.webkit.org/show_bug.cgi?id=38042 + + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * wtf/OwnPtrWin.cpp: Removed. + * wtf/win/OwnPtrWin.cpp: Copied from JavaScriptCore/wtf/OwnPtrWin.cpp. + +2010-04-23 Patrick Gansterer + + Reviewed by Laszlo Gombos. + + [BREWMP] Move OwnPtrBrew.cpp into platform specific folder. + https://bugs.webkit.org/show_bug.cgi?id=38042 + + * wtf/OwnPtrBrew.cpp: Removed. + * wtf/brew/OwnPtrBrew.cpp: Copied from JavaScriptCore/wtf/OwnPtrBrew.cpp. + +2010-04-22 Steve Block + + Reviewed by Adam Barth. + + Update Android to use isfinite, isinf, isnan and signbit from namespace std. + https://bugs.webkit.org/show_bug.cgi?id=37948 + + * wtf/MathExtras.h: + +2010-04-22 Fumitoshi Ukai + + Unreviewed build fix. + + * wtf/MD5.cpp: fix include path of CString.h + +2010-04-22 Fumitoshi Ukai + + Reviewed by Adam Barth. + + MD5 is required for WebSocket new protocol implementation + https://bugs.webkit.org/show_bug.cgi?id=37913 + + * GNUmakefile.am: + * JavaScriptCore.exp: + * JavaScriptCore.gypi: + * JavaScriptCore.pro: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * wtf/MD5.cpp: Added. + * wtf/MD5.h: Added. + +2010-04-22 Gavin Barraclough + + Reviewed by NOBODY (build fix). + Errk, accidentally committed commenting out two ASSERTs! reverting. + + * runtime/Collector.cpp: + (JSC::Heap::protect): + (JSC::Heap::unprotect): + +2010-04-22 Gavin Barraclough + + Reviewed by Geoff Garen. + + https://bugs.webkit.org/show_bug.cgi?id=38006 + Change lifetime of JSC::IdentifierTables used by WebCores to match AtomicStringTable + + Presently JSC's IdentifierTables are owned by the JSGlobalData. For + JSGlobalData objects created via the API this should continue to be the case, + but for the JSGlobalData objects used by WebCore (the main thread's common + global data, and those for workers) use a IdentifierTable provided (and owned) + by wtfThreadData. This allow the lifetime of these IdentifierTable to match + those of the corresponding AtomicStringTables. + + * API/APIShims.h: + (JSC::APIEntryShim::APIEntryShim): + * API/JSContextRef.cpp: + (JSContextGroupCreate): + * runtime/Collector.cpp: + (JSC::Heap::protect): + (JSC::Heap::unprotect): + (JSC::Heap::markRoots): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + (JSC::JSGlobalData::~JSGlobalData): + (JSC::JSGlobalData::createContextGroup): + (JSC::JSGlobalData::create): + (JSC::JSGlobalData::sharedInstance): + * runtime/JSGlobalData.h: + (JSC::JSGlobalData::): + (JSC::JSGlobalData::isSharedInstance): + * runtime/JSLock.cpp: + (JSC::JSLock::JSLock): + (JSC::JSLock::lock): + (JSC::JSLock::unlock): + (JSC::JSLock::DropAllLocks::DropAllLocks): + * wtf/WTFThreadData.cpp: + (WTF::WTFThreadData::WTFThreadData): + (WTF::WTFThreadData::~WTFThreadData): + +2010-04-22 Sheriff Bot + + Unreviewed, rolling out r58110. + http://trac.webkit.org/changeset/58110 + https://bugs.webkit.org/show_bug.cgi?id=38007 + + Caused an internal compiler error on Qt (Requested by abarth + on #webkit). + + * wtf/MathExtras.h: + +2010-04-22 Gavin Barraclough + + Reviewed by NOBODY (windows build fix). + + * API/JSWeakObjectMapRefPrivate.cpp: + +2010-04-22 Gavin Barraclough + + Reviewed by NOBODY (windows build fix). + + * API/JSBase.cpp: + * API/JSCallbackObject.cpp: + +2010-04-22 Gavin Barraclough + + Reviewed by Geoff Garen. + + https://bugs.webkit.org/show_bug.cgi?id=37978 + Unify JSC::IdentifierTable and WebCore::AtomicStringTable implementations. + + These two classes both implement a HashSet of uniqued StringImpls, with + translator classes to avoid unnecessary object creation. The only difference + between the classes is which flag (isIdentifier or inTable) is set. + Combine the two classes using a template predicated on which flag to use. + + New class AtomicStringTable created, containing all the goodness from + IdentifierTable & AtomicStringTable, expect for Identifier's literalTable, + which has been moved onto JSGlobalData. Removed duplicate string translator + classes. Renamed StringImpl's inTable flag to more explicit 'isAtomic', + and set this on the empty string (which matches Identifier behaviour, and + removes a redundant check for zero-length). + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/Identifier.cpp: + (JSC::createLiteralTable): + (JSC::deleteLiteralTable): + (JSC::Identifier::add): + (JSC::Identifier::addSlowCase): + * runtime/Identifier.h: + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + (JSC::JSGlobalData::~JSGlobalData): + * runtime/JSGlobalData.h: + * wtf/WTFThreadData.cpp: + (WTF::WTFThreadData::WTFThreadData): + (WTF::WTFThreadData::~WTFThreadData): + * wtf/WTFThreadData.h: + (WTF::WTFThreadData::atomicStringTable): + * wtf/text/AtomicString.cpp: + (WebCore::table): + (WebCore::operator==): + (WebCore::AtomicString::add): + (WebCore::AtomicString::find): + (WebCore::AtomicString::remove): + * wtf/text/AtomicStringTable.h: Added. + (WTF::CStringTranslator::hash): + (WTF::CStringTranslator::equal): + (WTF::CStringTranslator::translate): + (WTF::UCharBufferTranslator::hash): + (WTF::UCharBufferTranslator::equal): + (WTF::UCharBufferTranslator::translate): + (WTF::HashAndCharactersTranslator::hash): + (WTF::HashAndCharactersTranslator::equal): + (WTF::HashAndCharactersTranslator::translate): + (WTF::IdentifierOrAtomicStringTable::remove): + (WTF::::~IdentifierOrAtomicStringTable): + (WTF::::add): + (WTF::::find): + * wtf/text/StringImpl.cpp: + (WebCore::StringImpl::~StringImpl): + * wtf/text/StringImpl.h: + (WebCore::StringImpl::isAtomic): + (WebCore::StringImpl::setIsAtomic): + (WebCore::equal): + * wtf/text/StringImplBase.h: + (WTF::StringImplBase::StringImplBase): + +2010-04-22 Steve Block + + Reviewed by Adam Barth. + + Update Android to use isfinite, isinf, isnan and signbit from namespace std. + https://bugs.webkit.org/show_bug.cgi?id=37948 + + * wtf/MathExtras.h: + +2010-04-22 Jocelyn Turcotte + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove dependency of JSC to QtGui + https://bugs.webkit.org/show_bug.cgi?id=37867 + + The patch also make sure that hal.h is in the include path on Symbian. + The dependency to QtGui took care of that before. + + Patch by Thiago Macieira + and Rohan McGovern + + * JavaScriptCore.pri: + * JavaScriptCore.pro: + +2010-04-22 Jocelyn Turcotte + + Reviewed by Tor Arne Vestbø. + + [Qt] Corrects symbols visibility for JavaScriptCore. + + https://bugs.webkit.org/show_bug.cgi?id=37867 + + * JavaScriptCore.pro: + +2010-04-22 Gabor Loki + + Reviewed by Gavin Barraclough. + + Use BLX and BX to keep happy the return stack predictor above ARMv4 + https://bugs.webkit.org/show_bug.cgi?id=37862 + + Inspired by Jacob Bramley's patch from JaegerMonkey + + * assembler/ARMAssembler.cpp: + (JSC::ARMAssembler::executableCopy): + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::): + (JSC::ARMAssembler::bx): + (JSC::ARMAssembler::blx): + (JSC::ARMAssembler::loadBranchTarget): + (JSC::ARMAssembler::jmp): + (JSC::ARMAssembler::getLdrImmAddress): + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::jump): + (JSC::MacroAssemblerARM::nearCall): + (JSC::MacroAssemblerARM::call): + (JSC::MacroAssemblerARM::ret): + (JSC::MacroAssemblerARM::prepareCall): + (JSC::MacroAssemblerARM::call32): + +2010-04-21 Andy Estes + + Rubber stamped by Mark Rowe. + + Export WTF::deleteOwnedPtr(HFONT). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + 2010-04-21 Gavin Barraclough Rubber Stamped by Oliver Hunt. diff --git a/JavaScriptCore/Configurations/Version.xcconfig b/JavaScriptCore/Configurations/Version.xcconfig index 6aeb263..cc5943e 100644 --- a/JavaScriptCore/Configurations/Version.xcconfig +++ b/JavaScriptCore/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 533; -MINOR_VERSION = 6; +MINOR_VERSION = 9; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am index 2d024c1..d3ca76c 100644 --- a/JavaScriptCore/GNUmakefile.am +++ b/JavaScriptCore/GNUmakefile.am @@ -89,12 +89,17 @@ javascriptcore_sources += \ JavaScriptCore/jit/JITPropertyAccess.cpp \ JavaScriptCore/jit/JITPropertyAccess32_64.cpp \ JavaScriptCore/jit/JITArithmetic.cpp \ + JavaScriptCore/jit/JITArithmetic32_64.cpp \ JavaScriptCore/jit/ExecutableAllocator.cpp \ JavaScriptCore/jit/JIT.h \ JavaScriptCore/jit/JITInlineMethods.h \ JavaScriptCore/jit/JITStubs.cpp \ JavaScriptCore/jit/JITStubs.h \ JavaScriptCore/jit/JITStubCall.h \ + JavaScriptCore/jit/JSInterfaceJIT.h \ + JavaScriptCore/jit/SpecializedThunkJIT.h \ + JavaScriptCore/jit/ThunkGenerators.cpp \ + JavaScriptCore/jit/ThunkGenerators.h \ JavaScriptCore/bytecode/StructureStubInfo.cpp \ JavaScriptCore/bytecode/StructureStubInfo.h \ JavaScriptCore/bytecode/CodeBlock.cpp \ @@ -224,6 +229,7 @@ javascriptcore_sources += \ JavaScriptCore/wtf/AlwaysInline.h \ JavaScriptCore/wtf/Assertions.cpp \ JavaScriptCore/wtf/Assertions.h \ + JavaScriptCore/wtf/Atomics.h \ JavaScriptCore/wtf/ByteArray.cpp \ JavaScriptCore/wtf/ByteArray.h \ JavaScriptCore/wtf/CrossThreadRefCounted.h \ @@ -246,6 +252,8 @@ javascriptcore_sources += \ JavaScriptCore/wtf/ListHashSet.h \ JavaScriptCore/wtf/ListRefPtr.h \ JavaScriptCore/wtf/Locker.h \ + JavaScriptCore/wtf/MD5.cpp \ + JavaScriptCore/wtf/MD5.h \ JavaScriptCore/wtf/MainThread.cpp \ JavaScriptCore/wtf/MainThread.h \ JavaScriptCore/wtf/MathExtras.h \ @@ -281,7 +289,9 @@ javascriptcore_sources += \ JavaScriptCore/wtf/ThreadIdentifierDataPthreads.h \ JavaScriptCore/wtf/Threading.cpp \ JavaScriptCore/wtf/Threading.h \ + JavaScriptCore/wtf/ThreadingPrimitives.h \ JavaScriptCore/wtf/ThreadingPthreads.cpp \ + JavaScriptCore/wtf/ThreadSafeShared.h \ JavaScriptCore/wtf/ThreadSpecific.h \ JavaScriptCore/wtf/TypeTraits.cpp \ JavaScriptCore/wtf/TypeTraits.h \ diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp index e8e34ee..c08b54d 100644 --- a/JavaScriptCore/JavaScriptCore.exp +++ b/JavaScriptCore/JavaScriptCore.exp @@ -331,6 +331,7 @@ __ZN3WTF18dateToDaysFrom1970Eiii __ZN3WTF18monthFromDayInYearEib __ZN3WTF19initializeThreadingEv __ZN3WTF20fastMallocStatisticsEv +__ZN3WTF20initializeMainThreadEv __ZN3WTF21RefCountedLeakCounter16suppressMessagesEPKc __ZN3WTF21RefCountedLeakCounter24cancelMessageSuppressionEPKc __ZN3WTF21RefCountedLeakCounter9decrementEv @@ -346,6 +347,10 @@ __ZN3WTF32doubleToStringInJavaScriptFormatEdPcPj __ZN3WTF36lockAtomicallyInitializedStaticMutexEv __ZN3WTF37parseDateFromNullTerminatedCharactersEPKc __ZN3WTF38unlockAtomicallyInitializedStaticMutexEv +__ZN3WTF39initializeMainThreadToProcessMainThreadEv +__ZN3WTF3MD58addBytesEPKhm +__ZN3WTF3MD58checksumEv +__ZN3WTF3MD5C1Ev __ZN3WTF5Mutex4lockEv __ZN3WTF5Mutex6unlockEv __ZN3WTF5Mutex7tryLockEv diff --git a/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp b/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp index b2ccf1a..9e014dd 100644 --- a/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp +++ b/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp @@ -117,6 +117,7 @@ ['exclude', '/(gtk|glib|gobject)/.*\\.(cpp|h)$'], ['exclude', '(Default|Gtk|Mac|None|Qt|Win|Wx)\\.(cpp|mm)$'], ['exclude', 'wtf/CurrentTime\\.cpp$'], + ['exclude', 'wtf/MainThread.cpp$'], ['exclude', 'wtf/TC.*\\.(cpp|h)$'], ], 'direct_dependent_settings': { diff --git a/JavaScriptCore/JavaScriptCore.gypi b/JavaScriptCore/JavaScriptCore.gypi index ad2d09e..0e9774b 100644 --- a/JavaScriptCore/JavaScriptCore.gypi +++ b/JavaScriptCore/JavaScriptCore.gypi @@ -115,6 +115,7 @@ 'jit/JIT.cpp', 'jit/JIT.h', 'jit/JITArithmetic.cpp', + 'jit/JITArithmetic32_64.cpp', 'jit/JITCall.cpp', 'jit/JITCode.h', 'jit/JITInlineMethods.h', @@ -336,6 +337,7 @@ 'wtf/ASCIICType.h', 'wtf/Assertions.cpp', 'wtf/Assertions.h', + 'wtf/Atomics.h', 'wtf/AVLTree.h', 'wtf/ByteArray.cpp', 'wtf/ByteArray.h', @@ -370,6 +372,8 @@ 'wtf/ListHashSet.h', 'wtf/ListRefPtr.h', 'wtf/Locker.h', + 'wtf/MD5.cpp', + 'wtf/MD5.h', 'wtf/MainThread.cpp', 'wtf/MainThread.h', 'wtf/MallocZoneSupport.h', @@ -381,7 +385,6 @@ 'wtf/OwnFastMallocPtr.h', 'wtf/OwnPtr.h', 'wtf/OwnPtrCommon.h', - 'wtf/OwnPtrWin.cpp', 'wtf/PassOwnPtr.h', 'wtf/PassRefPtr.h', 'wtf/Platform.h', @@ -413,8 +416,10 @@ 'wtf/Threading.cpp', 'wtf/Threading.h', 'wtf/ThreadingNone.cpp', + 'wtf/ThreadingPrimitives.h', 'wtf/ThreadingPthreads.cpp', 'wtf/ThreadingWin.cpp', + 'wtf/ThreadSafeShared.h', 'wtf/ThreadSpecific.h', 'wtf/ThreadSpecificWin.cpp', 'wtf/TypeTraits.cpp', @@ -448,6 +453,7 @@ 'wtf/WTFThreadData.cpp', 'wtf/WTFThreadData.h', 'wtf/win/MainThreadWin.cpp', + 'wtf/win/OwnPtrWin.cpp', 'wtf/wx/MainThreadWx.cpp', 'yarr/RegexCompiler.cpp', 'yarr/RegexCompiler.h', diff --git a/JavaScriptCore/JavaScriptCore.pri b/JavaScriptCore/JavaScriptCore.pri index 24c8ce5..de5505f 100644 --- a/JavaScriptCore/JavaScriptCore.pri +++ b/JavaScriptCore/JavaScriptCore.pri @@ -1,7 +1,14 @@ # JavaScriptCore - Qt4 build info VPATH += $$PWD -JAVASCRIPTCORE_TARGET = jscore - +CONFIG(debug, debug|release) { + # Output in JavaScriptCore/ + JAVASCRIPTCORE_DESTDIR = debug + # Use a config-specific target to prevent parallel builds file clashes on Mac + JAVASCRIPTCORE_TARGET = jscored +} else { + JAVASCRIPTCORE_DESTDIR = release + JAVASCRIPTCORE_TARGET = jscore +} CONFIG(standalone_package) { isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated } else { @@ -14,6 +21,8 @@ symbian: { # Need to guarantee this comes before system includes of /epoc32/include MMP_RULES += "USERINCLUDE ../JavaScriptCore/profiler" LIBS += -lhal + # For hal.h + INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE } INCLUDEPATH = \ @@ -63,9 +72,8 @@ wince* { defineTest(addJavaScriptCoreLib) { - pathToJavaScriptCoreOutput = $$ARGS - CONFIG(debug_and_release):CONFIG(debug, debug|release): pathToJavaScriptCoreOutput = $$pathToJavaScriptCoreOutput/debug - CONFIG(debug_and_release):CONFIG(release, debug|release): pathToJavaScriptCoreOutput = $$pathToJavaScriptCoreOutput/release + # Argument is the relative path to JavaScriptCore.pro's qmake output + pathToJavaScriptCoreOutput = $$ARGS/$$JAVASCRIPTCORE_DESTDIR win32-msvc*|wince* { LIBS += -L$$pathToJavaScriptCoreOutput @@ -73,6 +81,9 @@ defineTest(addJavaScriptCoreLib) { POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib } else:symbian { LIBS += -l$${JAVASCRIPTCORE_TARGET}.lib + # The default symbian build system does not use library paths at all. However when building with + # qmake's symbian makespec that uses Makefiles + QMAKE_LIBDIR += $$pathToJavaScriptCoreOutput POST_TARGETDEPS += $${pathToJavaScriptCoreOutput}$${QMAKE_DIR_SEP}$${JAVASCRIPTCORE_TARGET}.lib } else { # Make sure jscore will be early in the list of libraries to workaround a bug in MinGW diff --git a/JavaScriptCore/JavaScriptCore.pro b/JavaScriptCore/JavaScriptCore.pro index f33be05..fc242cf 100644 --- a/JavaScriptCore/JavaScriptCore.pro +++ b/JavaScriptCore/JavaScriptCore.pro @@ -8,16 +8,19 @@ CONFIG += staticlib # Don't use JavaScriptCore as the target name. qmake would create a JavaScriptCore.vcproj for msvc # which already exists as a directory TARGET = $$JAVASCRIPTCORE_TARGET +DESTDIR = $$JAVASCRIPTCORE_DESTDIR QT += core +QT -= gui CONFIG += depend_includepath contains(QT_CONFIG, embedded):CONFIG += embedded -CONFIG(debug_and_release):CONFIG(debug, debug|release): DESTDIR = debug -CONFIG(debug_and_release):CONFIG(release, debug|release): DESTDIR = release - -!CONFIG(QTDIR_build) { +CONFIG(QTDIR_build) { + # Make sure we compile both debug and release on mac when inside Qt. + # This line was extracted from qbase.pri instead of including the whole file + win32|mac:!macx-xcode:CONFIG += debug_and_release +} else { CONFIG(debug, debug|release) { OBJECTS_DIR = obj/debug } else { # Release @@ -27,6 +30,12 @@ CONFIG(debug_and_release):CONFIG(release, debug|release): DESTDIR = release mac:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework):!build_pass:CONFIG += build_all } +# WebCore adds these config only when in a standalone build. +# qbase.pri takes care of that when in a QTDIR_build +# Here we add the config for both cases since we don't include qbase.pri +contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols +unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions + CONFIG(QTDIR_build) { # Remove the following 2 lines if you want debug information in JavaScriptCore CONFIG -= separate_debug_info @@ -90,12 +99,14 @@ SOURCES += \ jit/ExecutableAllocatorWin.cpp \ jit/ExecutableAllocator.cpp \ jit/JITArithmetic.cpp \ + jit/JITArithmetic32_64.cpp \ jit/JITCall.cpp \ jit/JIT.cpp \ jit/JITOpcodes.cpp \ jit/JITPropertyAccess.cpp \ jit/JITPropertyAccess32_64.cpp \ jit/JITStubs.cpp \ + jit/ThunkGenerators.cpp \ parser/Lexer.cpp \ parser/Nodes.cpp \ parser/ParserArena.cpp \ @@ -194,6 +205,7 @@ SOURCES += \ wtf/dtoa.cpp \ wtf/FastMalloc.cpp \ wtf/HashTable.cpp \ + wtf/MD5.cpp \ wtf/MainThread.cpp \ wtf/qt/MainThreadQt.cpp \ wtf/qt/StringQt.cpp \ @@ -223,3 +235,6 @@ SOURCES += \ !contains(DEFINES, USE_SYSTEM_MALLOC) { SOURCES += wtf/TCSystemAlloc.cpp } + +# Disable C++0x mode in JSC for those who enabled it in their Qt's mkspec +*-g++*:QMAKE_CXXFLAGS -= -std=c++0x -std=gnu++0x diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def index 76f2fa7..faa1d01 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def +++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def @@ -11,6 +11,7 @@ EXPORTS ??0JSArray@JSC@@QAE@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVArgList@1@@Z ??0JSByteArray@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@PAVByteArray@4@PBUClassInfo@1@@Z ??0JSFunction@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@HABVIdentifier@1@P6I?AVJSValue@1@0PAVJSObject@1@V61@ABVArgList@1@@Z@Z + ??0MD5@WTF@@QAE@XZ ??0Mutex@WTF@@QAE@XZ ??0PrototypeFunction@JSC@@QAE@PAVExecState@1@HABVIdentifier@1@P6I?AVJSValue@1@0PAVJSObject@1@V41@ABVArgList@1@@Z@Z ??0PrototypeFunction@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@HABVIdentifier@1@P6I?AVJSValue@1@0PAVJSObject@1@V61@ABVArgList@1@@Z@Z @@ -54,6 +55,7 @@ EXPORTS ?add@AtomicString@WebCore@@CA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PB_WII@Z ?add@Identifier@JSC@@SA?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@PAVExecState@2@PBD@Z ?add@PropertyNameArray@JSC@@QAEXPAVStringImpl@WebCore@@@Z + ?addBytes@MD5@WTF@@QAEXPBEI@Z ?addPropertyTransition@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z ?addPropertyTransitionToExistingStructure@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z ?addPropertyWithoutTransition@Structure@JSC@@QAEIABVIdentifier@2@IPAVJSCell@2@@Z @@ -86,12 +88,12 @@ EXPORTS ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVExecState@2@@Z ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@@Z ?checkSyntax@JSC@@YA?AVCompletion@1@PAVExecState@1@ABVSourceCode@1@@Z + ?checksum@MD5@WTF@@QAE?AV?$Vector@E$0BA@@2@XZ ?classInfo@InternalFunction@JSC@@UBEPBUClassInfo@2@XZ ?classInfo@JSCell@JSC@@UBEPBUClassInfo@2@XZ ?className@JSObject@JSC@@UBE?AVUString@2@XZ ?collate@Collator@WTF@@QBE?AW4Result@12@PB_WI0I@Z ?collectAllGarbage@Heap@JSC@@QAEXXZ - ?commentAtom@WebCore@@3VAtomicString@1@B ?configurable@PropertyDescriptor@JSC@@QBE_NXZ ?construct@JSC@@YAPAVJSObject@1@PAVExecState@1@VJSValue@1@W4ConstructType@1@ABTConstructData@1@ABVArgList@1@@Z ?constructArray@JSC@@YAPAVJSArray@1@PAVExecState@1@ABVArgList@1@@Z @@ -138,6 +140,7 @@ EXPORTS ?defineSetter@JSObject@JSC@@UAEXPAVExecState@2@ABVIdentifier@2@PAV12@I@Z ?deleteOwnedPtr@WTF@@YAXPAUHBITMAP__@@@Z ?deleteOwnedPtr@WTF@@YAXPAUHDC__@@@Z + ?deleteOwnedPtr@WTF@@YAXPAUHFONT__@@@Z ?deleteOwnedPtr@WTF@@YAXPAUHRGN__@@@Z ?deleteProperty@JSCell@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@@Z ?deleteProperty@JSCell@JSC@@UAE_NPAVExecState@2@I@Z @@ -156,7 +159,6 @@ EXPORTS ?doubleToStringInJavaScriptFormat@WTF@@YAXNQADPAI@Z ?dumpSampleData@JSGlobalData@JSC@@QAEXPAVExecState@2@@Z ?empty@StringImpl@WebCore@@SAPAV12@XZ - ?emptyAtom@WebCore@@3VAtomicString@1@B ?endsWith@StringImpl@WebCore@@QAE_NPAV12@_N@Z ?enumerable@PropertyDescriptor@JSC@@QBE_NXZ ?equal@Identifier@JSC@@SA_NPBVStringImpl@WebCore@@PBD@Z @@ -273,7 +275,6 @@ EXPORTS ?name@InternalFunction@JSC@@QAEABVUString@2@PAVExecState@2@@Z ?newUninitialized@CString@WTF@@SA?AV12@IAAPAD@Z ?nonInlineNaN@JSC@@YANXZ - ?nullAtom@WebCore@@3VAtomicString@1@B ?number@String@WebCore@@SA?AV12@G@Z ?number@String@WebCore@@SA?AV12@H@Z ?number@String@WebCore@@SA?AV12@I@Z @@ -346,11 +347,9 @@ EXPORTS ?split@String@WebCore@@QBEXABV12@_NAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z ?split@String@WebCore@@QBEX_WAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z ?split@String@WebCore@@QBEX_W_NAAV?$Vector@VString@WebCore@@$0A@@WTF@@@Z - ?starAtom@WebCore@@3VAtomicString@1@B ?startIgnoringLeaks@Structure@JSC@@SAXXZ ?startProfiling@Profiler@JSC@@QAEXPAVExecState@2@ABVUString@2@@Z ?startSampling@JSGlobalData@JSC@@QAEXXZ - ?staticData@WTFThreadData@WTF@@0PAV?$ThreadSpecific@VWTFThreadData@WTF@@@2@A ?stopIgnoringLeaks@Structure@JSC@@SAXXZ ?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVUString@2@@Z ?stopSampling@JSGlobalData@JSC@@QAEXXZ @@ -361,7 +360,6 @@ EXPORTS ?substring@StringImpl@WebCore@@QAE?AV?$PassRefPtr@VStringImpl@WebCore@@@WTF@@II@Z ?symbolTableGet@JSVariableObject@JSC@@IAE_NABVIdentifier@2@AAVPropertyDescriptor@2@@Z ?synthesizePrototype@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@@Z - ?textAtom@WebCore@@3VAtomicString@1@B ?thisObject@DebuggerCallFrame@JSC@@QBEPAVJSObject@2@XZ ?threadsafeCopy@String@WebCore@@QBE?AV12@XZ ?throwError@JSC@@YAPAVJSObject@1@PAVExecState@1@W4ErrorType@1@@Z @@ -420,8 +418,6 @@ EXPORTS ?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z ?waitForThreadCompletion@WTF@@YAHIPAPAX@Z ?writable@PropertyDescriptor@JSC@@QBE_NXZ - ?xmlAtom@WebCore@@3VAtomicString@1@B - ?xmlnsAtom@WebCore@@3VAtomicString@1@B WTFLog WTFLogVerbose WTFReportArgumentAssertionFailure diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj index 158621a..dddf194 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj +++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj @@ -1669,6 +1669,10 @@ > + + @@ -1704,6 +1708,22 @@ RelativePath="..\..\jit\JITStubs.h" > + + + + + + + + + + + + @@ -373,6 +381,14 @@ > + + + + @@ -413,10 +429,6 @@ > - - @@ -505,10 +517,18 @@ > + + + + diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 9dff7ef..2c99612 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -176,6 +176,8 @@ 41359CF70FDD89CB00206180 /* DateMath.h in Headers */ = {isa = PBXBuildFile; fileRef = 41359CF50FDD89CB00206180 /* DateMath.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4409D8470FAF80A200523B87 /* OwnPtrCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 440B7AED0FAF7FCB0073323E /* OwnPtrCommon.h */; settings = {ATTRIBUTES = (Private, ); }; }; 44DD48530FAEA85000D6B4EB /* PassOwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 44DD48520FAEA85000D6B4EB /* PassOwnPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 511FC4C9117EE28700425272 /* MD5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511FC4C7117EE23D00425272 /* MD5.cpp */; }; + 511FC4CB117EE2A800425272 /* MD5.h in Headers */ = {isa = PBXBuildFile; fileRef = 511FC4CA117EE2A800425272 /* MD5.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5D53726F0E1C54880021E549 /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; }; 5D5D8AB60E0D0A7200F9C692 /* jsc in Copy Into Framework */ = {isa = PBXBuildFile; fileRef = 932F5BE10822A1C700736975 /* jsc */; }; 5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; }; @@ -209,6 +211,7 @@ 868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA5F117D048200B908B1 /* StaticConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8698B86910D44D9400D8D01B /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698B86810D44D9400D8D01B /* StringBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; }; 8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698BB3710D86BAF00D8D01B /* UStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 869D04AF1193B54D00803475 /* CachedTranscendentalFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 869D04AE1193B54D00803475 /* CachedTranscendentalFunction.h */; settings = {ATTRIBUTES = (Private, ); }; }; 869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 869EBCB60E8C6D4A008722CC /* ResultType.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86A90ED00EE7D51F00AB350D /* JITArithmetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */; }; 86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */; }; @@ -288,11 +291,16 @@ A72701B90DADE94900E548D7 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; }; A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; }; A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A7386554118697B400540279 /* SpecializedThunkJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A7386551118697B400540279 /* SpecializedThunkJIT.h */; }; + A7386555118697B400540279 /* ThunkGenerators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7386552118697B400540279 /* ThunkGenerators.cpp */; }; + A7386556118697B400540279 /* ThunkGenerators.h in Headers */ = {isa = PBXBuildFile; fileRef = A7386553118697B400540279 /* ThunkGenerators.h */; settings = {ATTRIBUTES = (Private, ); }; }; A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; A7482B9411671147003B0712 /* JSWeakObjectMapRefPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */; }; A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */; settings = {ATTRIBUTES = (Private, ); }; }; A74B3499102A5F8E0032AB98 /* MarkStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A74B3498102A5F8E0032AB98 /* MarkStack.cpp */; }; + A75706DE118A2BCF0057F88F /* JITArithmetic32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75706DD118A2BCF0057F88F /* JITArithmetic32_64.cpp */; }; A766B44F0EE8DCD1009518CA /* ExecutableAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */ = {isa = PBXBuildFile; fileRef = A76C51741182748D00715B05 /* JSInterfaceJIT.h */; }; A76EE6590FAE59D5003F069A /* NativeFunctionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; }; A7795590101A74D500114E55 /* MarkStack.h in Headers */ = {isa = PBXBuildFile; fileRef = A779558F101A74D500114E55 /* MarkStack.h */; settings = {ATTRIBUTES = (Private, ); }; }; A782F1A50EEC9FA20036273F /* ExecutableAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */; }; @@ -458,6 +466,9 @@ BC3046070E1F497F003232CF /* Error.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3046060E1F497F003232CF /* Error.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC3135640F302FA3003DFD3A /* DebuggerActivation.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3135620F302FA3003DFD3A /* DebuggerActivation.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC3135650F302FA3003DFD3A /* DebuggerActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC3135630F302FA3003DFD3A /* DebuggerActivation.cpp */; }; + BC5F7BBE11823B590052C02C /* Atomics.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5F7BBB11823B590052C02C /* Atomics.h */; settings = {ATTRIBUTES = (Private, ); }; }; + BC5F7BBF11823B590052C02C /* ThreadingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5F7BBC11823B590052C02C /* ThreadingPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; }; + BC5F7BC011823B590052C02C /* ThreadSafeShared.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5F7BBD11823B590052C02C /* ThreadSafeShared.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC6AAAE50E1F426500AD87D8 /* ClassInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC6AAAE40E1F426500AD87D8 /* ClassInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC756FC90E2031B200DE7D12 /* JSGlobalObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC756FC70E2031B200DE7D12 /* JSGlobalObjectFunctions.h */; }; BC7F8FB90E19D1C3008632C0 /* JSNumberCell.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7F8FB80E19D1C3008632C0 /* JSNumberCell.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -671,6 +682,8 @@ 449097EE0F8F81B50076A327 /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = ""; }; 44DD48520FAEA85000D6B4EB /* PassOwnPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassOwnPtr.h; sourceTree = ""; }; 45E12D8806A49B0F00E9DF84 /* jsc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsc.cpp; sourceTree = ""; tabWidth = 4; }; + 511FC4C7117EE23D00425272 /* MD5.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MD5.cpp; sourceTree = ""; }; + 511FC4CA117EE2A800425272 /* MD5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MD5.h; sourceTree = ""; }; 5186111D0CC824830081412B /* Deque.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Deque.h; sourceTree = ""; }; 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = ""; }; @@ -751,6 +764,7 @@ 868BFA5F117D048200B908B1 /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = ""; }; 8698B86810D44D9400D8D01B /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = ""; }; 8698BB3710D86BAF00D8D01B /* UStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringImpl.h; sourceTree = ""; }; + 869D04AE1193B54D00803475 /* CachedTranscendentalFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTranscendentalFunction.h; sourceTree = ""; }; 869EBCB60E8C6D4A008722CC /* ResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultType.h; sourceTree = ""; }; 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITArithmetic.cpp; sourceTree = ""; }; 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMv7Assembler.h; sourceTree = ""; }; @@ -862,10 +876,15 @@ A72701B30DADE94900E548D7 /* ExceptionHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionHelpers.h; sourceTree = ""; }; A727FF650DA3053B00E548D7 /* JSPropertyNameIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPropertyNameIterator.h; sourceTree = ""; }; A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPropertyNameIterator.cpp; sourceTree = ""; }; + A7386551118697B400540279 /* SpecializedThunkJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecializedThunkJIT.h; sourceTree = ""; }; + A7386552118697B400540279 /* ThunkGenerators.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThunkGenerators.cpp; sourceTree = ""; }; + A7386553118697B400540279 /* ThunkGenerators.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThunkGenerators.h; sourceTree = ""; }; A7482B791166CDEA003B0712 /* JSWeakObjectMapRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakObjectMapRefPrivate.h; sourceTree = ""; }; A7482B7A1166CDEA003B0712 /* JSWeakObjectMapRefPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWeakObjectMapRefPrivate.cpp; sourceTree = ""; }; A7482E37116A697B003B0712 /* JSWeakObjectMapRefInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWeakObjectMapRefInternal.h; sourceTree = ""; }; A74B3498102A5F8E0032AB98 /* MarkStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkStack.cpp; sourceTree = ""; }; + A75706DD118A2BCF0057F88F /* JITArithmetic32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITArithmetic32_64.cpp; sourceTree = ""; }; + A76C51741182748D00715B05 /* JSInterfaceJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInterfaceJIT.h; sourceTree = ""; }; A76EE6580FAE59D5003F069A /* NativeFunctionWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeFunctionWrapper.h; sourceTree = ""; }; A779558F101A74D500114E55 /* MarkStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkStack.h; sourceTree = ""; }; A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocatorPosix.cpp; sourceTree = ""; }; @@ -950,6 +969,9 @@ BC3135630F302FA3003DFD3A /* DebuggerActivation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebuggerActivation.cpp; sourceTree = ""; }; BC337BDE0E1AF0B80076918A /* GetterSetter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetterSetter.h; sourceTree = ""; }; BC337BEA0E1B00CB0076918A /* Error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Error.cpp; sourceTree = ""; }; + BC5F7BBB11823B590052C02C /* Atomics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Atomics.h; sourceTree = ""; }; + BC5F7BBC11823B590052C02C /* ThreadingPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadingPrimitives.h; sourceTree = ""; }; + BC5F7BBD11823B590052C02C /* ThreadSafeShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadSafeShared.h; sourceTree = ""; }; BC6AAAE40E1F426500AD87D8 /* ClassInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassInfo.h; sourceTree = ""; }; BC756FC60E2031B200DE7D12 /* JSGlobalObjectFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGlobalObjectFunctions.cpp; sourceTree = ""; }; BC756FC70E2031B200DE7D12 /* JSGlobalObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGlobalObjectFunctions.h; sourceTree = ""; }; @@ -1192,6 +1214,9 @@ 1429D92C0ED22D7000B89619 /* jit */ = { isa = PBXGroup; children = ( + A7386551118697B400540279 /* SpecializedThunkJIT.h */, + A7386552118697B400540279 /* ThunkGenerators.cpp */, + A7386553118697B400540279 /* ThunkGenerators.h */, A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */, A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */, 86DB64630F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp */, @@ -1200,6 +1225,7 @@ 1429D92D0ED22D7000B89619 /* JIT.cpp */, 1429D92E0ED22D7000B89619 /* JIT.h */, 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */, + A75706DD118A2BCF0057F88F /* JITArithmetic32_64.cpp */, 86CC85A20EE79B7400288682 /* JITCall.cpp */, 86CCEFDD0F413F8900FD7F9E /* JITCode.h */, 86CC85A00EE79A4700288682 /* JITInlineMethods.h */, @@ -1209,6 +1235,7 @@ 960626950FB8EC02009798AB /* JITStubCall.h */, 14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */, 14A6581A0F4E36F4000150FD /* JITStubs.h */, + A76C51741182748D00715B05 /* JSInterfaceJIT.h */, ); path = jit; sourceTree = ""; @@ -1340,6 +1367,7 @@ 938C4F690CA06BC700D9310A /* ASCIICType.h */, 65E217B808E7EECC0023E5F6 /* Assertions.cpp */, 65E217B708E7EECC0023E5F6 /* Assertions.h */, + BC5F7BBB11823B590052C02C /* Atomics.h */, E1A596370DE3E1C300C17E37 /* AVLTree.h */, A7A1F7AA0F252B3C00E184E2 /* ByteArray.cpp */, A7A1F7AB0F252B3C00E184E2 /* ByteArray.h */, @@ -1372,6 +1400,8 @@ 06D358A30DAAD9C4003B174E /* MainThread.h */, 5DBD18AF0C5401A700C15EAE /* MallocZoneSupport.h */, BCF6553B0A2048DE0038A194 /* MathExtras.h */, + 511FC4C7117EE23D00425272 /* MD5.cpp */, + 511FC4CA117EE2A800425272 /* MD5.h */, E1EE798B0D6CA53D00FEA3BA /* MessageQueue.h */, 9303F5690991190000AD71B8 /* Noncopyable.h */, C0A2723F0E509F1E00E96E15 /* NotFound.h */, @@ -1406,7 +1436,9 @@ 18BAB52810DADFCD000D945B /* ThreadIdentifierDataPthreads.h */, 5D6A566A0F05995500266145 /* Threading.cpp */, E1EE79220D6C95CD00FEA3BA /* Threading.h */, + BC5F7BBC11823B590052C02C /* ThreadingPrimitives.h */, E1EE793C0D6C9B9200FEA3BA /* ThreadingPthreads.cpp */, + BC5F7BBD11823B590052C02C /* ThreadSafeShared.h */, E1B7C8BD0DA3A3360074B0DC /* ThreadSpecific.h */, 0B330C260F38C62300692DE3 /* TypeTraits.cpp */, 0B4D7E620F319AC800AD7E58 /* TypeTraits.h */, @@ -1493,6 +1525,7 @@ 704FD35305697E6D003DBED9 /* BooleanObject.h */, BC7952340E15EB5600A898AB /* BooleanPrototype.cpp */, BC7952350E15EB5600A898AB /* BooleanPrototype.h */, + 869D04AE1193B54D00803475 /* CachedTranscendentalFunction.h */, BCA62DFE0E2826230004F30D /* CallData.cpp */, 145C507F0D9DF63B0088F6B9 /* CallData.h */, BC6AAAE40E1F426500AD87D8 /* ClassInfo.h */, @@ -2089,6 +2122,14 @@ 86B99AB9117E391E00DF5A90 /* RopeImpl.h in Headers */, 86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */, 86B99AE4117E578100DF5A90 /* StringImplBase.h in Headers */, + 511FC4CB117EE2A800425272 /* MD5.h in Headers */, + BC5F7BBE11823B590052C02C /* Atomics.h in Headers */, + BC5F7BBF11823B590052C02C /* ThreadingPrimitives.h in Headers */, + BC5F7BC011823B590052C02C /* ThreadSafeShared.h in Headers */, + A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */, + A7386554118697B400540279 /* SpecializedThunkJIT.h in Headers */, + A7386556118697B400540279 /* ThunkGenerators.h in Headers */, + 869D04AF1193B54D00803475 /* CachedTranscendentalFunction.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2536,6 +2577,9 @@ 868BFA0E117CEFD100B908B1 /* StringImpl.cpp in Sources */, 868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */, 86B99AB8117E391E00DF5A90 /* RopeImpl.cpp in Sources */, + 511FC4C9117EE28700425272 /* MD5.cpp in Sources */, + A7386555118697B400540279 /* ThunkGenerators.cpp in Sources */, + A75706DE118A2BCF0057F88F /* JITArithmetic32_64.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/JavaScriptCore/assembler/ARMAssembler.cpp b/JavaScriptCore/assembler/ARMAssembler.cpp index 7393aa1..a181b7e 100644 --- a/JavaScriptCore/assembler/ARMAssembler.cpp +++ b/JavaScriptCore/assembler/ARMAssembler.cpp @@ -357,7 +357,7 @@ void* ARMAssembler::executableCopy(ExecutablePool* allocator) int pos = (*iter) & (~0x1); ARMWord* ldrAddr = reinterpret_cast(data + pos); ARMWord* addr = getLdrImmAddress(ldrAddr); - if (*addr != 0xffffffff) { + if (*addr != InvalidBranchTarget) { if (!(*iter & 1)) { int diff = reinterpret_cast(data + *addr) - (ldrAddr + DefaultPrefetching); diff --git a/JavaScriptCore/assembler/ARMAssembler.h b/JavaScriptCore/assembler/ARMAssembler.h index f93db68..2ca0949 100644 --- a/JavaScriptCore/assembler/ARMAssembler.h +++ b/JavaScriptCore/assembler/ARMAssembler.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 University of Szeged + * Copyright (C) 2009, 2010 University of Szeged * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -123,6 +123,7 @@ namespace JSC { FSUBD = 0x0e300b40, FMULD = 0x0e200b00, FCMPD = 0x0eb40b40, + FSQRTD = 0x0eb10bc0, DTR = 0x05000000, LDRH = 0x00100090, STRH = 0x00000090, @@ -131,6 +132,9 @@ namespace JSC { FDTR = 0x0d000b00, B = 0x0a000000, BL = 0x0b000000, +#if WTF_ARM_ARCH_AT_LEAST(5) || defined(__ARM_ARCH_4T__) + BX = 0x012fff10, +#endif FMSR = 0x0e000a10, FMRS = 0x0e100a10, FSITOD = 0x0eb80bc0, @@ -139,6 +143,7 @@ namespace JSC { #if WTF_ARM_ARCH_AT_LEAST(5) CLZ = 0x016f0f10, BKPT = 0xe120070, + BLX = 0x012fff30, #endif #if WTF_ARM_ARCH_AT_LEAST(7) MOVW = 0x03000000, @@ -182,6 +187,7 @@ namespace JSC { }; static const ARMWord INVALID_IMM = 0xf0000000; + static const ARMWord InvalidBranchTarget = 0xffffffff; static const int DefaultPrefetching = 2; class JmpSrc { @@ -421,6 +427,11 @@ namespace JSC { emitInst(static_cast(cc) | FCMPD, dd, 0, dm); } + void fsqrtd_r(int dd, int dm, Condition cc = AL) + { + emitInst(static_cast(cc) | FSQRTD, dd, 0, dm); + } + void ldr_imm(int rd, ARMWord imm, Condition cc = AL) { m_buffer.putIntWithConstantInt(static_cast(cc) | DTR | DT_LOAD | DT_UP | RN(ARMRegisters::pc) | RD(rd), imm, true); @@ -547,6 +558,30 @@ namespace JSC { #endif } + void bx(int rm, Condition cc = AL) + { +#if WTF_ARM_ARCH_AT_LEAST(5) || defined(__ARM_ARCH_4T__) + emitInst(static_cast(cc) | BX, 0, 0, RM(rm)); +#else + mov_r(ARMRegisters::pc, RM(rm), cc); +#endif + } + + JmpSrc blx(int rm, Condition cc = AL) + { +#if WTF_ARM_ARCH_AT_LEAST(5) + int s = m_buffer.uncheckedSize(); + emitInst(static_cast(cc) | BLX, 0, 0, RM(rm)); +#else + ASSERT(rm != 14); + ensureSpace(2 * sizeof(ARMWord), 0); + mov_r(ARMRegisters::lr, ARMRegisters::pc, cc); + int s = m_buffer.uncheckedSize(); + bx(rm, cc); +#endif + return JmpSrc(s); + } + static ARMWord lsl(int reg, ARMWord value) { ASSERT(reg <= ARMRegisters::pc); @@ -619,21 +654,34 @@ namespace JSC { return label(); } - JmpSrc jmp(Condition cc = AL, int useConstantPool = 0) + JmpSrc loadBranchTarget(int rd, Condition cc = AL, int useConstantPool = 0) { ensureSpace(sizeof(ARMWord), sizeof(ARMWord)); int s = m_buffer.uncheckedSize(); - ldr_un_imm(ARMRegisters::pc, 0xffffffff, cc); + ldr_un_imm(rd, InvalidBranchTarget, cc); m_jumps.append(s | (useConstantPool & 0x1)); return JmpSrc(s); } + JmpSrc jmp(Condition cc = AL, int useConstantPool = 0) + { + return loadBranchTarget(ARMRegisters::pc, cc, useConstantPool); + } + void* executableCopy(ExecutablePool* allocator); // Patching helpers static ARMWord* getLdrImmAddress(ARMWord* insn) { +#if WTF_ARM_ARCH_AT_LEAST(5) + // Check for call + if ((*insn & 0x0f7f0000) != 0x051f0000) { + // Must be BLX + ASSERT((*insn & 0x012fff30) == 0x012fff30); + insn--; + } +#endif // Must be an ldr ..., [pc +/- imm] ASSERT((*insn & 0x0f7f0000) == 0x051f0000); diff --git a/JavaScriptCore/assembler/AbstractMacroAssembler.h b/JavaScriptCore/assembler/AbstractMacroAssembler.h index f96e34a..1c7f269 100644 --- a/JavaScriptCore/assembler/AbstractMacroAssembler.h +++ b/JavaScriptCore/assembler/AbstractMacroAssembler.h @@ -160,7 +160,7 @@ public: // in a class requiring explicit construction in order to differentiate // from pointers used as absolute addresses to memory operations struct ImmPtr { - explicit ImmPtr(void* value) + explicit ImmPtr(const void* value) : m_value(value) { } @@ -170,7 +170,7 @@ public: return reinterpret_cast(m_value); } - void* m_value; + const void* m_value; }; // Imm32: diff --git a/JavaScriptCore/assembler/MacroAssemblerARM.h b/JavaScriptCore/assembler/MacroAssemblerARM.h index 52c4fa2..40d2e4a 100644 --- a/JavaScriptCore/assembler/MacroAssemblerARM.h +++ b/JavaScriptCore/assembler/MacroAssemblerARM.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2008 Apple Inc. - * Copyright (C) 2009 University of Szeged + * Copyright (C) 2009, 2010 University of Szeged * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -178,6 +178,20 @@ public: { m_assembler.movs_r(dest, m_assembler.asr(dest, imm.m_value & 0x1f)); } + + void urshift32(RegisterID shift_amount, RegisterID dest) + { + ARMWord w = ARMAssembler::getOp2(0x1f); + ASSERT(w != ARMAssembler::INVALID_IMM); + m_assembler.and_r(ARMRegisters::S0, shift_amount, w); + + m_assembler.movs_r(dest, m_assembler.lsr_r(dest, ARMRegisters::S0)); + } + + void urshift32(Imm32 imm, RegisterID dest) + { + m_assembler.movs_r(dest, m_assembler.lsr(dest, imm.m_value & 0x1f)); + } void sub32(RegisterID src, RegisterID dest) { @@ -259,6 +273,14 @@ public: else m_assembler.ldrh_d(dest, ARMRegisters::S0, ARMAssembler::getOp2Byte(-address.offset)); } + + void load16(ImplicitAddress address, RegisterID dest) + { + if (address.offset >= 0) + m_assembler.ldrh_u(dest, address.base, ARMAssembler::getOp2Byte(address.offset)); + else + m_assembler.ldrh_d(dest, address.base, ARMAssembler::getOp2Byte(-address.offset)); + } DataLabel32 store32WithAddressOffsetPatch(RegisterID src, Address address) { @@ -474,7 +496,7 @@ public: void jump(RegisterID target) { - move(target, ARMRegisters::pc); + m_assembler.bx(target); } void jump(Address address) @@ -566,14 +588,19 @@ public: Call nearCall() { +#if WTF_ARM_ARCH_AT_LEAST(5) + ensureSpace(2 * sizeof(ARMWord), sizeof(ARMWord)); + m_assembler.loadBranchTarget(ARMRegisters::S1, ARMAssembler::AL, true); + return Call(m_assembler.blx(ARMRegisters::S1), Call::LinkableNear); +#else prepareCall(); return Call(m_assembler.jmp(ARMAssembler::AL, true), Call::LinkableNear); +#endif } Call call(RegisterID target) { - prepareCall(); - move(ARMRegisters::pc, target); + m_assembler.blx(target); JmpSrc jmpSrc; return Call(jmpSrc, Call::None); } @@ -585,7 +612,7 @@ public: void ret() { - m_assembler.mov_r(ARMRegisters::pc, linkRegister); + m_assembler.bx(linkRegister); } void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest) @@ -681,8 +708,14 @@ public: Call call() { +#if WTF_ARM_ARCH_AT_LEAST(5) + ensureSpace(2 * sizeof(ARMWord), sizeof(ARMWord)); + m_assembler.loadBranchTarget(ARMRegisters::S1, ARMAssembler::AL, true); + return Call(m_assembler.blx(ARMRegisters::S1), Call::Linkable); +#else prepareCall(); return Call(m_assembler.jmp(ARMAssembler::AL, true), Call::Linkable); +#endif } Call tailRecursiveCall() @@ -740,12 +773,17 @@ public: return false; } + bool supportsFloatingPointSqrt() const + { + return s_isVFPPresent; + } + void loadDouble(ImplicitAddress address, FPRegisterID dest) { m_assembler.doubleTransfer(true, dest, address.base, address.offset); } - void loadDouble(void* address, FPRegisterID dest) + void loadDouble(const void* address, FPRegisterID dest) { m_assembler.ldr_un_imm(ARMRegisters::S0, (ARMWord)address); m_assembler.fdtr_u(true, dest, ARMRegisters::S0, 0); @@ -801,6 +839,11 @@ public: mulDouble(ARMRegisters::SD0, dest); } + void sqrtDouble(FPRegisterID src, FPRegisterID dest) + { + m_assembler.fsqrtd_r(dest, src); + } + void convertInt32ToDouble(RegisterID src, FPRegisterID dest) { m_assembler.fmsr_r(dest, src); @@ -886,44 +929,56 @@ protected: void prepareCall() { +#if WTF_ARM_ARCH_VERSION < 5 ensureSpace(2 * sizeof(ARMWord), sizeof(ARMWord)); m_assembler.mov_r(linkRegister, ARMRegisters::pc); +#endif } void call32(RegisterID base, int32_t offset) { +#if WTF_ARM_ARCH_AT_LEAST(5) + int targetReg = ARMRegisters::S1; +#else + int targetReg = ARMRegisters::pc; +#endif + int tmpReg = ARMRegisters::S1; + if (base == ARMRegisters::sp) offset += 4; if (offset >= 0) { if (offset <= 0xfff) { prepareCall(); - m_assembler.dtr_u(true, ARMRegisters::pc, base, offset); + m_assembler.dtr_u(true, targetReg, base, offset); } else if (offset <= 0xfffff) { - m_assembler.add_r(ARMRegisters::S0, base, ARMAssembler::OP2_IMM | (offset >> 12) | (10 << 8)); + m_assembler.add_r(tmpReg, base, ARMAssembler::OP2_IMM | (offset >> 12) | (10 << 8)); prepareCall(); - m_assembler.dtr_u(true, ARMRegisters::pc, ARMRegisters::S0, offset & 0xfff); + m_assembler.dtr_u(true, targetReg, tmpReg, offset & 0xfff); } else { - ARMWord reg = m_assembler.getImm(offset, ARMRegisters::S0); + ARMWord reg = m_assembler.getImm(offset, tmpReg); prepareCall(); - m_assembler.dtr_ur(true, ARMRegisters::pc, base, reg); + m_assembler.dtr_ur(true, targetReg, base, reg); } } else { offset = -offset; if (offset <= 0xfff) { prepareCall(); - m_assembler.dtr_d(true, ARMRegisters::pc, base, offset); + m_assembler.dtr_d(true, targetReg, base, offset); } else if (offset <= 0xfffff) { - m_assembler.sub_r(ARMRegisters::S0, base, ARMAssembler::OP2_IMM | (offset >> 12) | (10 << 8)); + m_assembler.sub_r(tmpReg, base, ARMAssembler::OP2_IMM | (offset >> 12) | (10 << 8)); prepareCall(); - m_assembler.dtr_d(true, ARMRegisters::pc, ARMRegisters::S0, offset & 0xfff); + m_assembler.dtr_d(true, targetReg, tmpReg, offset & 0xfff); } else { - ARMWord reg = m_assembler.getImm(offset, ARMRegisters::S0); + ARMWord reg = m_assembler.getImm(offset, tmpReg); prepareCall(); - m_assembler.dtr_dr(true, ARMRegisters::pc, base, reg); + m_assembler.dtr_dr(true, targetReg, base, reg); } } +#if WTF_ARM_ARCH_AT_LEAST(5) + m_assembler.blx(targetReg); +#endif } private: diff --git a/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/JavaScriptCore/assembler/MacroAssemblerARMv7.h index 3d08f0e..31a68d9 100644 --- a/JavaScriptCore/assembler/MacroAssemblerARMv7.h +++ b/JavaScriptCore/assembler/MacroAssemblerARMv7.h @@ -257,6 +257,21 @@ public: { m_assembler.asr(dest, dest, imm.m_value & 0x1f); } + + void urshift32(RegisterID shift_amount, RegisterID dest) + { + // Clamp the shift to the range 0..31 + ARMThumbImmediate armImm = ARMThumbImmediate::makeEncodedImm(0x1f); + ASSERT(armImm.isValid()); + m_assembler.ARM_and(dataTempRegister, shift_amount, armImm); + + m_assembler.lsr(dest, dest, dataTempRegister); + } + + void urshift32(Imm32 imm, RegisterID dest) + { + m_assembler.lsr(dest, dest, imm.m_value & 0x1f); + } void sub32(RegisterID src, RegisterID dest) { @@ -441,6 +456,11 @@ public: { m_assembler.ldrh(dest, makeBaseIndexBase(address), address.index, address.scale); } + + void load16(ImplicitAddress address, RegisterID dest) + { + m_assembler.ldrh(dest, address.base, address.offset); + } DataLabel32 store32WithAddressOffsetPatch(RegisterID src, Address address) { @@ -494,6 +514,11 @@ public: // In short, FIXME:. bool supportsFloatingPointTruncate() const { return false; } + bool supportsFloatingPointSqrt() const + { + return false; + } + void loadDouble(ImplicitAddress address, FPRegisterID dest) { RegisterID base = address.base; @@ -557,6 +582,11 @@ public: mulDouble(fpTempRegister, dest); } + void sqrtDouble(FPRegisterID, FPRegisterID) + { + ASSERT_NOT_REACHED(); + } + void convertInt32ToDouble(RegisterID src, FPRegisterID dest) { m_assembler.vmov(fpTempRegister, src); diff --git a/JavaScriptCore/assembler/MacroAssemblerX86.h b/JavaScriptCore/assembler/MacroAssemblerX86.h index 0366541..0918996 100644 --- a/JavaScriptCore/assembler/MacroAssemblerX86.h +++ b/JavaScriptCore/assembler/MacroAssemblerX86.h @@ -87,7 +87,7 @@ public: m_assembler.movl_mr(address, dest); } - void loadDouble(void* address, FPRegisterID dest) + void loadDouble(const void* address, FPRegisterID dest) { ASSERT(isSSE2Present()); m_assembler.movsd_mr(address, dest); @@ -172,6 +172,7 @@ public: bool supportsFloatingPoint() const { return m_isSSE2Present; } // See comment on MacroAssemblerARMv7::supportsFloatingPointTruncate() bool supportsFloatingPointTruncate() const { return m_isSSE2Present; } + bool supportsFloatingPointSqrt() const { return m_isSSE2Present; } private: const bool m_isSSE2Present; diff --git a/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/JavaScriptCore/assembler/MacroAssemblerX86Common.h index 27c2f15..7296193 100644 --- a/JavaScriptCore/assembler/MacroAssemblerX86Common.h +++ b/JavaScriptCore/assembler/MacroAssemblerX86Common.h @@ -249,6 +249,33 @@ public: { m_assembler.sarl_i8r(imm.m_value, dest); } + + void urshift32(RegisterID shift_amount, RegisterID dest) + { + // On x86 we can only shift by ecx; if asked to shift by another register we'll + // need rejig the shift amount into ecx first, and restore the registers afterwards. + if (shift_amount != X86Registers::ecx) { + swap(shift_amount, X86Registers::ecx); + + // E.g. transform "shrl %eax, %eax" -> "xchgl %eax, %ecx; shrl %ecx, %ecx; xchgl %eax, %ecx" + if (dest == shift_amount) + m_assembler.shrl_CLr(X86Registers::ecx); + // E.g. transform "shrl %eax, %ecx" -> "xchgl %eax, %ecx; shrl %ecx, %eax; xchgl %eax, %ecx" + else if (dest == X86Registers::ecx) + m_assembler.shrl_CLr(shift_amount); + // E.g. transform "shrl %eax, %ebx" -> "xchgl %eax, %ecx; shrl %ecx, %ebx; xchgl %eax, %ecx" + else + m_assembler.shrl_CLr(dest); + + swap(shift_amount, X86Registers::ecx); + } else + m_assembler.shrl_CLr(dest); + } + + void urshift32(Imm32 imm, RegisterID dest) + { + m_assembler.shrl_i8r(imm.m_value, dest); + } void sub32(RegisterID src, RegisterID dest) { @@ -301,6 +328,10 @@ public: m_assembler.xorl_mr(src.offset, src.base, dest); } + void sqrtDouble(FPRegisterID src, FPRegisterID dst) + { + m_assembler.sqrtsd_rr(src, dst); + } // Memory access operations: // @@ -334,6 +365,11 @@ public: { m_assembler.movzwl_mr(address.offset, address.base, address.index, address.scale, dest); } + + void load16(Address address, RegisterID dest) + { + m_assembler.movzwl_mr(address.offset, address.base, dest); + } DataLabel32 store32WithAddressOffsetPatch(RegisterID src, Address address) { diff --git a/JavaScriptCore/assembler/MacroAssemblerX86_64.h b/JavaScriptCore/assembler/MacroAssemblerX86_64.h index 339eaa4..168c93f 100644 --- a/JavaScriptCore/assembler/MacroAssemblerX86_64.h +++ b/JavaScriptCore/assembler/MacroAssemblerX86_64.h @@ -86,7 +86,7 @@ public: } } - void loadDouble(void* address, FPRegisterID dest) + void loadDouble(const void* address, FPRegisterID dest) { move(ImmPtr(address), scratchRegister); loadDouble(scratchRegister, dest); @@ -427,6 +427,7 @@ public: bool supportsFloatingPoint() const { return true; } // See comment on MacroAssemblerARMv7::supportsFloatingPointTruncate() bool supportsFloatingPointTruncate() const { return true; } + bool supportsFloatingPointSqrt() const { return true; } private: friend class LinkBuffer; diff --git a/JavaScriptCore/assembler/X86Assembler.h b/JavaScriptCore/assembler/X86Assembler.h index 14a02f7..20d72f5 100644 --- a/JavaScriptCore/assembler/X86Assembler.h +++ b/JavaScriptCore/assembler/X86Assembler.h @@ -167,6 +167,7 @@ private: OP2_MULSD_VsdWsd = 0x59, OP2_SUBSD_VsdWsd = 0x5C, OP2_DIVSD_VsdWsd = 0x5E, + OP2_SQRTSD_VsdWsd = 0x51, OP2_XORPD_VpdWpd = 0x57, OP2_MOVD_VdEd = 0x6E, OP2_MOVD_EdVd = 0x7E, @@ -200,6 +201,7 @@ private: GROUP1A_OP_POP = 0, GROUP2_OP_SHL = 4, + GROUP2_OP_SHR = 5, GROUP2_OP_SAR = 7, GROUP3_OP_TEST = 0, @@ -672,6 +674,21 @@ public: { m_formatter.oneByteOp(OP_GROUP2_EvCL, GROUP2_OP_SAR, dst); } + + void shrl_i8r(int imm, RegisterID dst) + { + if (imm == 1) + m_formatter.oneByteOp(OP_GROUP2_Ev1, GROUP2_OP_SHR, dst); + else { + m_formatter.oneByteOp(OP_GROUP2_EvIb, GROUP2_OP_SHR, dst); + m_formatter.immediate8(imm); + } + } + + void shrl_CLr(RegisterID dst) + { + m_formatter.oneByteOp(OP_GROUP2_EvCL, GROUP2_OP_SHR, dst); + } void shll_i8r(int imm, RegisterID dst) { @@ -1393,7 +1410,7 @@ public: } #if !CPU(X86_64) - void movsd_mr(void* address, XMMRegisterID dst) + void movsd_mr(const void* address, XMMRegisterID dst) { m_formatter.prefix(PRE_SSE_F2); m_formatter.twoByteOp(OP2_MOVSD_VsdWsd, (RegisterID)dst, address); @@ -1461,6 +1478,12 @@ public: m_formatter.twoByteOp(OP2_XORPD_VpdWpd, (RegisterID)dst, (RegisterID)src); } + void sqrtsd_rr(XMMRegisterID src, XMMRegisterID dst) + { + m_formatter.prefix(PRE_SSE_F2); + m_formatter.twoByteOp(OP2_SQRTSD_VsdWsd, (RegisterID)dst, (RegisterID)src); + } + // Misc instructions: void int3() @@ -1746,7 +1769,7 @@ private: } #if !CPU(X86_64) - void twoByteOp(TwoByteOpcodeID opcode, int reg, void* address) + void twoByteOp(TwoByteOpcodeID opcode, int reg, const void* address) { m_buffer.ensureSpace(maxInstructionSize); m_buffer.putByteUnchecked(OP_2BYTE_ESCAPE); @@ -2057,7 +2080,7 @@ private: } #if !CPU(X86_64) - void memoryModRM(int reg, void* address) + void memoryModRM(int reg, const void* address) { // noBase + ModRmMemoryNoDisp means noBase + ModRmMemoryDisp32! putModRm(ModRmMemoryNoDisp, reg, noBase); diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp index 8e77e12..d56d328 100644 --- a/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/JavaScriptCore/bytecode/CodeBlock.cpp @@ -931,6 +931,13 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& printf("[%4d] jless\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), offset, location + offset); break; } + case op_jlesseq: { + int r0 = (++it)->u.operand; + int r1 = (++it)->u.operand; + int offset = (++it)->u.operand; + printf("[%4d] jlesseq\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).data(), registerName(exec, r1).data(), offset, location + offset); + break; + } case op_loop_if_lesseq: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; @@ -1366,12 +1373,12 @@ void CodeBlock::derefStructures(Instruction* vPC) const vPC[4].u.structure->deref(); return; } - if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto)) { + if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto)) { vPC[4].u.structure->deref(); vPC[5].u.structure->deref(); return; } - if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain)) { + if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) { vPC[4].u.structure->deref(); vPC[5].u.structureChain->deref(); return; @@ -1394,7 +1401,9 @@ void CodeBlock::derefStructures(Instruction* vPC) const if ((vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto_list)) || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self_list)) || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto_list)) - || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self_list))) { + || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self_list)) + || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto_list)) + || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self_list))) { PolymorphicAccessStructureList* polymorphicStructures = vPC[4].u.polymorphicStructures; polymorphicStructures->derefStructures(vPC[5].u.operand); delete polymorphicStructures; @@ -1413,12 +1422,12 @@ void CodeBlock::refStructures(Instruction* vPC) const vPC[4].u.structure->ref(); return; } - if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto)) { + if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto)) { vPC[4].u.structure->ref(); vPC[5].u.structure->ref(); return; } - if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain)) { + if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) { vPC[4].u.structure->ref(); vPC[5].u.structureChain->ref(); return; diff --git a/JavaScriptCore/bytecode/Opcode.h b/JavaScriptCore/bytecode/Opcode.h index 0a7f3fa..b5a8c2d 100644 --- a/JavaScriptCore/bytecode/Opcode.h +++ b/JavaScriptCore/bytecode/Opcode.h @@ -138,6 +138,7 @@ namespace JSC { macro(op_jnless, 4) \ macro(op_jnlesseq, 4) \ macro(op_jless, 4) \ + macro(op_jlesseq, 4) \ macro(op_jmp_scopes, 3) \ macro(op_loop, 2) \ macro(op_loop_if_true, 3) \ diff --git a/JavaScriptCore/bytecode/SamplingTool.cpp b/JavaScriptCore/bytecode/SamplingTool.cpp index 8522e45..7191e38 100644 --- a/JavaScriptCore/bytecode/SamplingTool.cpp +++ b/JavaScriptCore/bytecode/SamplingTool.cpp @@ -43,7 +43,7 @@ namespace JSC { void SamplingFlags::sample() { - uint32_t mask = 1 << 31; + uint32_t mask = static_cast(1 << 31); unsigned index; for (index = 0; index < 32; ++index) { diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index aa5c5f9..db79d67 100644 --- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -635,7 +635,7 @@ PassRefPtr