From d73e11d56a094544f036fac3f6e4483d1104261e Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 11 Feb 2010 11:55:52 +0100 Subject: Update src/3rdparty/javascriptcore and adapt src/script to the changes - Update qscriptvalueiterator test to expect length property when iterating arrays and strings. - Use EvalExecutable::create() instead of EvalExecutable constructor. The constructor is private. - Reimplement getOwnPropertyDescriptor() in all custom script objects. - Remove all reimplementations of getPropertyAttributes(). It doesn't exist in trunk anymore (getOwnPropertyDescriptor() is used instead). - Remove checkDontDelete argument from deleteProperty() reimplementations. The purpose of this argument was to support deleting properties with attribute Undeletable from C++. But it was quite an invasive patch to JavaScriptCore, and it doesn't seem worth it. If this feature is really crucial it should be re-done upstream. One of the tests needed to be updated so it's not sensitive to the C++ undeletability. - Adapt getOwnPropertyNames() reimplementations to signature change. - Add missing QScriptObject structure flags, otherwise we don't get all virtual calls. - Remove our patch for reporting column numbers in the debugger callbacks. It was just too intrusive. As with the checkDontDelete issue, this should be redone upstream if it's really important. In 4.7, QScriptEngineAgent will always report a column number of 1. Other compilation fixes: - InternalFunction::name() takes an ExecState* argument, not GlobalData* - ScopeChain::globalObject is no longer a function but a member variable - ScopeChainNode constructor takes a GlobalObject argument - Heap::collect() is called collectAllGarbage() - JSValue::strictEqual() takes an ExecState* argument - Debugger::exception() takes a bool hasHandler argument - Debugger no longer reports column number (we decided to drop that patch from JSC) - UString doesn't have operator+=(char*) - Update the autotests to reflect the columnNumber=1 change. - Add helper class to avoid crashing inside JSC. Ever since r52856 in WebKit trunk, this is needed. There are probably a lot of other public API functions that need this guard as well, but I'll add them as they are discovered. - Update mkdist-javascriptcore tag, exclude a few more files. - Set ENABLE_JSC_MULTIPLE_THREADS=0 define on Mac due to r52355 in trunk. Reviewed-by: Simon Hausmann --- .../javascriptcore/JavaScriptCore/API/APICast.h | 22 +- .../javascriptcore/JavaScriptCore/API/APIShims.h | 99 + .../javascriptcore/JavaScriptCore/API/JSBase.cpp | 18 +- .../javascriptcore/JavaScriptCore/API/JSBase.h | 23 +- .../JavaScriptCore/API/JSCallbackConstructor.cpp | 5 +- .../JavaScriptCore/API/JSCallbackConstructor.h | 7 +- .../JavaScriptCore/API/JSCallbackFunction.cpp | 3 +- .../JavaScriptCore/API/JSCallbackFunction.h | 2 +- .../JavaScriptCore/API/JSCallbackObject.h | 14 +- .../JavaScriptCore/API/JSCallbackObjectFunctions.h | 116 +- .../JavaScriptCore/API/JSClassRef.cpp | 65 +- .../javascriptcore/JavaScriptCore/API/JSClassRef.h | 3 +- .../JavaScriptCore/API/JSContextRef.cpp | 34 +- .../JavaScriptCore/API/JSContextRefPrivate.h | 53 + .../JavaScriptCore/API/JSObjectRef.cpp | 64 +- .../JavaScriptCore/API/JSStringRef.h | 2 +- .../JavaScriptCore/API/JSValueRef.cpp | 83 +- .../JavaScriptCore/API/OpaqueJSString.cpp | 2 +- .../javascriptcore/JavaScriptCore/ChangeLog | 8084 +++++++++++++++++++- .../javascriptcore/JavaScriptCore/Info.plist | 4 +- .../JavaScriptCore/JavaScriptCore.gypi | 20 +- .../JavaScriptCore/JavaScriptCore.order | 2 - .../JavaScriptCore/JavaScriptCore.pri | 217 +- .../JavaScriptCore/assembler/ARMAssembler.cpp | 92 +- .../JavaScriptCore/assembler/ARMAssembler.h | 91 +- .../JavaScriptCore/assembler/ARMv7Assembler.h | 177 +- .../assembler/AbstractMacroAssembler.h | 8 +- .../JavaScriptCore/assembler/MacroAssembler.h | 23 +- .../JavaScriptCore/assembler/MacroAssemblerARM.cpp | 11 +- .../JavaScriptCore/assembler/MacroAssemblerARM.h | 148 +- .../JavaScriptCore/assembler/MacroAssemblerARMv7.h | 57 +- .../assembler/MacroAssemblerCodeRef.h | 12 +- .../JavaScriptCore/assembler/MacroAssemblerX86.h | 2 +- .../assembler/MacroAssemblerX86Common.h | 89 +- .../assembler/MacroAssemblerX86_64.h | 29 +- .../JavaScriptCore/assembler/X86Assembler.h | 64 +- .../JavaScriptCore/bytecode/CodeBlock.cpp | 333 +- .../JavaScriptCore/bytecode/CodeBlock.h | 13 +- .../JavaScriptCore/bytecode/Opcode.h | 13 +- .../JavaScriptCore/bytecode/SamplingTool.cpp | 4 +- .../JavaScriptCore/bytecode/SamplingTool.h | 4 + .../bytecompiler/BytecodeGenerator.cpp | 150 +- .../bytecompiler/BytecodeGenerator.h | 38 +- .../JavaScriptCore/bytecompiler/Label.h | 14 +- .../JavaScriptCore/bytecompiler/NodesCodegen.cpp | 2012 +++++ .../javascriptcore/JavaScriptCore/config.h | 25 +- .../JavaScriptCore/debugger/Debugger.cpp | 11 +- .../JavaScriptCore/debugger/Debugger.h | 9 +- .../JavaScriptCore/debugger/DebuggerActivation.cpp | 12 +- .../JavaScriptCore/debugger/DebuggerActivation.h | 11 +- .../JavaScriptCore/debugger/DebuggerCallFrame.cpp | 10 +- .../JavaScriptCore/generated/ArrayPrototype.lut.h | 2 +- .../JavaScriptCore/generated/DatePrototype.lut.h | 2 +- .../generated/GeneratedJITStubs_RVCT.h | 1199 +++ .../JavaScriptCore/generated/Grammar.cpp | 542 +- .../JavaScriptCore/generated/Grammar.h | 4 +- .../JavaScriptCore/generated/JSONObject.lut.h | 2 +- .../JavaScriptCore/generated/Lexer.lut.h | 2 +- .../JavaScriptCore/generated/MathObject.lut.h | 2 +- .../generated/NumberConstructor.lut.h | 2 +- .../generated/RegExpConstructor.lut.h | 2 +- .../JavaScriptCore/generated/RegExpObject.lut.h | 2 +- .../JavaScriptCore/generated/StringPrototype.lut.h | 9 +- .../JavaScriptCore/interpreter/CachedCall.h | 11 +- .../JavaScriptCore/interpreter/CallFrame.h | 27 +- .../JavaScriptCore/interpreter/Interpreter.cpp | 1007 +-- .../JavaScriptCore/interpreter/Interpreter.h | 13 +- .../JavaScriptCore/interpreter/Register.h | 65 +- .../JavaScriptCore/interpreter/RegisterFile.cpp | 2 +- .../JavaScriptCore/interpreter/RegisterFile.h | 8 +- .../JavaScriptCore/jit/ExecutableAllocator.h | 45 +- .../jit/ExecutableAllocatorFixedVMPool.cpp | 2 +- .../jit/ExecutableAllocatorPosix.cpp | 6 +- .../jit/ExecutableAllocatorSymbian.cpp | 75 + .../JavaScriptCore/jit/ExecutableAllocatorWin.cpp | 2 +- .../javascriptcore/JavaScriptCore/jit/JIT.cpp | 19 +- .../javascriptcore/JavaScriptCore/jit/JIT.h | 143 +- .../JavaScriptCore/jit/JITArithmetic.cpp | 383 +- .../javascriptcore/JavaScriptCore/jit/JITCall.cpp | 18 +- .../JavaScriptCore/jit/JITInlineMethods.h | 37 +- .../JavaScriptCore/jit/JITOpcodes.cpp | 674 +- .../JavaScriptCore/jit/JITPropertyAccess.cpp | 240 +- .../JavaScriptCore/jit/JITStubCall.h | 37 +- .../javascriptcore/JavaScriptCore/jit/JITStubs.cpp | 457 +- .../javascriptcore/JavaScriptCore/jit/JITStubs.h | 28 +- src/3rdparty/javascriptcore/JavaScriptCore/jsc.cpp | 91 +- .../JavaScriptCore/os-win32/WinMain.cpp | 81 + .../javascriptcore/JavaScriptCore/parser/Grammar.y | 6 +- .../javascriptcore/JavaScriptCore/parser/Lexer.cpp | 11 +- .../javascriptcore/JavaScriptCore/parser/Lexer.h | 6 + .../JavaScriptCore/parser/NodeConstructors.h | 1 - .../javascriptcore/JavaScriptCore/parser/Nodes.cpp | 1897 +---- .../javascriptcore/JavaScriptCore/parser/Nodes.h | 16 +- .../javascriptcore/JavaScriptCore/parser/Parser.h | 3 +- .../JavaScriptCore/parser/ParserArena.h | 2 +- .../JavaScriptCore/parser/SourceCode.h | 3 +- .../javascriptcore/JavaScriptCore/pcre/dftables | 1 + .../javascriptcore/JavaScriptCore/pcre/pcre.pri | 23 - .../JavaScriptCore/pcre/pcre_exec.cpp | 4 +- .../JavaScriptCore/profiler/HeavyProfile.cpp | 0 .../JavaScriptCore/profiler/HeavyProfile.h | 0 .../JavaScriptCore/profiler/ProfileGenerator.cpp | 2 +- .../JavaScriptCore/profiler/ProfileNode.cpp | 8 +- .../JavaScriptCore/profiler/Profiler.cpp | 22 +- .../JavaScriptCore/profiler/Profiler.h | 2 +- .../JavaScriptCore/profiler/TreeProfile.cpp | 0 .../JavaScriptCore/profiler/TreeProfile.h | 0 .../JavaScriptCore/runtime/ArgList.h | 10 +- .../JavaScriptCore/runtime/Arguments.cpp | 31 +- .../JavaScriptCore/runtime/Arguments.h | 11 +- .../JavaScriptCore/runtime/ArrayConstructor.cpp | 4 +- .../JavaScriptCore/runtime/ArrayConstructor.h | 2 +- .../JavaScriptCore/runtime/ArrayPrototype.cpp | 17 +- .../JavaScriptCore/runtime/ArrayPrototype.h | 2 +- .../runtime/BatchedTransitionOptimizer.h | 2 +- .../JavaScriptCore/runtime/BooleanConstructor.cpp | 2 +- .../JavaScriptCore/runtime/BooleanConstructor.h | 2 +- .../JavaScriptCore/runtime/BooleanObject.cpp | 2 +- .../JavaScriptCore/runtime/BooleanObject.h | 4 +- .../JavaScriptCore/runtime/BooleanPrototype.cpp | 2 +- .../JavaScriptCore/runtime/BooleanPrototype.h | 2 +- .../JavaScriptCore/runtime/CallData.h | 4 +- .../JavaScriptCore/runtime/Collector.cpp | 808 +- .../JavaScriptCore/runtime/Collector.h | 153 +- .../JavaScriptCore/runtime/CollectorHeapIterator.h | 126 +- .../JavaScriptCore/runtime/CommonIdentifiers.h | 1 + .../JavaScriptCore/runtime/Completion.cpp | 17 +- .../JavaScriptCore/runtime/ConstructData.cpp | 7 +- .../JavaScriptCore/runtime/ConstructData.h | 2 +- .../JavaScriptCore/runtime/DateConstructor.cpp | 28 +- .../JavaScriptCore/runtime/DateConstructor.h | 2 +- .../JavaScriptCore/runtime/DateConversion.cpp | 59 +- .../JavaScriptCore/runtime/DateConversion.h | 19 +- .../JavaScriptCore/runtime/DateInstance.cpp | 91 +- .../JavaScriptCore/runtime/DateInstance.h | 42 +- .../JavaScriptCore/runtime/DateInstanceCache.h | 94 + .../JavaScriptCore/runtime/DatePrototype.cpp | 379 +- .../JavaScriptCore/runtime/DatePrototype.h | 8 +- .../JavaScriptCore/runtime/ErrorConstructor.cpp | 2 +- .../JavaScriptCore/runtime/ErrorConstructor.h | 2 +- .../JavaScriptCore/runtime/ErrorInstance.cpp | 2 +- .../JavaScriptCore/runtime/ErrorInstance.h | 2 +- .../JavaScriptCore/runtime/ErrorPrototype.cpp | 24 +- .../JavaScriptCore/runtime/ErrorPrototype.h | 2 +- .../JavaScriptCore/runtime/ExceptionHelpers.cpp | 74 +- .../JavaScriptCore/runtime/ExceptionHelpers.h | 1 + .../JavaScriptCore/runtime/Executable.cpp | 12 +- .../JavaScriptCore/runtime/Executable.h | 24 +- .../JavaScriptCore/runtime/FunctionConstructor.cpp | 26 +- .../JavaScriptCore/runtime/FunctionConstructor.h | 2 +- .../JavaScriptCore/runtime/FunctionPrototype.cpp | 8 +- .../JavaScriptCore/runtime/FunctionPrototype.h | 4 +- .../JavaScriptCore/runtime/GetterSetter.h | 2 +- .../JavaScriptCore/runtime/GlobalEvalFunction.cpp | 2 +- .../JavaScriptCore/runtime/GlobalEvalFunction.h | 7 +- .../JavaScriptCore/runtime/Identifier.cpp | 72 +- .../JavaScriptCore/runtime/Identifier.h | 66 +- .../JavaScriptCore/runtime/InitializeThreading.cpp | 7 +- .../JavaScriptCore/runtime/InternalFunction.cpp | 20 +- .../JavaScriptCore/runtime/InternalFunction.h | 14 +- .../JavaScriptCore/runtime/JSAPIValueWrapper.h | 2 +- .../JavaScriptCore/runtime/JSActivation.cpp | 6 +- .../JavaScriptCore/runtime/JSActivation.h | 11 +- .../JavaScriptCore/runtime/JSArray.cpp | 74 +- .../JavaScriptCore/runtime/JSArray.h | 23 +- .../JavaScriptCore/runtime/JSByteArray.cpp | 18 +- .../JavaScriptCore/runtime/JSByteArray.h | 13 +- .../JavaScriptCore/runtime/JSCell.cpp | 29 +- .../javascriptcore/JavaScriptCore/runtime/JSCell.h | 67 +- .../JavaScriptCore/runtime/JSFunction.cpp | 25 +- .../JavaScriptCore/runtime/JSFunction.h | 24 +- .../JavaScriptCore/runtime/JSGlobalData.cpp | 82 +- .../JavaScriptCore/runtime/JSGlobalData.h | 56 +- .../JavaScriptCore/runtime/JSGlobalObject.cpp | 32 +- .../JavaScriptCore/runtime/JSGlobalObject.h | 78 +- .../runtime/JSGlobalObjectFunctions.cpp | 46 +- .../JavaScriptCore/runtime/JSNotAnObject.cpp | 2 +- .../JavaScriptCore/runtime/JSNotAnObject.h | 7 +- .../JavaScriptCore/runtime/JSNumberCell.h | 20 +- .../JavaScriptCore/runtime/JSONObject.cpp | 19 +- .../JavaScriptCore/runtime/JSONObject.h | 7 +- .../JavaScriptCore/runtime/JSObject.cpp | 93 +- .../JavaScriptCore/runtime/JSObject.h | 44 +- .../runtime/JSPropertyNameIterator.cpp | 54 +- .../runtime/JSPropertyNameIterator.h | 94 +- .../JavaScriptCore/runtime/JSStaticScopeObject.h | 5 +- .../JavaScriptCore/runtime/JSString.cpp | 191 +- .../JavaScriptCore/runtime/JSString.h | 377 +- .../JavaScriptCore/runtime/JSTypeInfo.h | 12 +- .../JavaScriptCore/runtime/JSValue.h | 52 +- .../JavaScriptCore/runtime/JSVariableObject.cpp | 20 +- .../JavaScriptCore/runtime/JSVariableObject.h | 11 +- .../JavaScriptCore/runtime/JSWrapperObject.h | 6 +- .../JavaScriptCore/runtime/JSZombie.cpp | 48 + .../JavaScriptCore/runtime/JSZombie.h | 78 + .../JavaScriptCore/runtime/LiteralParser.cpp | 24 +- .../JavaScriptCore/runtime/Lookup.cpp | 2 +- .../javascriptcore/JavaScriptCore/runtime/Lookup.h | 2 +- .../JavaScriptCore/runtime/MarkStack.h | 4 +- .../JavaScriptCore/runtime/MarkStackNone.cpp | 49 + .../JavaScriptCore/runtime/MarkStackPosix.cpp | 28 +- .../JavaScriptCore/runtime/MarkStackSymbian.cpp | 48 + .../JavaScriptCore/runtime/MarkStackWin.cpp | 6 +- .../JavaScriptCore/runtime/MathObject.cpp | 25 +- .../JavaScriptCore/runtime/MathObject.h | 7 +- .../runtime/NativeErrorConstructor.cpp | 4 +- .../runtime/NativeErrorConstructor.h | 2 +- .../runtime/NativeErrorPrototype.cpp | 2 +- .../JavaScriptCore/runtime/NativeErrorPrototype.h | 2 +- .../JavaScriptCore/runtime/NumberConstructor.cpp | 2 +- .../JavaScriptCore/runtime/NumberConstructor.h | 7 +- .../JavaScriptCore/runtime/NumberObject.cpp | 2 +- .../JavaScriptCore/runtime/NumberObject.h | 16 +- .../JavaScriptCore/runtime/NumberPrototype.cpp | 54 +- .../JavaScriptCore/runtime/NumberPrototype.h | 2 +- .../JavaScriptCore/runtime/ObjectConstructor.cpp | 31 +- .../JavaScriptCore/runtime/ObjectConstructor.h | 2 +- .../JavaScriptCore/runtime/ObjectPrototype.cpp | 4 +- .../JavaScriptCore/runtime/ObjectPrototype.h | 2 +- .../JavaScriptCore/runtime/Operations.cpp | 19 +- .../JavaScriptCore/runtime/Operations.h | 260 +- .../JavaScriptCore/runtime/PropertyDescriptor.cpp | 8 +- .../JavaScriptCore/runtime/PropertyDescriptor.h | 2 +- .../JavaScriptCore/runtime/PropertyNameArray.cpp | 7 +- .../JavaScriptCore/runtime/PropertyNameArray.h | 36 +- .../JavaScriptCore/runtime/Protect.h | 2 +- .../JavaScriptCore/runtime/PrototypeFunction.cpp | 2 +- .../JavaScriptCore/runtime/PrototypeFunction.h | 2 +- .../JavaScriptCore/runtime/RegExp.cpp | 1 - .../javascriptcore/JavaScriptCore/runtime/RegExp.h | 2 - .../JavaScriptCore/runtime/RegExpConstructor.cpp | 52 +- .../JavaScriptCore/runtime/RegExpConstructor.h | 54 +- .../JavaScriptCore/runtime/RegExpMatchesArray.h | 12 +- .../JavaScriptCore/runtime/RegExpObject.cpp | 6 +- .../JavaScriptCore/runtime/RegExpObject.h | 9 +- .../JavaScriptCore/runtime/RegExpPrototype.cpp | 22 +- .../JavaScriptCore/runtime/RegExpPrototype.h | 2 +- .../JavaScriptCore/runtime/ScopeChain.cpp | 4 +- .../JavaScriptCore/runtime/ScopeChain.h | 17 +- .../JavaScriptCore/runtime/SmallStrings.cpp | 22 +- .../JavaScriptCore/runtime/StringBuilder.h | 81 + .../JavaScriptCore/runtime/StringConstructor.cpp | 14 +- .../JavaScriptCore/runtime/StringConstructor.h | 2 +- .../JavaScriptCore/runtime/StringObject.cpp | 18 +- .../JavaScriptCore/runtime/StringObject.h | 13 +- .../StringObjectThatMasqueradesAsUndefined.h | 6 +- .../JavaScriptCore/runtime/StringPrototype.cpp | 171 +- .../JavaScriptCore/runtime/StringPrototype.h | 2 +- .../JavaScriptCore/runtime/Structure.cpp | 220 +- .../JavaScriptCore/runtime/Structure.h | 49 +- .../JavaScriptCore/runtime/StructureChain.cpp | 17 +- .../JavaScriptCore/runtime/StructureChain.h | 7 +- .../runtime/StructureTransitionTable.h | 2 +- .../JavaScriptCore/runtime/TimeoutChecker.cpp | 8 +- .../JavaScriptCore/runtime/Tracing.h | 2 +- .../JavaScriptCore/runtime/UString.cpp | 1012 +-- .../JavaScriptCore/runtime/UString.h | 594 +- .../JavaScriptCore/runtime/UStringImpl.cpp | 82 + .../JavaScriptCore/runtime/UStringImpl.h | 313 + .../JavaScriptCore/runtime/WeakGCMap.h | 122 + .../JavaScriptCore/runtime/WeakGCPtr.h | 128 + .../JavaScriptCore/runtime/WeakRandom.h | 86 + .../javascriptcore/JavaScriptCore/wrec/WREC.h | 2 +- .../JavaScriptCore/wrec/WRECGenerator.cpp | 6 +- .../JavaScriptCore/wrec/WRECGenerator.h | 4 +- src/3rdparty/javascriptcore/JavaScriptCore/wscript | 4 +- .../JavaScriptCore/wtf/AlwaysInline.h | 2 +- .../JavaScriptCore/wtf/Assertions.cpp | 10 +- .../javascriptcore/JavaScriptCore/wtf/Assertions.h | 112 +- .../JavaScriptCore/wtf/CrossThreadRefCounted.h | 14 +- .../JavaScriptCore/wtf/CurrentTime.cpp | 12 +- .../JavaScriptCore/wtf/CurrentTime.h | 23 +- .../javascriptcore/JavaScriptCore/wtf/DateMath.cpp | 362 +- .../javascriptcore/JavaScriptCore/wtf/DateMath.h | 65 +- .../JavaScriptCore/wtf/FastMalloc.cpp | 142 +- .../javascriptcore/JavaScriptCore/wtf/FastMalloc.h | 21 +- .../javascriptcore/JavaScriptCore/wtf/GOwnPtr.cpp | 65 - .../javascriptcore/JavaScriptCore/wtf/GOwnPtr.h | 98 - .../JavaScriptCore/wtf/HashCountedSet.h | 10 +- .../JavaScriptCore/wtf/HashFunctions.h | 3 - .../javascriptcore/JavaScriptCore/wtf/HashMap.h | 66 + .../javascriptcore/JavaScriptCore/wtf/HashSet.h | 2 +- .../javascriptcore/JavaScriptCore/wtf/HashTable.h | 2 +- .../JavaScriptCore/wtf/ListHashSet.h | 2 +- .../javascriptcore/JavaScriptCore/wtf/ListRefPtr.h | 3 + .../JavaScriptCore/wtf/MainThread.cpp | 24 +- .../javascriptcore/JavaScriptCore/wtf/MainThread.h | 4 + .../javascriptcore/JavaScriptCore/wtf/MathExtras.h | 20 +- .../JavaScriptCore/wtf/MessageQueue.h | 103 +- .../javascriptcore/JavaScriptCore/wtf/PassRefPtr.h | 94 +- .../javascriptcore/JavaScriptCore/wtf/Platform.h | 899 ++- .../JavaScriptCore/wtf/PtrAndFlags.h | 2 +- .../JavaScriptCore/wtf/RandomNumber.cpp | 10 +- .../JavaScriptCore/wtf/RandomNumberSeed.h | 10 +- .../javascriptcore/JavaScriptCore/wtf/RefPtr.h | 72 +- .../JavaScriptCore/wtf/StdLibExtras.h | 14 + .../JavaScriptCore/wtf/StringExtras.cpp | 62 + .../JavaScriptCore/wtf/StringExtras.h | 19 +- .../JavaScriptCore/wtf/StringHashFunctions.h | 157 + .../javascriptcore/JavaScriptCore/wtf/TCSpinLock.h | 14 +- .../JavaScriptCore/wtf/TCSystemAlloc.cpp | 6 +- .../wtf/ThreadIdentifierDataPthreads.cpp | 97 + .../wtf/ThreadIdentifierDataPthreads.h | 77 + .../JavaScriptCore/wtf/ThreadSpecific.h | 46 +- .../JavaScriptCore/wtf/Threading.cpp | 9 +- .../javascriptcore/JavaScriptCore/wtf/Threading.h | 31 +- .../JavaScriptCore/wtf/ThreadingNone.cpp | 6 +- .../JavaScriptCore/wtf/ThreadingPthreads.cpp | 51 +- .../JavaScriptCore/wtf/ThreadingWin.cpp | 14 +- .../JavaScriptCore/wtf/TypeTraits.cpp | 16 +- .../javascriptcore/JavaScriptCore/wtf/TypeTraits.h | 36 +- .../javascriptcore/JavaScriptCore/wtf/VMTags.h | 6 +- .../javascriptcore/JavaScriptCore/wtf/Vector.h | 40 +- .../JavaScriptCore/wtf/VectorTraits.h | 2 +- .../JavaScriptCore/wtf/android/AndroidThreading.h | 39 + .../wtf/android/MainThreadAndroid.cpp | 42 + .../javascriptcore/JavaScriptCore/wtf/dtoa.cpp | 103 +- .../javascriptcore/JavaScriptCore/wtf/dtoa.h | 12 +- .../JavaScriptCore/wtf/qt/ThreadingQt.cpp | 30 +- .../JavaScriptCore/wtf/unicode/UTF8.cpp | 1 + .../JavaScriptCore/wtf/unicode/Unicode.h | 4 - .../wtf/unicode/glib/UnicodeGLib.cpp | 1 + .../JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h | 7 +- .../JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp | 6 +- .../JavaScriptCore/wtf/unicode/icu/UnicodeIcu.h | 5 + .../JavaScriptCore/wtf/unicode/qt4/UnicodeQt4.h | 136 - .../wtf/unicode/wince/UnicodeWince.cpp | 1 + .../JavaScriptCore/wtf/wince/FastMallocWince.h | 1 - .../JavaScriptCore/wtf/wince/MemoryManager.cpp | 8 +- .../JavaScriptCore/yarr/RegexCompiler.cpp | 2 +- .../JavaScriptCore/yarr/RegexInterpreter.cpp | 8 +- .../JavaScriptCore/yarr/RegexJIT.cpp | 31 +- .../javascriptcore/JavaScriptCore/yarr/RegexJIT.h | 13 +- .../JavaScriptCore/yarr/RegexPattern.h | 2 +- src/3rdparty/javascriptcore/VERSION | 4 +- src/3rdparty/javascriptcore/WebKit.pri | 100 +- src/script/api/qscriptcontextinfo.cpp | 2 +- src/script/api/qscriptengine.cpp | 34 +- src/script/api/qscriptengine_p.h | 18 + src/script/api/qscriptengineagent.cpp | 10 +- src/script/api/qscriptengineagent_p.h | 7 +- src/script/api/qscriptvalue.cpp | 11 +- src/script/api/qscriptvalueiterator.cpp | 3 +- src/script/bridge/qscriptactivationobject.cpp | 18 +- src/script/bridge/qscriptactivationobject_p.h | 6 +- src/script/bridge/qscriptclassobject.cpp | 82 +- src/script/bridge/qscriptclassobject_p.h | 11 +- src/script/bridge/qscriptdeclarativeclass.cpp | 10 +- src/script/bridge/qscriptdeclarativeclass_p.h | 3 +- src/script/bridge/qscriptdeclarativeobject.cpp | 38 +- src/script/bridge/qscriptdeclarativeobject_p.h | 8 +- src/script/bridge/qscriptglobalobject.cpp | 38 +- src/script/bridge/qscriptglobalobject_p.h | 25 +- src/script/bridge/qscriptobject.cpp | 38 +- src/script/bridge/qscriptobject_p.h | 18 +- src/script/bridge/qscriptqobject.cpp | 156 +- src/script/bridge/qscriptqobject_p.h | 22 +- src/script/bridge/qscriptvariant.cpp | 7 +- src/script/script.pro | 5 + tests/auto/qscriptclass/tst_qscriptclass.cpp | 1 + .../qscriptengineagent/tst_qscriptengineagent.cpp | 24 + tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 8 +- .../tst_qscriptvalueiterator.cpp | 22 +- util/webkit/mkdist-javascriptcore | 7 +- 364 files changed, 22214 insertions(+), 9448 deletions(-) create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/API/APIShims.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/API/JSContextRefPrivate.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/NodesCodegen.cpp create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/generated/GeneratedJITStubs_RVCT.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/os-win32/WinMain.cpp delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/profiler/HeavyProfile.cpp delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/profiler/HeavyProfile.h delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/profiler/TreeProfile.cpp delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/profiler/TreeProfile.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateInstanceCache.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSZombie.cpp create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSZombie.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/MarkStackNone.cpp create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/MarkStackSymbian.cpp create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/StringBuilder.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/UStringImpl.cpp create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/UStringImpl.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/WeakGCMap.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/WeakGCPtr.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/runtime/WeakRandom.h delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/GOwnPtr.cpp delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/GOwnPtr.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/StringExtras.cpp create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/StringHashFunctions.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/ThreadIdentifierDataPthreads.cpp create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/ThreadIdentifierDataPthreads.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/android/AndroidThreading.h create mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/android/MainThreadAndroid.cpp diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h index b6d1532..4284c44 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h @@ -27,6 +27,7 @@ #define APICast_h #include "JSAPIValueWrapper.h" +#include "JSGlobalObject.h" #include "JSValue.h" #include #include @@ -50,16 +51,20 @@ typedef struct OpaqueJSValue* JSObjectRef; inline JSC::ExecState* toJS(JSContextRef c) { + ASSERT(c); return reinterpret_cast(const_cast(c)); } inline JSC::ExecState* toJS(JSGlobalContextRef c) { + ASSERT(c); return reinterpret_cast(c); } -inline JSC::JSValue toJS(JSC::ExecState*, JSValueRef v) +inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v) { + ASSERT_UNUSED(exec, exec); + ASSERT(v); #if USE(JSVALUE32_64) JSC::JSCell* jsCell = reinterpret_cast(const_cast(v)); if (!jsCell) @@ -72,6 +77,20 @@ inline JSC::JSValue toJS(JSC::ExecState*, JSValueRef v) #endif } +inline JSC::JSValue toJSForGC(JSC::ExecState* exec, JSValueRef v) +{ + ASSERT_UNUSED(exec, exec); + ASSERT(v); +#if USE(JSVALUE32_64) + JSC::JSCell* jsCell = reinterpret_cast(const_cast(v)); + if (!jsCell) + return JSC::JSValue(); + return jsCell; +#else + return JSC::JSValue::decode(reinterpret_cast(const_cast(v))); +#endif +} + inline JSC::JSObject* toJS(JSObjectRef o) { return reinterpret_cast(o); @@ -118,6 +137,7 @@ inline JSContextRef toRef(JSC::ExecState* e) inline JSGlobalContextRef toGlobalRef(JSC::ExecState* e) { + ASSERT(e == e->lexicalGlobalObject()->globalExec()); return reinterpret_cast(e); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/APIShims.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/APIShims.h new file mode 100644 index 0000000..f809d5d --- /dev/null +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/APIShims.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef APIShims_h +#define APIShims_h + +#include "CallFrame.h" +#include "JSLock.h" + +namespace JSC { + +class APIEntryShimWithoutLock { +protected: + APIEntryShimWithoutLock(JSGlobalData* globalData, bool registerThread) + : m_globalData(globalData) + , m_entryIdentifierTable(setCurrentIdentifierTable(globalData->identifierTable)) + { + if (registerThread) + globalData->heap.registerThread(); + m_globalData->timeoutChecker->start(); + } + + ~APIEntryShimWithoutLock() + { + m_globalData->timeoutChecker->stop(); + setCurrentIdentifierTable(m_entryIdentifierTable); + } + +private: + JSGlobalData* m_globalData; + IdentifierTable* m_entryIdentifierTable; +}; + +class APIEntryShim : public APIEntryShimWithoutLock { +public: + // Normal API entry + APIEntryShim(ExecState* exec, bool registerThread = true) + : APIEntryShimWithoutLock(&exec->globalData(), registerThread) + , m_lock(exec) + { + } + + // JSPropertyNameAccumulator only has a globalData. + APIEntryShim(JSGlobalData* globalData, bool registerThread = true) + : APIEntryShimWithoutLock(globalData, registerThread) + , m_lock(globalData->isSharedInstance ? LockForReal : SilenceAssertionsOnly) + { + } + +private: + JSLock m_lock; +}; + +class APICallbackShim { +public: + APICallbackShim(ExecState* exec) + : m_dropAllLocks(exec) + , m_globalData(&exec->globalData()) + { + resetCurrentIdentifierTable(); + m_globalData->timeoutChecker->start(); + } + + ~APICallbackShim() + { + m_globalData->timeoutChecker->stop(); + setCurrentIdentifierTable(m_globalData->identifierTable); + } + +private: + JSLock::DropAllLocks m_dropAllLocks; + JSGlobalData* m_globalData; +}; + +} + +#endif diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSBase.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSBase.cpp index 4a32d35..ebfeafa 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSBase.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSBase.cpp @@ -28,6 +28,7 @@ #include "JSBasePrivate.h" #include "APICast.h" +#include "APIShims.h" #include "Completion.h" #include "OpaqueJSString.h" #include "SourceCode.h" @@ -43,8 +44,7 @@ using namespace JSC; JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsThisObject = toJS(thisObject); @@ -69,8 +69,7 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th bool JSCheckScriptSyntax(JSContextRef ctx, JSStringRef script, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), startingLineNumber); Completion completion = checkSyntax(exec->dynamicGlobalObject()->globalExec(), source); @@ -94,12 +93,11 @@ void JSGarbageCollect(JSContextRef ctx) return; ExecState* exec = toJS(ctx); - JSGlobalData& globalData = exec->globalData(); - - JSLock lock(globalData.isSharedInstance ? LockForReal : SilenceAssertionsOnly); + APIEntryShim entryShim(exec, false); + JSGlobalData& globalData = exec->globalData(); if (!globalData.heap.isBusy()) - globalData.heap.collect(); + globalData.heap.collectAllGarbage(); // FIXME: Perhaps we should trigger a second mark and sweep // once the garbage collector is done if this is called when @@ -109,8 +107,6 @@ void JSGarbageCollect(JSContextRef ctx) void JSReportExtraMemoryCost(JSContextRef ctx, size_t size) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); - + APIEntryShim entryShim(exec); exec->globalData().heap.reportExtraMemoryCost(size); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSBase.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSBase.h index 0a0dcda..2e16720 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSBase.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSBase.h @@ -64,33 +64,20 @@ typedef struct OpaqueJSValue* JSObjectRef; /* JavaScript symbol exports */ -#if !defined(JS_EXPORT) -#if defined(BUILDING_WX__) +#undef JS_EXPORT +#if defined(JS_NO_EXPORT) #define JS_EXPORT #elif defined(__GNUC__) && !defined(__CC_ARM) && !defined(__ARMCC__) #define JS_EXPORT __attribute__((visibility("default"))) -#elif defined(_WIN32_WCE) - #if defined(JS_BUILDING_JS) - #define JS_EXPORT __declspec(dllexport) - #elif defined(JS_IMPORT_JS) - #define JS_EXPORT __declspec(dllimport) - #else - #define JS_EXPORT - #endif -#elif defined(WIN32) || defined(_WIN32) - /* - * TODO: Export symbols with JS_EXPORT when using MSVC. - * See http://bugs.webkit.org/show_bug.cgi?id=16227 - */ +#elif defined(WIN32) || defined(_WIN32) || defined(_WIN32_WCE) #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF) - #define JS_EXPORT __declspec(dllexport) + #define JS_EXPORT __declspec(dllexport) #else - #define JS_EXPORT __declspec(dllimport) + #define JS_EXPORT __declspec(dllimport) #endif #else #define JS_EXPORT #endif -#endif #ifdef __cplusplus extern "C" { diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.cpp index 64c83cb..9c5f6d7 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.cpp @@ -26,6 +26,7 @@ #include "config.h" #include "JSCallbackConstructor.h" +#include "APIShims.h" #include "APICast.h" #include #include @@ -36,7 +37,7 @@ namespace JSC { const ClassInfo JSCallbackConstructor::info = { "CallbackConstructor", 0, 0, 0 }; -JSCallbackConstructor::JSCallbackConstructor(PassRefPtr structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) +JSCallbackConstructor::JSCallbackConstructor(NonNullPassRefPtr structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) : JSObject(structure) , m_class(jsClass) , m_callback(callback) @@ -66,7 +67,7 @@ static JSObject* constructJSCallback(ExecState* exec, JSObject* constructor, con JSValueRef exception = 0; JSObjectRef result; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); result = callback(ctx, constructorRef, argumentCount, arguments.data(), &exception); } if (exception) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.h index 0497aa2..c4bd7ad 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.h @@ -33,7 +33,7 @@ namespace JSC { class JSCallbackConstructor : public JSObject { public: - JSCallbackConstructor(PassRefPtr, JSClassRef, JSObjectCallAsConstructorCallback); + JSCallbackConstructor(NonNullPassRefPtr, JSClassRef, JSObjectCallAsConstructorCallback); virtual ~JSCallbackConstructor(); JSClassRef classRef() const { return m_class; } JSObjectCallAsConstructorCallback callback() const { return m_callback; } @@ -41,9 +41,12 @@ public: static PassRefPtr createStructure(JSValue proto) { - return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | HasStandardGetOwnPropertySlot | HasDefaultMark | HasDefaultGetPropertyNames)); + return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); } +protected: + static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags; + private: virtual ConstructType getConstructData(ConstructData&); virtual const ClassInfo* classInfo() const { return &info; } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.cpp index b7dd768..0e434d9 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.cpp @@ -27,6 +27,7 @@ #include #include "JSCallbackFunction.h" +#include "APIShims.h" #include "APICast.h" #include "CodeBlock.h" #include "JSFunction.h" @@ -61,7 +62,7 @@ JSValue JSCallbackFunction::call(ExecState* exec, JSObject* functionObject, JSVa JSValueRef exception = 0; JSValueRef result; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); result = static_cast(functionObject)->m_callback(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception); } if (exception) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.h index 3a17fa2..0cf25c4 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackFunction.h @@ -41,7 +41,7 @@ public: // refactor the code so this override isn't necessary static PassRefPtr createStructure(JSValue proto) { - return Structure::create(proto, TypeInfo(ObjectType, HasStandardGetOwnPropertySlot | HasDefaultMark)); + return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); } private: diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObject.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObject.h index e767cb5..2e25991 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObject.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObject.h @@ -36,7 +36,7 @@ namespace JSC { template class JSCallbackObject : public Base { public: - JSCallbackObject(ExecState*, PassRefPtr, JSClassRef, void* data); + JSCallbackObject(ExecState*, NonNullPassRefPtr, JSClassRef, void* data); JSCallbackObject(JSClassRef); virtual ~JSCallbackObject(); @@ -50,23 +50,27 @@ public: static PassRefPtr createStructure(JSValue proto) { - return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | OverridesHasInstance)); + return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); } +protected: + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesHasInstance | OverridesMarkChildren | OverridesGetPropertyNames | Base::StructureFlags; + private: virtual UString className() const; virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&); + virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&); - virtual bool deleteProperty(ExecState*, const Identifier&, bool checkDontDelete = true); - virtual bool deleteProperty(ExecState*, unsigned, bool checkDontDelete = true); + virtual bool deleteProperty(ExecState*, const Identifier&); + virtual bool deleteProperty(ExecState*, unsigned); virtual bool hasInstance(ExecState* exec, JSValue value, JSValue proto); - virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, bool includeNonEnumerable = false); + virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); virtual double toNumber(ExecState*) const; virtual UString toString(ExecState*) const; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObjectFunctions.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObjectFunctions.h index c84c191..4b28a99 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObjectFunctions.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackObjectFunctions.h @@ -24,6 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "APIShims.h" #include "APICast.h" #include "Error.h" #include "JSCallbackFunction.h" @@ -47,7 +48,7 @@ inline JSCallbackObject* JSCallbackObject::asCallbackObject(JSValue } template -JSCallbackObject::JSCallbackObject(ExecState* exec, PassRefPtr structure, JSClassRef jsClass, void* data) +JSCallbackObject::JSCallbackObject(ExecState* exec, NonNullPassRefPtr structure, JSClassRef jsClass, void* data) : Base(structure) , m_callbackObjectData(new JSCallbackObjectData(data, jsClass)) { @@ -79,7 +80,7 @@ void JSCallbackObject::init(ExecState* exec) // initialize from base to derived for (int i = static_cast(initRoutines.size()) - 1; i >= 0; i--) { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); JSObjectInitializeCallback initialize = initRoutines[i]; initialize(toRef(exec), toRef(this)); } @@ -117,7 +118,7 @@ bool JSCallbackObject::getOwnPropertySlot(ExecState* exec, const Identifie if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) { if (!propertyNameRef) propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); if (hasProperty(ctx, thisRef, propertyNameRef.get())) { slot.setCustom(this, callbackGetter); return true; @@ -128,18 +129,18 @@ bool JSCallbackObject::getOwnPropertySlot(ExecState* exec, const Identifie JSValueRef exception = 0; JSValueRef value; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); value = getProperty(ctx, thisRef, propertyNameRef.get(), &exception); } - exec->setException(toJS(exec, exception)); - if (value) { - slot.setValue(toJS(exec, value)); - return true; - } if (exception) { + exec->setException(toJS(exec, exception)); slot.setValue(jsUndefined()); return true; } + if (value) { + slot.setValue(toJS(exec, value)); + return true; + } } if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { @@ -167,6 +168,25 @@ bool JSCallbackObject::getOwnPropertySlot(ExecState* exec, unsigned proper } template +bool JSCallbackObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +{ + PropertySlot slot; + if (getOwnPropertySlot(exec, propertyName, slot)) { + // Ideally we should return an access descriptor, but returning a value descriptor is better than nothing. + JSValue value = slot.getValue(exec, propertyName); + if (!exec->hadException()) + descriptor.setValue(value); + // We don't know whether the property is configurable, but assume it is. + descriptor.setConfigurable(true); + // We don't know whether the property is enumerable (we could call getOwnPropertyNames() to find out), but assume it isn't. + descriptor.setEnumerable(false); + return true; + } + + return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor); +} + +template void JSCallbackObject::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { JSContextRef ctx = toRef(exec); @@ -181,10 +201,11 @@ void JSCallbackObject::put(ExecState* exec, const Identifier& propertyName JSValueRef exception = 0; bool result; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); } - exec->setException(toJS(exec, exception)); + if (exception) + exec->setException(toJS(exec, exception)); if (result || exception) return; } @@ -199,10 +220,11 @@ void JSCallbackObject::put(ExecState* exec, const Identifier& propertyName JSValueRef exception = 0; bool result; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); } - exec->setException(toJS(exec, exception)); + if (exception) + exec->setException(toJS(exec, exception)); if (result || exception) return; } else @@ -224,7 +246,7 @@ void JSCallbackObject::put(ExecState* exec, const Identifier& propertyName } template -bool JSCallbackObject::deleteProperty(ExecState* exec, const Identifier& propertyName, bool checkDontDelete) +bool JSCallbackObject::deleteProperty(ExecState* exec, const Identifier& propertyName) { JSContextRef ctx = toRef(exec); JSObjectRef thisRef = toRef(this); @@ -237,10 +259,11 @@ bool JSCallbackObject::deleteProperty(ExecState* exec, const Identifier& p JSValueRef exception = 0; bool result; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); result = deleteProperty(ctx, thisRef, propertyNameRef.get(), &exception); } - exec->setException(toJS(exec, exception)); + if (exception) + exec->setException(toJS(exec, exception)); if (result || exception) return true; } @@ -262,13 +285,13 @@ bool JSCallbackObject::deleteProperty(ExecState* exec, const Identifier& p } } - return Base::deleteProperty(exec, propertyName, checkDontDelete); + return Base::deleteProperty(exec, propertyName); } template -bool JSCallbackObject::deleteProperty(ExecState* exec, unsigned propertyName, bool checkDontDelete) +bool JSCallbackObject::deleteProperty(ExecState* exec, unsigned propertyName) { - return deleteProperty(exec, Identifier::from(exec, propertyName), checkDontDelete); + return deleteProperty(exec, Identifier::from(exec, propertyName)); } template @@ -298,10 +321,11 @@ JSObject* JSCallbackObject::construct(ExecState* exec, JSObject* construct JSValueRef exception = 0; JSObject* result; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); result = toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), &exception)); } - exec->setException(toJS(exec, exception)); + if (exception) + exec->setException(toJS(exec, exception)); return result; } } @@ -322,10 +346,11 @@ bool JSCallbackObject::hasInstance(ExecState* exec, JSValue value, JSValue JSValueRef exception = 0; bool result; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); result = hasInstance(execRef, thisRef, valueRef, &exception); } - exec->setException(toJS(exec, exception)); + if (exception) + exec->setException(toJS(exec, exception)); return result; } } @@ -360,10 +385,11 @@ JSValue JSCallbackObject::call(ExecState* exec, JSObject* functionObject, JSValueRef exception = 0; JSValue result; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); result = toJS(exec, callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception)); } - exec->setException(toJS(exec, exception)); + if (exception) + exec->setException(toJS(exec, exception)); return result; } } @@ -373,14 +399,14 @@ JSValue JSCallbackObject::call(ExecState* exec, JSObject* functionObject, } template -void JSCallbackObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, bool includeNonEnumerable) +void JSCallbackObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { JSContextRef execRef = toRef(exec); JSObjectRef thisRef = toRef(this); for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); getPropertyNames(execRef, thisRef, toRef(&propertyNames)); } @@ -390,7 +416,7 @@ void JSCallbackObject::getOwnPropertyNames(ExecState* exec, PropertyNameAr for (iterator it = staticValues->begin(); it != end; ++it) { UString::Rep* name = it->first.get(); StaticValueEntry* entry = it->second; - if (entry->getProperty && !(entry->attributes & kJSPropertyAttributeDontEnum)) + if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties))) propertyNames.add(Identifier(exec, name)); } } @@ -401,13 +427,13 @@ void JSCallbackObject::getOwnPropertyNames(ExecState* exec, PropertyNameAr for (iterator it = staticFunctions->begin(); it != end; ++it) { UString::Rep* name = it->first.get(); StaticFunctionEntry* entry = it->second; - if (!(entry->attributes & kJSPropertyAttributeDontEnum)) + if (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties)) propertyNames.add(Identifier(exec, name)); } } } - Base::getOwnPropertyNames(exec, propertyNames, includeNonEnumerable); + Base::getOwnPropertyNames(exec, propertyNames, mode); } template @@ -426,7 +452,7 @@ double JSCallbackObject::toNumber(ExecState* exec) const JSValueRef exception = 0; JSValueRef value; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); value = convertToType(ctx, thisRef, kJSTypeNumber, &exception); } if (exception) { @@ -435,7 +461,8 @@ double JSCallbackObject::toNumber(ExecState* exec) const } double dValue; - return toJS(exec, value).getNumber(dValue) ? dValue : NaN; + if (value) + return toJS(exec, value).getNumber(dValue) ? dValue : NaN; } return Base::toNumber(exec); @@ -452,14 +479,15 @@ UString JSCallbackObject::toString(ExecState* exec) const JSValueRef exception = 0; JSValueRef value; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); value = convertToType(ctx, thisRef, kJSTypeString, &exception); } if (exception) { exec->setException(toJS(exec, exception)); return ""; } - return toJS(exec, value).getString(); + if (value) + return toJS(exec, value).getString(exec); } return Base::toString(exec); @@ -504,16 +532,17 @@ JSValue JSCallbackObject::staticValueGetter(ExecState* exec, const Identif JSValueRef exception = 0; JSValueRef value; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); } - exec->setException(toJS(exec, exception)); + if (exception) { + exec->setException(toJS(exec, exception)); + return jsUndefined(); + } if (value) return toJS(exec, value); - if (exception) - return jsUndefined(); } - + return throwError(exec, ReferenceError, "Static value property defined with NULL getProperty callback."); } @@ -557,14 +586,15 @@ JSValue JSCallbackObject::callbackGetter(ExecState* exec, const Identifier JSValueRef exception = 0; JSValueRef value; { - JSLock::DropAllLocks dropAllLocks(exec); + APICallbackShim callbackShim(exec); value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); } - exec->setException(toJS(exec, exception)); + if (exception) { + exec->setException(toJS(exec, exception)); + return jsUndefined(); + } if (value) return toJS(exec, value); - if (exception) - return jsUndefined(); } return throwError(exec, ReferenceError, "hasProperty callback returned true for a property that doesn't exist."); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.cpp index afde7ce..c6685bf 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.cpp @@ -34,6 +34,7 @@ #include #include +using namespace std; using namespace JSC; const JSClassDefinition kJSClassDefinitionEmpty = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -52,7 +53,7 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* , callAsConstructor(definition->callAsConstructor) , hasInstance(definition->hasInstance) , convertToType(definition->convertToType) - , m_className(UString::Rep::createFromUTF8(definition->className)) + , m_className(UString::createFromUTF8(definition->className).rep()->ref()) , m_staticValues(0) , m_staticFunctions(0) { @@ -61,8 +62,9 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* if (const JSStaticValue* staticValue = definition->staticValues) { m_staticValues = new OpaqueJSClassStaticValuesTable(); while (staticValue->name) { - m_staticValues->add(UString::Rep::createFromUTF8(staticValue->name), - new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes)); + // Use a local variable here to sidestep an RVCT compiler bug. + StaticValueEntry* entry = new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes); + m_staticValues->add(UString::createFromUTF8(staticValue->name).rep()->ref(), entry); ++staticValue; } } @@ -70,8 +72,9 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* if (const JSStaticFunction* staticFunction = definition->staticFunctions) { m_staticFunctions = new OpaqueJSClassStaticFunctionsTable(); while (staticFunction->name) { - m_staticFunctions->add(UString::Rep::createFromUTF8(staticFunction->name), - new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes)); + // Use a local variable here to sidestep an RVCT compiler bug. + StaticFunctionEntry* entry = new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes); + m_staticFunctions->add(UString::createFromUTF8(staticFunction->name).rep()->ref(), entry); ++staticFunction; } } @@ -82,12 +85,12 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* OpaqueJSClass::~OpaqueJSClass() { - ASSERT(!m_className.rep()->identifierTable()); + ASSERT(!m_className.rep()->isIdentifier()); if (m_staticValues) { OpaqueJSClassStaticValuesTable::const_iterator end = m_staticValues->end(); for (OpaqueJSClassStaticValuesTable::const_iterator it = m_staticValues->begin(); it != end; ++it) { - ASSERT(!it->first->identifierTable()); + ASSERT(!it->first->isIdentifier()); delete it->second; } delete m_staticValues; @@ -96,7 +99,7 @@ OpaqueJSClass::~OpaqueJSClass() if (m_staticFunctions) { OpaqueJSClassStaticFunctionsTable::const_iterator end = m_staticFunctions->end(); for (OpaqueJSClassStaticFunctionsTable::const_iterator it = m_staticFunctions->begin(); it != end; ++it) { - ASSERT(!it->first->identifierTable()); + ASSERT(!it->first->isIdentifier()); delete it->second; } delete m_staticFunctions; @@ -118,39 +121,32 @@ static void clearReferenceToPrototype(JSObjectRef prototype) jsClassData->cachedPrototype = 0; } -PassRefPtr OpaqueJSClass::create(const JSClassDefinition* definition) +PassRefPtr OpaqueJSClass::create(const JSClassDefinition* clientDefinition) { - if (const JSStaticFunction* staticFunctions = definition->staticFunctions) { - // copy functions into a prototype class - JSClassDefinition protoDefinition = kJSClassDefinitionEmpty; - protoDefinition.staticFunctions = staticFunctions; - protoDefinition.finalize = clearReferenceToPrototype; - - // We are supposed to use JSClassRetain/Release but since we know that we currently have - // the only reference to this class object we cheat and use a RefPtr instead. - RefPtr protoClass = adoptRef(new OpaqueJSClass(&protoDefinition, 0)); - - // remove functions from the original class - JSClassDefinition objectDefinition = *definition; - objectDefinition.staticFunctions = 0; - - return adoptRef(new OpaqueJSClass(&objectDefinition, protoClass.get())); - } + JSClassDefinition definition = *clientDefinition; // Avoid modifying client copy. - return adoptRef(new OpaqueJSClass(definition, 0)); + JSClassDefinition protoDefinition = kJSClassDefinitionEmpty; + protoDefinition.finalize = clearReferenceToPrototype; + swap(definition.staticFunctions, protoDefinition.staticFunctions); // Move static functions to the prototype. + + // We are supposed to use JSClassRetain/Release but since we know that we currently have + // the only reference to this class object we cheat and use a RefPtr instead. + RefPtr protoClass = adoptRef(new OpaqueJSClass(&protoDefinition, 0)); + return adoptRef(new OpaqueJSClass(&definition, protoClass.get())); } OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass) : m_class(jsClass) - , cachedPrototype(0) { if (jsClass->m_staticValues) { staticValues = new OpaqueJSClassStaticValuesTable; OpaqueJSClassStaticValuesTable::const_iterator end = jsClass->m_staticValues->end(); for (OpaqueJSClassStaticValuesTable::const_iterator it = jsClass->m_staticValues->begin(); it != end; ++it) { - ASSERT(!it->first->identifierTable()); - staticValues->add(UString::Rep::createCopying(it->first->data(), it->first->size()), - new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes)); + ASSERT(!it->first->isIdentifier()); + // Use a local variable here to sidestep an RVCT compiler bug. + StaticValueEntry* entry = new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes); + staticValues->add(UString::Rep::create(it->first->data(), it->first->size()), entry); + } } else @@ -161,9 +157,10 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass) staticFunctions = new OpaqueJSClassStaticFunctionsTable; OpaqueJSClassStaticFunctionsTable::const_iterator end = jsClass->m_staticFunctions->end(); for (OpaqueJSClassStaticFunctionsTable::const_iterator it = jsClass->m_staticFunctions->begin(); it != end; ++it) { - ASSERT(!it->first->identifierTable()); - staticFunctions->add(UString::Rep::createCopying(it->first->data(), it->first->size()), - new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes)); + ASSERT(!it->first->isIdentifier()); + // Use a local variable here to sidestep an RVCT compiler bug. + StaticFunctionEntry* entry = new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes); + staticFunctions->add(UString::Rep::create(it->first->data(), it->first->size()), entry); } } else @@ -240,5 +237,5 @@ JSObject* OpaqueJSClass::prototype(ExecState* exec) jsClassData.cachedPrototype->setPrototype(prototype); } } - return jsClassData.cachedPrototype; + return jsClassData.cachedPrototype.get(); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.h index c4777dd..ae60aad 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSClassRef.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -76,7 +77,7 @@ struct OpaqueJSClassContextData : Noncopyable { OpaqueJSClassStaticValuesTable* staticValues; OpaqueJSClassStaticFunctionsTable* staticFunctions; - JSC::JSObject* cachedPrototype; + JSC::WeakGCPtr cachedPrototype; }; struct OpaqueJSClass : public ThreadSafeShared { diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSContextRef.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSContextRef.cpp index c358a84..6bdc3c8 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSContextRef.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSContextRef.cpp @@ -25,6 +25,7 @@ #include "config.h" #include "JSContextRef.h" +#include "JSContextRefPrivate.h" #include "APICast.h" #include "InitializeThreading.h" @@ -34,7 +35,7 @@ #include "JSObject.h" #include -#if PLATFORM(DARWIN) +#if OS(DARWIN) #include static const int32_t webkitFirstVersionWithConcurrentGlobalContexts = 0x2100500; // 528.5.0 @@ -45,7 +46,7 @@ using namespace JSC; JSContextGroupRef JSContextGroupCreate() { initializeThreading(); - return toRef(JSGlobalData::create().releaseRef()); + return toRef(JSGlobalData::createNonDefault().releaseRef()); } JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group) @@ -62,7 +63,7 @@ void JSContextGroupRelease(JSContextGroupRef group) JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) { initializeThreading(); -#if PLATFORM(DARWIN) +#if OS(DARWIN) // When running on Tiger or Leopard, or if the application was linked before JSGlobalContextCreate was changed // to use a unique JSGlobalData, we use a shared one for compatibility. #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) @@ -73,7 +74,7 @@ JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) JSLock lock(LockForReal); return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass); } -#endif // PLATFORM(DARWIN) +#endif // OS(DARWIN) return JSGlobalContextCreateInGroup(0, globalObjectClass); } @@ -83,8 +84,9 @@ JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClass initializeThreading(); JSLock lock(LockForReal); + RefPtr globalData = group ? PassRefPtr(toJS(group)) : JSGlobalData::createNonDefault(); - RefPtr globalData = group ? PassRefPtr(toJS(group)) : JSGlobalData::create(); + APIEntryShim entryShim(globalData.get(), false); #if ENABLE(JSC_MULTIPLE_THREADS) globalData->makeUsableFromMultipleThreads(); @@ -107,12 +109,9 @@ JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClass JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef ctx) { ExecState* exec = toJS(ctx); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSGlobalData& globalData = exec->globalData(); - - globalData.heap.registerThread(); - gcProtect(exec->dynamicGlobalObject()); globalData.ref(); return ctx; @@ -121,18 +120,16 @@ JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef ctx) void JSGlobalContextRelease(JSGlobalContextRef ctx) { ExecState* exec = toJS(ctx); - JSLock lock(exec); + APIEntryShim entryShim(exec, false); gcUnprotect(exec->dynamicGlobalObject()); JSGlobalData& globalData = exec->globalData(); if (globalData.refCount() == 2) { // One reference is held by JSGlobalObject, another added by JSGlobalContextRetain(). // The last reference was released, this is our last chance to collect. - ASSERT(!globalData.heap.protectedObjectCount()); - ASSERT(!globalData.heap.isBusy()); globalData.heap.destroy(); } else - globalData.heap.collect(); + globalData.heap.collectAllGarbage(); globalData.deref(); } @@ -140,8 +137,7 @@ void JSGlobalContextRelease(JSGlobalContextRef ctx) JSObjectRef JSContextGetGlobalObject(JSContextRef ctx) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); // It is necessary to call toThisObject to get the wrapper object when used with WebCore. return toRef(exec->lexicalGlobalObject()->toThisObject(exec)); @@ -152,3 +148,11 @@ JSContextGroupRef JSContextGetGroup(JSContextRef ctx) ExecState* exec = toJS(ctx); return toRef(&exec->globalData()); } + +JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx) +{ + ExecState* exec = toJS(ctx); + APIEntryShim entryShim(exec); + + return toGlobalRef(exec->lexicalGlobalObject()->globalExec()); +} diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSContextRefPrivate.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSContextRefPrivate.h new file mode 100644 index 0000000..ff014ec --- /dev/null +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSContextRefPrivate.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2009 Apple Computer, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef JSContextRefPrivate_h +#define JSContextRefPrivate_h + +#include +#include +#include + +#ifndef __cplusplus +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*! +@function +@abstract Gets the global context of a JavaScript execution context. +@param ctx The JSContext whose global context you want to get. +@result ctx's global context. +*/ +JS_EXPORT JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx); + +#ifdef __cplusplus +} +#endif + +#endif /* JSContextRefPrivate_h */ diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSObjectRef.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSObjectRef.cpp index 06ef578..faaa4eb 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSObjectRef.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSObjectRef.cpp @@ -76,8 +76,7 @@ void JSClassRelease(JSClassRef jsClass) JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); if (!jsClass) return toRef(new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure())); // slightly more efficient @@ -92,8 +91,7 @@ JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data) JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name, JSObjectCallAsFunctionCallback callAsFunction) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous"); @@ -103,8 +101,7 @@ JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name, JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObjectCallAsConstructorCallback callAsConstructor) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsPrototype = jsClass ? jsClass->prototype(exec) : 0; if (!jsPrototype) @@ -118,8 +115,7 @@ JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObje JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned parameterCount, const JSStringRef parameterNames[], JSStringRef body, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous"); @@ -141,8 +137,7 @@ JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned pa JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* result; if (argumentCount) { @@ -167,8 +162,7 @@ JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSVa JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); MarkedArgumentBuffer argList; for (size_t i = 0; i < argumentCount; ++i) @@ -188,8 +182,7 @@ JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSVal JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); MarkedArgumentBuffer argList; for (size_t i = 0; i < argumentCount; ++i) @@ -209,8 +202,7 @@ JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSVa JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); MarkedArgumentBuffer argList; for (size_t i = 0; i < argumentCount; ++i) @@ -230,8 +222,7 @@ JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSV JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); return toRef(exec, jsObject->prototype()); @@ -240,8 +231,7 @@ JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object) void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); JSValue jsValue = toJS(exec, value); @@ -252,8 +242,7 @@ void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); @@ -263,8 +252,7 @@ bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef prope JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); @@ -280,8 +268,7 @@ JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); Identifier name(propertyName->identifier(&exec->globalData())); @@ -304,8 +291,7 @@ void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef prope JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); @@ -322,8 +308,7 @@ JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsi void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef value, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); JSValue jsValue = toJS(exec, value); @@ -339,8 +324,7 @@ void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned p bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); @@ -389,8 +373,7 @@ bool JSObjectIsFunction(JSContextRef, JSObjectRef object) JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); JSObject* jsThisObject = toJS(thisObject); @@ -427,8 +410,7 @@ bool JSObjectIsConstructor(JSContextRef, JSObjectRef object) JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSObject* jsObject = toJS(object); @@ -466,8 +448,7 @@ JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef ctx, JSObjectRef o { JSObject* jsObject = toJS(object); ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSGlobalData* globalData = &exec->globalData(); @@ -492,7 +473,7 @@ JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array) void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array) { if (--array->refCount == 0) { - JSLock lock(array->globalData->isSharedInstance ? LockForReal : SilenceAssertionsOnly); + APIEntryShim entryShim(array->globalData, false); delete array; } } @@ -510,9 +491,6 @@ JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef array, JSStringRef propertyName) { PropertyNameArray* propertyNames = toJS(array); - - propertyNames->globalData()->heap.registerThread(); - JSLock lock(propertyNames->globalData()->isSharedInstance ? LockForReal : SilenceAssertionsOnly); - + APIEntryShim entryShim(propertyNames->globalData()); propertyNames->add(propertyName->identifier(propertyNames->globalData())); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSStringRef.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSStringRef.h index 41d8978..c58b958 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSStringRef.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSStringRef.h @@ -37,7 +37,7 @@ extern "C" { #endif -#if (!defined(WIN32) && !defined(_WIN32) && !defined(__WINSCW__)) +#if !defined(WIN32) && !defined(_WIN32) && !defined(__WINSCW__) /*! @typedef JSChar @abstract A Unicode character. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSValueRef.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSValueRef.cpp index 2207181..a12cc34 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/JSValueRef.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/JSValueRef.cpp @@ -28,6 +28,7 @@ #include #include "APICast.h" +#include "APIShims.h" #include "JSCallbackObject.h" #include @@ -41,13 +42,14 @@ #include // for std::min -JSType JSValueGetType(JSContextRef ctx, JSValueRef value) +using namespace JSC; + +::JSType JSValueGetType(JSContextRef ctx, JSValueRef value) { - JSC::ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSC::JSLock lock(exec); + ExecState* exec = toJS(ctx); + APIEntryShim entryShim(exec); - JSC::JSValue jsValue = toJS(exec, value); + JSValue jsValue = toJS(exec, value); if (jsValue.isUndefined()) return kJSTypeUndefined; @@ -63,13 +65,10 @@ JSType JSValueGetType(JSContextRef ctx, JSValueRef value) return kJSTypeObject; } -using namespace JSC; // placed here to avoid conflict between JSC::JSType and JSType, above. - bool JSValueIsUndefined(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); return jsValue.isUndefined(); @@ -78,8 +77,7 @@ bool JSValueIsUndefined(JSContextRef ctx, JSValueRef value) bool JSValueIsNull(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); return jsValue.isNull(); @@ -88,8 +86,7 @@ bool JSValueIsNull(JSContextRef ctx, JSValueRef value) bool JSValueIsBoolean(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); return jsValue.isBoolean(); @@ -98,8 +95,7 @@ bool JSValueIsBoolean(JSContextRef ctx, JSValueRef value) bool JSValueIsNumber(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); return jsValue.isNumber(); @@ -108,8 +104,7 @@ bool JSValueIsNumber(JSContextRef ctx, JSValueRef value) bool JSValueIsString(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); return jsValue.isString(); @@ -118,8 +113,7 @@ bool JSValueIsString(JSContextRef ctx, JSValueRef value) bool JSValueIsObject(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); return jsValue.isObject(); @@ -128,8 +122,7 @@ bool JSValueIsObject(JSContextRef ctx, JSValueRef value) bool JSValueIsObjectOfClass(JSContextRef ctx, JSValueRef value, JSClassRef jsClass) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); @@ -145,8 +138,7 @@ bool JSValueIsObjectOfClass(JSContextRef ctx, JSValueRef value, JSClassRef jsCla bool JSValueIsEqual(JSContextRef ctx, JSValueRef a, JSValueRef b, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsA = toJS(exec, a); JSValue jsB = toJS(exec, b); @@ -163,20 +155,18 @@ bool JSValueIsEqual(JSContextRef ctx, JSValueRef a, JSValueRef b, JSValueRef* ex bool JSValueIsStrictEqual(JSContextRef ctx, JSValueRef a, JSValueRef b) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsA = toJS(exec, a); JSValue jsB = toJS(exec, b); - return JSValue::strictEqual(jsA, jsB); + return JSValue::strictEqual(exec, jsA, jsB); } bool JSValueIsInstanceOfConstructor(JSContextRef ctx, JSValueRef value, JSObjectRef constructor, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); @@ -195,8 +185,7 @@ bool JSValueIsInstanceOfConstructor(JSContextRef ctx, JSValueRef value, JSObject JSValueRef JSValueMakeUndefined(JSContextRef ctx) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); return toRef(exec, jsUndefined()); } @@ -204,8 +193,7 @@ JSValueRef JSValueMakeUndefined(JSContextRef ctx) JSValueRef JSValueMakeNull(JSContextRef ctx) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); return toRef(exec, jsNull()); } @@ -213,8 +201,7 @@ JSValueRef JSValueMakeNull(JSContextRef ctx) JSValueRef JSValueMakeBoolean(JSContextRef ctx, bool value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); return toRef(exec, jsBoolean(value)); } @@ -222,8 +209,7 @@ JSValueRef JSValueMakeBoolean(JSContextRef ctx, bool value) JSValueRef JSValueMakeNumber(JSContextRef ctx, double value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); return toRef(exec, jsNumber(exec, value)); } @@ -231,8 +217,7 @@ JSValueRef JSValueMakeNumber(JSContextRef ctx, double value) JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); return toRef(exec, jsString(exec, string->ustring())); } @@ -240,8 +225,7 @@ JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string) bool JSValueToBoolean(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); return jsValue.toBoolean(exec); @@ -250,8 +234,7 @@ bool JSValueToBoolean(JSContextRef ctx, JSValueRef value) double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); @@ -268,8 +251,7 @@ double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); @@ -286,8 +268,7 @@ JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef* JSObjectRef JSValueToObject(JSContextRef ctx, JSValueRef value, JSValueRef* exception) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); JSValue jsValue = toJS(exec, value); @@ -304,19 +285,17 @@ JSObjectRef JSValueToObject(JSContextRef ctx, JSValueRef value, JSValueRef* exce void JSValueProtect(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); - JSValue jsValue = toJS(exec, value); + JSValue jsValue = toJSForGC(exec, value); gcProtect(jsValue); } void JSValueUnprotect(JSContextRef ctx, JSValueRef value) { ExecState* exec = toJS(ctx); - exec->globalData().heap.registerThread(); - JSLock lock(exec); + APIEntryShim entryShim(exec); - JSValue jsValue = toJS(exec, value); + JSValue jsValue = toJSForGC(exec, value); gcUnprotect(jsValue); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/OpaqueJSString.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/API/OpaqueJSString.cpp index 7c7b1af..f740abe 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/OpaqueJSString.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/OpaqueJSString.cpp @@ -42,7 +42,7 @@ PassRefPtr OpaqueJSString::create(const UString& ustring) UString OpaqueJSString::ustring() const { if (this && m_characters) - return UString(m_characters, m_length, true); + return UString(m_characters, m_length); return UString::null(); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index 5fa56a7..35aabc9 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -1,3 +1,7410 @@ +2010-01-27 Kwang Yul Seo + + Reviewed by Oliver Hunt. + + [BREWMP] Add MarkStack fastMalloc implementation for platforms without VirtualAlloc or mmap. + https://bugs.webkit.org/show_bug.cgi?id=33582 + + Use fastMalloc and fastFree to implement MarkStack::allocateStack and + MarkStack::releaseStack for platforms without page level allocation. + + * runtime/MarkStack.h: + (JSC::MarkStack::MarkStackArray::shrinkAllocation): + * runtime/MarkStackNone.cpp: Added. + (JSC::MarkStack::initializePagesize): + (JSC::MarkStack::allocateStack): + (JSC::MarkStack::releaseStack): + +2010-01-27 Kwang Yul Seo + + Reviewed by Eric Seidel. + + [BREWMP] Don't use time function + https://bugs.webkit.org/show_bug.cgi?id=33577 + + Calling time(0) in BREW devices causes a crash because time + is not properly ported in most devices. Cast currentTime() to + time_t to get the same result as time(0). + + * wtf/DateMath.cpp: + (WTF::calculateUTCOffset): + +2010-01-27 Alexey Proskuryakov + + Revert r53899 (HashMap key checks) and subsequent build fixes, + because they make SVG tests crash in release builds. + + * wtf/HashMap.h: + (WTF::::remove): + * wtf/HashSet.h: + (WTF::::remove): + * wtf/HashTable.h: + (WTF::::add): + (WTF::::addPassingHashCode): + (WTF::::removeAndInvalidate): + (WTF::::remove): + (WTF::::rehash): + (WTF::::checkTableConsistency): + (WTF::::checkTableConsistencyExceptSize): + * wtf/HashTraits.h: + (WTF::GenericHashTraits::emptyValue): + (WTF::): + * wtf/RefPtrHashMap.h: + (WTF::::remove): + +2010-01-26 Alexey Proskuryakov + + More Windows build fixing. + + * wtf/HashTraits.h: _msize takes void*, remove const qualifier from type. + +2010-01-26 Alexey Proskuryakov + + Windows build fix. + + * wtf/HashTraits.h: Include malloc.h for _msize(). + +2010-01-26 Alexey Proskuryakov + + Build fix. + + * wtf/HashTable.h: (WTF::HashTable::checkTableConsistencyExceptSize): Remove const from a + static (empty) version of this function. + +2010-01-26 Alexey Proskuryakov + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=34150 + WebKit needs a mechanism to catch stale HashMap entries + + It is very difficult to catch stale pointers that are HashMap keys - since a pointer's hash + is just its value, it is very unlikely that any observable problem is reproducible. + + This extends hash table consistency checks to check that pointers are referencing allocated + memory blocks, and makes it possible to invoke the checks explicitly (it is not feasible + to enable CHECK_HASHTABLE_CONSISTENCY by default, because that affects performance too much). + + * wtf/HashMap.h: (WTF::::checkConsistency): Call through to HashTable implementation. We can + add similar calls to HashSet and HashCountedSet, but I haven't seen hard to debug problems + with those yet. + + * wtf/HashSet.h: (WTF::::remove): The version of checkTableConsistency that's guarded by + CHECK_HASHTABLE_CONSISTENCY is now called internalCheckTableConsistency(). + + * wtf/HashTable.h: + (WTF::HashTable::internalCheckTableConsistency): + (WTF::HashTable::internalCheckTableConsistencyExceptSize): + (WTF::HashTable::checkTableConsistencyExceptSize): + Expose checkTableConsistency() even if CHECK_HASHTABLE_CONSISTENCY is off. + (WTF::::add): Updated for checkTableConsistency renaming. + (WTF::::addPassingHashCode): Ditto. + (WTF::::removeAndInvalidate): Ditto. + (WTF::::remove): Ditto. + (WTF::::rehash): Ditto. + (WTF::::checkTableConsistency): The assertion for !shouldExpand() was not correct - this + function returns true for tables with m_table == 0. + (WTF::::checkTableConsistencyExceptSize): Call checkValueConsistency for key. Potentially, + we could do the same for values. + + * wtf/HashTraits.h: + (WTF::GenericHashTraits::checkValueConsistency): An empty function that can be overridden + to add checks. Currently, the only override is for pointer hashes. + + * wtf/RefPtrHashMap.h: (WTF::::remove): Updated for checkTableConsistency renaming. + +2010-01-26 Lyon Chen + + Reviewed by Maciej Stachowiak. + + Opcode.h use const void* for Opcode cause error #1211 for RVCT compiler + https://bugs.webkit.org/show_bug.cgi?id=33902 + + * bytecode/Opcode.h: + +2010-01-26 Steve Falkenburg + + Reviewed by Oliver Hunt. + + Windows build references non-existent include paths + https://bugs.webkit.org/show_bug.cgi?id=34175 + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: + * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: + * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: + * JavaScriptCore.vcproj/testapi/testapi.vcproj: + * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: + +2010-01-26 Oliver Hunt + + Reviewed by Geoffrey Garen. + + Using JavaScriptCore API with a webkit vended context can result in slow script dialog + https://bugs.webkit.org/show_bug.cgi?id=34172 + + Make the APIShim correctly increment and decrement the timeout + entry counter. + + * API/APIShims.h: + (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): + (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): + (JSC::APICallbackShim::APICallbackShim): + (JSC::APICallbackShim::~APICallbackShim): + +2010-01-26 Simon Hausmann + + [Qt] Fix compilation of QtScript with non-gcc compilers + + Variable length stack arrays are a gcc extension. Use QVarLengthArray + as a more portable solution that still tries to allocate on the stack + first. + + * qt/api/qscriptvalue_p.h: + (QScriptValuePrivate::call): + +2010-01-26 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + [Qt] Fix the build on platforms without JIT support. + + The JIT support should be determined at compile-time via wtf/Platform.h + + * qt/api/QtScript.pro: + +2010-01-26 Jedrzej Nowacki + + Reviewed by Simon Hausmann. + + First steps of the QtScript API. + + Two new classes were created; QScriptEngine and QScriptValue. + The first should encapsulate a javascript context and the second a script + value. + + This API is still in development, so it isn't compiled by default. + To trigger compilation, pass --qmakearg="CONFIG+=build-qtscript" to + build-webkit. + + https://bugs.webkit.org/show_bug.cgi?id=32565 + + * qt/api/QtScript.pro: Added. + * qt/api/qscriptconverter_p.h: Added. + (QScriptConverter::toString): + * qt/api/qscriptengine.cpp: Added. + (QScriptEngine::QScriptEngine): + (QScriptEngine::~QScriptEngine): + (QScriptEngine::evaluate): + (QScriptEngine::collectGarbage): + * qt/api/qscriptengine.h: Added. + * qt/api/qscriptengine_p.cpp: Added. + (QScriptEnginePrivate::QScriptEnginePrivate): + (QScriptEnginePrivate::~QScriptEnginePrivate): + (QScriptEnginePrivate::evaluate): + * qt/api/qscriptengine_p.h: Added. + (QScriptEnginePrivate::get): + (QScriptEnginePrivate::collectGarbage): + (QScriptEnginePrivate::makeJSValue): + (QScriptEnginePrivate::context): + * qt/api/qscriptvalue.cpp: Added. + (QScriptValue::QScriptValue): + (QScriptValue::~QScriptValue): + (QScriptValue::isValid): + (QScriptValue::isBool): + (QScriptValue::isBoolean): + (QScriptValue::isNumber): + (QScriptValue::isNull): + (QScriptValue::isString): + (QScriptValue::isUndefined): + (QScriptValue::isError): + (QScriptValue::isObject): + (QScriptValue::isFunction): + (QScriptValue::toString): + (QScriptValue::toNumber): + (QScriptValue::toBool): + (QScriptValue::toBoolean): + (QScriptValue::toInteger): + (QScriptValue::toInt32): + (QScriptValue::toUInt32): + (QScriptValue::toUInt16): + (QScriptValue::call): + (QScriptValue::engine): + (QScriptValue::operator=): + (QScriptValue::equals): + (QScriptValue::strictlyEquals): + * qt/api/qscriptvalue.h: Added. + (QScriptValue::): + * qt/api/qscriptvalue_p.h: Added. + (QScriptValuePrivate::): + (QScriptValuePrivate::get): + (QScriptValuePrivate::QScriptValuePrivate): + (QScriptValuePrivate::isValid): + (QScriptValuePrivate::isBool): + (QScriptValuePrivate::isNumber): + (QScriptValuePrivate::isNull): + (QScriptValuePrivate::isString): + (QScriptValuePrivate::isUndefined): + (QScriptValuePrivate::isError): + (QScriptValuePrivate::isObject): + (QScriptValuePrivate::isFunction): + (QScriptValuePrivate::toString): + (QScriptValuePrivate::toNumber): + (QScriptValuePrivate::toBool): + (QScriptValuePrivate::toInteger): + (QScriptValuePrivate::toInt32): + (QScriptValuePrivate::toUInt32): + (QScriptValuePrivate::toUInt16): + (QScriptValuePrivate::equals): + (QScriptValuePrivate::strictlyEquals): + (QScriptValuePrivate::assignEngine): + (QScriptValuePrivate::call): + (QScriptValuePrivate::engine): + (QScriptValuePrivate::context): + (QScriptValuePrivate::value): + (QScriptValuePrivate::object): + (QScriptValuePrivate::inherits): + (QScriptValuePrivate::isJSBased): + (QScriptValuePrivate::isNumberBased): + (QScriptValuePrivate::isStringBased): + * qt/api/qtscriptglobal.h: Added. + * qt/tests/qscriptengine/qscriptengine.pro: Added. + * qt/tests/qscriptengine/tst_qscriptengine.cpp: Added. + (tst_QScriptEngine::tst_QScriptEngine): + (tst_QScriptEngine::~tst_QScriptEngine): + (tst_QScriptEngine::init): + (tst_QScriptEngine::cleanup): + (tst_QScriptEngine::collectGarbage): + (tst_QScriptEngine::evaluate): + * qt/tests/qscriptvalue/qscriptvalue.pro: Added. + * qt/tests/qscriptvalue/tst_qscriptvalue.cpp: Added. + (tst_QScriptValue::tst_QScriptValue): + (tst_QScriptValue::~tst_QScriptValue): + (tst_QScriptValue::init): + (tst_QScriptValue::cleanup): + (tst_QScriptValue::ctor): + (tst_QScriptValue::toString_data): + (tst_QScriptValue::toString): + (tst_QScriptValue::copyConstructor_data): + (tst_QScriptValue::copyConstructor): + (tst_QScriptValue::assignOperator_data): + (tst_QScriptValue::assignOperator): + (tst_QScriptValue::dataSharing): + (tst_QScriptValue::constructors_data): + (tst_QScriptValue::constructors): + (tst_QScriptValue::call): + * qt/tests/tests.pri: Added. + * qt/tests/tests.pro: Added. + +2010-01-25 Dmitry Titov + + Reviewed by David Levin. + + Fix Chromium Linux tests: the pthread functions on Linux produce segfault if they receive 0 thread handle. + After r53714, we can have 0 thread handles passed to pthread_join and pthread_detach if corresponding threads + were already terminated and their threadMap entries cleared. + Add a 0 check. + + * wtf/ThreadingPthreads.cpp: + (WTF::waitForThreadCompletion): + (WTF::detachThread): + +2010-01-24 Laszlo Gombos + + Reviewed by Maciej Stachowiak. + + Refactor JITStubs.cpp so that DEFINE_STUB_FUNCTION is only used once for each function + https://bugs.webkit.org/show_bug.cgi?id=33866 + + Place the guard USE(JSVALUE32_64) inside the body of the DEFINE_STUB_FUNCTION + macro for those functions that are always present. + + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + +2010-01-22 Kevin Watters + + Reviewed by Kevin Ollivier. + + [wx] Remove the Bakefile build system, which is no longer being used. + + https://bugs.webkit.org/show_bug.cgi?id=34022 + + * JavaScriptCoreSources.bkl: Removed. + * jscore.bkl: Removed. + +2010-01-22 Steve Falkenburg + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=34025 + Enable client-based Geolocation abstraction for Mac, Windows AppleWebKit targets. + + * Configurations/FeatureDefines.xcconfig: + +2010-01-22 Dmitry Titov + + Not reviewed, attempted Snow Leopard build fix. + + * wtf/ThreadingPthreads.cpp: Add a forward declaration of a function which is not 'static'. + +2009-01-22 Dmitry Titov + + Reviewed by Maciej Stachowiak. + + Fix the leak of ThreadIdentifiers in threadMap across threads. + https://bugs.webkit.org/show_bug.cgi?id=32689 + + Test is added to DumpRenderTree.mm. + + * Android.mk: Added file ThreadIdentifierDataPthreads.(h|cpp) to build. + * Android.v8.wtf.mk: Ditto. + * GNUmakefile.am: Ditto. + * JavaScriptCore.gyp/JavaScriptCore.gyp: Ditto. + * JavaScriptCore.gypi: Ditto. + * JavaScriptCore.xcodeproj/project.pbxproj: Ditto. + + * wtf/ThreadIdentifierDataPthreads.cpp: Added. Contains custom implementation of thread-specific data that uses custom destructor. + (WTF::ThreadIdentifierData::~ThreadIdentifierData): Removes the ThreadIdentifier from the threadMap. + (WTF::ThreadIdentifierData::identifier): + (WTF::ThreadIdentifierData::initialize): + (WTF::ThreadIdentifierData::destruct): Custom thread-specific destructor. Resets the value for the key again to cause second invoke. + (WTF::ThreadIdentifierData::initializeKeyOnceHelper): + (WTF::ThreadIdentifierData::initializeKeyOnce): Need to use pthread_once since initialization may come on any thread(s). + * wtf/ThreadIdentifierDataPthreads.h: Added. + (WTF::ThreadIdentifierData::ThreadIdentifierData): + + * wtf/Threading.cpp: + (WTF::threadEntryPoint): Move initializeCurrentThreadInternal to after the lock to make + sure it is invoked when ThreadIdentifier is already established. + + * wtf/Threading.h: Rename setThreadNameInternal -> initializeCurrentThreadInternal since it does more then only set the name now. + * wtf/ThreadingNone.cpp: + (WTF::initializeCurrentThreadInternal): Ditto. + * wtf/ThreadingWin.cpp: + (WTF::initializeCurrentThreadInternal): Ditto. + (WTF::initializeThreading): Ditto. + * wtf/gtk/ThreadingGtk.cpp: + (WTF::initializeCurrentThreadInternal): Ditto. + * wtf/qt/ThreadingQt.cpp: + (WTF::initializeCurrentThreadInternal): Ditto. + + * wtf/ThreadingPthreads.cpp: + (WTF::establishIdentifierForPthreadHandle): + (WTF::clearPthreadHandleForIdentifier): Make it not 'static' so the ~ThreadIdentifierData() in another file can call it. + (WTF::initializeCurrentThreadInternal): Set the thread-specific data. The ThreadIdentifier is already established by creating thread. + (WTF::waitForThreadCompletion): Remove call to clearPthreadHandleForIdentifier(threadID) since it is now done in ~ThreadIdentifierData(). + (WTF::detachThread): Ditto. + (WTF::currentThread): Use the thread-specific data to get the ThreadIdentifier. It's many times faster then Mutex-protected iteration through the map. + Also, set the thread-specific data if called first time on the thread. + +2010-01-21 Kwang Yul Seo + + Reviewed by Alexey Proskuryakov. + + Add ThreadSpecific for ENABLE(SINGLE_THREADED) + https://bugs.webkit.org/show_bug.cgi?id=33878 + + Implement ThreadSpecific with a simple getter/setter + when ENABLE(SINGLE_THREADED) is true. + + Due to the change in https://bugs.webkit.org/show_bug.cgi?id=33236, + an implementation of ThreadSpecific must be available to build WebKit. + This causes a build failure for platforms without a proper + ThreadSpecific implementation. + + * wtf/ThreadSpecific.h: + (WTF::::ThreadSpecific): + (WTF::::~ThreadSpecific): + (WTF::::get): + (WTF::::set): + (WTF::::destroy): + +2010-01-21 Kwang Yul Seo + + Reviewed by Maciej Stachowiak. + + Add fastStrDup to FastMalloc + https://bugs.webkit.org/show_bug.cgi?id=33937 + + The new string returned by fastStrDup is obtained with fastMalloc, + and can be freed with fastFree. This makes the memory management + more consistent because we don't need to keep strdup allocated pointers + and free them with free(). Instead we can use fastFree everywhere. + + * wtf/FastMalloc.cpp: + (WTF::fastStrDup): + * wtf/FastMalloc.h: + +2010-01-21 Brady Eidson + + Reviewed by Maciej Stachowiak. + + history.back() for same-document history traversals isn't synchronous as the specification states. + and https://bugs.webkit.org/show_bug.cgi?id=33538 + + * wtf/Platform.h: Add a "HISTORY_ALWAYS_ASYNC" enable and turn it on for Chromium. + +2010-01-21 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Always create a prototype for automatically managed classes. + + This fixes some errors where prototype chains were not correctly hooked + up, and also ensures that API classes work correctly with features like + instanceof. + + * API/JSClassRef.cpp: + (OpaqueJSClass::create): Cleaned up some of this code. Also changed it + to always create a prototype class. + + * API/tests/testapi.c: + (Derived2_class): + (main): Fixed a null value crash in the exception checking code. + * API/tests/testapi.js: Added some tests for the case where a prototype + chain would not be hooked up correctly. + +2010-01-21 Oliver Hunt + + Reviewed by Geoff Garen. + + Force JSC to create a prototype chain for API classes with a + parent class but no static functions. + + * API/JSClassRef.cpp: + (OpaqueJSClass::create): + +2010-01-21 Kent Hansen + + Reviewed by Geoffrey Garen. + + Object.getOwnPropertyDescriptor always returns undefined for JS API objects + https://bugs.webkit.org/show_bug.cgi?id=33946 + + Ideally the getOwnPropertyDescriptor() reimplementation should return an + access descriptor that wraps the property getter and setter callbacks, but + that approach is much more involved than returning a value descriptor. + Keep it simple for now. + + * API/JSCallbackObject.h: + * API/JSCallbackObjectFunctions.h: + (JSC::::getOwnPropertyDescriptor): + * API/tests/testapi.js: + +2010-01-20 Mark Rowe + + Build fix. + + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_PageHeap::initializeScavenger): Remove unnecessary function call. + +2010-01-20 Mark Rowe + + Reviewed by Oliver Hunt. + + Use the inline i386 assembly for x86_64 as well rather than falling back to using pthread mutexes. + + * wtf/TCSpinLock.h: + (TCMalloc_SpinLock::Lock): + (TCMalloc_SpinLock::Unlock): + (TCMalloc_SlowLock): + +2010-01-20 Mark Rowe + + Reviewed by Oliver Hunt. + + Use GCD instead of an extra thread for FastMalloc scavenging on platforms where it is supported + + Abstract the background scavenging slightly so that an alternate implementation that uses GCD can be used on platforms + where it is supported. + + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_PageHeap::init): + (WTF::TCMalloc_PageHeap::initializeScavenger): + (WTF::TCMalloc_PageHeap::signalScavenger): + (WTF::TCMalloc_PageHeap::shouldContinueScavenging): + (WTF::TCMalloc_PageHeap::Delete): + (WTF::TCMalloc_PageHeap::periodicScavenge): + * wtf/Platform.h: + +2010-01-20 Geoffrey Garen + + Reviewed by Oliver Hunt. + + REGRESSION(53460): Heap::destroy may not run + all destructors + + * runtime/Collector.cpp: + (JSC::Heap::freeBlocks): Instead of fully marking protected objects, + just set their mark bits. This prevents protected objects from keeping + unprotected objects alive. Destructor order is not guaranteed, so it's + OK to destroy objects pointed to by protected objects before destroying + protected objects. + +2010-01-19 David Levin + + Reviewed by Oliver Hunt. + + CrossThreadCopier needs to support ThreadSafeShared better. + https://bugs.webkit.org/show_bug.cgi?id=33698 + + * wtf/TypeTraits.cpp: Added tests for the new type traits. + * wtf/TypeTraits.h: + (WTF::IsSubclass): Determines if a class is a derived from another class. + (WTF::IsSubclassOfTemplate): Determines if a class is a derived from a + template class (with one parameter that is unknown). + (WTF::RemoveTemplate): Reveals the type for a template parameter. + +2010-01-20 Steve Falkenburg + + Reviewed by Darin Adler and Adam Roben. + + Feature defines are difficult to maintain on Windows builds + https://bugs.webkit.org/show_bug.cgi?id=33883 + + FeatureDefines.vsprops are now maintained in a way similar to + Configurations/FeatureDefines.xcconfig, with the added advantage + of having a single FeatureDefines file across all projects. + + * Configurations/FeatureDefines.xcconfig: Add comments about keeping feature definitions in sync. + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add FeatureDefines.vsprops inherited property sheet. + * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add FeatureDefines.vsprops inherited property sheet. + +2010-01-20 Csaba Osztrogonác + + [Qt] Unreviewed buildfix for r53547. + + * DerivedSources.pro: + +2010-01-20 Tor Arne Vestbø + + Reviewed by Simon Hausmann. + + [Qt] Make extraCompilers for generated sources depend on their scripts + + * DerivedSources.pro: + +2010-01-19 Brian Weinstein + + Reviewed by Tim Hatcher. + + When JavaScriptCore calls Debugger::Exception, have it pass a + hasHandler variable that represents if exception is being handled + in the same function (not in a parent on the call stack). + + This just adds a new parameter, no behavior is changed. + + * debugger/Debugger.h: + * interpreter/Interpreter.cpp: + (JSC::Interpreter::throwException): + +2010-01-18 Maciej Stachowiak + + Reviewed by Adam Barth. + + Inline functions that are hot in DOM manipulation + https://bugs.webkit.org/show_bug.cgi?id=33820 + + (3% speedup on Dromaeo DOM Core tests) + + * runtime/WeakGCMap.h: + (JSC::::get): inline + +2010-01-19 Laszlo Gombos + + Unreviewed build fix for JIT with RVCT. + + Remove IMPORT statement; cti_vm_throw is already defined in JITStubs.h. + Remove extra ')'. + + * jit/JITStubs.cpp: + (JSC::ctiVMThrowTrampoline): + +2010-01-19 Geoffrey Garen + + Reviewed by Oliver Hunt. + + REGRESSION (52082): Crash on worker thread when reloading http://radnan.public.iastate.edu/procedural/ + https://bugs.webkit.org/show_bug.cgi?id=33826 + + This bug was caused by a GC-protected object being destroyed early by + Heap::destroy. Clients of the GC protect APIs (reasonably) expect pointers + to GC-protected memory to be valid. + + The solution is to do two passes of tear-down in Heap::destroy. The first + pass tears down all unprotected objects. The second pass ASSERTs that all + previously protected objects are now unprotected, and then tears down + all perviously protected objects. These two passes simulate the two passes + that would have been required to free a protected object during normal GC. + + * API/JSContextRef.cpp: Removed some ASSERTs that have moved into Heap. + + * runtime/Collector.cpp: + (JSC::Heap::destroy): Moved ASSERTs to here. + (JSC::Heap::freeBlock): Tidied up the use of didShrink by moving its + setter to the function that does the shrinking. + (JSC::Heap::freeBlocks): Implemented above algorithm. + (JSC::Heap::shrinkBlocks): Tidied up the use of didShrink. + +2010-01-19 Gavin Barraclough + + Reviewed by NOBODY (build fix). + + Reverting r53455, breaks 2 javascriptcore tests. + + * API/JSContextRef.cpp: + * runtime/Collector.cpp: + (JSC::Heap::destroy): + (JSC::Heap::freeBlock): + (JSC::Heap::freeBlocks): + (JSC::Heap::shrinkBlocks): + +2010-01-18 Gavin Barraclough + + Reviewed by NOBODY (build fix). + + Revert r53454, since it causes much sadness in this world. + + * runtime/UString.cpp: + (JSC::UString::spliceSubstringsWithSeparators): + (JSC::UString::replaceRange): + * runtime/UStringImpl.cpp: + (JSC::UStringImpl::baseSharedBuffer): + (JSC::UStringImpl::sharedBuffer): + (JSC::UStringImpl::~UStringImpl): + * runtime/UStringImpl.h: + (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield): + (JSC::UntypedPtrAndBitfield::asPtr): + (JSC::UntypedPtrAndBitfield::operator&=): + (JSC::UntypedPtrAndBitfield::operator|=): + (JSC::UntypedPtrAndBitfield::operator&): + (JSC::UStringImpl::create): + (JSC::UStringImpl::cost): + (JSC::UStringImpl::isIdentifier): + (JSC::UStringImpl::setIsIdentifier): + (JSC::UStringImpl::ref): + (JSC::UStringImpl::deref): + (JSC::UStringImpl::checkConsistency): + (JSC::UStringImpl::UStringImpl): + (JSC::UStringImpl::bufferOwnerString): + (JSC::UStringImpl::bufferOwnership): + (JSC::UStringImpl::isStatic): + * wtf/StringHashFunctions.h: + (WTF::stringHash): + +2010-01-18 Geoffrey Garen + + Reviewed by Oliver Hunt. + + REGRESSION (52082): Crash on worker thread when reloading http://radnan.public.iastate.edu/procedural/ + https://bugs.webkit.org/show_bug.cgi?id=33826 + + This bug was caused by a GC-protected object being destroyed early by + Heap::destroy. Clients of the GC protect APIs (reasonably) expect pointers + to GC-protected memory to be valid. + + The solution is to do two passes of tear-down in Heap::destroy. The first + pass tears down all unprotected objects. The second pass ASSERTs that all + previously protected objects are now unprotected, and then tears down + all perviously protected objects. These two passes simulate the two passes + that would have been required to free a protected object during normal GC. + + * API/JSContextRef.cpp: Removed some ASSERTs that have moved into Heap. + + * runtime/Collector.cpp: + (JSC::Heap::destroy): Moved ASSERTs to here. + (JSC::Heap::freeBlock): Tidied up the use of didShrink by moving its + setter to the function that does the shrinking. + (JSC::Heap::freeBlocks): Implemented above algorithm. + (JSC::Heap::shrinkBlocks): Tidied up the use of didShrink. + +2010-01-18 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=33731 + Remove UntypedPtrAndBitfield from UStringImpl (akin to PtrAndFlags). + + This break the OS X Leaks tool. Instead, free up some more bits from the refCount. + + * runtime/UStringImpl.cpp: + (JSC::UStringImpl::sharedBuffer): + (JSC::UStringImpl::~UStringImpl): + * runtime/UStringImpl.h: + (JSC::UStringImpl::cost): + (JSC::UStringImpl::checkConsistency): + (JSC::UStringImpl::UStringImpl): + (JSC::UStringImpl::bufferOwnerString): + (JSC::UStringImpl::): + * wtf/StringHashFunctions.h: + (WTF::stringHash): + +2010-01-18 Kent Tamura + + Reviewed by Darin Adler. + + HTMLInputElement::valueAsDate setter support for type=month. + https://bugs.webkit.org/show_bug.cgi?id=33021 + + Expose the following functions to be used by WebCore: + - WTF::msToyear() + - WTF::dayInYear() + - WTF::monthFromDayInYear() + - WTF::dayInMonthFromDayInYear() + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * wtf/DateMath.cpp: + (WTF::msToYear): Remove "static inline". + (WTF::dayInYear): Remove "static inline". + (WTF::monthFromDayInYear): Remove "static inline". + (WTF::dayInMonthFromDayInYear): Remove "static inline". + * wtf/DateMath.h: Declare the above functions. + +2010-01-18 Darin Adler + + Fix build by reverting the previous change. + + * runtime/UString.h: Rolled out the FastAllocBase base class. + It was making UString larger, and therefore JSString larger, + and too big for a garbage collection cell. + + This raises the unpleasant possibility that many classes became + larger because we added the FastAllocBase base class. I am + worried about this, and it needs to be investigated. + +2010-01-18 Zoltan Horvath + + Reviewed by Darin Adler. + + Allow custom memory allocation control for UString class + https://bugs.webkit.org/show_bug.cgi?id=27831 + + Inherits the following class from FastAllocBase because it is + instantiated by 'new' and no need to be copyable: + + class name - instantiated at: + classs UString - JavaScriptCore/runtime/UString.cpp:160 + + * runtime/UString.h: + +2010-01-18 Evan Cheng + + Reviewed by Darin Adler. + + Add some ALWAYS_INLINE for key functions not inlined by some versions of GCC. + rdar://problem/7553780 + + * runtime/JSObject.h: + (JSC::JSObject::getPropertySlot): ALWAYS_INLINE both overloads. + * runtime/JSString.h: + (JSC::JSString::JSString): ALWAYS_INLINE the version that takes a UString. + * runtime/UString.h: + (JSC::operator==): ALWAYS_INLINE the version that compares two UString objects. + +2010-01-18 Csaba Osztrogonác + + Reviewed by Darin Adler. + + Delete dftables-xxxxxxxx.in files automatically. + https://bugs.webkit.org/show_bug.cgi?id=33796 + + * pcre/dftables: unlink unnecessary temporary file. + +2010-01-18 Tor Arne Vestbø + + Reviewed by Simon Hausmann. + + [Qt] Force qmake to generate a single makefile for DerivedSources.pro + + * DerivedSources.pro: + +2010-01-18 Csaba Osztrogonác + + Rubber-stamped by Gustavo Noronha Silva. + + Rolling out r53391 and r53392 because of random crashes on buildbots. + https://bugs.webkit.org/show_bug.cgi?id=33731 + + * bytecode/CodeBlock.h: + (JSC::CallLinkInfo::seenOnce): + (JSC::CallLinkInfo::setSeen): + (JSC::MethodCallLinkInfo::MethodCallLinkInfo): + (JSC::MethodCallLinkInfo::seenOnce): + (JSC::MethodCallLinkInfo::setSeen): + * jit/JIT.cpp: + (JSC::JIT::unlinkCall): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::patchMethodCallProto): + * runtime/UString.cpp: + (JSC::UString::spliceSubstringsWithSeparators): + (JSC::UString::replaceRange): + * runtime/UString.h: + * runtime/UStringImpl.cpp: + (JSC::UStringImpl::baseSharedBuffer): + (JSC::UStringImpl::sharedBuffer): + (JSC::UStringImpl::~UStringImpl): + * runtime/UStringImpl.h: + (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield): + (JSC::UntypedPtrAndBitfield::asPtr): + (JSC::UntypedPtrAndBitfield::operator&=): + (JSC::UntypedPtrAndBitfield::operator|=): + (JSC::UntypedPtrAndBitfield::operator&): + (JSC::UStringImpl::create): + (JSC::UStringImpl::cost): + (JSC::UStringImpl::isIdentifier): + (JSC::UStringImpl::setIsIdentifier): + (JSC::UStringImpl::ref): + (JSC::UStringImpl::deref): + (JSC::UStringImpl::checkConsistency): + (JSC::UStringImpl::UStringImpl): + (JSC::UStringImpl::bufferOwnerString): + (JSC::UStringImpl::bufferOwnership): + (JSC::UStringImpl::isStatic): + * wtf/StringHashFunctions.h: + (WTF::stringHash): + +2010-01-18 Simon Hausmann + + Reviewed by Kenneth Rohde Christiansen. + + Fix the build with strict gcc and RVCT versions: It's not legal to cast a + pointer to a function to a void* without an intermediate cast to a non-pointer + type. A cast to a ptrdiff_t inbetween fixes it. + + * runtime/JSString.h: + (JSC::Fiber::JSString): + +2010-01-15 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=33731 + Remove UntypedPtrAndBitfield from UStringImpl (akin to PtrAndFlags). + + This break the OS X Leaks tool. Instead, free up some more bits from the refCount. + + * runtime/UStringImpl.cpp: + (JSC::UStringImpl::sharedBuffer): + (JSC::UStringImpl::~UStringImpl): + * runtime/UStringImpl.h: + (JSC::UStringImpl::cost): + (JSC::UStringImpl::checkConsistency): + (JSC::UStringImpl::UStringImpl): + (JSC::UStringImpl::bufferOwnerString): + (JSC::UStringImpl::): + * wtf/StringHashFunctions.h: + (WTF::stringHash): + +2010-01-15 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=33731 + Remove uses of PtrAndFlags from JIT data stuctures. + + These break the OS X Leaks tool. Free up a bit in CallLinkInfo, and invalid + permutation of pointer states in MethodCallLinkInfo to represent the removed bits. + + * bytecode/CodeBlock.h: + (JSC::CallLinkInfo::seenOnce): + (JSC::CallLinkInfo::setSeen): + (JSC::MethodCallLinkInfo::MethodCallLinkInfo): + (JSC::MethodCallLinkInfo::seenOnce): + (JSC::MethodCallLinkInfo::setSeen): + * jit/JIT.cpp: + (JSC::JIT::unlinkCall): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::patchMethodCallProto): + * runtime/UString.h: + +2010-01-16 Maciej Stachowiak + + Reviewed by Oliver Hunt. + + Cache JS string values made from DOM strings (Dromaeo speedup) + https://bugs.webkit.org/show_bug.cgi?id=33768 + + + * runtime/JSString.h: + (JSC::jsStringWithFinalizer): Added new mechanism for a string to have an optional + finalizer callback, for the benefit of weak-referencing caches. + (JSC::): + (JSC::Fiber::JSString): + (JSC::Fiber::~JSString): + * runtime/JSString.cpp: + (JSC::JSString::resolveRope): Clear fibers so this doesn't look like a string with a finalizer. + * runtime/WeakGCMap.h: Include "Collector.h" to make this header includable by itself. + +2010-01-15 Sam Weinig + + Reviewed by Maciej Stachowiak. + + Fix for + Add ALWAYS_INLINE to jsLess for a 1% speedup on llvm-gcc. + + * runtime/Operations.h: + (JSC::jsLess): + +2010-01-14 Geoffrey Garen + + Reviewed by Oliver Hunt. + + REGRESISON: Google maps buttons not working properly + https://bugs.webkit.org/show_bug.cgi?id=31871 + + REGRESSION(r52948): JavaScript exceptions thrown on Google Maps when + getting directions for a second time + https://bugs.webkit.org/show_bug.cgi?id=33446 + + SunSpider and v8 report no change. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::tryCacheGetByID): Update our cached offset in case + flattening the dictionary changed any of its offsets. + + * jit/JITStubs.cpp: + (JSC::JITThunks::tryCacheGetByID): + (JSC::DEFINE_STUB_FUNCTION): + * runtime/Operations.h: + (JSC::normalizePrototypeChain): ditto + +2010-01-14 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=33705 + UStringImpl::create() should use internal storage + + When creating a UStringImpl copying of a UChar*, we can use an internal buffer, + by calling UStringImpl::tryCreateUninitialized(). + + Also, remove duplicate of copyChars from JSString, call UStringImpl's version. + + Small (max 0.5%) progression on Sunspidey. + + * runtime/JSString.cpp: + (JSC::JSString::resolveRope): + * runtime/UStringImpl.h: + (JSC::UStringImpl::create): + +2010-01-14 Gavin Barraclough + + Reviewed by Sam Weinig. + + Make naming & behaviour of UString[Impl] methods more consistent. + https://bugs.webkit.org/show_bug.cgi?id=33702 + + UString::create() creates a copy of the UChar* passed, but UStringImpl::create() assumes + that it should assume ownership of the provided buffer (with UString::createNonCopying() + and UStringImpl::createCopying() providing the alternate behaviours). Unify on create() + taking a copy of the provided buffer. For non-copying cases, use the name 'adopt', and + make this method take a Vector&. For cases where non-copying construction was being + used, other than from a Vector, change the code to allocate the storage along with + the UStringImpl using UStringImpl::createUninitialized(). (The adopt() method also more + closely matches that of WebCore::StringImpl). + + Also, UString::createUninitialized() and UStringImpl::createUninitialized() have incompatible + behaviours, in that the UString form sets the provided UChar* to a null or non-null value to + indicate success or failure, but UStringImpl uses the returned PassRefPtr to + indicate when allocation has failed (potentially leaving the output Char* uninitialized). + This is also incompatible with WebCore::StringImpl's behaviour, in that + StringImpl::createUninitialized() will CRASH() if unable to allocate. Some uses of + createUninitialized() in JSC are unsafe, since they do not test the result for null. + UStringImpl's indication is preferable, since we may want a successful call to set the result + buffer to 0 (specifically, StringImpl returns 0 for the buffer where createUninitialized() + returns the empty string, which seems reasonable to catch bugs early). UString's method + cannot support UStringImpl's behaviour directly, since it returns an object rather than a + pointer. + - remove UString::createUninitialized(), replace with calls to UStringImpl::createUninitialized() + - create a UStringImpl::tryCreateUninitialized() form UStringImpl::createUninitialized(), + with current behaviour, make createUninitialized() crash on failure to allocate. + - make cases in JSC that do not check the result call createUninitialized(), and cases that do + check call tryCreateUninitialized(). + + Rename computedHash() to existingHash(), to bring this in line wih WebCore::StringImpl. + + * API/JSClassRef.cpp: + (OpaqueJSClassContextData::OpaqueJSClassContextData): + * JavaScriptCore.exp: + * runtime/ArrayPrototype.cpp: + (JSC::arrayProtoFuncToString): + * runtime/Identifier.cpp: + (JSC::CStringTranslator::translate): + (JSC::UCharBufferTranslator::translate): + * runtime/JSString.cpp: + (JSC::JSString::resolveRope): + * runtime/Lookup.cpp: + (JSC::HashTable::createTable): + * runtime/Lookup.h: + (JSC::HashTable::entry): + * runtime/StringBuilder.h: + (JSC::StringBuilder::release): + * runtime/StringConstructor.cpp: + (JSC::stringFromCharCodeSlowCase): + * runtime/StringPrototype.cpp: + (JSC::substituteBackreferencesSlow): + (JSC::stringProtoFuncToLowerCase): + (JSC::stringProtoFuncToUpperCase): + (JSC::stringProtoFuncFontsize): + (JSC::stringProtoFuncLink): + * runtime/Structure.cpp: + (JSC::Structure::despecifyDictionaryFunction): + (JSC::Structure::get): + (JSC::Structure::despecifyFunction): + (JSC::Structure::put): + (JSC::Structure::remove): + (JSC::Structure::insertIntoPropertyMapHashTable): + (JSC::Structure::checkConsistency): + * runtime/Structure.h: + (JSC::Structure::get): + * runtime/StructureTransitionTable.h: + (JSC::StructureTransitionTableHash::hash): + * runtime/UString.cpp: + (JSC::createRep): + (JSC::UString::UString): + (JSC::UString::spliceSubstringsWithSeparators): + (JSC::UString::replaceRange): + (JSC::UString::operator=): + * runtime/UString.h: + (JSC::UString::adopt): + (JSC::IdentifierRepHash::hash): + (JSC::makeString): + * runtime/UStringImpl.h: + (JSC::UStringImpl::adopt): + (JSC::UStringImpl::create): + (JSC::UStringImpl::createUninitialized): + (JSC::UStringImpl::tryCreateUninitialized): + (JSC::UStringImpl::existingHash): + +2010-01-13 Kent Hansen + + Reviewed by Oliver Hunt. + + JSON.stringify and JSON.parse needlessly process properties in the prototype chain + https://bugs.webkit.org/show_bug.cgi?id=33053 + + * runtime/JSONObject.cpp: + (JSC::Stringifier::Holder::appendNextProperty): + (JSC::Walker::walk): + +2010-01-13 Gavin Barraclough + + Reviewed by NOBODY (buildfix). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-01-13 Alexey Proskuryakov + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=33641 + Assertion failure in Lexer.cpp if input stream ends while in string escape + + Test: fast/js/end-in-string-escape.html + + * parser/Lexer.cpp: (JSC::Lexer::lex): Bail out quickly on end of stream, not giving the + assertion a chance to fire. + +2010-01-13 Gavin Barraclough + + Reviewed by NOBODY (buildfix). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-01-13 Gavin Barraclough + + Rubber stamped by Sam Weinig & Darin Adler. + + Three quick fixes to UStringImpl. + - The destroy() method can be switched back to a normal destructor; since we've switched + the way we protect static strings to be using an odd ref-count the destroy() won't abort. + - The cost() calculation logic was wrong. If you have multiple JSStrings wrapping substrings + of a base string, they would each report the full cost of the base string to the heap. + Instead we should only be reporting once for the base string. + - Remove the overloaded new operator calling fastMalloc, replace this with a 'using' to pick + up the implementation from the parent class. + + * JavaScriptCore.exp: + * runtime/UStringImpl.cpp: + (JSC::UStringImpl::~UStringImpl): + * runtime/UStringImpl.h: + (JSC::UStringImpl::cost): + (JSC::UStringImpl::deref): + +2010-01-13 Jocelyn Turcotte + + Reviewed by Simon Hausmann. + + [Qt] Split the build process in two different .pro files. + This allows qmake to be run once all source files are available. + + * DerivedSources.pro: Added. + * JavaScriptCore.pri: Moved source generation to DerivedSources.pro + * pcre/pcre.pri: Moved source generation to DerivedSources.pro + +2010-01-12 Kent Hansen + + Reviewed by Geoffrey Garen. + + [ES5] Implement Object.getOwnPropertyNames + https://bugs.webkit.org/show_bug.cgi?id=32242 + + Add an extra argument to getPropertyNames() and getOwnPropertyNames() + (and all reimplementations thereof) that indicates whether non-enumerable + properties should be added. + + * API/JSCallbackObject.h: + * API/JSCallbackObjectFunctions.h: + (JSC::::getOwnPropertyNames): + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * debugger/DebuggerActivation.cpp: + (JSC::DebuggerActivation::getOwnPropertyNames): + * debugger/DebuggerActivation.h: + * runtime/Arguments.cpp: + (JSC::Arguments::getOwnPropertyNames): + * runtime/Arguments.h: + * runtime/CommonIdentifiers.h: + * runtime/JSArray.cpp: + (JSC::JSArray::getOwnPropertyNames): + * runtime/JSArray.h: + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::getOwnPropertyNames): + * runtime/JSByteArray.h: + * runtime/JSFunction.cpp: + (JSC::JSFunction::getOwnPropertyNames): + * runtime/JSFunction.h: + * runtime/JSNotAnObject.cpp: + (JSC::JSNotAnObject::getOwnPropertyNames): + * runtime/JSNotAnObject.h: + * runtime/JSObject.cpp: + (JSC::getClassPropertyNames): + (JSC::JSObject::getPropertyNames): + (JSC::JSObject::getOwnPropertyNames): + * runtime/JSObject.h: + * runtime/JSVariableObject.cpp: + (JSC::JSVariableObject::getOwnPropertyNames): + * runtime/JSVariableObject.h: + * runtime/ObjectConstructor.cpp: + (JSC::ObjectConstructor::ObjectConstructor): + (JSC::objectConstructorGetOwnPropertyNames): + * runtime/RegExpMatchesArray.h: + (JSC::RegExpMatchesArray::getOwnPropertyNames): + * runtime/StringObject.cpp: + (JSC::StringObject::getOwnPropertyNames): + * runtime/StringObject.h: + * runtime/Structure.cpp: Rename getEnumerablePropertyNames() to getPropertyNames(), which takes an extra argument. + (JSC::Structure::getPropertyNames): + * runtime/Structure.h: + (JSC::): + +2010-01-12 Alexey Proskuryakov + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=33540 + Make it possible to build in debug mode with assertions disabled + + * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): + * runtime/Identifier.cpp: (JSC::Identifier::checkSameIdentifierTable): + * wtf/FastMalloc.cpp: + * wtf/HashTable.h: (WTF::HashTableConstIterator::checkValidity): + * yarr/RegexCompiler.cpp: (JSC::Yarr::compileRegex): + +2009-11-23 Yong Li + + Reviewed by Adam Treat. + + Make GIF decoder support down-sampling + https://bugs.webkit.org/show_bug.cgi?id=31806 + + * platform/image-decoders/ImageDecoder.cpp: + (WebCore::ImageDecoder::upperBoundScaledY): + (WebCore::ImageDecoder::lowerBoundScaledY): + * platform/image-decoders/ImageDecoder.h: + (WebCore::RGBA32Buffer::scaledRect): + (WebCore::RGBA32Buffer::setScaledRect): + (WebCore::ImageDecoder::scaledSize): + * platform/image-decoders/gif/GIFImageDecoder.cpp: + (WebCore::GIFImageDecoder::sizeNowAvailable): + (WebCore::GIFImageDecoder::initFrameBuffer): + (WebCore::copyOnePixel): + (WebCore::GIFImageDecoder::haveDecodedRow): + (WebCore::GIFImageDecoder::frameComplete): + +2010-01-12 Adam Barth + + Reviewed by Eric Seidel. + + ecma/Date/15.9.5.12-1.js fails every night at midnight + https://bugs.webkit.org/show_bug.cgi?id=28041 + + Change the test to use a concrete time instead of "now". + + * tests/mozilla/ecma/Date/15.9.5.10-1.js: + * tests/mozilla/ecma/Date/15.9.5.12-1.js: + +2010-01-11 Csaba Osztrogonác + + Reviewed by Ariya Hidayat. + + [Qt] Enable JIT and YARR_JIT if (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) + + * wtf/Platform.h: + +2010-01-11 Geoffrey Garen + + Reviewed by Alexey Proskuryakov. + + https://bugs.webkit.org/show_bug.cgi?id=33481 + Uninitialized data members in ArrayStorage + + SunSpider reports no change. + + * runtime/JSArray.cpp: + (JSC::JSArray::JSArray): Initialize missing data members in the two cases + where we don't use fastZeroedMalloc, so it doesn't happen automatically. + +2010-01-11 Steve Falkenburg + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=33480 + + Improve debugging reliability for WTF on Windows. + Store WTF static library's PDB file into a better location. + + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + +2010-01-11 Steve Falkenburg + + Windows build fix. + Remove extraneous entries from def file causing build warning. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-01-10 Kent Hansen + + Reviewed by Darin Adler. + + RegExp.prototype.toString returns "//" for empty regular expressions + https://bugs.webkit.org/show_bug.cgi?id=33319 + + "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA. + + * runtime/RegExpPrototype.cpp: + (JSC::regExpProtoFuncToString): + + * tests/mozilla/ecma_2/RegExp/properties-001.js: + (AddRegExpCases): + * tests/mozilla/js1_2/regexp/toString.js: + Update relevant Mozilla tests (Mozilla has had this behavior since November 2003). + +2010-01-10 Darin Adler + + * tests/mozilla/ecma/Array/15.4.1.1.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.1.2.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.2.1-1.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.2.2-1.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.2.2-2.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.2.3.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.3.2.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.3.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.4.1.js: Added property allow-tabs. + * tests/mozilla/ecma/Array/15.4.4.js: Added property allow-tabs. + * tests/mozilla/ecma/LexicalConventions/7.7.4.js: Added property allow-tabs. + * tests/mozilla/ecma/Math/15.8.2.13.js: Added property allow-tabs. + * tests/mozilla/ecma/Math/15.8.2.16.js: Added property allow-tabs. + * tests/mozilla/ecma/Math/15.8.2.18.js: Added property allow-tabs. + * tests/mozilla/ecma/Math/15.8.2.2.js: Added property allow-tabs. + * tests/mozilla/ecma/Math/15.8.2.4.js: Added property allow-tabs. + * tests/mozilla/ecma/Math/15.8.2.5.js: Added property allow-tabs. + * tests/mozilla/ecma/Math/15.8.2.7.js: Added property allow-tabs. + * tests/mozilla/ecma/String/15.5.1.js: Added property allow-tabs. + * tests/mozilla/ecma/String/15.5.2.js: Added property allow-tabs. + * tests/mozilla/ecma/String/15.5.3.1-3.js: Added property allow-tabs. + * tests/mozilla/ecma/String/15.5.3.1-4.js: Added property allow-tabs. + * tests/mozilla/ecma/String/15.5.3.js: Added property allow-tabs. + * tests/mozilla/ecma/TypeConversion/9.5-2.js: Added property allow-tabs. + * tests/mozilla/ecma/jsref.js: Modified property allow-tabs. + * tests/mozilla/ecma/shell.js: Modified property allow-tabs. + * tests/mozilla/ecma_2/LexicalConventions/keywords-001.js: Added property allow-tabs. + * tests/mozilla/ecma_2/RegExp/exec-001.js: Added property allow-tabs. + * tests/mozilla/ecma_2/String/match-004.js: Added property allow-tabs. + * tests/mozilla/ecma_2/String/replace-001.js: Added property allow-tabs. + * tests/mozilla/ecma_2/String/split-002.js: Added property allow-tabs. + * tests/mozilla/ecma_2/jsref.js: Modified property allow-tabs. + * tests/mozilla/ecma_2/shell.js: Added property allow-tabs. + * tests/mozilla/ecma_3/Date/shell.js: Modified property allow-tabs. + * tests/mozilla/ecma_3/Exceptions/regress-181654.js: Added property allow-tabs. + * tests/mozilla/ecma_3/RegExp/regress-209067.js: Added property allow-tabs. + * tests/mozilla/ecma_3/RegExp/regress-85721.js: Added property allow-tabs. + * tests/mozilla/importList.html: Added property allow-tabs. + * tests/mozilla/js1_1/shell.js: Added property allow-tabs. + * tests/mozilla/js1_2/Array/general1.js: Added property allow-tabs. + * tests/mozilla/js1_2/Array/general2.js: Added property allow-tabs. + * tests/mozilla/js1_2/Array/slice.js: Added property allow-tabs. + * tests/mozilla/js1_2/Array/splice1.js: Added property allow-tabs. + * tests/mozilla/js1_2/Array/splice2.js: Added property allow-tabs. + * tests/mozilla/js1_2/Objects/toString-001.js: Added property allow-tabs. + * tests/mozilla/js1_2/String/charCodeAt.js: Added property allow-tabs. + * tests/mozilla/js1_2/String/concat.js: Modified property allow-tabs. + * tests/mozilla/js1_2/String/match.js: Added property allow-tabs. + * tests/mozilla/js1_2/String/slice.js: Added property allow-tabs. + * tests/mozilla/js1_2/function/Function_object.js: Added property allow-tabs. + * tests/mozilla/js1_2/function/Number.js: Modified property allow-tabs. + * tests/mozilla/js1_2/function/String.js: Modified property allow-tabs. + * tests/mozilla/js1_2/function/nesting.js: Added property allow-tabs. + * tests/mozilla/js1_2/function/regexparg-1.js: Added property allow-tabs. + * tests/mozilla/js1_2/function/regexparg-2-n.js: Added property allow-tabs. + * tests/mozilla/js1_2/jsref.js: Added property allow-tabs. + * tests/mozilla/js1_2/operator/equality.js: Added property allow-tabs. + * tests/mozilla/js1_2/operator/strictEquality.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_dollar_number.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_input.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_input_as_array.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_lastIndex.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_lastMatch.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_lastMatch_as_array.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_lastParen.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_lastParen_as_array.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_leftContext.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_leftContext_as_array.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_multiline.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_multiline_as_array.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_object.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_rightContext.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/RegExp_rightContext_as_array.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/alphanumeric.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/asterisk.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/backslash.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/backspace.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/beginLine.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/character_class.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/compile.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/control_characters.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/digit.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/dot.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/endLine.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/everything.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/exec.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/flags.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/global.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/hexadecimal.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/ignoreCase.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/interval.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/octal.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/parentheses.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/plus.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/question_mark.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/simple_form.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/source.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/special_characters.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/string_replace.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/string_search.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/string_split.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/test.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/toString.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/vertical_bar.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/whitespace.js: Added property allow-tabs. + * tests/mozilla/js1_2/regexp/word_boundary.js: Added property allow-tabs. + * tests/mozilla/js1_2/shell.js: Added property allow-tabs. + * tests/mozilla/js1_2/statements/break.js: Added property allow-tabs. + * tests/mozilla/js1_2/statements/continue.js: Added property allow-tabs. + * tests/mozilla/js1_2/statements/do_while.js: Added property allow-tabs. + * tests/mozilla/js1_2/statements/switch.js: Added property allow-tabs. + * tests/mozilla/js1_2/statements/switch2.js: Added property allow-tabs. + * tests/mozilla/js1_3/shell.js: Added property allow-tabs. + * tests/mozilla/js1_4/shell.js: Added property allow-tabs. + * tests/mozilla/js1_5/Regress/regress-111557.js: Added property allow-tabs. + * tests/mozilla/js1_5/Regress/regress-216320.js: Added property allow-tabs. + * tests/mozilla/menuhead.html: Added property allow-tabs. + * tests/mozilla/mklistpage.pl: Added property allow-tabs. + * tests/mozilla/runtests.pl: Added property allow-tabs. + +2010-01-08 Daniel Bates + + Reviewed by Adam Barth. + + https://bugs.webkit.org/show_bug.cgi?id=33417 + + Cleans up style errors exposed by the patch for bug #33198. + Moreover, fixes all "Weird number of spaces at line-start. Are you using a 4-space indent?" + errors reported by check-webkit-style. + + No functionality was changed. So, no new tests. + + * wtf/Platform.h: + +2010-01-08 Kent Hansen + + Reviewed by Eric Seidel. + + Don't store RegExp flags string representation + https://bugs.webkit.org/show_bug.cgi?id=33321 + + It's unused; the string representation is reconstructed from flags. + + * runtime/RegExp.cpp: + (JSC::RegExp::RegExp): + * runtime/RegExp.h: + +2010-01-08 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Memory use grows grows possibly unbounded in this JavaScript Array test case + https://bugs.webkit.org/show_bug.cgi?id=31675 + + This fixes one observed bug in this test case, which is that + arrays don't report extra cost for the sparse value maps. + + SunSpider reports a small speedup. + + * runtime/JSArray.cpp: + (JSC::JSArray::putSlowCase): Report extra memory cost for + the sparse value map. + * runtime/JSArray.h: + +2010-01-08 Yong Li + + Reviewed by Darin Adler. + + Remove unnecessary #include from FastMalloc.cpp + https://bugs.webkit.org/show_bug.cgi?id=33393 + + * wtf/FastMalloc.cpp: + +2010-01-08 Eric Seidel + + No review, rolling out r52983. + http://trac.webkit.org/changeset/52983 + https://bugs.webkit.org/show_bug.cgi?id=33321 + + Broke 59 JavaScriptCore tests. I don't think Kent knew about + run-javascriptcore-tests. Sadly neither does the commit-bot, + yet. + + * runtime/RegExp.cpp: + (JSC::RegExp::RegExp): + * runtime/RegExp.h: + (JSC::RegExp::flags): + +2010-01-08 Eric Seidel + + No review, rolling out r52981. + http://trac.webkit.org/changeset/52981 + https://bugs.webkit.org/show_bug.cgi?id=33319 + + Caused two JS tests to start failing: + ecma_2/RegExp/properties-001.js and js1_2/regexp/toString.js + + * runtime/RegExpPrototype.cpp: + (JSC::regExpProtoFuncToString): + +2010-01-08 Kent Hansen + + Reviewed by Darin Adler. + + Don't store RegExp flags string representation + https://bugs.webkit.org/show_bug.cgi?id=33321 + + It's unused; the string representation is reconstructed from flags. + + * runtime/RegExp.cpp: + (JSC::RegExp::RegExp): + * runtime/RegExp.h: + +2010-01-08 Kent Hansen + + Reviewed by Darin Adler. + + RegExp.prototype.toString returns "//" for empty regular expressions + https://bugs.webkit.org/show_bug.cgi?id=33319 + + "//" starts a single-line comment, hence "/(?:)/" should be used, according to ECMA. + + * runtime/RegExpPrototype.cpp: + (JSC::regExpProtoFuncToString): + +2010-01-08 Norbert Leser + + Reviewed by Darin Adler. + + RVCT compiler with "-Otime -O3" optimization tries to optimize out + inline new'ed pointers that are passed as arguments. + Proposed patch assigns new'ed pointer explicitly outside function call. + + https://bugs.webkit.org/show_bug.cgi?id=33084 + + * API/JSClassRef.cpp: + (OpaqueJSClass::OpaqueJSClass): + (OpaqueJSClassContextData::OpaqueJSClassContextData): + +2010-01-08 Gabor Loki + + Reviewed by Gavin Barraclough. + + Remove an unnecessary cacheFlush from ARM_TRADITIONAL JIT + https://bugs.webkit.org/show_bug.cgi?id=33203 + + * assembler/ARMAssembler.cpp: Remove obsolete linkBranch function. + (JSC::ARMAssembler::executableCopy): Inline a clean linkBranch code. + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::getLdrImmAddress): Use inline function. + (JSC::ARMAssembler::getLdrImmAddressOnPool): Ditto. + (JSC::ARMAssembler::patchPointerInternal): Remove an unnecessary cacheFlush. + (JSC::ARMAssembler::linkJump): Use patchPointerInternal instead of linkBranch. + (JSC::ARMAssembler::linkCall): Ditto. + (JSC::ARMAssembler::relinkCall): Ditto. + +2010-01-07 Gabor Loki + + Reviewed by Gavin Barraclough. + + Build fix for JSVALUE32 when ENABLE_JIT_OPTIMIZE* are disabled + https://bugs.webkit.org/show_bug.cgi?id=33311 + + Move compileGetDirectOffset function to common part of JSVALUE32 + + * jit/JITPropertyAccess.cpp: + (JSC::JIT::compileGetDirectOffset): + +2010-01-07 Laszlo Gombos + + Reviewed by Maciej Stachowiak. + + Allow call sites to determine if ASSERT_* and LOG_* macros are operational + https://bugs.webkit.org/show_bug.cgi?id=33020 + + * wtf/Assertions.h: Set ASSERT_MSG_DISABLED, FATAL_DISABLED, + ERROR_DISABLED, LOG_DISABLED to 1 if the compiler does not support + variadic macros. Refactor for better readibility. + +2010-01-07 Daniel Bates + + Reviewed by Eric Seidel. + + https://bugs.webkit.org/show_bug.cgi?id=32987 + + Added ENABLE_XHTMLMP flag. Disabled by default. + + * Configurations/FeatureDefines.xcconfig: + +2010-01-07 Laszlo Gombos + + Reviewed by Gavin Barraclough. + + [Symbian] Port ARM traditional JIT Trampolines to RVCT + https://bugs.webkit.org/show_bug.cgi?id=30552 + + Take the GCC implementation and mechanically convert + it to RVCT syntax. + + Use 'bx rX' instead of 'mov pc, rX' when it is available. + + Developed in cooperation with Iain Campbell and Gabor Loki. + + * JavaScriptCore.pri: Extra step to generate RVCT stubs. The + script generation intentionally executed all the time not just + for RVCT targets. + + * create_rvct_stubs: Added. Perl script to expand precompiler macros + for RVCT assembler - the template is defined in JITStubs.cpp. + + * jit/JITStubs.cpp: + (JSC::ctiTrampoline): + (JSC::ctiVMThrowTrampoline): + (JSC::ctiOpThrowNotCaught): + +2010-01-07 Geoffrey Garen + + Reviewed by Sam Weinig. + + Fix a crash seen on the buildbots. + + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::init): Disable specific function tracking here, + instead of in WebCore, to ensure that the disabling happens before a + specific function can be registered. + +2010-01-07 Alexey Proskuryakov + + Mac build fix. + + * JavaScriptCore.exp: Export new JSGlobalData static data members. + +2010-01-07 Alexey Proskuryakov + + Reviewed by Geoffrey Garen. + + https://bugs.webkit.org/show_bug.cgi?id=33057 + REGRESSION(r49365): typeof(xhr.responseText) != "string" in Windows + + REGRESSION: WebKit fails to start PeaceKeeper benchmark + + Test: fast/js/webcore-string-comparison.html + + In r49365, some code was moved from JSString.cpp to JSString.h, and as a result, WebCore + got a way to directly instantiate JSStrings over DLL borders. Since vftable for JSString was + not exported, objects created from WebCore got a different vptr, and JavaScriptCore + optimizations that relied on vptr of all JSString objects being equal failed. + + * config.h: Added a JS_EXPORTCLASS macro for exporting classes. It's currently the same as + JS_EXPORTDATA, but it clearly needed a new name. + + * runtime/InitializeThreading.cpp: + (JSC::initializeThreadingOnce): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::storeVPtrs): + (JSC::JSGlobalData::JSGlobalData): + (JSC::JSGlobalData::createNonDefault): + (JSC::JSGlobalData::create): + (JSC::JSGlobalData::sharedInstance): + * runtime/JSGlobalData.h: + Store vptrs just once, no need to repeatedly pick and copy them. This makes it possible to + assert vptr correctness in object destructors (which don't have access to JSGlobalData, + and even Heap::heap(this) will fail for fake objects created from storeVPtrs()). + + * runtime/JSArray.cpp: (JSC::JSArray::~JSArray): Assert that vptr is what we expect it to be. + It's important to assert in destructor, because MSVC changes the vptr after constructor + is invoked. + * runtime/JSByteArray.cpp: (JSC::JSByteArray::~JSByteArray): Ditto. + * runtime/JSByteArray.h: Ditto. + * runtime/JSFunction.h: Ditto. + * runtime/JSFunction.cpp: (JSC::JSFunction::~JSFunction): Ditto. + + * runtime/JSCell.h: (JSC::JSCell::setVPtr): Added a method to substitute vptr for another + one. + + * runtime/JSString.h: Export JSString class together with its vftable, and tell other + libraries tp import it. This is needed on platforms that have a separate JavaScriptCore + dynamic library - and on Mac, we already did the export via JavaScriptCore.exp. + (JSC::JSString::~JSString): Assert tha vptr is what we expect it to be. + (JSC::fixupVPtr): Store a previously saved primary vftable pointer (do nothing if building + JavaScriptCore itself). + (JSC::jsSingleCharacterString): Call fixupVPtr in case this is call across DLL boundary. + (JSC::jsSingleCharacterSubstring): Ditto. + (JSC::jsNontrivialString): Ditto. + (JSC::jsString): Ditto. + (JSC::jsSubstring): Ditto. + (JSC::jsOwnedString): Ditto. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export the new static + JSGlobalData members that are used in WebCore via inline functions. + +2010-01-07 Geoffrey Garen + + Reviewed by Sam Weinig. + + Safari memory usage skyrockets using new Google AdWords interface + https://bugs.webkit.org/show_bug.cgi?id=33343 + + The memory use was caused by the global object creating too many structures + as it thrashed between different specific functions. + + * runtime/Structure.cpp: + (JSC::Structure::Structure): + (JSC::Structure::addPropertyTransition): + (JSC::Structure::changePrototypeTransition): + (JSC::Structure::despecifyFunctionTransition): + (JSC::Structure::addAnonymousSlotsTransition): + (JSC::Structure::getterSetterTransition): + (JSC::Structure::toDictionaryTransition): + (JSC::Structure::addPropertyWithoutTransition): + (JSC::Structure::despecifyAllFunctions): + * runtime/Structure.h: + (JSC::Structure::disableSpecificFunctionTracking): Track a thrash count + for specific functions. Disable specific function tracking once the + thrash count has been hit. + +2010-01-07 Csaba Osztrogonác + + Reviewed by Simon Hausmann. + + [Qt] Enable JIT in debug mode on win32 after r51141 fixed the crashes. + + * JavaScriptCore.pri: + +2010-01-07 Zoltan Horvath + + Reviewed by Holger Freyther. + + [Mac] Build fix when FAST_MALLOC_MATCH_VALIDATION=1 + https://bugs.webkit.org/show_bug.cgi?id=33312 + + Using of operator += cause compile error on Mac, so it is changed to + "= static_cast(old_ptr) + 1". + + * wtf/FastMalloc.cpp: + (WTF::TCMallocStats::realloc): + +2010-01-07 Zoltan Horvath + + Reviewed by Holger Freyther. + + [Qt] Build fix when FAST_MALLOC_MATCH_VALIDATION=1 + https://bugs.webkit.org/show_bug.cgi?id=33312 + + Remove pByte (committed in r42344 from #20422), because pByte doesn't + exist and it is unnecessary. + + * wtf/FastMalloc.cpp: + (WTF::TCMallocStats::realloc): + +2010-01-06 Gavin Barraclough + + QT build fix. + + * runtime/Identifier.cpp: + (JSC::createIdentifierTableSpecific): + +2010-01-06 Gavin Barraclough + + Windows build fix part I. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2010-01-06 Dan Bernstein + + Build fix + + * runtime/Identifier.cpp: + (JSC::createIdentifierTableSpecificCallback): + +2010-01-05 Gavin Barraclough + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=33236 + Remove m_identifierTable pointer from UString + + Currently every string holds a pointer so that during destruction, + if a string has been used as an identifier, it can remove itself + from the table. By instead accessing the identifierTable via a + thread specific tracking the table associated with the current + globaldata, we can save the memory cost of this pointer. + + * API/APIShims.h: + (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): + (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): + (JSC::APICallbackShim::APICallbackShim): + (JSC::APICallbackShim::~APICallbackShim): + + - change the API shims to track the identifierTable of the current JSGlobalData. + + * API/JSContextRef.cpp: + (JSContextGroupCreate): + + - update creation of JSGlobalData for API usage to use new create method. + - fix shim instanciation bug in JSGlobalContextCreateInGroup. + + * JavaScriptCore.exp: + * runtime/Completion.cpp: + (JSC::checkSyntax): + (JSC::evaluate): + + - add asserts to check the identifierTable is being tracked correctly. + + * runtime/Identifier.cpp: + (JSC::IdentifierTable::~IdentifierTable): + (JSC::IdentifierTable::add): + (JSC::Identifier::remove): + (JSC::Identifier::checkSameIdentifierTable): + (JSC::createIdentifierTableSpecificCallback): + (JSC::createIdentifierTableSpecific): + (JSC::createDefaultDataSpecific): + + - Use currentIdentifierTable() instead of UStringImpl::m_identifierTable. + - Define methods to access the thread specific identifier tables. + + * runtime/Identifier.h: + (JSC::ThreadIdentifierTableData::ThreadIdentifierTableData): + (JSC::defaultIdentifierTable): + (JSC::setDefaultIdentifierTable): + (JSC::currentIdentifierTable): + (JSC::setCurrentIdentifierTable): + (JSC::resetCurrentIdentifierTable): + + - Declare methods to access the thread specific identifier tables. + + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::createNonDefault): + (JSC::JSGlobalData::create): + (JSC::JSGlobalData::sharedInstance): + + - creation of JSGlobalData objects, other than for API usage, associate themselves with the current thread. + + * runtime/JSGlobalData.h: + * runtime/UStringImpl.cpp: + (JSC::UStringImpl::destroy): + + - destroy() method should be using isIdentifier(). + + * runtime/UStringImpl.h: + (JSC::UStringImpl::isIdentifier): + (JSC::UStringImpl::setIsIdentifier): + (JSC::UStringImpl::checkConsistency): + (JSC::UStringImpl::UStringImpl): + + - replace m_identifierTable with a single m_isIdentifier bit. + + * wtf/StringHashFunctions.h: + (WTF::stringHash): + + - change string hash result from 32-bit to 31-bit, to free a bit in UStringImpl for m_isIdentifier. + +2009-12-25 Patrick Gansterer + + Reviewed by Eric Seidel. + + Buildfix for WinCE + style fixes. + https://bugs.webkit.org/show_bug.cgi?id=32939 + + * jsc.cpp: + (functionPrint): + (functionQuit): + (parseArguments): + (fillBufferWithContentsOfFile): + +2010-01-05 Patrick Gansterer + + Reviewed by Eric Seidel. + + WinCE buildfix after r52791 (renamed PLATFORM(WINCE) to OS(WINCE)). + https://bugs.webkit.org/show_bug.cgi?id=33205 + + * jit/ExecutableAllocator.h: + +2010-01-05 Patrick Gansterer + + Reviewed by Darin Adler. + + Added compiler error for unsupported platforms. + https://bugs.webkit.org/show_bug.cgi?id=33112 + + * jit/JITStubs.cpp: + +2010-01-05 Gabor Loki + + Reviewed by Maciej Stachowiak. + + Follow r52729 in ARMAssembler. + https://bugs.webkit.org/show_bug.cgi?id=33208 + + Use WTF_ARM_ARCH_AT_LEAST instead of ARM_ARCH_VERSION + + * assembler/ARMAssembler.cpp: + (JSC::ARMAssembler::encodeComplexImm): Move tmp declaration to ARMv7 + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::): + (JSC::ARMAssembler::bkpt): + +2010-01-05 Maciej Stachowiak + + Unreviewed build fix for Gtk+ + + Don't use // comments in Platform.h, at least some of them seem to make the version of GCC + used on the Gtk buildbot unhappy. + + * wtf/Platform.h: + +2010-01-04 Maciej Stachowiak + + Reviewed by Darin Fisher. + + Reorganize, document and rename OS() platform macros. + https://bugs.webkit.org/show_bug.cgi?id=33198 + + * wtf/Platform.h: Rename, reorganize and document OS() macros. + + Adapt to name changes. Also fixed a few incorrect OS checks. + + * API/JSContextRef.cpp: + * assembler/MacroAssemblerARM.cpp: + (JSC::isVFPPresent): + * assembler/MacroAssemblerX86Common.h: + * bytecode/SamplingTool.cpp: + * config.h: + * interpreter/RegisterFile.cpp: + (JSC::RegisterFile::~RegisterFile): + * interpreter/RegisterFile.h: + (JSC::RegisterFile::RegisterFile): + (JSC::RegisterFile::grow): + * jit/ExecutableAllocator.h: + * jit/ExecutableAllocatorFixedVMPool.cpp: + * jit/ExecutableAllocatorPosix.cpp: + * jit/ExecutableAllocatorSymbian.cpp: + * jit/ExecutableAllocatorWin.cpp: + * jit/JITOpcodes.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + * jit/JITStubs.cpp: + * jsc.cpp: + (main): + * parser/Grammar.y: + * profiler/ProfileNode.cpp: + (JSC::getCount): + * runtime/Collector.cpp: + (JSC::Heap::Heap): + (JSC::Heap::allocateBlock): + (JSC::Heap::freeBlockPtr): + (JSC::currentThreadStackBase): + (JSC::getCurrentPlatformThread): + (JSC::suspendThread): + (JSC::resumeThread): + (JSC::getPlatformThreadRegisters): + (JSC::otherThreadStackPointer): + * runtime/Collector.h: + * runtime/DateConstructor.cpp: + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + * runtime/InitializeThreading.cpp: + (JSC::initializeThreading): + * runtime/MarkStack.h: + (JSC::MarkStack::MarkStackArray::shrinkAllocation): + * runtime/MarkStackPosix.cpp: + * runtime/MarkStackSymbian.cpp: + * runtime/MarkStackWin.cpp: + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncLastIndexOf): + * runtime/TimeoutChecker.cpp: + (JSC::getCPUTime): + * runtime/UString.cpp: + (JSC::UString::from): + * wtf/Assertions.cpp: + * wtf/Assertions.h: + * wtf/CurrentTime.cpp: + (WTF::lowResUTCTime): + * wtf/CurrentTime.h: + (WTF::getLocalTime): + * wtf/DateMath.cpp: + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_ThreadCache::InitModule): + (WTF::TCMallocStats::): + * wtf/FastMalloc.h: + * wtf/MathExtras.h: + * wtf/RandomNumber.cpp: + (WTF::randomNumber): + * wtf/RandomNumberSeed.h: + (WTF::initializeRandomNumberGenerator): + * wtf/StringExtras.h: + * wtf/TCSpinLock.h: + (TCMalloc_SpinLock::Unlock): + (TCMalloc_SlowLock): + * wtf/TCSystemAlloc.cpp: + * wtf/ThreadSpecific.h: + (WTF::::destroy): + * wtf/Threading.h: + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + (WTF::isMainThread): + * wtf/ThreadingWin.cpp: + (WTF::wtfThreadEntryPoint): + (WTF::createThreadInternal): + * wtf/VMTags.h: + * wtf/unicode/icu/CollatorICU.cpp: + (WTF::Collator::userDefault): + * wtf/win/MainThreadWin.cpp: + (WTF::initializeMainThreadPlatform): + +2010-01-04 Gustavo Noronha Silva + + Add missing files to the build system - make distcheck build fix. + + * GNUmakefile.am: + +2010-01-04 Gavin Barraclough + + Reviewed by Sam Weinig, additional coding by Mark Rowe. + + https://bugs.webkit.org/show_bug.cgi?id=33163 + Add string hashing functions to WTF. + Use WTF's string hashing functions from UStringImpl. + + * GNUmakefile.am: + * JavaScriptCore.exp: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/UStringImpl.cpp: + * runtime/UStringImpl.h: + (JSC::UStringImpl::computeHash): + * wtf/HashFunctions.h: + * wtf/StringHashFunctions.h: Added. + (WTF::stringHash): + +2010-01-04 Dmitry Titov + + Not reviewed, attempt to fix ARM bulid. + + * wtf/Platform.h: + +2010-01-04 Gavin Barraclough + + Rubber stamped by Geoff Garen. + + Add an 'isIdentifier' to UStringImpl, use this where appropriate + (where previously 'identifierTable' was being tested). + + * API/JSClassRef.cpp: + (OpaqueJSClass::~OpaqueJSClass): + (OpaqueJSClassContextData::OpaqueJSClassContextData): + * runtime/Identifier.cpp: + (JSC::Identifier::addSlowCase): + * runtime/Identifier.h: + (JSC::Identifier::add): + * runtime/PropertyNameArray.cpp: + (JSC::PropertyNameArray::add): + * runtime/UStringImpl.h: + (JSC::UStringImpl::isIdentifier): + +2010-01-04 Gavin Barraclough + + Reviewed by Sam "Shimmey Shimmey" Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=33158 + Refactor JSC API entry/exit to use RAII instead of copy/pasting code. + Make it easier to change set of actions taken when passing across the API boundary. + + * API/APIShims.h: Added. + (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): + (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): + (JSC::APIEntryShim::APIEntryShim): + (JSC::APICallbackShim::APICallbackShim): + (JSC::APICallbackShim::~APICallbackShim): + * API/JSBase.cpp: + (JSEvaluateScript): + (JSCheckScriptSyntax): + (JSGarbageCollect): + (JSReportExtraMemoryCost): + * API/JSCallbackConstructor.cpp: + (JSC::constructJSCallback): + * API/JSCallbackFunction.cpp: + (JSC::JSCallbackFunction::call): + * API/JSCallbackObjectFunctions.h: + (JSC::::init): + (JSC::::getOwnPropertySlot): + (JSC::::put): + (JSC::::deleteProperty): + (JSC::::construct): + (JSC::::hasInstance): + (JSC::::call): + (JSC::::getOwnPropertyNames): + (JSC::::toNumber): + (JSC::::toString): + (JSC::::staticValueGetter): + (JSC::::callbackGetter): + * API/JSContextRef.cpp: + * API/JSObjectRef.cpp: + (JSObjectMake): + (JSObjectMakeFunctionWithCallback): + (JSObjectMakeConstructor): + (JSObjectMakeFunction): + (JSObjectMakeArray): + (JSObjectMakeDate): + (JSObjectMakeError): + (JSObjectMakeRegExp): + (JSObjectGetPrototype): + (JSObjectSetPrototype): + (JSObjectHasProperty): + (JSObjectGetProperty): + (JSObjectSetProperty): + (JSObjectGetPropertyAtIndex): + (JSObjectSetPropertyAtIndex): + (JSObjectDeleteProperty): + (JSObjectCallAsFunction): + (JSObjectCallAsConstructor): + (JSObjectCopyPropertyNames): + (JSPropertyNameArrayRelease): + (JSPropertyNameAccumulatorAddName): + * API/JSValueRef.cpp: + (JSValueGetType): + (JSValueIsUndefined): + (JSValueIsNull): + (JSValueIsBoolean): + (JSValueIsNumber): + (JSValueIsString): + (JSValueIsObject): + (JSValueIsObjectOfClass): + (JSValueIsEqual): + (JSValueIsStrictEqual): + (JSValueIsInstanceOfConstructor): + (JSValueMakeUndefined): + (JSValueMakeNull): + (JSValueMakeBoolean): + (JSValueMakeNumber): + (JSValueMakeString): + (JSValueToBoolean): + (JSValueToNumber): + (JSValueToStringCopy): + (JSValueToObject): + (JSValueProtect): + (JSValueUnprotect): + * JavaScriptCore.xcodeproj/project.pbxproj: + +2010-01-04 Dan Bernstein + + Reviewed by Ada Chan and Mark Rowe. + + Updated copyright string + + * Info.plist: + * JavaScriptCore.vcproj/JavaScriptCore.resources/Info.plist: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: + +2010-01-04 Adam Roben + + No review, rolling out r52741. + http://trac.webkit.org/changeset/52741 + https://bugs.webkit.org/show_bug.cgi?id=33056 + + * wtf/AlwaysInline.h: + +2010-01-04 Patrick Gansterer + + Reviewed by Darin Adler. + + Add cacheFlush support for WinCE + https://bugs.webkit.org/show_bug.cgi?id=33110 + + * jit/ExecutableAllocator.h: + (JSC::ExecutableAllocator::cacheFlush): + +2010-01-04 Patrick Gansterer + + Reviewed by Adam Roben. + + Implement NO_RETURN for COMPILER(MSVC). + https://bugs.webkit.org/show_bug.cgi?id=33056 + + * wtf/AlwaysInline.h: + +2010-01-04 Maciej Stachowiak + + Reviewed by Simon Hausmann. + + Fix some PLATFORM(*_ENDIAN) uses to CPU() + https://bugs.webkit.org/show_bug.cgi?id=33148 + + * runtime/JSCell.cpp: + (JSC::): + * runtime/JSValue.h: + (JSC::JSValue::): + +2010-01-04 Maciej Stachowiak + + Reviewed by Adam Barth. + + Document CPU() macros in comments. + https://bugs.webkit.org/show_bug.cgi?id=33147 + + * wtf/Platform.h: + +2010-01-04 Maciej Stachowiak + + Reviewed by Adam Barth. + + Reorganize, document and rename CPU() platform macros. + https://bugs.webkit.org/show_bug.cgi?id=33145 + ExecutableAllocatorSymbian appears to have buggy ARM version check + https://bugs.webkit.org/show_bug.cgi?id=33138 + + * wtf/Platform.h: + Rename all macros related to detection of particular CPUs or + classes of CPUs to CPU(), reorganize and document them. + + All remaining changes are adapting to the renames, plus fixing the + second bug cited above. + + * assembler/ARMAssembler.cpp: + * assembler/ARMAssembler.h: + * assembler/ARMv7Assembler.h: + * assembler/AbstractMacroAssembler.h: + (JSC::AbstractMacroAssembler::Imm32::Imm32): + * assembler/MacroAssembler.h: + * assembler/MacroAssemblerARM.cpp: + * assembler/MacroAssemblerARM.h: + * assembler/MacroAssemblerCodeRef.h: + (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): + * assembler/MacroAssemblerX86.h: + * assembler/MacroAssemblerX86Common.h: + * assembler/MacroAssemblerX86_64.h: + * assembler/X86Assembler.h: + (JSC::X86Registers::): + (JSC::X86Assembler::): + (JSC::X86Assembler::movl_mEAX): + (JSC::X86Assembler::movl_EAXm): + (JSC::X86Assembler::repatchLoadPtrToLEA): + (JSC::X86Assembler::X86InstructionFormatter::memoryModRM): + * jit/ExecutableAllocator.h: + * jit/ExecutableAllocatorFixedVMPool.cpp: + * jit/ExecutableAllocatorPosix.cpp: + * jit/ExecutableAllocatorSymbian.cpp: + (JSC::ExecutableAllocator::intializePageSize): + * jit/JIT.cpp: + * jit/JIT.h: + * jit/JITArithmetic.cpp: + * jit/JITInlineMethods.h: + (JSC::JIT::beginUninterruptedSequence): + (JSC::JIT::restoreArgumentReferenceForTrampoline): + (JSC::JIT::emitCount): + * jit/JITOpcodes.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::privateCompileGetByIdProto): + (JSC::JIT::privateCompileGetByIdProtoList): + (JSC::JIT::privateCompileGetByIdChainList): + (JSC::JIT::privateCompileGetByIdChain): + * jit/JITStubs.cpp: + (JSC::JITThunks::JITThunks): + * jit/JITStubs.h: + * runtime/Collector.cpp: + (JSC::currentThreadStackBase): + (JSC::getPlatformThreadRegisters): + (JSC::otherThreadStackPointer): + * wrec/WREC.h: + * wrec/WRECGenerator.cpp: + (JSC::WREC::Generator::generateEnter): + (JSC::WREC::Generator::generateReturnSuccess): + (JSC::WREC::Generator::generateReturnFailure): + * wrec/WRECGenerator.h: + * wtf/FastMalloc.cpp: + * wtf/TCSpinLock.h: + (TCMalloc_SpinLock::Lock): + (TCMalloc_SpinLock::Unlock): + (TCMalloc_SlowLock): + * wtf/Threading.h: + * wtf/dtoa.cpp: + * yarr/RegexJIT.cpp: + (JSC::Yarr::RegexGenerator::generateEnter): + (JSC::Yarr::RegexGenerator::generateReturn): + * yarr/RegexJIT.h: + +2010-01-04 Maciej Stachowiak + + Reviewed by Adam Barth. + + Clean up COMPILER macros and remove unused ones. + https://bugs.webkit.org/show_bug.cgi?id=33132 + + Removed values are COMPILER(BORLAND) and COMPILER(CYGWIN) - they were + not used anywhere. + + * wtf/Platform.h: + +2010-01-03 Maciej Stachowiak + + Reviewed by Eric Seidel. + + Update wtf/Platform.h to document the new system for porting macros. + https://bugs.webkit.org/show_bug.cgi?id=33130 + + * wtf/Platform.h: + +2009-12-29 Laszlo Gombos + + Reviewed by Maciej Stachowiak. + + PLATFORM(CAIRO) should be defined by WIN_CAIRO define + https://bugs.webkit.org/show_bug.cgi?id=22250 + + * wtf/Platform.h: Define WTF_PLATFORM_CAIRO for GTK port only + For the WinCairo port WTF_PLATFORM_CAIRO is already defined in config.h + +2009-12-28 Shu Chang + + Reviewed by Laszlo Gombos. + + [Qt] Delete ThreadPrivate instance after it is finished. + https://bugs.webkit.org/show_bug.cgi?id=32614 + + * wtf/qt/ThreadingQt.cpp: + (WTF::ThreadMonitor::instance): + (WTF::ThreadMonitor::threadFinished): + (WTF::createThreadInternal): + (WTF::detachThread): + +2009-12-28 Patrick Gansterer + + Reviewed by Maciej Stachowiak. + + Cleanup of #define JS_EXPORT. + + * API/JSBase.h: + +2009-12-27 Patrick Gansterer + + Reviewed by Adam Barth. + + WinCE buildfix (HWND_MESSAGE isn't supported there) + + * wtf/win/MainThreadWin.cpp: + (WTF::initializeMainThreadPlatform): + +2009-12-27 Patrick Gansterer + + Reviewed by Adam Barth. + + Added a file with WinMain function to link agains in WinCE. + + * os-win32/WinMain.cpp: Added. + (convertToUtf8): + (WinMain): + +2009-12-24 Laszlo Gombos + + Unreviewed; revert of r52550. + + The change regressed the following LayoutTests for QtWebKit. + + fast/workers/worker-call.html -> crashed + fast/workers/worker-close.html -> crashed + + * wtf/qt/ThreadingQt.cpp: + (WTF::waitForThreadCompletion): + (WTF::detachThread): + +2009-12-24 Shu Chang + + Reviewed by Laszlo Gombos. + + [Qt] Fix memory leak by deleting instance of ThreadPrivate + in function waitForThreadCompletion(), synchronously, or in + detachThread(), asynchronously. + https://bugs.webkit.org/show_bug.cgi?id=32614 + + * wtf/qt/ThreadingQt.cpp: + (WTF::waitForThreadCompletion): + (WTF::detachThread): + +2009-12-23 Kwang Yul Seo + + Reviewed by Laszlo Gombos. + + Include stddef.h for ptrdiff_t + https://bugs.webkit.org/show_bug.cgi?id=32891 + + ptrdiff_t is typedef-ed in stddef.h. + Include stddef.h in jit/ExecutableAllocator.h. + + * jit/ExecutableAllocator.h: + +2009-12-23 Patrick Gansterer + + Reviewed by Eric Seidel. + + Buildfix after r47092. + + * wtf/wince/MemoryManager.cpp: + (WTF::tryFastMalloc): + (WTF::tryFastZeroedMalloc): + (WTF::tryFastCalloc): + (WTF::tryFastRealloc): + +2009-12-23 Kent Tamura + + Reviewed by Darin Adler. + + HTMLInputElement::valueAsDate getter support. + https://bugs.webkit.org/show_bug.cgi?id=32876 + + Expose dateToDaysFrom1970(). + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * wtf/DateMath.cpp: + (WTF::dateToDaysFrom1970): + * wtf/DateMath.h: + +2009-12-22 Darin Adler + + Reviewed by Mark Rowe. + + Turn off datagrid by default, at least for all platforms Apple ships. + The datagrid implementation isn't ready for general web use yet. + + * Configurations/FeatureDefines.xcconfig: Turn off datagrid by default. + +2009-12-22 Steve Block + + Reviewed by David Levin. + + Updates Android's scheduleDispatchFunctionsOnMainThread() to use new + AndroidThreading class, rather than using JavaSharedClient directly. + This fixes the current layering violation. + https://bugs.webkit.org/show_bug.cgi?id=32651 + + The pattern is copied from Chromium, which uses the ChromiumThreading + class. This patch also fixes the style in ChromiumThreading.h. + + * wtf/android/AndroidThreading.h: Added. Declares AndroidThreading. + * wtf/android/MainThreadAndroid.cpp: Modified + (WTF::scheduleDispatchFunctionsOnMainThread): Uses AndroidThreading. + * wtf/chromium/ChromiumThreading.h: Modified. Fixes style. + +2009-12-22 Gavin Barraclough + + Reviewed by Sam Weinig. + + Fix a couple of problems with UntypedPtrAndBitfield. + + Add a m_leaksPtr to reduce false positives from leaks in debug builds + (this isn't perfect because we'd like a solution for release builds, + but this is now at least as good as a PtrAndFlags would be). + + Switch SmallStringsto use a regular string for the base, rather than + a static one. UntypedPtrAndBitfield assumes all strings are at least + 8 byte aligned; this migt not be true of static strings. Shared buffers + are heap allocated, as are all UStringImpls other than static strings. + Static strings cannot end up being the owner string of substrings, + since the only static strings are length 0. + + * runtime/SmallStrings.cpp: + (JSC::SmallStringsStorage::SmallStringsStorage): + * runtime/UStringImpl.h: + (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield): + (JSC::UStringImpl::UStringImpl): + +2009-12-22 Kwang Yul Seo + + Reviewed by Darin Adler. + + RVCT (__ARMCC_VERSION < 400000) does not provide strcasecmp and strncasecmp + https://bugs.webkit.org/show_bug.cgi?id=32857 + + Add implementation of strcasecmp and strncasecmp for RVCT < 4.0 + because earlier versions of RVCT 4.0 does not provide these functions. + + * wtf/StringExtras.cpp: Added. + (strcasecmp): + (strncasecmp): + * wtf/StringExtras.h: + +2009-12-22 Kwang Yul Seo + + Reviewed by Darin Adler. + + Define ALWAYS_INLINE and WTF_PRIVATE_INLINE to __forceinline for RVCT + https://bugs.webkit.org/show_bug.cgi?id=32853 + + Use __forceinline forces RVCT to compile a C or C++ function + inline. The compiler attempts to inline the function, regardless of + the characteristics of the function. + + * wtf/AlwaysInline.h: + * wtf/FastMalloc.h: + +2009-12-21 Simon Hausmann + + Prospective GTK build fix: Add UStringImpl.cpp/h to the build. + + * GNUmakefile.am: + +2009-12-21 Simon Hausmann + + Fix the Qt build, add UStringImpl.cpp to the build. + + * JavaScriptCore.pri: + +2009-12-21 Gavin Barraclough + + Windows Build fix part 5. + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + +2009-12-21 Gavin Barraclough + + Reviewed by NOBODY (build fix). + Fix breakage of world introduced in build fix to r52463. + + * runtime/UStringImpl.h: + +2009-12-21 Gavin Barraclough + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=32831 + Replace UString::Rep implementation, following introduction of ropes to JSC. + + * Remove redundant overcapacity mechanisms. + * Reduce memory cost of Rep's. + * Add an inline storage mechanism akin to that in WebCore's StringImpl. + + ~1% Sunspider progression. + + * JavaScriptCore.exp: + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/JSString.cpp: + (JSC::JSString::resolveRope): + * runtime/SmallStrings.cpp: + (JSC::SmallStringsStorage::SmallStringsStorage): + * runtime/UString.cpp: + (JSC::initializeUString): + (JSC::createRep): + (JSC::UString::createFromUTF8): + (JSC::UString::createUninitialized): + (JSC::UString::spliceSubstringsWithSeparators): + (JSC::UString::replaceRange): + (JSC::UString::ascii): + (JSC::UString::operator=): + (JSC::UString::toStrictUInt32): + (JSC::equal): + * runtime/UString.h: + (JSC::UString::isEmpty): + (JSC::UString::cost): + (JSC::makeString): + * runtime/UStringImpl.cpp: Added. + (JSC::UStringImpl::baseSharedBuffer): + (JSC::UStringImpl::sharedBuffer): + (JSC::UStringImpl::destroy): + (JSC::UStringImpl::computeHash): + * runtime/UStringImpl.h: Added. + (JSC::UntypedPtrAndBitfield::UntypedPtrAndBitfield): + (JSC::UntypedPtrAndBitfield::asPtr): + (JSC::UntypedPtrAndBitfield::operator&=): + (JSC::UntypedPtrAndBitfield::operator|=): + (JSC::UntypedPtrAndBitfield::operator&): + (JSC::UStringImpl::create): + (JSC::UStringImpl::createCopying): + (JSC::UStringImpl::createUninitialized): + (JSC::UStringImpl::data): + (JSC::UStringImpl::size): + (JSC::UStringImpl::cost): + (JSC::UStringImpl::hash): + (JSC::UStringImpl::computedHash): + (JSC::UStringImpl::setHash): + (JSC::UStringImpl::identifierTable): + (JSC::UStringImpl::setIdentifierTable): + (JSC::UStringImpl::ref): + (JSC::UStringImpl::deref): + (JSC::UStringImpl::allocChars): + (JSC::UStringImpl::copyChars): + (JSC::UStringImpl::computeHash): + (JSC::UStringImpl::null): + (JSC::UStringImpl::empty): + (JSC::UStringImpl::checkConsistency): + (JSC::UStringImpl::): + (JSC::UStringImpl::UStringImpl): + (JSC::UStringImpl::operator new): + (JSC::UStringImpl::bufferOwnerString): + (JSC::UStringImpl::bufferOwnership): + (JSC::UStringImpl::isStatic): + +2009-12-18 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + Move some build decisions from Qt build system into source files + https://bugs.webkit.org/show_bug.cgi?id=31956 + + * JavaScriptCore.pri: Compile files unconditionally + * jit/ExecutableAllocatorPosix.cpp: Guard with PLATFORM(UNIX) && !PLATFORM(SYMBIAN) + * jit/ExecutableAllocatorWin.cpp: Guard with PLATFORM(WIN_OS) + * runtime/MarkStackPosix.cpp: Guard with PLATFORM(UNIX) && !PLATFORM(SYMBIAN) + * runtime/MarkStackSymbian.cpp: Guard with PLATFORM(SYMBIAN) + * runtime/MarkStackWin.cpp: Guard with PLATFORM(WIN_OS) + * wtf/Platform.h: Guard ENABLE_JSC_MULTIPLE_THREADS with ENABLE_SINGLE_THREADED for the Qt port + * wtf/ThreadingNone.cpp: Guard with ENABLE(SINGLE_THREADED) + * wtf/qt/ThreadingQt.cpp: Guard with !ENABLE(SINGLE_THREADED) + +2009-12-18 Gavin Barraclough + + Reviewed by Sam Weinig. + + Add createNonCopying method to UString to make replace constructor passed bool, + to make behaviour more explicit. Add createFromUTF8 to UString (wrapping method + on UString::Rep), since other cases of transliteration (e.g. from ascii) are + performed in UString constructors. Add/use setHash & size() accessors on Rep, + rather than accessing _hash/len directly. + + * API/JSClassRef.cpp: + (OpaqueJSClass::OpaqueJSClass): + * API/OpaqueJSString.cpp: + (OpaqueJSString::ustring): + * JavaScriptCore.exp: + * runtime/ArrayPrototype.cpp: + (JSC::arrayProtoFuncToString): + * runtime/Identifier.cpp: + (JSC::Identifier::equal): + (JSC::CStringTranslator::translate): + (JSC::UCharBufferTranslator::translate): + (JSC::Identifier::addSlowCase): + * runtime/JSString.cpp: + (JSC::JSString::resolveRope): + * runtime/JSString.h: + (JSC::JSString::Rope::Fiber::refAndGetLength): + (JSC::JSString::Rope::append): + * runtime/StringBuilder.h: + (JSC::StringBuilder::release): + * runtime/StringConstructor.cpp: + (JSC::stringFromCharCodeSlowCase): + * runtime/StringPrototype.cpp: + (JSC::substituteBackreferencesSlow): + (JSC::stringProtoFuncToLowerCase): + (JSC::stringProtoFuncToUpperCase): + (JSC::stringProtoFuncFontsize): + (JSC::stringProtoFuncLink): + * runtime/UString.cpp: + (JSC::UString::UString): + (JSC::UString::createNonCopying): + (JSC::UString::createFromUTF8): + * runtime/UString.h: + (JSC::UString::Rep::setHash): + (JSC::UString::~UString): + (JSC::makeString): + +2009-12-18 Geoffrey Garen + + Reviewed by Cameron Zwarich and Gavin Barraclough. + + Changed Register constructors to assignment operators, to streamline + moving values into registers. (In theory, there's no difference between + the two, since the constructor should just inline away, but there seems + to be a big difference in the addled mind of the GCC optimizer.) + + In the interpreter, this is a 3.5% SunSpider speedup and a 1K-2K + reduction in stack usage per privateExecute stack frame. + + * interpreter/CallFrame.h: + (JSC::ExecState::setCalleeArguments): + (JSC::ExecState::setCallerFrame): + (JSC::ExecState::setScopeChain): + (JSC::ExecState::init): + (JSC::ExecState::setArgumentCount): + (JSC::ExecState::setCallee): + (JSC::ExecState::setCodeBlock): Added a little bit of casting so these + functions could use the new Register assignment operators. + + * interpreter/Register.h: + (JSC::Register::withInt): + (JSC::Register::Register): + (JSC::Register::operator=): Swapped in assignment operators for constructors. + +2009-12-18 Yongjun Zhang + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=32713 + [Qt] make wtf/Assertions.h compile in winscw compiler. + + Add string arg before ellipsis to help winscw compiler resolve variadic + macro definitions in wtf/Assertions.h. + + * wtf/Assertions.h: + +2009-12-18 Geoffrey Garen + + Reviewed by Adam Roben. + + Fixed intermittent failure seen on Windows buildbot, and in other JSC + API clients. + + Added a WeakGCPtr class and changed OpaqueJSClass::cachedPrototype to + use it, to avoid vending a stale object as a prototype. + + * API/JSClassRef.cpp: + (OpaqueJSClassContextData::OpaqueJSClassContextData): + (OpaqueJSClass::prototype): + * API/JSClassRef.h: Use WeakGCPtr. + + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/WeakGCPtr.h: Added. + (JSC::WeakGCPtr::WeakGCPtr): + (JSC::WeakGCPtr::get): + (JSC::WeakGCPtr::clear): + (JSC::WeakGCPtr::operator*): + (JSC::WeakGCPtr::operator->): + (JSC::WeakGCPtr::operator!): + (JSC::WeakGCPtr::operator bool): + (JSC::WeakGCPtr::operator UnspecifiedBoolType): + (JSC::WeakGCPtr::assign): + (JSC::::operator): + (JSC::operator==): + (JSC::operator!=): + (JSC::static_pointer_cast): + (JSC::const_pointer_cast): + (JSC::getPtr): Added WeakGCPtr to the project. + +2009-12-18 Gavin Barraclough + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=32720 + + * JavaScriptCore.exp: + - Remove exports for UString::append + * JavaScriptCore.xcodeproj/project.pbxproj: + - Make StringBuilder a private header (was project). + +2009-12-18 Martin Robinson + + Reviewed by Gustavo Noronha Silva. + + [GTK] GRefPtr does not take a reference when assigned a raw pointer + https://bugs.webkit.org/show_bug.cgi?id=32709 + + Ensure that when assigning a raw pointer to a GRefPtr, the reference + count is incremented. Also remove the GRefPtr conversion overload as + GRefPtr types have necessarily incompatible reference counting. + + * wtf/gtk/GRefPtr.h: + (WTF::GRefPtr::operator=): + +2009-12-18 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + [Qt] Clean up the qmake build system to distinguish between trunk builds and package builds + + https://bugs.webkit.org/show_bug.cgi?id=32716 + + * pcre/pcre.pri: Use standalone_package instead of QTDIR_build + +2009-12-18 Martin Robinson + + Reviewed by Gustavo Noronha Silva. + + [GTK] Compile warning from line 29 of GRefPtr.cpp + https://bugs.webkit.org/show_bug.cgi?id=32703 + + Fix memory leak and compiler warning in GRefPtr GHashTable template + specialization. + + * wtf/gtk/GRefPtr.cpp: + (WTF::refGPtr): + +2009-12-17 Sam Weinig + + Reviewed by Mark Rowe. + + Add BUILDING_ON_SNOW_LEOPARD and TARGETING_SNOW_LEOPARD #defines. + + * wtf/Platform.h: + +2009-12-17 Adam Roben + + Sync JavaScriptCore.vcproj with JavaScriptCore.xcodeproj and the + source tree + + Fixes . + + Reviewed by Ada Chan. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Moved + around files and filters so that the structure matches + JavaScriptCore.xcodeproj and the source tree. A few headers that were + previously omitted have been added, as well as JSZombie.{cpp,h}. + +2009-12-17 Adam Roben + + Remove HeavyProfile and TreeProfile completely + + These were mostly removed in r42808, but the empty files were left in + place. + + Fixes . + + Reviewed by John Sullivan. + + * Android.mk: + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.pri: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCoreSources.bkl: + Removed HeavyProfile/TreeProfile source files. + + * profiler/HeavyProfile.cpp: Removed. + * profiler/HeavyProfile.h: Removed. + * profiler/TreeProfile.cpp: Removed. + * profiler/TreeProfile.h: Removed. + +2009-12-17 Martin Robinson + + Reviewed by Gustavo Noronha Silva. + + [GTK] WebKit GTK needs a wrapper for ref counted glib/gobject structs + https://bugs.webkit.org/show_bug.cgi?id=21599 + + Implement GRefPtr, a smart pointer for reference counted GObject types. + + * GNUmakefile.am: + * wtf/gtk/GOwnPtr.cpp: + (WTF::GDir): + * wtf/gtk/GRefPtr.h: Added. + (WTF::): + (WTF::GRefPtr::GRefPtr): + (WTF::GRefPtr::~GRefPtr): + (WTF::GRefPtr::clear): + (WTF::GRefPtr::get): + (WTF::GRefPtr::operator*): + (WTF::GRefPtr::operator->): + (WTF::GRefPtr::operator!): + (WTF::GRefPtr::operator UnspecifiedBoolType): + (WTF::GRefPtr::hashTableDeletedValue): + (WTF::::operator): + (WTF::::swap): + (WTF::swap): + (WTF::operator==): + (WTF::operator!=): + (WTF::static_pointer_cast): + (WTF::const_pointer_cast): + (WTF::getPtr): + (WTF::adoptGRef): + (WTF::refGPtr): + (WTF::derefGPtr): + +2009-12-17 Gustavo Noronha Silva + + Unreviewed. Build fixes for make distcheck. + + * GNUmakefile.am: + +2009-12-16 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Fixed Interpreter::privateExecute macro generates + bloated code + + This patch cuts Interpreter stack use by about a third. + + * bytecode/Opcode.h: Changed Opcode to const void* to work with the + const static initiliazation we want to do in Interpreter::privateExecute. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::Interpreter): Moved hashtable initialization here to + avoid polluting Interpreter::privateExecute's stack, and changed it from a + series of add() calls to one add() call in a loop, to cut down on code size. + + (JSC::Interpreter::privateExecute): Changed a series of label computations + to a copy of a compile-time constant array to cut down on code size. + +2009-12-16 Mark Rowe + + Build fix. Disable debug variants of WebKit frameworks. + + * JavaScriptCore.xcodeproj/project.pbxproj: + +2009-12-15 Geoffrey Garen + + Reviewed by Sam "r=me" Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=32498 + + REGRESSION(r51978-r52039): AJAX "Mark This Forum Read" function no longer + works + + Fixed a tyop. + + * runtime/Operations.h: + (JSC::jsAdd): Use the '&&' operator, not the ',' operator. + +2009-12-15 Geoffrey Garen + + Try to fix the windows build: don't export this inlined function. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-12-15 Geoffrey Garen + + Reviewed by Beth Dakin. + + Inlined JSCell's operator new. + + 3.7% speedup on bench-allocate-nonretained.js. + + * JavaScriptCore.exp: + * runtime/JSCell.cpp: + * runtime/JSCell.h: + (JSC::JSCell::operator new): + +2009-12-15 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Removed the number heap, replacing it with a one-item free list for + numbers, taking advantage of the fact that two number cells fit inside + the space for one regular cell, and number cells don't require destruction. + + SunSpider says 1.6% faster in JSVALUE32 mode (the only mode that + heap-allocates numbers). + + SunSpider says 1.1% faster in JSVALUE32_64 mode. v8 says 0.8% faster + in JSVALUE32_64 mode. 10% speedup on bench-alloc-nonretained.js. 6% + speedup on bench-alloc-retained.js. + + There's a lot of formulaic change in this patch, but not much substance. + + * JavaScriptCore.exp: + * debugger/Debugger.cpp: + (JSC::Debugger::recompileAllJSFunctions): + * runtime/Collector.cpp: + (JSC::Heap::Heap): + (JSC::Heap::destroy): + (JSC::Heap::allocateBlock): + (JSC::Heap::freeBlock): + (JSC::Heap::freeBlockPtr): + (JSC::Heap::freeBlocks): + (JSC::Heap::recordExtraCost): + (JSC::Heap::allocate): + (JSC::Heap::resizeBlocks): + (JSC::Heap::growBlocks): + (JSC::Heap::shrinkBlocks): + (JSC::Heap::markConservatively): + (JSC::Heap::clearMarkBits): + (JSC::Heap::markedCells): + (JSC::Heap::sweep): + (JSC::Heap::markRoots): + (JSC::Heap::objectCount): + (JSC::Heap::addToStatistics): + (JSC::Heap::statistics): + (JSC::Heap::isBusy): + (JSC::Heap::reset): + (JSC::Heap::collectAllGarbage): + (JSC::Heap::primaryHeapBegin): + (JSC::Heap::primaryHeapEnd): + * runtime/Collector.h: + (JSC::): Removed all code pertaining to the number heap, and changed all + heap template functions and classes to non-template functions and classes. + + (JSC::Heap::allocateNumber): A new optimization to replace the number + heap: allocate half-sized number cells in pairs, returning the first + cell and caching the second cell for the next allocation. + + * runtime/CollectorHeapIterator.h: + (JSC::LiveObjectIterator::LiveObjectIterator): + (JSC::LiveObjectIterator::operator++): + (JSC::DeadObjectIterator::DeadObjectIterator): + (JSC::DeadObjectIterator::operator++): + (JSC::ObjectIterator::ObjectIterator): + (JSC::ObjectIterator::operator++): + * runtime/JSCell.h: + (JSC::JSCell::isNumber): Removed all code pertaining to the number heap, + and changed all heap template functions and classes to non-template functions + and classes. + +2009-12-15 Zoltan Horvath + + Reviewed by Darin Adler. + + Allow custom memory allocation control for WeakGCMap class + https://bugs.webkit.org/show_bug.cgi?id=32547 + + Inherits WeakGCMap from FastAllocBase because it is instantiated by + 'new' at: WebCore/dom/Document.cpp:512. + + * runtime/WeakGCMap.h: + +2009-12-15 Zoltan Horvath + + Reviewed by Darin Adler. + + Allow custom memory allocation control for dtoa's P5Node struct + https://bugs.webkit.org/show_bug.cgi?id=32544 + + Inherits P5Node struct from Noncopyable because it is instantiated by + 'new' at wtf/dtoa.cpp:588 and don't need to be copyable. + + * wtf/dtoa.cpp: + +2009-12-14 Geoffrey Garen + + Reviewed by Simon Fraser. + + https://bugs.webkit.org/show_bug.cgi?id=32524 + REGRESSION(52084): fast/dom/prototypes.html failing two CSS tests + + * wtf/StdLibExtras.h: + (WTF::bitCount): The original patch put the parentheses in the wrong + place, completely changing the calculation and making it almost always + wrong. Moved the parentheses around the '+' operation, like the original + compiler warning suggested. + +2009-12-14 Gabor Loki + + Unreviewed trivial buildfix. + + Fix crosses initialization of usedPrimaryBlocks for JSValue32 + + * runtime/Collector.cpp: + (JSC::Heap::markConservatively): + +2009-12-14 Csaba Osztrogonác + + Reviewed by Simon Hausmann. + + GCC 4.3.x warning fixed. Suggested parantheses added. + warning: ../../../JavaScriptCore/wtf/StdLibExtras.h:77: warning: suggest parentheses around + or - in operand of & + + * wtf/StdLibExtras.h: + (WTF::bitCount): + +2009-12-13 Geoffrey Garen + + Reviewed by Sam Weinig. + + Changed GC from mark-sweep to mark-allocate. + + Added WeakGCMap to keep WebCore blissfully ignorant about objects that + have become garbage but haven't run their destructors yet. + + 1% SunSpider speedup. + 7.6% v8 speedup (37% splay speedup). + 17% speedup on bench-alloc-nonretained.js. + 18% speedup on bench-alloc-retained.js. + + * API/JSBase.cpp: + (JSGarbageCollect): + * API/JSContextRef.cpp: + * JavaScriptCore.exp: + * JavaScriptCore.xcodeproj/project.pbxproj: Updated for renames and new + files. + + * debugger/Debugger.cpp: + (JSC::Debugger::recompileAllJSFunctions): Updated to use the Collector + iterator abstraction. + + * jsc.cpp: + (functionGC): Updated for rename. + + * runtime/Collector.cpp: Slightly reduced the number of allocations per + collection, so that small workloads only allocate on collector block, + rather than two. + + (JSC::Heap::Heap): Updated to use the new allocateBlock function. + + (JSC::Heap::destroy): Updated to use the new freeBlocks function. + + (JSC::Heap::allocateBlock): New function to initialize a block when + allocating it. + + (JSC::Heap::freeBlock): Consolidated the responsibility for running + destructors into this function. + + (JSC::Heap::freeBlocks): Updated to use freeBlock. + + (JSC::Heap::recordExtraCost): Sweep the heap in this reporting function, + so that allocation, which is more common, doesn't have to check extraCost. + + (JSC::Heap::heapAllocate): Run destructors right before recycling a + garbage cell. This has better cache utilization than a separate sweep phase. + + (JSC::Heap::resizeBlocks): + (JSC::Heap::growBlocks): + (JSC::Heap::shrinkBlocks): New set of functions for managing the size of + the heap, now that the heap doesn't maintain any information about its + size. + + (JSC::isPointerAligned): + (JSC::isHalfCellAligned): + (JSC::isPossibleCell): + (JSC::isCellAligned): + (JSC::Heap::markConservatively): Cleaned up this code a bit. + + (JSC::Heap::clearMarkBits): + (JSC::Heap::markedCells): Some helper functions for examining the the mark + bitmap. + + (JSC::Heap::sweep): Simplified this function by using a DeadObjectIterator. + + (JSC::Heap::markRoots): Reordered some operations for clarity. + + (JSC::Heap::objectCount): + (JSC::Heap::addToStatistics): + (JSC::Heap::statistics): Rewrote these functions to calculate an object + count on demand, since the heap doesn't maintain this information by + itself. + + (JSC::Heap::reset): New function for resetting the heap once we've + exhausted heap space. + + (JSC::Heap::collectAllGarbage): This function matches the old collect() + behavior, but it's now an uncommon function used only by API. + + * runtime/Collector.h: + (JSC::CollectorBitmap::count): + (JSC::CollectorBitmap::isEmpty): Added some helper functions for managing + the collector mark bitmap. + + (JSC::Heap::reportExtraMemoryCost): Changed reporting from cell equivalents + to bytes, so it's easier to understand. + + * runtime/CollectorHeapIterator.h: + (JSC::CollectorHeapIterator::CollectorHeapIterator): + (JSC::CollectorHeapIterator::operator!=): + (JSC::CollectorHeapIterator::operator*): + (JSC::CollectorHeapIterator::advance): + (JSC::::LiveObjectIterator): + (JSC::::operator): + (JSC::::DeadObjectIterator): + (JSC::::ObjectIterator): New iterators for encapsulating details about + heap layout, and what's live and dead on the heap. + + * runtime/JSArray.cpp: + (JSC::JSArray::putSlowCase): + (JSC::JSArray::increaseVectorLength): Delay reporting extra cost until + we're fully constructed, so the heap mark phase won't visit us in an + invalid state. + + * runtime/JSCell.h: + (JSC::JSCell::): + (JSC::JSCell::createDummyStructure): + (JSC::JSCell::JSCell): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + * runtime/JSGlobalData.h: Added a dummy cell to simplify allocation logic. + + * runtime/JSString.h: + (JSC::jsSubstring): Don't report extra cost for substrings, since they + share a buffer that's already reported extra cost. + + * runtime/Tracing.d: + * runtime/Tracing.h: Changed these dtrace hooks not to report object + counts, since they're no longer cheap to compute. + + * runtime/UString.h: Updated for renames. + + * runtime/WeakGCMap.h: Added. + (JSC::WeakGCMap::isEmpty): + (JSC::WeakGCMap::uncheckedGet): + (JSC::WeakGCMap::uncheckedBegin): + (JSC::WeakGCMap::uncheckedEnd): + (JSC::::get): + (JSC::::take): + (JSC::::set): + (JSC::::uncheckedRemove): Mentioned above. + + * wtf/StdLibExtras.h: + (WTF::bitCount): Added a bit population count function, so the heap can + count live objects to fulfill statistics questions. + +The very last cell in the block is not allocated -- should not be marked. + +2009-12-13 Geoffrey Garen + + Windows build fix: Export some new symbols. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-12-13 Geoffrey Garen + + Windows build fix: Removed some old exports. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-12-13 Geoffrey Garen + + Windows build fix: Use unsigned instead of uint32_t to avoid dependencies. + + * wtf/StdLibExtras.h: + (WTF::bitCount): + +2009-12-13 Gavin Barraclough + + Reviewed by NOBODY (speculative Windows build fix). + + * runtime/JSGlobalObjectFunctions.cpp: + +2009-12-13 Gavin Barraclough + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=32496 + Switch remaining cases of string construction to use StringBuilder. + Builds strings using a vector rather than using string append / addition. + + * JavaScriptCore.exp: + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/Executable.cpp: + (JSC::FunctionExecutable::paramString): + * runtime/FunctionConstructor.cpp: + (JSC::constructFunction): + * runtime/JSGlobalObjectFunctions.cpp: + (JSC::encode): + (JSC::decode): + (JSC::globalFuncEscape): + (JSC::globalFuncUnescape): + * runtime/JSONObject.cpp: + (JSC::Stringifier::stringify): + (JSC::Stringifier::indent): + * runtime/JSString.h: + * runtime/LiteralParser.cpp: + (JSC::LiteralParser::Lexer::lexString): + * runtime/NumberPrototype.cpp: + (JSC::integerPartNoExp): + (JSC::numberProtoFuncToFixed): + (JSC::numberProtoFuncToPrecision): + * runtime/Operations.h: + (JSC::jsString): + * runtime/StringPrototype.cpp: + (JSC::substituteBackreferencesSlow): + (JSC::substituteBackreferences): + (JSC::stringProtoFuncConcat): + +2009-12-08 Jeremy Moskovich + + Reviewed by Eric Seidel. + + Add code to allow toggling ATSUI/Core Text rendering at runtime in ComplexTextController. + https://bugs.webkit.org/show_bug.cgi?id=31802 + + The goal here is to allow for a zero runtime hit for ports that decide to select + the API at compile time. + When both USE(ATSUI) and USE(CORE_TEXT) are true, the API is toggled + at runtime. Core Text is used for OS Versions >= 10.6. + + * wtf/Platform.h: #define USE_CORE_TEXT and USE_ATSUI on Chrome/Mac. + +2009-12-11 Maciej Stachowiak + + Reviewed by Oliver Hunt. + + Unify codegen for forward and backward variants of branches + https://bugs.webkit.org/show_bug.cgi?id=32463 + + * jit/JIT.h: + (JSC::JIT::emit_op_loop): Implemented in terms of forward variant. + (JSC::JIT::emit_op_loop_if_true): ditto + (JSC::JIT::emitSlow_op_loop_if_true): ditto + (JSC::JIT::emit_op_loop_if_false): ditto + (JSC::JIT::emitSlow_op_loop_if_false): ditto + (JSC::JIT::emit_op_loop_if_less): ditto + (JSC::JIT::emitSlow_op_loop_if_less): ditto + * jit/JITOpcodes.cpp: + +2009-12-11 Sam Weinig + + Reviewed by Anders Carlsson. + + Allow WTFs concept of the main thread to differ from pthreads when necessary. + + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): + (WTF::isMainThread): + * wtf/mac/MainThreadMac.mm: + (WTF::initializeMainThreadPlatform): + (WTF::scheduleDispatchFunctionsOnMainThread): + +2009-12-11 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=32454 + Refactor construction of simple strings to avoid string concatenation. + + Building strings through concatenation has a memory and performance cost - + a memory cost since we must over-allocate the buffer to leave space to append + into, and performance in that the string may still require reallocation (and + thus copying during construction). Instead move the full construction to + within a single function call (makeString), so that the arguments' lengths + can be calculated and an appropriate sized buffer allocated before copying + any characters. + + ~No performance change (~2% progression on date tests). + + * bytecode/CodeBlock.cpp: + (JSC::escapeQuotes): + (JSC::valueToSourceString): + (JSC::constantName): + (JSC::idName): + (JSC::CodeBlock::registerName): + (JSC::regexpToSourceString): + (JSC::regexpName): + * bytecompiler/NodesCodegen.cpp: + (JSC::substitute): + * profiler/Profiler.cpp: + (JSC::Profiler::createCallIdentifier): + * runtime/DateConstructor.cpp: + (JSC::callDate): + * runtime/DateConversion.cpp: + (JSC::formatDate): + (JSC::formatDateUTCVariant): + (JSC::formatTime): + (JSC::formatTimeUTC): + * runtime/DateConversion.h: + (JSC::): + * runtime/DatePrototype.cpp: + (JSC::dateProtoFuncToString): + (JSC::dateProtoFuncToUTCString): + (JSC::dateProtoFuncToDateString): + (JSC::dateProtoFuncToTimeString): + (JSC::dateProtoFuncToGMTString): + * runtime/ErrorPrototype.cpp: + (JSC::errorProtoFuncToString): + * runtime/ExceptionHelpers.cpp: + (JSC::createUndefinedVariableError): + (JSC::createErrorMessage): + (JSC::createInvalidParamError): + * runtime/FunctionPrototype.cpp: + (JSC::insertSemicolonIfNeeded): + (JSC::functionProtoFuncToString): + * runtime/ObjectPrototype.cpp: + (JSC::objectProtoFuncToString): + * runtime/RegExpConstructor.cpp: + (JSC::constructRegExp): + * runtime/RegExpObject.cpp: + (JSC::RegExpObject::match): + * runtime/RegExpPrototype.cpp: + (JSC::regExpProtoFuncCompile): + (JSC::regExpProtoFuncToString): + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncBig): + (JSC::stringProtoFuncSmall): + (JSC::stringProtoFuncBlink): + (JSC::stringProtoFuncBold): + (JSC::stringProtoFuncFixed): + (JSC::stringProtoFuncItalics): + (JSC::stringProtoFuncStrike): + (JSC::stringProtoFuncSub): + (JSC::stringProtoFuncSup): + (JSC::stringProtoFuncFontcolor): + (JSC::stringProtoFuncFontsize): + (JSC::stringProtoFuncAnchor): + * runtime/UString.h: + (JSC::): + (JSC::makeString): + +2009-12-10 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=32400 + Switch remaining cases of string addition to use ropes. + + Re-landing r51975 - added toPrimitiveString method, + performs toPrimitive then subsequent toString operations. + + ~1% progression on Sunspidey. + + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * runtime/JSString.h: + (JSC::JSString::JSString): + (JSC::JSString::appendStringInConstruct): + * runtime/Operations.cpp: + (JSC::jsAddSlowCase): + * runtime/Operations.h: + (JSC::jsString): + (JSC::jsAdd): + +2009-12-11 Adam Roben + + Windows build fix + + * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added + $(WebKitOutputDir)/include/private to the include path. + +2009-12-11 Adam Roben + + Move QuartzCorePresent.h to include/private + + This fixes other projects that use wtf/Platform.h + + Rubber-stamped by Steve Falkenburg. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Let VS do its thang. + * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Write + QuartzCorePresent.h to $(WebKitOutputDir)/include/private. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: + * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: + Added $(WebKitOutputDir)/include/private to the include path. + +2009-12-11 Adam Roben + + Fix clean builds and everything rebuilding on every build + + Reviewed by Sam Weinig. + + * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Don't + write out QuartzCorePresent.h if it exists but is older than + QuartzCore.h. Also, create the directory we write QuartzCorePresent.h + into first. + +2009-12-11 Adam Roben + + Windows build fix for systems with spaces in their paths + + * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: Quote some paths. + +2009-12-11 Chris Marrin + + Reviewed by Adam Roben. + + Add check for presence of QuartzCore headers + https://bugs.webkit.org/show_bug.cgi?id=31856 + + The script now checks for the presence of QuartzCore.h. If present + it will turn on ACCELERATED_COMPOSITING and 3D_RENDERING to enable + HW compositing on Windows. The script writes QuartzCorePresent.h to + the build directory which has a define telling whether QuartzCore is + present. + + * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh: + * wtf/Platform.h: + +2009-12-11 Kent Tamura + + Reviewed by Darin Adler. + + Fix a problem that JSC::gregorianDateTimeToMS() returns a negative + value for a huge year value. + https://bugs.webkit.org/show_bug.cgi?id=32304 + + * wtf/DateMath.cpp: + (WTF::dateToDaysFrom1970): Renamed from dateToDayInYear, and changed the return type to double. + (WTF::calculateDSTOffset): Follow the dateToDaysFrom1970() change. + (WTF::timeClip): Use maxECMAScriptTime. + (JSC::gregorianDateTimeToMS): Follow the dateToDaysFrom1970() change. + +2009-12-10 Adam Barth + + No review, rolling out r51975. + http://trac.webkit.org/changeset/51975 + + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * runtime/JSString.h: + (JSC::JSString::JSString): + (JSC::JSString::appendStringInConstruct): + * runtime/Operations.cpp: + (JSC::jsAddSlowCase): + * runtime/Operations.h: + (JSC::jsString): + (JSC::jsAdd): + +2009-12-10 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Incorrect caching of prototype lookup with dictionary base + https://bugs.webkit.org/show_bug.cgi?id=32402 + + Make sure we don't add cached prototype lookup to the proto_list + lookup chain if the top level object is a dictionary. + + * jit/JITStubs.cpp: + (JSC::JITThunks::tryCacheGetByID): + +2009-12-10 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=32400 + Switch remaining cases of string addition to use ropes. + + ~1% progression on Sunspidey. + + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * runtime/JSString.h: + (JSC::JSString::JSString): + (JSC::JSString::appendStringInConstruct): + * runtime/Operations.cpp: + (JSC::jsAddSlowCase): + * runtime/Operations.h: + (JSC::jsString): + (JSC::jsAdd): + +2009-12-10 Kent Hansen + + Reviewed by Geoffrey Garen. + + Remove JSObject::getPropertyAttributes() and all usage of it. + https://bugs.webkit.org/show_bug.cgi?id=31933 + + getOwnPropertyDescriptor() should be used instead. + + * JavaScriptCore.exp: + * JavaScriptCore.order: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * debugger/DebuggerActivation.cpp: + (JSC::DebuggerActivation::getOwnPropertyDescriptor): + * debugger/DebuggerActivation.h: + * runtime/JSObject.cpp: + (JSC::JSObject::propertyIsEnumerable): + * runtime/JSObject.h: + * runtime/JSVariableObject.cpp: + * runtime/JSVariableObject.h: + +2009-12-10 Gavin Barraclough + + Reviewed by Oliver Hunt & Mark Rowe. + + https://bugs.webkit.org/show_bug.cgi?id=32367 + Add support for short Ropes (up to 3 entries) inline within JSString. + (rather than externally allocating an object to hold the rope). + Switch jsAdd of (JSString* + JSString*) to now make use of Ropes. + + ~1% progression on Sunspidey. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * jit/JITOpcodes.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * runtime/JSString.cpp: + (JSC::JSString::resolveRope): + (JSC::JSString::toBoolean): + (JSC::JSString::getStringPropertyDescriptor): + * runtime/JSString.h: + (JSC::JSString::Rope::Fiber::deref): + (JSC::JSString::Rope::Fiber::ref): + (JSC::JSString::Rope::Fiber::refAndGetLength): + (JSC::JSString::Rope::append): + (JSC::JSString::JSString): + (JSC::JSString::~JSString): + (JSC::JSString::value): + (JSC::JSString::tryGetValue): + (JSC::JSString::length): + (JSC::JSString::canGetIndex): + (JSC::JSString::appendStringInConstruct): + (JSC::JSString::appendValueInConstructAndIncrementLength): + (JSC::JSString::isRope): + (JSC::JSString::string): + (JSC::JSString::ropeLength): + (JSC::JSString::getStringPropertySlot): + * runtime/Operations.h: + (JSC::jsString): + (JSC::jsAdd): + (JSC::resolveBase): + +2009-12-09 Anders Carlsson + + Reviewed by Geoffrey Garen. + + Fix three more things found by compiling with clang++. + + * runtime/Structure.h: + (JSC::StructureTransitionTable::reifySingleTransition): + Add the 'std' qualifier to the call to make_pair. + + * wtf/DateMath.cpp: + (WTF::initializeDates): + Incrementing a bool is deprecated according to the C++ specification. + + * wtf/PtrAndFlags.h: + (WTF::PtrAndFlags::PtrAndFlags): + Name lookup should not be done in dependent bases, so explicitly qualify the call to set. + +2009-12-09 Maciej Stachowiak + + Reviewed by Oliver Hunt. + + Google reader gets stuck in the "Loading..." state and does not complete + https://bugs.webkit.org/show_bug.cgi?id=32256 + + + * jit/JITArithmetic.cpp: + (JSC::JIT::emitSlow_op_jless): Fix some backward branches. + +2009-12-09 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=32228 + Make destruction of ropes non-recursive to prevent stack exhaustion. + Also, pass a UString& into initializeFiber rather than a Ustring::Rep*, + since the Rep is not being ref counted this could result in usage of a + Rep with refcount zero (where the Rep comes from a temporary UString + returned from a function). + + * runtime/JSString.cpp: + (JSC::JSString::Rope::destructNonRecursive): + (JSC::JSString::Rope::~Rope): + * runtime/JSString.h: + (JSC::JSString::Rope::initializeFiber): + * runtime/Operations.h: + (JSC::concatenateStrings): + +2009-12-09 Zoltan Herczeg + + Reviewed by Eric Seidel. + + https://bugs.webkit.org/show_bug.cgi?id=31930 + + Update to r51457. ASSERTs changed to COMPILE_ASSERTs. + The speedup is 25%. + + * runtime/JSGlobalData.cpp: + (JSC::VPtrSet::VPtrSet): + +2009-12-09 Steve Block + + Reviewed by Adam Barth. + + Updates Android Makefiles with latest additions. + https://bugs.webkit.org/show_bug.cgi?id=32278 + + * Android.mk: Modified. + * Android.v8.wtf.mk: Modified. + +2009-12-09 Sam Weinig + + Reviewed by Gavin Barraclough. + + Fix a bug found while trying to compile JavaScriptCore with clang++. + + * yarr/RegexPattern.h: + (JSC::Yarr::PatternTerm::PatternTerm): Don't self assign here. Use false instead. + +2009-12-09 Anders Carlsson + + Reviewed by Sam Weinig. + + Attempt to fix the Windows build. + + * wtf/FastMalloc.h: + +2009-12-09 Anders Carlsson + + Reviewed by Sam Weinig. + + Fix some things found while trying to compile JavaScriptCore with clang++. + + * wtf/FastMalloc.h: + Add correct exception specifications for the allocation/deallocation operators. + + * wtf/Vector.h: + * wtf/VectorTraits.h: + Fix a bunch of struct/class mismatches. + +2009-12-08 Maciej Stachowiak + + Reviewed by Darin Adler. + + move code generation portions of Nodes.cpp to bytecompiler directory + https://bugs.webkit.org/show_bug.cgi?id=32284 + + * bytecompiler/NodesCodegen.cpp: Copied from parser/Nodes.cpp. Removed parts that + are not about codegen. + * parser/Nodes.cpp: Removed everything that is about codegen. + + Update build systems: + + * Android.mk: + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.pri: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * JavaScriptCoreSources.bkl: + +2009-12-08 Kevin Watters + + Reviewed by Kevin Ollivier. + + [wx] Mac plugins support. + + https://bugs.webkit.org/show_bug.cgi?id=32236 + + * wtf/Platform.h: + +2009-12-08 Dmitry Titov + + Rubber-stamped by David Levin. + + Revert and reopen "Add asserts to RefCounted to make sure ref/deref happens on the right thread." + It may have caused massive increase of reported leaks on the bots. + https://bugs.webkit.org/show_bug.cgi?id=31639 + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/WTF/WTF.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/Structure.cpp: + (JSC::Structure::Structure): + * wtf/RefCounted.h: + (WTF::RefCountedBase::ref): + (WTF::RefCountedBase::hasOneRef): + (WTF::RefCountedBase::refCount): + (WTF::RefCountedBase::derefBase): + * wtf/ThreadVerifier.h: Removed. + +2009-12-08 Gustavo Noronha Silva + + Reviewed by Darin Adler. + + Make WebKit build correctly on FreeBSD, IA64, and Alpha. + Based on work by Petr Salinger , + and Colin Watson . + + * wtf/Platform.h: + +2009-12-08 Dmitry Titov + + Reviewed by Darin Adler. + + Add asserts to RefCounted to make sure ref/deref happens on the right thread. + https://bugs.webkit.org/show_bug.cgi?id=31639 + + * runtime/Structure.cpp: + (JSC::Structure::Structure): Disable thread verification on this class since it uses addressOfCount(). + * wtf/RefCounted.h: + (WTF::RefCountedBase::ref): Add ASSERT. + (WTF::RefCountedBase::hasOneRef): Ditto. + (WTF::RefCountedBase::refCount): Ditto. + (WTF::RefCountedBase::derefBase): Ditto. + (WTF::RefCountedBase::disableThreadVerification): delegate to ThreadVerifier method. + * wtf/ThreadVerifier.h: Added. + (WTF::ThreadVerifier::ThreadVerifier): New Debug-only class to verify that ref/deref of RefCounted is done on the same thread. + (WTF::ThreadVerifier::activate): Activates checks. Called when ref count becomes above 2. + (WTF::ThreadVerifier::deactivate): Deactivates checks. Called when ref count drops below 2. + (WTF::ThreadVerifier::disableThreadVerification): used on objects that should not be checked (StringImpl etc) + (WTF::ThreadVerifier::verifyThread): + * GNUmakefile.am: Add ThreadVerifier.h to the build file. + * JavaScriptCore.gypi: Ditto. + * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto. + * JavaScriptCore.xcodeproj/project.pbxproj: Ditto. + +2009-12-08 Steve Block + + Reviewed by Adam Barth. + + [Android] Adds Makefiles for Android port. + https://bugs.webkit.org/show_bug.cgi?id=31325 + + * Android.mk: Added. + * Android.v8.wtf.mk: Added. + +2009-12-07 Dmitry Titov + + Rubber-stamped by Darin Adler. + + Remove ENABLE_SHARED_SCRIPT flags + https://bugs.webkit.org/show_bug.cgi?id=32245 + This patch was obtained by "git revert" command and then un-reverting of ChangeLog files. + + * Configurations/FeatureDefines.xcconfig: + * wtf/Platform.h: + +2009-12-07 Gavin Barraclough + + Reviewed by NOBODY (Windows build fixage part I). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-12-05 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=32184 + Handle out-of-memory conditions with JSC Ropes with a JS exception, rather than crashing. + Switch from using fastMalloc to tryFastMalloc, pass an ExecState to record the exception on. + + * API/JSCallbackObjectFunctions.h: + (JSC::::toString): + * API/JSValueRef.cpp: + (JSValueIsStrictEqual): + * JavaScriptCore.exp: + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitEqualityOp): + * debugger/DebuggerCallFrame.cpp: + (JSC::DebuggerCallFrame::functionName): + (JSC::DebuggerCallFrame::calculatedFunctionName): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::callEval): + (JSC::Interpreter::privateExecute): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * profiler/ProfileGenerator.cpp: + (JSC::ProfileGenerator::addParentForConsoleStart): + * profiler/Profiler.cpp: + (JSC::Profiler::willExecute): + (JSC::Profiler::didExecute): + (JSC::Profiler::createCallIdentifier): + (JSC::createCallIdentifierFromFunctionImp): + * profiler/Profiler.h: + * runtime/ArrayPrototype.cpp: + (JSC::arrayProtoFuncIndexOf): + (JSC::arrayProtoFuncLastIndexOf): + * runtime/DateConstructor.cpp: + (JSC::constructDate): + * runtime/FunctionPrototype.cpp: + (JSC::functionProtoFuncToString): + * runtime/InternalFunction.cpp: + (JSC::InternalFunction::name): + (JSC::InternalFunction::displayName): + (JSC::InternalFunction::calculatedDisplayName): + * runtime/InternalFunction.h: + * runtime/JSCell.cpp: + (JSC::JSCell::getString): + * runtime/JSCell.h: + (JSC::JSValue::getString): + * runtime/JSONObject.cpp: + (JSC::gap): + (JSC::Stringifier::Stringifier): + (JSC::Stringifier::appendStringifiedValue): + * runtime/JSObject.cpp: + (JSC::JSObject::putDirectFunction): + (JSC::JSObject::putDirectFunctionWithoutTransition): + (JSC::JSObject::defineOwnProperty): + * runtime/JSObject.h: + * runtime/JSPropertyNameIterator.cpp: + (JSC::JSPropertyNameIterator::get): + * runtime/JSString.cpp: + (JSC::JSString::Rope::~Rope): + (JSC::JSString::resolveRope): + (JSC::JSString::getPrimitiveNumber): + (JSC::JSString::toNumber): + (JSC::JSString::toString): + (JSC::JSString::toThisString): + (JSC::JSString::getStringPropertyDescriptor): + * runtime/JSString.h: + (JSC::JSString::Rope::createOrNull): + (JSC::JSString::Rope::operator new): + (JSC::JSString::value): + (JSC::JSString::tryGetValue): + (JSC::JSString::getIndex): + (JSC::JSString::getStringPropertySlot): + (JSC::JSValue::toString): + * runtime/JSValue.h: + * runtime/NativeErrorConstructor.cpp: + (JSC::NativeErrorConstructor::NativeErrorConstructor): + * runtime/Operations.cpp: + (JSC::JSValue::strictEqualSlowCase): + * runtime/Operations.h: + (JSC::JSValue::equalSlowCaseInline): + (JSC::JSValue::strictEqualSlowCaseInline): + (JSC::JSValue::strictEqual): + (JSC::jsLess): + (JSC::jsLessEq): + (JSC::jsAdd): + (JSC::concatenateStrings): + * runtime/PropertyDescriptor.cpp: + (JSC::PropertyDescriptor::equalTo): + * runtime/PropertyDescriptor.h: + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncReplace): + (JSC::stringProtoFuncToLowerCase): + (JSC::stringProtoFuncToUpperCase): + +2009-12-07 Nikolas Zimmermann + + Reviewed by Holger Freyther. + + Turn on (SVG) Filters support, by default. + https://bugs.webkit.org/show_bug.cgi?id=32224 + + * Configurations/FeatureDefines.xcconfig: Enable FILTERS build flag. + +2009-12-07 Steve Falkenburg + + Build fix. Be flexible about which version of ICU is used on Windows. + + * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Add optional xcopy commands to copy ICU 4.2. + +2009-12-07 Maciej Stachowiak + + Reviewed by Oliver Hunt. + + op_loop_if_less JIT codegen is broken for 64-bit + https://bugs.webkit.org/show_bug.cgi?id=32221 + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_loop_if_false): Fix codegen in this version - test was backwards. + +2009-12-07 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + Object.create fails if properties on the descriptor are getters + https://bugs.webkit.org/show_bug.cgi?id=32219 + + Correctly initialise the PropertySlots with the descriptor object. + + * runtime/ObjectConstructor.cpp: + (JSC::toPropertyDescriptor): + +2009-12-06 Maciej Stachowiak + + Not reviewed, build fix. + + Actually tested 64-bit *and* 32-bit build this time. + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_loop_if_false): + +2009-12-06 Maciej Stachowiak + + Not reviewed, build fix. + + Really really fix 64-bit build for prior patch (actually tested this time). + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_loop_if_false): + (JSC::JIT::emitSlow_op_loop_if_false): + +2009-12-06 Maciej Stachowiak + + Not reviewed, build fix. + + Really fix 64-bit build for prior patch. + + * jit/JITArithmetic.cpp: + (JSC::JIT::emitSlow_op_jless): + +2009-12-06 Maciej Stachowiak + + Not reviewed, build fix. + + Fix 64-bit build for prior patch. + + * jit/JITOpcodes.cpp: + (JSC::JIT::emitSlow_op_loop_if_less): + +2009-12-05 Maciej Stachowiak + + Reviewed by Oliver Hunt. + + conway benchmark spends half it's time in op_less (jump fusion fails) + https://bugs.webkit.org/show_bug.cgi?id=32190 + + <1% speedup on SunSpider and V8 + 2x speedup on "conway" benchmark + + Two optimizations: + 1) Improve codegen for logical operators &&, || and ! in a condition context + + When generating code for combinations of &&, || and !, in a + condition context (i.e. in an if statement or loop condition), we + used to produce a value, and then separately jump based on its + truthiness. Now we pass the false and true targets in, and let the + logical operators generate jumps directly. This helps in four + ways: + + a) Individual clauses of a short-circuit logical operator can now + jump directly to the then or else clause of an if statement (or to + the top or exit of a loop) instead of jumping to a jump. + + b) It used to be that jump fusion with the condition of the first + clause of a logical operator was inhibited, because the register + was ref'd to be used later, in the actual condition jump; this no + longer happens since a jump straight to the final target is + generated directly. + + c) It used to be that jump fusion with the condition of the second + clause of a logical operator was inhibited, because there was a + jump target right after the second clause and before the actual + condition jump. But now it's no longer necessary for the first + clause to jump there so jump fusion is not blocked. + + d) We avoid generating excess mov statements in some cases. + + As a concrete example this source: + + if (!((x < q && y < q) || (t < q && z < q))) { + // ... + } + + Used to generate this bytecode: + + [ 34] less r1, r-15, r-19 + [ 38] jfalse r1, 7(->45) + [ 41] less r1, r-16, r-19 + [ 45] jtrue r1, 14(->59) + [ 48] less r1, r-17, r-19 + [ 52] jfalse r1, 7(->59) + [ 55] less r1, r-18, r-19 + [ 59] jtrue r1, 17(->76) + + And now generates this bytecode (also taking advantage of the second optimization below): + + [ 34] jnless r-15, r-19, 8(->42) + [ 38] jless r-16, r-19, 26(->64) + [ 42] jnless r-17, r-19, 8(->50) + [ 46] jless r-18, r-19, 18(->64) + + Note the jump fusion and the fact that there's less jump + indirection - three of the four jumps go straight to the target + clause instead of indirecting through another jump. + + 2) Implement jless opcode to take advantage of the above, since we'll now often generate + a less followed by a jtrue where fusion is not forbidden. + + * parser/Nodes.h: + (JSC::ExpressionNode::hasConditionContextCodegen): Helper function to determine + whether a node supports special conditional codegen. Return false as this is the default. + (JSC::ExpressionNode::emitBytecodeInConditionContext): Assert not reached - only really + defined for nodes that do have conditional codegen. + (JSC::UnaryOpNode::expr): Add const version. + (JSC::LogicalNotNode::hasConditionContextCodegen): Returne true only if subexpression + supports it. + (JSC::LogicalOpNode::hasConditionContextCodegen): Return true. + * parser/Nodes.cpp: + (JSC::LogicalNotNode::emitBytecodeInConditionContext): Implemented - just swap + the true and false targets for the child node. + (JSC::LogicalOpNode::emitBytecodeInConditionContext): Implemented - handle jumps + directly, improving codegen quality. Also handles further nested conditional codegen. + (JSC::ConditionalNode::emitBytecode): Use condition context codegen when available. + (JSC::IfNode::emitBytecode): ditto + (JSC::IfElseNode::emitBytecode): ditto + (JSC::DoWhileNode::emitBytecode): ditto + (JSC::WhileNode::emitBytecode): ditto + (JSC::ForNode::emitBytecode): ditto + + * bytecode/Opcode.h: + - Added loop_if_false opcode - needed now that falsey jumps can be backwards. + - Added jless opcode to take advantage of new fusion opportunities. + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::dump): Handle above. + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitJumpIfTrue): Add peephole for less + jtrue ==> jless. + (JSC::BytecodeGenerator::emitJumpIfFalse): Add handling of backwrds falsey jumps. + * bytecompiler/BytecodeGenerator.h: + (JSC::BytecodeGenerator::emitNodeInConditionContext): Wrapper to handle tracking of + overly deep expressions etc. + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): Implement the two new opcodes (loop_if_false, jless). + * jit/JIT.cpp: + (JSC::JIT::privateCompileMainPass): Implement JIT support for the two new opcodes. + (JSC::JIT::privateCompileSlowCases): ditto + * jit/JIT.h: + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_jless): + (JSC::JIT::emitSlow_op_jless): ditto + (JSC::JIT::emitBinaryDoubleOp): ditto + * jit/JITOpcodes.cpp: + (JSC::JIT::emitSlow_op_loop_if_less): ditto + (JSC::JIT::emit_op_loop_if_false): ditto + (JSC::JIT::emitSlow_op_loop_if_false): ditto + * jit/JITStubs.cpp: + * jit/JITStubs.h: + (JSC::): + +2009-12-04 Kent Hansen + + Reviewed by Darin Adler. + + JavaScript delete operator should return false for string properties + https://bugs.webkit.org/show_bug.cgi?id=32012 + + * runtime/StringObject.cpp: + (JSC::StringObject::deleteProperty): + +2009-12-03 Drew Wilson + + Rolled back r51633 because it causes a perf regression in Chromium. + + * wtf/Platform.h: + +2009-12-03 Gavin Barraclough + + Try and fix the Windows build. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export a symbol that should be exported. + +2009-12-03 Mark Rowe + + Try and fix the Mac build. + + * JavaScriptCore.exp: Export a symbol that should be exported. + +2009-12-03 Oliver Hunt + + Reviewed by Gavin Barraclough. + + REGRESSION(4.0.3-48777): Crash in JSC::ExecState::propertyNames() (Debug-only?) + https://bugs.webkit.org/show_bug.cgi?id=32133 + + Work around odd GCC-ism and correct the scopechain for use by + calls made while a cachedcall is active on the callstack. + + * interpreter/CachedCall.h: + (JSC::CachedCall::newCallFrame): + * runtime/JSArray.cpp: + (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key): + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncReplace): + +2009-12-03 Gavin Barraclough + + Reviewed by Oliver "Brraaaaiiiinnnnnzzzzzzzz" Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=32136 + Add a rope representation to JSString. Presently JSString always holds its data in UString form. + Instead, allow the result of a string concatenation to be represented in a tree form - with a + variable sized, reference-counted rope node retaining a set of UString::Reps (or other rope nopes). + + Strings must still currently be resolved down to a flat UString representation before being used, + but by holding the string in a rope representation during construction we can avoid copying data + until we know the final size of the string. + + ~2% progression on SunSpider (~25% on date-format-xparb, ~20% on string-validate-input). + + * JavaScriptCore.exp: + + - Update exports. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + + - Make use of new JSString::length() method to avoid prematurely resolving ropes. + + * jit/JITOpcodes.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + + - Switch the string length trampoline to read the length directly from JSString::m_length, + rather than from the JSString's UString::Rep's 'len' property. + + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + + - Modify op_add such that addition of two strings, where either or both strings are already + in rope representation, produces a rope as a result. + + * runtime/JSString.cpp: + (JSC::JSString::Rope::~Rope): + (JSC::copyChars): + (JSC::JSString::resolveRope): + (JSC::JSString::getPrimitiveNumber): + (JSC::JSString::toBoolean): + (JSC::JSString::toNumber): + (JSC::JSString::toString): + (JSC::JSString::toThisString): + (JSC::JSString::getStringPropertyDescriptor): + * runtime/JSString.h: + (JSC::JSString::Rope::Fiber::Fiber): + (JSC::JSString::Rope::Fiber::destroy): + (JSC::JSString::Rope::Fiber::isRope): + (JSC::JSString::Rope::Fiber::rope): + (JSC::JSString::Rope::Fiber::string): + (JSC::JSString::Rope::create): + (JSC::JSString::Rope::initializeFiber): + (JSC::JSString::Rope::ropeLength): + (JSC::JSString::Rope::stringLength): + (JSC::JSString::Rope::fibers): + (JSC::JSString::Rope::Rope): + (JSC::JSString::Rope::operator new): + (JSC::JSString::JSString): + (JSC::JSString::value): + (JSC::JSString::length): + (JSC::JSString::isRope): + (JSC::JSString::rope): + (JSC::JSString::string): + (JSC::JSString::canGetIndex): + (JSC::jsSingleCharacterSubstring): + (JSC::JSString::getIndex): + (JSC::jsSubstring): + (JSC::JSString::getStringPropertySlot): + + - Add rope form. + + * runtime/Operations.h: + (JSC::jsAdd): + (JSC::concatenateStrings): + + - Update string concatenation, and addition of ropes, to produce ropes. + + * runtime/StringObject.cpp: + (JSC::StringObject::getOwnPropertyNames): + + - Make use of new JSString::length() method to avoid prematurely resolving ropes. + +2009-11-23 Jeremy Moskovich + + Reviewed by Eric Seidel. + + Switch Chrome/Mac to use Core Text APIs rather than ATSUI APIs. + https://bugs.webkit.org/show_bug.cgi?id=31802 + + No test since this is already covered by existing pixel tests. + + * wtf/Platform.h: #define USE_CORE_TEXT for Chrome/Mac. + +2009-12-02 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Add files missed in prior patch. + + * runtime/JSZombie.cpp: + (JSC::): + (JSC::JSZombie::leakedZombieStructure): + * runtime/JSZombie.h: Added. + (JSC::JSZombie::JSZombie): + (JSC::JSZombie::isZombie): + (JSC::JSZombie::classInfo): + (JSC::JSZombie::isGetterSetter): + (JSC::JSZombie::isAPIValueWrapper): + (JSC::JSZombie::isPropertyNameIterator): + (JSC::JSZombie::getCallData): + (JSC::JSZombie::getConstructData): + (JSC::JSZombie::getUInt32): + (JSC::JSZombie::toPrimitive): + (JSC::JSZombie::getPrimitiveNumber): + (JSC::JSZombie::toBoolean): + (JSC::JSZombie::toNumber): + (JSC::JSZombie::toString): + (JSC::JSZombie::toObject): + (JSC::JSZombie::markChildren): + (JSC::JSZombie::put): + (JSC::JSZombie::deleteProperty): + (JSC::JSZombie::toThisObject): + (JSC::JSZombie::toThisString): + (JSC::JSZombie::toThisJSString): + (JSC::JSZombie::getJSNumber): + (JSC::JSZombie::getOwnPropertySlot): + +2009-12-02 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Add zombies to JSC + https://bugs.webkit.org/show_bug.cgi?id=32103 + + Add a compile time flag to make the JSC collector replace "unreachable" + objects with zombie objects. The zombie object is a JSCell subclass that + ASSERTs on any attempt to use the JSCell methods. In addition there are + a number of additional assertions in bottleneck code to catch zombie usage + as quickly as possible. + + Grrr. Argh. Brains. + + * JavaScriptCore.xcodeproj/project.pbxproj: + * interpreter/Register.h: + (JSC::Register::Register): + * runtime/ArgList.h: + (JSC::MarkedArgumentBuffer::append): + (JSC::ArgList::ArgList): + * runtime/Collector.cpp: + (JSC::Heap::destroy): + (JSC::Heap::sweep): + * runtime/Collector.h: + * runtime/JSCell.h: + (JSC::JSCell::isZombie): + (JSC::JSValue::isZombie): + * runtime/JSValue.h: + (JSC::JSValue::decode): + (JSC::JSValue::JSValue): + * wtf/Platform.h: + +2009-12-01 Jens Alfke + + Reviewed by Darin Adler. + + Added variants of find/contains/add that allow a foreign key type to be used. + This will allow AtomicString-keyed maps to be queried by C string without + having to create a temporary AtomicString (see HTTPHeaderMap.) + The code for this is adapted from the equivalent in HashSet.h. + + * wtf/HashMap.h: + (WTF::HashMap::find): + (WTF::HashMap::contains): + (WTF::HashMap::add): + * wtf/HashSet.h: Changed "method" to "function member" in a comment. + +2009-12-01 Gustavo Noronha Silva + + Revert 51551 because it broke GTK+. + + * wtf/Platform.h: + +2009-11-30 Gavin Barraclough + + Windows Build fix. Reviewed by NOBODY. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-11-24 Gavin Barraclough + + Reviewed by Geoff Garen. + + Bug 31859 - Make world selection for JSC IsolatedWorlds automagical. + + WebCore presently has to explicitly specify the world before entering into JSC, + which is a little fragile (particularly since property access via a + getter/setter might invoke execution). Instead derive the current world from + the lexical global object. + + Remove the temporary duct tape of willExecute/didExecute virtual hooks on the JSGlobalData::ClientData - these are no longer necessary. + + * API/JSBase.cpp: + (JSEvaluateScript): + * API/JSObjectRef.cpp: + (JSObjectCallAsFunction): + * JavaScriptCore.exp: + * runtime/JSGlobalData.cpp: + * runtime/JSGlobalData.h: + +2009-11-30 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove obsolete PLATFORM(KDE) code + https://bugs.webkit.org/show_bug.cgi?id=31958 + + KDE is now using unpatched QtWebKit. + + * parser/Lexer.cpp: Remove obsolete KDE_USE_FINAL guard + * wtf/Platform.h: Remove PLATFORM(KDE) definition and code + section that is guarded with it. + +2009-11-30 Jan-Arve Sæther + + Reviewed by Simon Hausmann. + + [Qt] Fix compilation with win32-icc + + The Intel compiler does not support the __has_trivial_constructor type + trait. The Intel Compiler can report itself as _MSC_VER >= 1400. The + reason for that is that the Intel Compiler depends on the Microsoft + Platform SDK, and in order to try to be "fully" MS compatible it will + "pretend" to be the same MS compiler as was shipped with the MS PSDK. + (Thus, compiling with win32-icc with VC8 SDK will make the source code + "think" the compiler at hand supports this type trait). + + * wtf/TypeTraits.h: + +2009-11-29 Laszlo Gombos + + Reviewed by Eric Seidel. + + [Qt] Mac build has JIT disabled + https://bugs.webkit.org/show_bug.cgi?id=31828 + + * wtf/Platform.h: Enable JIT for Qt Mac builds + +2009-11-28 Laszlo Gombos + + Reviewed by Eric Seidel. + + Apply workaround for the limitation of VirtualFree with MEM_RELEASE to all ports running on Windows + https://bugs.webkit.org/show_bug.cgi?id=31943 + + * runtime/MarkStack.h: + (JSC::MarkStack::MarkStackArray::shrinkAllocation): + +2009-11-28 Zoltan Herczeg + + Reviewed by Gavin Barraclough. + + https://bugs.webkit.org/show_bug.cgi?id=31930 + + Seems a typo. We don't need ~270k memory to determine the vptrs. + + * runtime/JSGlobalData.cpp: + (JSC::VPtrSet::VPtrSet): + +2009-11-27 Shinichiro Hamaji + + Unreviewed. + + Move GOwnPtr* from wtf to wtf/gtk + https://bugs.webkit.org/show_bug.cgi?id=31793 + + Build fix for chromium after r51423. + Exclude gtk directory from chromium build. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + +2009-11-25 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Incorrect behaviour of jneq_null in the interpreter + https://bugs.webkit.org/show_bug.cgi?id=31901 + + Correct the logic of jneq_null. This is already covered by existing tests. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + +2009-11-26 Laszlo Gombos + + Reviewed by Oliver Hunt. + + Move GOwnPtr* from wtf to wtf/gtk + https://bugs.webkit.org/show_bug.cgi?id=31793 + + * GNUmakefile.am: Change the path for GOwnPtr.*. + * JavaScriptCore.gyp/JavaScriptCore.gyp: Remove + GOwnPtr.cpp from the exclude list. + * JavaScriptCore.gypi: Change the path for GOwnPtr.*. + * wscript: Remove GOwnPtr.cpp from the exclude list. + * wtf/GOwnPtr.cpp: Removed. + * wtf/GOwnPtr.h: Removed. + * wtf/Threading.h: Change the path for GOwnPtr.h. + * wtf/gtk/GOwnPtr.cpp: Copied from JavaScriptCore/wtf/GOwnPtr.cpp. + * wtf/gtk/GOwnPtr.h: Copied from JavaScriptCore/wtf/GOwnPtr.h. + * wtf/unicode/glib/UnicodeGLib.h: Change the path for GOwnPtr.h. + +2009-11-24 Dmitry Titov + + Reviewed by Eric Seidel. + + Add ENABLE_SHARED_SCRIPT feature define and flag for build-webkit + https://bugs.webkit.org/show_bug.cgi?id=31444 + + * Configurations/FeatureDefines.xcconfig: + * wtf/Platform.h: + +2009-11-24 Chris Marrin + + Reviewed by Simon Fraser. + + Add ability to enable ACCELERATED_COMPOSITING on Windows (currently disabled) + https://bugs.webkit.org/show_bug.cgi?id=27314 + + * wtf/Platform.h: + +2009-11-24 Jason Smith + + Reviewed by Alexey Proskuryakov. + + RegExp#exec's returned Array-like object behaves differently from + regular Arrays + https://bugs.webkit.org/show_bug.cgi?id=31689 + + * JavaScriptCore/runtime/RegExpConstructor.cpp: ensure that undefined + values are added to the returned RegExpMatchesArray + +2009-11-24 Oliver Hunt + + Reviewed by Alexey Proskuryakov. + + JSON.stringify performance on undefined is very poor + https://bugs.webkit.org/show_bug.cgi?id=31839 + + Switch from a UString to a Vector when building + the JSON string, allowing us to safely remove the substr-copy + we otherwise did when unwinding an undefined property. + + Also turns out to be a ~5% speedup on stringification. + + * runtime/JSONObject.cpp: + (JSC::Stringifier::StringBuilder::append): + (JSC::Stringifier::stringify): + (JSC::Stringifier::Holder::appendNextProperty): + +2009-11-24 Mark Rowe + + Fix production builds where the source tree may be read-only. + + * JavaScriptCore.xcodeproj/project.pbxproj: + +2009-11-23 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + Include "config.h" to meet Coding Style Guidelines + https://bugs.webkit.org/show_bug.cgi?id=31792 + + * wtf/unicode/UTF8.cpp: + * wtf/unicode/glib/UnicodeGLib.cpp: + * wtf/unicode/wince/UnicodeWince.cpp: + +2009-11-23 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Streamlined some Math functions where we expect or know the result not + to be representable as an int. + + SunSpider says 0.6% faster. + + * runtime/JSNumberCell.h: + (JSC::JSValue::JSValue): + * runtime/JSValue.h: + (JSC::JSValue::): + (JSC::jsDoubleNumber): + (JSC::JSValue::JSValue): Added a function for making a numeric JSValue + and skipping the "can I encode this as an int?" check, avoiding the + overhead of int <-> double roundtripping and double <-> double comparison + and branching. + + * runtime/MathObject.cpp: + (JSC::mathProtoFuncACos): + (JSC::mathProtoFuncASin): + (JSC::mathProtoFuncATan): + (JSC::mathProtoFuncATan2): + (JSC::mathProtoFuncCos): + (JSC::mathProtoFuncExp): + (JSC::mathProtoFuncLog): + (JSC::mathProtoFuncRandom): + (JSC::mathProtoFuncSin): + (JSC::mathProtoFuncSqrt): + (JSC::mathProtoFuncTan): For these functions, which we expect or know + to produce results not representable as ints, call jsDoubleNumber instead + of jsNumber. + +2009-11-23 Mark Rowe + + Unreviewed. Unbreak the regression tests after r51329. + + * API/JSBase.cpp: + (JSEvaluateScript): Null-check clientData before dereferencing it. + * API/JSObjectRef.cpp: + (JSObjectCallAsFunction): Ditto. + +2009-11-23 Gavin Barraclough + + Reviewed by Geoff Garen. + + Part 1/3 of REGRESSION: Many web pages fail to render after interesting script runs in isolated world + + Some clients of the JavaScriptCore API expect to be able to make callbacks over the JSC API, + and for this to automagically cause execution to take place in the world associated with the + global object associated with the ExecState (JSContextRef) passed. However this is not how + things work - the world must be explicitly set within WebCore. + + Making this work just for API calls to evaluate & call will be a far from perfect solution, + since direct (non-API) use of JSC still relies on WebCore setting the current world correctly. + A better solution would be to make this all work automagically all throughout WebCore, but this + will require more refactoring. + + Since the API is in JSC but worlds only exist in WebCore, add callbacks on the JSGlobalData::ClientData + to allow it to update the current world on entry/exit via the JSC API. This is temporary duck + tape, and should be removed once the current world no longer needs to be explicitly tracked. + + * API/JSBase.cpp: + (JSEvaluateScript): + * API/JSObjectRef.cpp: + (JSObjectCallAsFunction): + * JavaScriptCore.exp: + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::ClientData::beginningExecution): + (JSC::JSGlobalData::ClientData::completedExecution): + * runtime/JSGlobalData.h: + +2009-11-23 Steve Block + + Reviewed by Dmitry Titov. + + Adds MainThreadAndroid.cpp with Android-specific WTF threading functions. + https://bugs.webkit.org/show_bug.cgi?id=31807 + + * wtf/android: Added. + * wtf/android/MainThreadAndroid.cpp: Added. + (WTF::timeoutFired): + (WTF::initializeMainThreadPlatform): + (WTF::scheduleDispatchFunctionsOnMainThread): + +2009-11-23 Alexey Proskuryakov + + Reviewed by Brady Eidson. + + https://bugs.webkit.org/show_bug.cgi?id=31748 + Make WebSocketHandleCFNet respect proxy auto-configuration files via CFProxySupport + + * JavaScriptCore.exp: Export callOnMainThreadAndWait. + +2009-11-23 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Symbian] Fix lastIndexOf() for Symbian + https://bugs.webkit.org/show_bug.cgi?id=31773 + + Symbian soft floating point library has problems with operators + comparing NaN to numbers. Without a workaround lastIndexOf() + function does not work. + + Patch developed by David Leong. + + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncLastIndexOf):Add an extra test + to check for NaN for Symbian. + +2009-11-23 Steve Block + + Reviewed by Eric Seidel. + + Android port lacks implementation of atomicIncrement and atomicDecrement. + https://bugs.webkit.org/show_bug.cgi?id=31715 + + * wtf/Threading.h: Modified. + (WTF::atomicIncrement): Added Android implementation. + (WTF::atomicDecrement): Added Android implementation. + +2009-11-22 Laszlo Gombos + + Unreviewed. + + [Qt] Sort source lists and remove obsolete comments + from the build system. + + * JavaScriptCore.pri: + +2009-11-21 Laszlo Gombos + + Reviewed by Eric Seidel. + + [Qt][Mac] Turn on multiple JavaScript threads for QtWebkit on Mac + https://bugs.webkit.org/show_bug.cgi?id=31753 + + * wtf/Platform.h: + +2009-11-19 Steve Block + + Android port lacks configuration in Platform.h and config.h. + https://bugs.webkit.org/show_bug.cgi?id=31671 + + * wtf/Platform.h: Modified. Added Android-specific configuration. + +2009-11-19 Alexey Proskuryakov + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=31690 + Make SocketStreamHandleCFNet work on Windows + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * wtf/MainThread.cpp: + (WTF::FunctionWithContext::FunctionWithContext): + (WTF::dispatchFunctionsFromMainThread): + (WTF::callOnMainThreadAndWait): + * wtf/MainThread.h: + Re-add callOnMainThreadAndWait(), which was removed in bug 23926. + +2009-11-19 Dmitry Titov + + Reviewed by David Levin. + + isMainThread() on Chromium (Mac and Linux) is so slow it timeouts LayoutTests.. + https://bugs.webkit.org/show_bug.cgi?id=31693 + + * wtf/ThreadingPthreads.cpp: + (WTF::initializeThreading): grab and use the pthread_t of the main thread instead of ThreadIdentifier. + (WTF::isMainThread): Ditto. + +2009-11-19 Laszlo Gombos + + Reviewed by Darin Adler. + + Remove HAVE(STRING_H) guard from JavaScriptCore + https://bugs.webkit.org/show_bug.cgi?id=31668 + + * config.h: + * runtime/UString.cpp: + +2009-11-19 Dumitru Daniliuc + + Reviewed by Dmitry Titov. + + Fixing a bug in MessageQueue::removeIf() that leads to an + assertion failure. + + https://bugs.webkit.org/show_bug.cgi?id=31657 + + * wtf/MessageQueue.h: + (WTF::MessageQueue::removeIf): + +2009-11-19 Laszlo Gombos + + Reviewed by Darin Adler. + + Remove HAVE(FLOAT_H) guard + https://bugs.webkit.org/show_bug.cgi?id=31661 + + JavaScriptCore has a dependency on float.h, there is + no need to guard float.h. + + * runtime/DatePrototype.cpp: Remove include directive + for float.h as it is included in MathExtras.h already. + * runtime/Operations.cpp: Ditto. + * runtime/UString.cpp: Ditto. + * wtf/dtoa.cpp: Ditto. + * wtf/MathExtras.h: Remove HAVE(FLOAT_H) guard. + * wtf/Platform.h: Ditto. + +2009-11-19 Thiago Macieira + + Reviewed by Simon Hausmann. + + Build fix for 32-bit Sparc machines: these machines are big-endian. + + * wtf/Platform.h: + +2009-11-18 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove support for Qt v4.3 or older versions + https://bugs.webkit.org/show_bug.cgi?id=29469 + + * JavaScriptCore.pro: + * jsc.pro: + * wtf/unicode/qt4/UnicodeQt4.h: + +2009-11-18 Kent Tamura + + Reviewed by Darin Adler. + + Move UString::from(double) implementation to new + WTF::doubleToStringInJavaScriptFormat(), and expose it because WebCore + code will use it. + https://bugs.webkit.org/show_bug.cgi?id=31330 + + - Introduce new function createRep(const char*, unsigned) and + UString::UString(const char*, unsigned) to reduce 2 calls to strlen(). + - Fix a bug that dtoa() doesn't update *rve if the input value is NaN + or Infinity. + + No new tests because this doesn't change the behavior. + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * runtime/UString.cpp: + (JSC::createRep): + (JSC::UString::UString): + (JSC::UString::from): Move the code to doubleToStringInJavaScriptFormat(). + * runtime/UString.h: + * wtf/dtoa.cpp: + (WTF::dtoa): Fix a bug about rve. + (WTF::append): A helper for doubleToStringInJavaScriptFormat(). + (WTF::doubleToStringInJavaScriptFormat): Move the code from UString::from(double). + * wtf/dtoa.h: + +2009-11-18 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Remove WTF_USE_JAVASCRIPTCORE_BINDINGS as it is no longer used + https://bugs.webkit.org/show_bug.cgi?id=31643 + + * JavaScriptCore.pro: + +2009-11-18 Nate Chapin + + Reviewed by Darin Fisher. + + Remove Chromium's unnecessary dependency on wtf's tcmalloc files. + + https://bugs.webkit.org/show_bug.cgi?id=31648 + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + +2009-11-18 Thiago Macieira + + Reviewed by Gavin Barraclough. + + [Qt] Implement symbol hiding for JSC's JIT functions. + + These functions are implemented directly in assembly, so they need the + proper directives to enable/disable visibility. On ELF systems, it's + .hidden, whereas on Mach-O systems (Mac) it's .private_extern. On + Windows, it's not necessary since you have to explicitly export. I + also implemented the AIX idiom, though it's unlikely anyone will + implement AIX/POWER JIT. + https://bugs.webkit.org/show_bug.cgi?id=30864 + + * jit/JITStubs.cpp: + +2009-11-18 Oliver Hunt + + Reviewed by Alexey Proskuryakov. + + Interpreter may do an out of range access when throwing an exception in the profiler. + https://bugs.webkit.org/show_bug.cgi?id=31635 + + Add bounds check. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::throwException): + +2009-11-18 Gabor Loki + + Reviewed by Darin Adler. + + Fix the clobber list of cacheFlush for ARM and Thumb2 on Linux + https://bugs.webkit.org/show_bug.cgi?id=31631 + + * jit/ExecutableAllocator.h: + (JSC::ExecutableAllocator::cacheFlush): + +2009-11-18 Harald Fernengel + + Reviewed by Simon Hausmann. + + [Qt] Fix detection of linux-g++ + + Never use "linux-g++*" to check for linux-g++, since this will break embedded + builds which use linux-arm-g++ and friends. Use 'linux*-g++*' to check for any + g++ on linux mkspec. + + * JavaScriptCore.pri: + +2009-11-17 Jon Honeycutt + + Add JSContextRefPrivate.h to list of copied files. + + Reviewed by Mark Rowe. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: + +2009-11-17 Martin Robinson + + Reviewed by Adam Barth. + + [GTK] Style cleanup for GOwnPtr + https://bugs.webkit.org/show_bug.cgi?id=31506 + + Remove forward declaration in GOwnPtr and do some style cleanup. + + * wtf/GOwnPtr.cpp: + * wtf/GOwnPtr.h: + (WTF::GOwnPtr::GOwnPtr): + (WTF::GOwnPtr::~GOwnPtr): + (WTF::GOwnPtr::get): + (WTF::GOwnPtr::release): + (WTF::GOwnPtr::outPtr): + (WTF::GOwnPtr::set): + (WTF::GOwnPtr::clear): + (WTF::GOwnPtr::operator*): + (WTF::GOwnPtr::operator->): + (WTF::GOwnPtr::operator!): + (WTF::GOwnPtr::operator UnspecifiedBoolType): + (WTF::GOwnPtr::swap): + (WTF::swap): + (WTF::operator==): + (WTF::operator!=): + (WTF::getPtr): + (WTF::freeOwnedGPtr): + +2009-11-17 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + Incorrect use of JavaScriptCore API in DumpRenderTree + https://bugs.webkit.org/show_bug.cgi?id=31577 + + Add assertions to the 'toJS' functions to catch mistakes like + this early. Restructure existing code which blindly passed potentially + null values to toJS when forwarding exceptions so that a null check is + performed first. + + * API/APICast.h: + (toJS): + (toJSForGC): + * API/JSCallbackObjectFunctions.h: + (JSC::::getOwnPropertySlot): + (JSC::::put): + (JSC::::deleteProperty): + (JSC::::construct): + (JSC::::hasInstance): + (JSC::::call): + (JSC::::toNumber): + (JSC::::toString): + (JSC::::staticValueGetter): + (JSC::::callbackGetter): + * API/tests/testapi.c: Fix errors in the API tester. + (MyObject_getProperty): + (MyObject_convertToType): + (EvilExceptionObject_convertToType): + +2009-11-16 Zoltan Herczeg + + Reviewed by Gavin Barraclough. + + https://bugs.webkit.org/show_bug.cgi?id=31050 + + Minor fixes for JSVALUE32_64: branchConvertDoubleToInt32 + failed on a CortexA8 CPU, but not on a simulator; and + JITCall.cpp modifications was somehow not committed to mainline. + + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::fmrs_r): + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::branchConvertDoubleToInt32): + * jit/JITCall.cpp: + (JSC::JIT::compileOpCall): + +2009-11-16 Joerg Bornemann + + Reviewed by Simon Hausmann. + + Fix Qt build on Windows CE 6. + + * JavaScriptCore.pri: Add missing include path. + * wtf/Platform.h: Include ce_time.h for Windows CE 6. + +2009-11-13 Zoltan Herczeg + + Reviewed by Gavin Barraclough. + + https://bugs.webkit.org/show_bug.cgi?id=31050 + + Adding optimization support for mode JSVALUE32_64 + on ARM systems. + + * jit/JIT.h: + * jit/JITCall.cpp: + (JSC::JIT::compileOpCall): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_method_check): + (JSC::JIT::compileGetByIdHotPath): + (JSC::JIT::compileGetByIdSlowCase): + (JSC::JIT::emit_op_put_by_id): + +2009-11-14 Zoltan Herczeg + + Reviewed by Gavin Barraclough. + + https://bugs.webkit.org/show_bug.cgi?id=31050 + + Adding JSVALUE32_64 support for ARM (but not turning it + on by default). All optimizations must be disabled, since + this patch is only the first of a series of patches. + + During the work, a lot of x86 specific code revealed and + made platform independent. + See revisions: 50531 50541 50593 50594 50595 + + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::): + (JSC::ARMAssembler::fdivd_r): + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::lshift32): + (JSC::MacroAssemblerARM::neg32): + (JSC::MacroAssemblerARM::rshift32): + (JSC::MacroAssemblerARM::branchOr32): + (JSC::MacroAssemblerARM::set8): + (JSC::MacroAssemblerARM::setTest8): + (JSC::MacroAssemblerARM::loadDouble): + (JSC::MacroAssemblerARM::divDouble): + (JSC::MacroAssemblerARM::convertInt32ToDouble): + (JSC::MacroAssemblerARM::zeroDouble): + * jit/JIT.cpp: + * jit/JIT.h: + * jit/JITOpcodes.cpp: + (JSC::JIT::privateCompileCTIMachineTrampolines): + * jit/JITStubs.cpp: + * wtf/StdLibExtras.h: + +2009-11-13 Dominik Röttsches + + Reviewed by Eric Seidel. + + Unify TextBoundaries implementations by only relying on WTF Unicode abstractions + https://bugs.webkit.org/show_bug.cgi?id=31468 + + Adding isAlphanumeric abstraction, required + by TextBoundaries.cpp. + + * wtf/unicode/glib/UnicodeGLib.h: + (WTF::Unicode::isAlphanumeric): + * wtf/unicode/icu/UnicodeIcu.h: + (WTF::Unicode::isAlphanumeric): + +2009-11-13 Norbert Leser + + Reviewed by Eric Seidel. + + Added macros for USERINCLUDE paths within symbian blocks + to guarantee inclusion of respective header files from local path + first (to avoid clashes with same names of header files in system include path). + + * JavaScriptCore.pri: + +2009-11-13 Oliver Hunt + + Reviewed by Geoff Garen. + + JSValueProtect and JSValueUnprotect don't protect API wrapper values + https://bugs.webkit.org/show_bug.cgi?id=31485 + + Make JSValueProtect/Unprotect use a new 'toJS' function, 'toJSForGC' that + does not attempt to to strip out API wrapper objects. + + * API/APICast.h: + (toJSForGC): + * API/JSValueRef.cpp: + (JSValueProtect): + (JSValueUnprotect): + * API/tests/testapi.c: + (makeGlobalNumberValue): + (main): + +2009-11-13 İsmail Dönmez + + Reviewed by Antti Koivisto. + + Fix typo, ce_time.cpp should be ce_time.c + + * JavaScriptCore.pri: + +2009-11-12 Steve VanDeBogart + + Reviewed by Adam Barth. + + Calculate the time offset only if we were able to parse + the date string. This saves an IPC in Chromium for + invalid date strings. + https://bugs.webkit.org/show_bug.cgi?id=31416 + + * wtf/DateMath.cpp: + (WTF::parseDateFromNullTerminatedCharacters): + (JSC::parseDateFromNullTerminatedCharacters): + +2009-11-12 Oliver Hunt + + Rollout r50896 until i can work out why it causes failures. + + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitReturn): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::execute): + * parser/Nodes.cpp: + (JSC::EvalNode::emitBytecode): + +2009-11-12 Steve Falkenburg + + Reviewed by Stephanie Lewis. + + Remove LIBRARY directive from def file to fix Debug_All target. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-11-12 Gustavo Noronha Silva + + Rubber-stamped by Holger Freyther. + + Revert r50204, since it makes DRT crash on 32 bits release builds + for GTK+. + + * wtf/FastMalloc.h: + +2009-11-12 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Start unifying entry logic for function and eval code. + + Eval now uses a ret instruction to end execution, and sets up + a callframe more in line with what we do for function entry. + + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitReturn): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::execute): + * parser/Nodes.cpp: + (JSC::EvalNode::emitBytecode): + +2009-11-12 Richard Moe Gustavsen + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Disable pthread_setname_np. + + This allows Qt builds on Mac from 10.6 to run on earlier version + where this symbol is not present. + https://bugs.webkit.org/show_bug.cgi?id=31403 + + * wtf/Platform.h: + +2009-11-12 Thiago Macieira + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Fix linking on Linux 32-bit. + + It was missing the ".text" directive at the top of the file, + indicating that code would follow. Without it, the assembler created + "NOTYPE" symbols, which would result in linker errors. + https://bugs.webkit.org/show_bug.cgi?id=30863 + + * jit/JITStubs.cpp: + +2009-11-11 Laszlo Gombos + + Reviewed by Alexey Proskuryakov. + + Refactor multiple JavaScriptCore threads + https://bugs.webkit.org/show_bug.cgi?id=31328 + + Remove the id field from the PlatformThread structure + as it is not used. + + * runtime/Collector.cpp: + (JSC::getCurrentPlatformThread): + (JSC::suspendThread): + (JSC::resumeThread): + (JSC::getPlatformThreadRegisters): + +2009-11-10 Geoffrey Garen + + Linux build fix: Added an #include for UINT_MAX. + + * runtime/WeakRandom.h: + +2009-11-10 Geoffrey Garen + + JavaScriptGlue build fix: Marked a file 'private' instead of 'project'. + + * JavaScriptCore.xcodeproj/project.pbxproj: + +2009-11-10 Geoffrey Garen + + Reviewed by Gavin "avGni arBalroguch" Barraclough. + + Faster Math.random, based on GameRand. + + SunSpider says 1.4% faster. + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: Added the header to the project. + + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + * runtime/JSGlobalData.h: Use an object to track random number generation + state, initialized to the current time. + + * runtime/MathObject.cpp: + (JSC::MathObject::MathObject): + (JSC::mathProtoFuncRandom): Use the new hotness. + + * runtime/WeakRandom.h: Added. + (JSC::WeakRandom::WeakRandom): + (JSC::WeakRandom::get): + (JSC::WeakRandom::advance): The new hotness. + +2009-11-09 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Imported the v8 DST cache. + + SunSpider says 1.5% faster. + + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::resetDateCache): Reset the DST cache when resetting + other date data. + + * runtime/JSGlobalData.h: + (JSC::DSTOffsetCache::DSTOffsetCache): + (JSC::DSTOffsetCache::reset): Added a struct for the DST cache. + + * wtf/DateMath.cpp: + (WTF::calculateDSTOffsetSimple): + (WTF::calculateDSTOffset): + (WTF::parseDateFromNullTerminatedCharacters): + (JSC::getDSTOffset): + (JSC::gregorianDateTimeToMS): + (JSC::msToGregorianDateTime): + (JSC::parseDateFromNullTerminatedCharacters): + * wtf/DateMath.h: The imported code for probing and updating the cache. + +2009-11-09 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Fixed an edge case that could cause the engine not to notice a timezone + change. + + No test because this case would require manual intervention to change + the timezone during the test. + + SunSpider reports no change. + + * runtime/DateInstanceCache.h: + (JSC::DateInstanceCache::DateInstanceCache): + (JSC::DateInstanceCache::reset): Added a helper function for resetting + this cache. Also, shrank the cache, since we'll be resetting it often. + + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::resetDateCache): Include resetting the DateInstanceCache + in resetting Date data. (Otherwise, a cache hit could bypass a necessary + timezone update check.) + +2009-11-09 Geoffrey Garen + + Reviewed by Sam Weinig. + + Some manual inlining and constant propogation in Date code. + + SunSpider reports a 0.4% speedup on date-*, no overall speedup. Shark + says some previously evident stalls are now gone. + + * runtime/DateConstructor.cpp: + (JSC::callDate): + * runtime/DateConversion.cpp: + (JSC::formatTime): + (JSC::formatTimeUTC): Split formatTime into UTC and non-UTC variants. + + * runtime/DateConversion.h: + * runtime/DateInstance.cpp: + (JSC::DateInstance::calculateGregorianDateTime): + (JSC::DateInstance::calculateGregorianDateTimeUTC): + * runtime/DateInstance.h: + (JSC::DateInstance::gregorianDateTime): + (JSC::DateInstance::gregorianDateTimeUTC): Split gregorianDateTime into + a UTC and non-UTC variant, and split each variant into a fast inline + case and a slow out-of-line case. + + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + (JSC::dateProtoFuncToString): + (JSC::dateProtoFuncToUTCString): + (JSC::dateProtoFuncToISOString): + (JSC::dateProtoFuncToDateString): + (JSC::dateProtoFuncToTimeString): + (JSC::dateProtoFuncGetFullYear): + (JSC::dateProtoFuncGetUTCFullYear): + (JSC::dateProtoFuncToGMTString): + (JSC::dateProtoFuncGetMonth): + (JSC::dateProtoFuncGetUTCMonth): + (JSC::dateProtoFuncGetDate): + (JSC::dateProtoFuncGetUTCDate): + (JSC::dateProtoFuncGetDay): + (JSC::dateProtoFuncGetUTCDay): + (JSC::dateProtoFuncGetHours): + (JSC::dateProtoFuncGetUTCHours): + (JSC::dateProtoFuncGetMinutes): + (JSC::dateProtoFuncGetUTCMinutes): + (JSC::dateProtoFuncGetSeconds): + (JSC::dateProtoFuncGetUTCSeconds): + (JSC::dateProtoFuncGetTimezoneOffset): + (JSC::setNewValueFromTimeArgs): + (JSC::setNewValueFromDateArgs): + (JSC::dateProtoFuncSetYear): + (JSC::dateProtoFuncGetYear): Updated for the gregorianDateTime change above. + +2009-11-09 Geoffrey Garen + + Build fix: export a new symbol. + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-11-09 Geoffrey Garen + + Reviewed by Sam "Home Wrecker" Weinig. + + Added a tiny cache for Date parsing. + + SunSpider says 1.2% faster. + + * runtime/DateConversion.cpp: + (JSC::parseDate): Try to reuse the last parsed Date, if present. + + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::resetDateCache): + * runtime/JSGlobalData.h: Added storage for last parsed Date. Refactored + this code to make resetting the date cache easier. + + * runtime/JSGlobalObject.h: + (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for + refactoring. + + * wtf/DateMath.cpp: + (JSC::parseDateFromNullTerminatedCharacters): + * wtf/DateMath.h: Changed ExecState to be first parameter, as is the JSC custom. + +2009-11-09 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Can cache prototype lookups on uncacheable dictionaries. + https://bugs.webkit.org/show_bug.cgi?id=31198 + + Replace fromDictionaryTransition with flattenDictionaryObject and + flattenDictionaryStructure. This change is necessary as we need to + guarantee that our attempt to convert away from a dictionary structure + will definitely succeed, and in some cases this requires mutating the + object storage itself. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::tryCacheGetByID): + * jit/JITStubs.cpp: + (JSC::JITThunks::tryCacheGetByID): + (JSC::DEFINE_STUB_FUNCTION): + * runtime/BatchedTransitionOptimizer.h: + (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer): + * runtime/JSObject.h: + (JSC::JSObject::flattenDictionaryObject): + * runtime/Operations.h: + (JSC::normalizePrototypeChain): + * runtime/Structure.cpp: + (JSC::Structure::flattenDictionaryStructure): + (JSC::comparePropertyMapEntryIndices): + * runtime/Structure.h: + +2009-11-09 Laszlo Gombos + + Not reviewed, build fix. + + Remove extra character from r50701. + + * JavaScriptCore.pri: + +2009-11-09 Laszlo Gombos + + Not reviewed, build fix. + + Revert r50695 because it broke QtWebKit (clean builds). + + * JavaScriptCore.pri: + +2009-11-09 Norbert Leser + + Reviewed by Kenneth Rohde Christiansen. + + Prepended $$PWD to GENERATED_SOURCES_DIR to avoid potential ambiguities when included from WebCore.pro. + Some preprocessors consider this GENERATED_SOURCES_DIR relative to current invoking dir (e.g., ./WebCore), + and not the working dir of JavaCriptCore.pri (i.e., ../JavaScriptCore/). + + * JavaScriptCore.pri: + +2009-11-09 Laszlo Gombos + + Reviewed by Kenneth Rohde Christiansen. + + Use explicit parentheses to silence gcc 4.4 -Wparentheses warnings + https://bugs.webkit.org/show_bug.cgi?id=31040 + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + +2009-11-08 David Levin + + Reviewed by NOBODY (speculative snow leopard and windows build fixes). + + * wtf/DateMath.cpp: + (WTF::parseDateFromNullTerminatedCharacters): + (JSC::gregorianDateTimeToMS): + (JSC::msToGregorianDateTime): + (JSC::parseDateFromNullTerminatedCharacters): + * wtf/DateMath.h: + (JSC::GregorianDateTime::GregorianDateTime): + +2009-11-08 David Levin + + Reviewed by NOBODY (chromium build fix). + + Hopefully, the last build fix. + + Create better separation in DateMath about the JSC + and non-JSC portions. Also, only expose the non-JSC + version in the exports. + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * wtf/DateMath.cpp: + (WTF::parseDateFromNullTerminatedCharacters): + (JSC::getUTCOffset): + (JSC::gregorianDateTimeToMS): + (JSC::msToGregorianDateTime): + (JSC::parseDateFromNullTerminatedCharacters): + * wtf/DateMath.h: + (JSC::gmtoffset): + +2009-11-08 David Levin + + Reviewed by NOBODY (chromium build fix). + + For the change in DateMath. + + * config.h: + * wtf/DateMath.cpp: + +2009-11-06 Geoffrey Garen + + Windows build fix: export some symbols. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-11-06 Geoffrey Garen + + Build fix: updated export file. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + +2009-11-06 Geoffrey Garen + + Build fix: added some #includes. + + * wtf/CurrentTime.h: + * wtf/DateMath.h: + +2009-11-06 Geoffrey Garen + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=31197 + Implemented a timezone cache not based on Mac OS X's notify_check API. + + If the VM calculates the local timezone offset from UTC, it caches the + result until the end of the current VM invocation. (We don't want to cache + forever, because the user's timezone may change over time.) + + This removes notify_* overhead on Mac, and, more significantly, removes + OS time and date call overhead on non-Mac platforms. + + ~8% speedup on Date microbenchmark on Mac. SunSpider reports maybe a tiny + speedup on Mac. (Speedup on non-Mac platforms should be even more noticeable.) + + * JavaScriptCore.exp: + + * interpreter/CachedCall.h: + (JSC::CachedCall::CachedCall): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::execute): + * runtime/JSGlobalObject.h: + (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Made the + DynamicGlobalObjectScope constructor responsible for checking whether a + dynamicGlobalObject has already been set. This eliminated some duplicate + client code, and allowed me to avoid adding even more duplicate client + code. Made DynamicGlobalObjectScope responsible for resetting the + local timezone cache upon first entry to the VM. + + * runtime/DateConstructor.cpp: + (JSC::constructDate): + (JSC::callDate): + (JSC::dateParse): + (JSC::dateUTC): + * runtime/DateConversion.cpp: + (JSC::parseDate): + * runtime/DateConversion.h: + * runtime/DateInstance.cpp: + (JSC::DateInstance::gregorianDateTime): + * runtime/DateInstance.h: + * runtime/DateInstanceCache.h: + * runtime/DatePrototype.cpp: + (JSC::setNewValueFromTimeArgs): + (JSC::setNewValueFromDateArgs): + (JSC::dateProtoFuncSetYear): + * runtime/InitializeThreading.cpp: + (JSC::initializeThreadingOnce): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + * runtime/JSGlobalData.h: + * wtf/DateMath.cpp: + (WTF::getCurrentUTCTime): + (WTF::getCurrentUTCTimeWithMicroseconds): + (WTF::getLocalTime): + (JSC::getUTCOffset): Use the new cache. Also, see below. + (JSC::gregorianDateTimeToMS): + (JSC::msToGregorianDateTime): + (JSC::initializeDates): + (JSC::parseDateFromNullTerminatedCharacters): Simplified the way this function + accounts for the local timezone offset, to accomodate our new caching API, + and a (possibly misguided) caller in WebCore. Also, see below. + * wtf/DateMath.h: + (JSC::GregorianDateTime::GregorianDateTime): Moved most of the code in + DateMath.* into the JSC namespace. The code needed to move so it could + naturally interact with ExecState and JSGlobalData to support caching. + Logically, it seemed right to move it, too, since this code is not really + as low-level as the WTF namespace might imply -- it implements a set of + date parsing and conversion quirks that are finely tuned to the JavaScript + language. Also removed the Mac OS X notify_* infrastructure. + + * wtf/CurrentTime.h: + (WTF::currentTimeMS): + (WTF::getLocalTime): Moved the rest of the DateMath code here, and renamed + it to make it consistent with WTF's currentTime function. + +2009-11-06 Gabor Loki + + Unreviewed trivial buildfix after r50595. + + Rename the remaining rshiftPtr calls to rshift32 + + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_rshift): + * jit/JITInlineMethods.h: + (JSC::JIT::emitFastArithImmToInt): + +2009-11-06 Gavin Barraclough + + Reviewed by Oliver Hunt. + + Tidy up the shift methods on the macro-assembler interface. + + Currently behaviour of shifts of a magnitude > 0x1f is undefined. + Instead defined that all shifts are masked to this range. This makes a lot of + practical sense, both since having undefined behaviour is not particularly + desirable, and because this behaviour is commonly required (particularly since + it is required bt ECMA-262 for shifts). + + Update the ARM assemblers to provide this behaviour. Remove (now) redundant + masks from JITArithmetic, and remove rshiftPtr (this was used in case that + could be rewritten in a simpler form using rshift32, only optimized JSVALUE32 + on x86-64, which uses JSVALUE64!) + + * assembler/MacroAssembler.h: + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::lshift32): + (JSC::MacroAssemblerARM::rshift32): + * assembler/MacroAssemblerARMv7.h: + (JSC::MacroAssemblerARMv7::lshift32): + (JSC::MacroAssemblerARMv7::rshift32): + * assembler/MacroAssemblerX86_64.h: + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_lshift): + (JSC::JIT::emit_op_rshift): + +2009-11-05 Gavin Barraclough + + Rubber Stamped by Oliver Hunt. + + Remove a magic number (1) from the JIT, instead compute the value with OBJECT_OFFSET. + + * jit/JITInlineMethods.h: + (JSC::JIT::emitPutJITStubArg): + (JSC::JIT::emitPutJITStubArgConstant): + (JSC::JIT::emitGetJITStubArg): + (JSC::JIT::emitPutJITStubArgFromVirtualRegister): + * jit/JITStubCall.h: + (JSC::JITStubCall::JITStubCall): + (JSC::JITStubCall::getArgument): + * jit/JITStubs.h: + +2009-11-05 Zoltan Herczeg + + Reviewed by Gavin Barraclough. + + https://bugs.webkit.org/show_bug.cgi?id=31159 + Fix branchDouble behaviour on ARM THUMB2 JIT. + + The x86 branchDouble behaviour is reworked, and all JIT + ports should follow the x86 port. See bug 31104 and 31151 + + This patch contains a fix for the traditional ARM port + + * assembler/ARMAssembler.h: + (JSC::ARMAssembler::): + (JSC::ARMAssembler::fmrs_r): + (JSC::ARMAssembler::ftosid_r): + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::): + (JSC::MacroAssemblerARM::branchDouble): + (JSC::MacroAssemblerARM::branchConvertDoubleToInt32): + +2009-11-05 Chris Jerdonek + + Reviewed by Eric Seidel. + + Removed the "this is part of the KDE project" comments from + all *.h, *.cpp, *.idl, and *.pm files. + + https://bugs.webkit.org/show_bug.cgi?id=31167 + + The maintenance and architecture page in the project wiki lists + this as a task. + + This change includes no changes or additions to test cases + since the change affects only comments. + + * wtf/wince/FastMallocWince.h: + +2009-11-05 Gabor Loki + + Reviewed by Gavin Barraclough. + + Use ARMv7 specific encoding for immediate constants on ARMv7 target + https://bugs.webkit.org/show_bug.cgi?id=31060 + + * assembler/ARMAssembler.cpp: + (JSC::ARMAssembler::getOp2): Use INVALID_IMM + (JSC::ARMAssembler::getImm): Use encodeComplexImm for complex immediate + (JSC::ARMAssembler::moveImm): Ditto. + (JSC::ARMAssembler::encodeComplexImm): Encode a constant by one or two + instructions or a PC relative load. + * assembler/ARMAssembler.h: Use INVALID_IMM if a constant cannot be + encoded as an immediate constant. + (JSC::ARMAssembler::): + (JSC::ARMAssembler::movw_r): 16-bit immediate load + (JSC::ARMAssembler::movt_r): High halfword 16-bit immediate load + (JSC::ARMAssembler::getImm16Op2): Encode immediate constant for + movw_r and mowt_r + +2009-11-04 Mark Mentovai + + Reviewed by Mark Rowe. + + Provide TARGETING_TIGER and TARGETING_LEOPARD as analogues to + BUILDING_ON_TIGER and BUILDING_ON_LEOPARD. The TARGETING_ macros + consider the deployment target; the BUILDING_ON_ macros consider the + headers being built against. + + * wtf/Platform.h: + +2009-11-04 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=31151 + Fix branchDouble behaviour on ARM THUMB2 JIT. + + The ARMv7 JIT is currently using ARMv7Assembler::ConditionEQ to branch + for DoubleEqualOrUnordered, however this is incorrect – ConditionEQ won't + branch on unordered operands. Similarly, DoubleLessThanOrUnordered & + DoubleLessThanOrEqualOrUnordered use ARMv7Assembler::ConditionLO & + ARMv7Assembler::ConditionLS, whereas they should be using + ARMv7Assembler::ConditionLT & ARMv7Assembler::ConditionLE. + + Fix these, and fill out the missing DoubleConditions. + + * assembler/MacroAssemblerARMv7.h: + (JSC::MacroAssemblerARMv7::): + (JSC::MacroAssemblerARMv7::branchDouble): + +2009-11-04 Gavin Barraclough + + Rubber Stamped by Oliver Hunt. + + Enable native call optimizations on ARMv7. (Existing ARM_TRADITIONAL + implementation was generic, worked perfectly, just needed turning on). + + * jit/JITOpcodes.cpp: + * wtf/Platform.h: + +2009-11-04 Gavin Barraclough + + Rubber Stamped by Mark Rowe, Oliver Hunt, and Sam Weinig. + + Add a missing assert to the ARMv7 JIT. + + * assembler/ARMv7Assembler.h: + (JSC::ARMThumbImmediate::ARMThumbImmediate): + +2009-11-04 Mark Rowe + + Rubber-stamped by Oliver Hunt. + + Remove bogus op_ prefix on dumped version of three opcodes. + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::dump): + +2009-11-04 Mark Rowe + + Reviewed by Sam Weinig. + + Fix dumping of constants in bytecode so that they aren't printed as large positive register numbers. + + We do this by having the registerName function return information about the constant if the register + number corresponds to a constant. This requires that registerName, and several functions that call it, + be converted to member functions of CodeBlock so that the constant value can be retrieved. The + ExecState also needs to be threaded down through these functions so that it can be passed on to + constantName when needed. + + * bytecode/CodeBlock.cpp: + (JSC::constantName): + (JSC::CodeBlock::registerName): + (JSC::CodeBlock::printUnaryOp): + (JSC::CodeBlock::printBinaryOp): + (JSC::CodeBlock::printConditionalJump): + (JSC::CodeBlock::printGetByIdOp): + (JSC::CodeBlock::printPutByIdOp): + (JSC::CodeBlock::dump): + * bytecode/CodeBlock.h: + (JSC::CodeBlock::isConstantRegisterIndex): + +2009-11-04 Pavel Heimlich + + Reviewed by Alexey Proskuryakov. + + https://bugs.webkit.org/show_bug.cgi?id=30647 + Solaris build failure due to strnstr. + + * wtf/StringExtras.h: Enable strnstr on Solaris, too. + +2009-11-04 Gavin Barraclough + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=31104 + Refactor x86-specific behaviour out of the JIT. + + - Add explicit double branch conditions for ordered and unordered comparisons (presently the brehaviour is a mix). + - Refactor double to int conversion out into the MacroAssembler. + - Remove broken double to int conversion for !JSVALUE32_64 builds - this code was broken and slowing us down, fixing it showed it not to be an improvement. + - Remove exclusion of double to int conversion from (1 % X) cases in JSVALUE32_64 builds - if this was of benefit this is no longer the case; simplify. + + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::): + * assembler/MacroAssemblerARMv7.h: + (JSC::MacroAssemblerARMv7::): + * assembler/MacroAssemblerX86Common.h: + (JSC::MacroAssemblerX86Common::): + (JSC::MacroAssemblerX86Common::convertInt32ToDouble): + (JSC::MacroAssemblerX86Common::branchDouble): + (JSC::MacroAssemblerX86Common::branchConvertDoubleToInt32): + * jit/JITArithmetic.cpp: + (JSC::JIT::emitBinaryDoubleOp): + (JSC::JIT::emit_op_div): + (JSC::JIT::emitSlow_op_jnless): + (JSC::JIT::emitSlow_op_jnlesseq): + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_jfalse): + +2009-11-04 Mark Mentovai + + Reviewed by Eric Seidel. + + Remove BUILDING_ON_LEOPARD from JavaScriptCore.gyp. This is supposed + to be set as needed only in wtf/Platform.h. + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + +2009-11-02 Oliver Hunt + + Reviewed by Gavin Barraclough. + + REGRESSION (r48573): JSC may incorrectly cache chain lookups with a dictionary at the head of the chain + https://bugs.webkit.org/show_bug.cgi?id=31045 + + Add guards to prevent caching of prototype chain lookups with dictionaries at the + head of the chain. Also add a few tighter assertions to cached prototype lookups + to catch this in future. + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::tryCacheGetByID): + (JSC::Interpreter::privateExecute): + * jit/JITStubs.cpp: + (JSC::JITThunks::tryCacheGetByID): + +2009-11-02 Laszlo Gombos + + Reviewed by Darin Adler. + + PLATFORM(CF) should be set when building for Qt on Darwin + https://bugs.webkit.org/show_bug.cgi?id=23671 + + * wtf/Platform.h: Turn on CF support if both QT and DARWIN + platforms are defined. + +2009-11-02 Dmitry Titov + + Reviewed by David Levin. + + Remove threadsafe refcounting from tasks used with WTF::MessageQueue. + https://bugs.webkit.org/show_bug.cgi?id=30612 + + * wtf/MessageQueue.h: + (WTF::MessageQueue::alwaysTruePredicate): + (WTF::MessageQueue::~MessageQueue): + (WTF::MessageQueue::append): + (WTF::MessageQueue::appendAndCheckEmpty): + (WTF::MessageQueue::prepend): + (WTF::MessageQueue::waitForMessage): + (WTF::MessageQueue::waitForMessageFilteredWithTimeout): + (WTF::MessageQueue::tryGetMessage): + (WTF::MessageQueue::removeIf): + The MessageQueue is changed to act as a queue of OwnPtr. It takes ownership + of posted tasks and passes it to the new owner (in another thread) when the task is fetched. + All methods have arguments of type PassOwnPtr and return the same type. + + * wtf/Threading.cpp: + (WTF::createThread): + Superficial change to trigger rebuild of JSC project on Windows, + workaround for https://bugs.webkit.org/show_bug.cgi?id=30890 + +2009-10-30 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Fixed failing layout test: restore a special case I accidentally deleted. + + * runtime/DatePrototype.cpp: + (JSC::setNewValueFromDateArgs): In the case of applying a change to a date + that is NaN, reset the date to 0 *and* then apply the change; don't just + reset the date to 0. + +2009-10-30 Geoffrey Garen + + Windows build fix: update for object-to-pointer change. + + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + +2009-10-29 Geoffrey Garen + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=30942 + Use pointers instead of copies to pass GregorianDateTime objects around. + + SunSpider reports a shocking 4.5% speedup on date-format-xparb, and 1.3% + speedup on date-format-tofte. + + * runtime/DateInstance.cpp: + (JSC::DateInstance::gregorianDateTime): + * runtime/DateInstance.h: + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + (JSC::dateProtoFuncToString): + (JSC::dateProtoFuncToUTCString): + (JSC::dateProtoFuncToISOString): + (JSC::dateProtoFuncToDateString): + (JSC::dateProtoFuncToTimeString): + (JSC::dateProtoFuncGetFullYear): + (JSC::dateProtoFuncGetUTCFullYear): + (JSC::dateProtoFuncToGMTString): + (JSC::dateProtoFuncGetMonth): + (JSC::dateProtoFuncGetUTCMonth): + (JSC::dateProtoFuncGetDate): + (JSC::dateProtoFuncGetUTCDate): + (JSC::dateProtoFuncGetDay): + (JSC::dateProtoFuncGetUTCDay): + (JSC::dateProtoFuncGetHours): + (JSC::dateProtoFuncGetUTCHours): + (JSC::dateProtoFuncGetMinutes): + (JSC::dateProtoFuncGetUTCMinutes): + (JSC::dateProtoFuncGetSeconds): + (JSC::dateProtoFuncGetUTCSeconds): + (JSC::dateProtoFuncGetTimezoneOffset): + (JSC::setNewValueFromTimeArgs): + (JSC::setNewValueFromDateArgs): + (JSC::dateProtoFuncSetYear): + (JSC::dateProtoFuncGetYear): Renamed getGregorianDateTime to gregorianDateTime, + since it no longer has an out parameter. Uses 0 to indicate invalid dates. + +2009-10-30 Zoltan Horvath + + Reviewed by Darin Adler. + + Allow custom memory allocation control for JavaScriptCore's ListHashSet + https://bugs.webkit.org/show_bug.cgi?id=30853 + + Inherits ListHashSet class from FastAllocBase because it is + instantiated by 'new' in WebCore/rendering/RenderBlock.cpp:1813. + + * wtf/ListHashSet.h: + +2009-10-30 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Regression: crash enumerating properties of an object with getters or setters + https://bugs.webkit.org/show_bug.cgi?id=30948 + + Add a guard to prevent us trying to cache property enumeration on + objects with getters or setters. + + * runtime/JSPropertyNameIterator.cpp: + (JSC::JSPropertyNameIterator::create): + +2009-10-30 Roland Steiner + + Reviewed by Eric Seidel. + + Remove ENABLE_RUBY guards as discussed with Dave Hyatt and Maciej Stachowiak. + + Bug 28420 - Implement HTML5 rendering + (https://bugs.webkit.org/show_bug.cgi?id=28420) + + No new tests (no functional change). + + * Configurations/FeatureDefines.xcconfig: + +2009-10-29 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + REGRESSION (r50218-r50262): E*TRADE accounts page is missing content + https://bugs.webkit.org/show_bug.cgi?id=30947 + + + The logic for flagging that a structure has non-enumerable properties + was in addPropertyWithoutTransition, rather than in the core Structure::put + method. Despite this I was unable to produce a testcase that caused + the failure that etrade was experiencing, but the new assertion in + getEnumerablePropertyNames triggers on numerous layout tests without + the fix, so in effecti all for..in enumeration in any test ends up + doing the required consistency check. + + * runtime/Structure.cpp: + (JSC::Structure::addPropertyWithoutTransition): + (JSC::Structure::put): + (JSC::Structure::getEnumerablePropertyNames): + (JSC::Structure::checkConsistency): + +2009-10-29 Gabor Loki + + Reviewed by Gavin Barraclough. + + Add cacheFlush support for Thumb-2 on Linux + https://bugs.webkit.org/show_bug.cgi?id=30865 + + * jit/ExecutableAllocator.h: + (JSC::ExecutableAllocator::cacheFlush): + +2009-10-28 Gavin Barraclough + + Reviewed by Oliver Hunt. + + JSC JIT on ARMv7 cannot link jumps >16Mb range + https://bugs.webkit.org/show_bug.cgi?id=30891 + + Start planing all relative jumps as move-32-bit-immediate-to-register-BX. + In the cases where the jump would fall within a relative jump range, use a relative jump. + + * JavaScriptCore.xcodeproj/project.pbxproj: + * assembler/ARMv7Assembler.h: + (JSC::ARMv7Assembler::~ARMv7Assembler): + (JSC::ARMv7Assembler::LinkRecord::LinkRecord): + (JSC::ARMv7Assembler::): + (JSC::ARMv7Assembler::executableCopy): + (JSC::ARMv7Assembler::linkJump): + (JSC::ARMv7Assembler::relinkJump): + (JSC::ARMv7Assembler::setInt32): + (JSC::ARMv7Assembler::isB): + (JSC::ARMv7Assembler::isBX): + (JSC::ARMv7Assembler::isMOV_imm_T3): + (JSC::ARMv7Assembler::isMOVT): + (JSC::ARMv7Assembler::isNOP_T1): + (JSC::ARMv7Assembler::isNOP_T2): + (JSC::ARMv7Assembler::linkJumpAbsolute): + (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmFirst): + (JSC::ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmSecond): + (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp5i6Imm4Reg4EncodedImm): + * assembler/MacroAssemblerARMv7.h: + (JSC::MacroAssemblerARMv7::makeJump): + (JSC::MacroAssemblerARMv7::makeBranch): + * jit/JIT.h: + * wtf/Platform.h: + +2009-10-28 Oliver Hunt + + Reviewed by Geoff Garen. + + Improve for..in enumeration performance + https://bugs.webkit.org/show_bug.cgi?id=30887 + + Improve indexing of an object with a for..in iterator by + identifying cases where get_by_val is being used with a iterator + as the subscript and replace it with a new get_by_pname + bytecode. get_by_pname then optimizes lookups that directly access + the base object. + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::dump): + * bytecode/Opcode.h: + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitGetByVal): + * bytecompiler/BytecodeGenerator.h: + (JSC::BytecodeGenerator::pushOptimisedForIn): + (JSC::BytecodeGenerator::popOptimisedForIn): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::privateExecute): + * jit/JIT.cpp: + (JSC::JIT::privateCompileMainPass): + (JSC::JIT::privateCompileSlowCases): + * jit/JIT.h: + * jit/JITPropertyAccess.cpp: + (JSC::JIT::compileGetDirectOffset): + (JSC::JIT::emit_op_get_by_pname): + (JSC::JIT::emitSlow_op_get_by_pname): + * parser/Nodes.cpp: + (JSC::ForInNode::emitBytecode): + * runtime/JSObject.h: + * runtime/JSPropertyNameIterator.cpp: + (JSC::JSPropertyNameIterator::create): + * runtime/JSPropertyNameIterator.h: + (JSC::JSPropertyNameIterator::getOffset): + (JSC::JSPropertyNameIterator::JSPropertyNameIterator): + * runtime/JSValue.h: + (JSC::JSValue::): + * runtime/Structure.cpp: + (JSC::Structure::addPropertyTransition): + (JSC::Structure::changePrototypeTransition): + (JSC::Structure::despecifyFunctionTransition): + (JSC::Structure::addAnonymousSlotsTransition): + (JSC::Structure::getterSetterTransition): + (JSC::Structure::toDictionaryTransition): + (JSC::Structure::addPropertyWithoutTransition): + Track the existence (or not) of non-enumerable properties. + * runtime/Structure.h: + (JSC::Structure::propertyStorageCapacity): + (JSC::Structure::propertyStorageSize): + (JSC::Structure::hasNonEnumerableProperties): + (JSC::Structure::hasAnonymousSlots): + +2009-10-28 Dmitry Titov + + Not reviewed, attemp to fix Windows build. + + Touch the cpp file to cause recompile. + + * wtf/Threading.cpp: + (WTF::threadEntryPoint): + +2009-10-28 Dmitry Titov + + Reviewed by David Levin. + + https://bugs.webkit.org/show_bug.cgi?id=30805 + Add MessageQueue::removeIf(Predicate&) to remove certain tasks without pulling them from the queue. + Existing Database tests cover this since Database removes tasks when it is stopped. + + * wtf/MessageQueue.h: + (WTF::::removeIf): + +2009-10-28 Afonso R. Costa Jr. + + Reviewed by Oliver Hunt. + + [Qt] Enable YARR when YARR_JIT is enabled + https://bugs.webkit.org/show_bug.cgi?id=30730 + + When enabling or disabling JIT using JAVASCRIPTCORE_JIT, the ENABLE_YARR should + be toggled also. + + * JavaScriptCore.pri: + +2009-10-24 Martin Robinson + + Reviewed by Oliver Hunt. + + Fix strict aliasing warning by switching reinterpret_cast to bitwise_cast. + + strict-aliasing warnings in JSFunction.h + https://bugs.webkit.org/show_bug.cgi?id=27869 + + * runtime/JSFunction.h: + (JSC::JSFunction::nativeFunction): + (JSC::JSFunction::scopeChain): + (JSC::JSFunction::setScopeChain): + (JSC::JSFunction::setNativeFunction): + +2009-10-28 Jan-Arve Sæther + + Reviewed by Tor Arne Vestbø. + + Build-fix for 64-bit Windows + + * wtf/Platform.h: Make sure to use WTF_USE_JSVALUE64 + +2009-10-28 Gavin Barraclough + + Reviewed by NOBODY (build fix!). + + * jit/JIT.h: + +2009-10-26 Holger Hans Peter Freyther + + Rubber-stamped by Darin Adler. + + Export fastMalloc, fastCalloc, fastRealloc and fastFree on GCC/Unix + https://bugs.webkit.org/show_bug.cgi?id=30769 + + When using -fvisibility=hidden to hide all internal symbols by default + the malloc symbols will be hidden as well. For memory instrumentation + it is needed to provide an instrumented version of these symbols and + override the normal routines and by changing the visibility back to + default this becomes possible. + + The only other solution would be to use system malloc instead of the + TCmalloc implementation but this will not allow to analyze memory + behavior with the default allocator. + + * wtf/FastMalloc.h: Define WTF_FAST_MALLOC_EXPORT for GCC and !darwin + +2009-10-27 Gavin Barraclough + + Rubber Stamped by Samuel Q. Weinig. + + Make the asserts protecting the offsets in the JIT more descriptive. + + * jit/JIT.h: + * jit/JITCall.cpp: + (JSC::JIT::compileOpCall): + * jit/JITPropertyAccess.cpp: + (JSC::JIT::emit_op_method_check): + (JSC::JIT::compileGetByIdHotPath): + (JSC::JIT::compileGetByIdSlowCase): + (JSC::JIT::emit_op_put_by_id): + +2009-10-27 Geoffrey Garen + + Reviewed by Sam Weinig. + + A little bit of refactoring in the date code. + + * JavaScriptCore.exp: Don't export this unused symbol. + + * runtime/DateConstructor.cpp: + (JSC::constructDate): + + * runtime/DateInstance.cpp: + (JSC::DateInstance::DateInstance): + * runtime/DateInstance.h: Removed some unused functions. Changed the default + constructor to ensure that a DateInstance is always initialized. + + * runtime/DatePrototype.cpp: + (JSC::DatePrototype::DatePrototype): Pass an initializer to our constructor, + since it now requires one. + + * wtf/DateMath.cpp: + (WTF::msToGregorianDateTime): Only compute our offset from UTC if our + output will require it. Otherwise, our offset is 0. + +2009-10-27 Geoffrey Garen + + Build fix: Mark DateInstaceCache.h private, so other frameworks can see it. + + * JavaScriptCore.xcodeproj/project.pbxproj: + +2009-10-27 Geoffrey Garen + + Build fix: re-readded this file. + + * runtime/DateInstanceCache.h: Added. + (JSC::DateInstanceData::create): + (JSC::DateInstanceData::DateInstanceData): + (JSC::DateInstanceCache::DateInstanceCache): + (JSC::DateInstanceCache::add): + (JSC::DateInstanceCache::lookup): + +2009-10-27 Geoffrey Garen + + Reviewed by Darin Adler and Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=30800 + Cache recently computed date data. + + SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js. + + * GNUmakefile.am: + * JavaScriptCore.gypi: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: + * JavaScriptCore.xcodeproj/project.pbxproj: Added new file. + + * runtime/DateInstance.cpp: + (JSC::DateInstance::DateInstance): + (JSC::DateInstance::getGregorianDateTime): Use the shared cache. + + * runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion + of a "cache cache". + + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + (JSC::dateProtoFuncToString): + (JSC::dateProtoFuncToUTCString): + (JSC::dateProtoFuncToISOString): + (JSC::dateProtoFuncToDateString): + (JSC::dateProtoFuncToTimeString): + (JSC::dateProtoFuncGetFullYear): + (JSC::dateProtoFuncGetUTCFullYear): + (JSC::dateProtoFuncToGMTString): + (JSC::dateProtoFuncGetMonth): + (JSC::dateProtoFuncGetUTCMonth): + (JSC::dateProtoFuncGetDate): + (JSC::dateProtoFuncGetUTCDate): + (JSC::dateProtoFuncGetDay): + (JSC::dateProtoFuncGetUTCDay): + (JSC::dateProtoFuncGetHours): + (JSC::dateProtoFuncGetUTCHours): + (JSC::dateProtoFuncGetMinutes): + (JSC::dateProtoFuncGetUTCMinutes): + (JSC::dateProtoFuncGetSeconds): + (JSC::dateProtoFuncGetUTCSeconds): + (JSC::dateProtoFuncGetTimezoneOffset): + (JSC::setNewValueFromTimeArgs): + (JSC::setNewValueFromDateArgs): + (JSC::dateProtoFuncSetYear): + (JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they + can access the DateInstanceCache. + + * runtime/JSGlobalData.h: Keep a DateInstanceCache. + +2009-10-27 James Robinson + + Reviewed by Darin Fisher. + + Ensures that JavaScriptCore/wtf/CurrentTime.cpp is not built in PLATFORM(CHROMIUM) builds. + + Chromium uses a different method to calculate the current time than is used in + JavaScriptCore/wtf/CurrentTime.cpp. This can lead to time skew when calls to currentTime() and Chromium's time + function are mixed. In particular, timers can get scheduled in the past which leads to 100% CPU use. + See http://code.google.com/p/chromium/issues/detail?id=25892 for an example. + + https://bugs.webkit.org/show_bug.cgi?id=30833 + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + * wtf/CurrentTime.cpp: + +2009-10-27 Peter Varga + + Rubber-stamped by Tor Arne Vestbø. + + Fix typo in RegexInterpreter.cpp and RegexJIT.cpp alterantive to + alternative. + + * yarr/RegexInterpreter.cpp: + (JSC::Yarr::ByteCompiler::alternativeBodyDisjunction): + (JSC::Yarr::ByteCompiler::alternativeDisjunction): + (JSC::Yarr::ByteCompiler::emitDisjunction): + * yarr/RegexJIT.cpp: + (JSC::Yarr::RegexGenerator::generateDisjunction): + +2009-10-26 Laszlo Gombos + + Reviewed by Darin Adler. + + Make .rc files compile on Windows without depending on MFC headers + https://bugs.webkit.org/show_bug.cgi?id=30750 + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Use + winresrc.h because it exists even when MFC is not installed, and is + all that's needed here. + +2009-10-26 Gabor Loki + + Reviewed by Gavin Barraclough. + + The thunkReturnAddress is on JITStackFrame on ARM JIT as well + https://bugs.webkit.org/show_bug.cgi?id=30782 + + Move the thunkReturnAddress from top of the stack into the JITStackFrame + structure. This is a requirement for JSValue32_64 support on ARM. + + * assembler/MacroAssemblerARM.h: + (JSC::MacroAssemblerARM::ret): Return with link register + (JSC::MacroAssemblerARM::prepareCall): Store the return address in link register + * jit/JIT.h: Remove unused ctiReturnRegister + * jit/JITInlineMethods.h: Same as ARMv7 + (JSC::JIT::restoreArgumentReference): Ditto. + (JSC::JIT::restoreArgumentReferenceForTrampoline): Ditto. + * jit/JITOpcodes.cpp: Remove ctiReturnRegister related instruction + * jit/JITStubs.cpp: Store thunkReturnAddress on JITStackFrame. Use + small trampoline functions which handle return addresses for each + CTI_STUB_FUNCTION. + * jit/JITStubs.h: Store thunkReturnAddress on JITStackFrame + (JSC::JITStackFrame::returnAddressSlot): Return with the address of thunkReturnAddress + * yarr/RegexJIT.cpp: + (JSC::Yarr::RegexGenerator::generateEnter): Remove the unnecessary instruction + +2009-10-26 Steve Block + + Reviewed by Darin Adler. + + Adds ability to disable ReadWriteLock on platforms (eg Android) that use pthreads but do not support pthread_rwlock. + https://bugs.webkit.org/show_bug.cgi?id=30713 + + * wtf/Platform.h: Modified. Defines HAVE_PTHREAD_RWLOCK for all platforms currently using pthreads. + * wtf/Threading.h: Modified. Use pthread_rwlock_t only when HAVE_PTHREAD_RWLOCK is defined. + * wtf/ThreadingPthreads.cpp: Modified. Build ReadWriteLock methods only when HAVE_PTHREAD_RWLOCK is defined. + +2009-10-24 Laszlo Gombos + + Reviewed by Holger Freyther. + + [Qt] [Symbian] Set the capability and memory required to run QtWebKit for Symbian + https://bugs.webkit.org/show_bug.cgi?id=30476 + + Assign ReadUserData WriteUserData NetworkServices Symbian capabilities + to jsc.exe. + + * jsc.pro: + +2009-10-23 Steve Block + + Reviewed by Dmitry Titov. + + Fixes a leak in createThreadInternal on Android. + https://bugs.webkit.org/show_bug.cgi?id=30698 + + * wtf/ThreadingPthreads.cpp: Modified. + (WTF::createThreadInternal): Avoid leaking a ThreadData object on failure. + +2009-10-22 Geoffrey Garen + + Reviewed by Alexey Proskuryakov. + + Fixed ASSERT when opening Safari's Caches window while the Web Inspector + is open. + + * runtime/Collector.cpp: + (JSC::typeName): Added two new types to the type name list in the Collector. + These types have been around for a while, but nobody remembered to consider them here. + + * runtime/JSCell.h: + (JSC::JSCell::isPropertyNameIterator): + * runtime/JSPropertyNameIterator.h: + (JSC::JSPropertyNameIterator::isPropertyNameIterator): Give the Collector + a way to tell if a cell is a JSPropertyNameIterator. + +2009-10-22 Steve Falkenburg + + Reviewed by Jon Honeycutt. + + https://bugs.webkit.org/show_bug.cgi?id=30686 + Remove debug-specific def file. + Only Debug_All target uses JavaScriptCore_debug.dll naming, and since + that target is only used internally, maintaining two files just to + suppress a single link warning isn't worthwhile. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Removed. + +2009-10-21 Jon Honeycutt + + Screenshots of off-screen plug-ins are blank + After halting a transparent PluginView on + Windows, the transparency is applied twice + + Reviewed by Dan Bernstein. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + Export WTF::deleteOwnedPtr(HDC). + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + Ditto. + +2009-10-20 Geoffrey Garen + + Windows build fix: updated variable name. + + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + +2009-10-20 Geoffrey Garen + + Reviewed by Mark Rowe. + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_next_pname): Slightly tweaked this #ifdef to match the + size of a JSValue because m_jsStrings is an array of JSValues. + +2009-10-20 Geoffrey Garen + + Reviewed by Mark Rowe. + + Fixed a 64-bit regression caused by the fix for + https://bugs.webkit.org/show_bug.cgi?id=30570. + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_next_pname): Use TimesEight stepping on 64-bit, since + 64-bit pointers are eight bytes long. + +2009-10-20 Geoffrey Garen + + Reviewed by Sam Weinig. + + Refactored DateInstance::msToGregorianDateTime so that a DateInstance's + caller doesn't need to supply the DateInstance's own internal value to + the DateInstance. + + * runtime/DateInstance.cpp: + (JSC::DateInstance::getGregorianDateTime): Renamed from "msToGregorianDateTime". + + * runtime/DateInstance.h: + * runtime/DatePrototype.cpp: + (JSC::formatLocaleDate): + (JSC::dateProtoFuncToString): + (JSC::dateProtoFuncToUTCString): + (JSC::dateProtoFuncToISOString): + (JSC::dateProtoFuncToDateString): + (JSC::dateProtoFuncToTimeString): + (JSC::dateProtoFuncToLocaleString): + (JSC::dateProtoFuncToLocaleDateString): + (JSC::dateProtoFuncToLocaleTimeString): + (JSC::dateProtoFuncGetTime): + (JSC::dateProtoFuncGetFullYear): + (JSC::dateProtoFuncGetUTCFullYear): + (JSC::dateProtoFuncToGMTString): + (JSC::dateProtoFuncGetMonth): + (JSC::dateProtoFuncGetUTCMonth): + (JSC::dateProtoFuncGetDate): + (JSC::dateProtoFuncGetUTCDate): + (JSC::dateProtoFuncGetDay): + (JSC::dateProtoFuncGetUTCDay): + (JSC::dateProtoFuncGetHours): + (JSC::dateProtoFuncGetUTCHours): + (JSC::dateProtoFuncGetMinutes): + (JSC::dateProtoFuncGetUTCMinutes): + (JSC::dateProtoFuncGetSeconds): + (JSC::dateProtoFuncGetUTCSeconds): + (JSC::dateProtoFuncGetTimezoneOffset): + (JSC::setNewValueFromTimeArgs): + (JSC::setNewValueFromDateArgs): + (JSC::dateProtoFuncSetYear): + (JSC::dateProtoFuncGetYear): Also renamed "utc" to "outputIsUTC", for clarity. + +2009-10-20 Gabor Loki + + Reviewed by Geoffrey Garen. + + The op_next_pname should use 4 bytes addressing mode in case of JSValue32 + https://bugs.webkit.org/show_bug.cgi?id=30570 + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_next_pname): + +2009-10-20 Gabor Loki + + Reviewed by Oliver Hunt. + + Move OverridesMarkChildren flag from DatePrototype to its parent class + https://bugs.webkit.org/show_bug.cgi?id=30372 + + * runtime/DateInstance.h: + (JSC::DateInstance::createStructure): + * runtime/DatePrototype.h: + +2009-10-19 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Tightened up some put_by_id_transition code generation. + https://bugs.webkit.org/show_bug.cgi?id=30539 + + * jit/JIT.h: + * jit/JITPropertyAccess.cpp: + (JSC::JIT::testPrototype): + (JSC::JIT::privateCompilePutByIdTransition): No need to do object type + checks or read Structures and prototypes from objects: they're all known + constants at compile time. + +2009-10-19 Geoffrey Garen + + Reviewed by Sam Weinig. + + Added a private API for getting a global context from a context, for + clients who want to preserve a context for a later callback. + + * API/APICast.h: + (toGlobalRef): Added an ASSERT, since this function is used more often + than before. + + * API/JSContextRef.cpp: + * API/JSContextRefPrivate.h: Added. The new API. + + * API/tests/testapi.c: + (print_callAsFunction): + (main): Test the new API. + + * JavaScriptCore.exp: + * JavaScriptCore.xcodeproj/project.pbxproj: Build and export the new API. + +2009-10-17 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Tightened up some instanceof code generation. + https://bugs.webkit.org/show_bug.cgi?id=30488 + + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_instanceof): + (JSC::JIT::emitSlow_op_instanceof): No need to do object type checks - + cell type checks and ImplementsDefaultHasIntance checks implicitly + supersede object type checks. + +2009-10-18 Kwang Yul Seo + + Reviewed by Darin Adler. + + Use _stricmp and _strnicmp instead of deprecated stricmp and strnicmp. + https://bugs.webkit.org/show_bug.cgi?id=30474 + + stricmp and strnicmp are deprecated beginning in Visual + C++ 2005. Use _stricmp and _strnicmp instead in StringExtras.h. + + * wtf/StringExtras.h: + (strncasecmp): + (strcasecmp): + +2009-10-16 Geoffrey Garen + + Build fix: apparently we shouldn't export those symbols? + + * JavaScriptCore.exp: + +2009-10-16 Geoffrey Garen + + Build fix: export some symbols. + + * JavaScriptCore.exp: + +2009-10-16 Oliver Hunt + + Reviewed by Gavin Barraclough. + + structure typeinfo flags should be inherited. + https://bugs.webkit.org/show_bug.cgi?id=30468 + + Add StructureFlag constant to the various JSC classes and use + it for the TypeInfo construction. This allows us to simply + accumulate flags by basing each classes StructureInfo on its parents. + + * API/JSCallbackConstructor.h: + (JSC::JSCallbackConstructor::createStructure): + * API/JSCallbackFunction.h: + (JSC::JSCallbackFunction::createStructure): + * API/JSCallbackObject.h: + (JSC::JSCallbackObject::createStructure): + * debugger/DebuggerActivation.h: + (JSC::DebuggerActivation::createStructure): + * runtime/Arguments.h: + (JSC::Arguments::createStructure): + * runtime/BooleanObject.h: + (JSC::BooleanObject::createStructure): + * runtime/DatePrototype.h: + (JSC::DatePrototype::createStructure): + * runtime/FunctionPrototype.h: + (JSC::FunctionPrototype::createStructure): + * runtime/GlobalEvalFunction.h: + (JSC::GlobalEvalFunction::createStructure): + * runtime/InternalFunction.h: + (JSC::InternalFunction::createStructure): + * runtime/JSActivation.h: + (JSC::JSActivation::createStructure): + * runtime/JSArray.h: + (JSC::JSArray::createStructure): + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::createStructure): + * runtime/JSByteArray.h: + * runtime/JSFunction.h: + (JSC::JSFunction::createStructure): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::createStructure): + * runtime/JSNotAnObject.h: + (JSC::JSNotAnObject::createStructure): + * runtime/JSONObject.h: + (JSC::JSONObject::createStructure): + * runtime/JSObject.h: + (JSC::JSObject::createStructure): + * runtime/JSStaticScopeObject.h: + (JSC::JSStaticScopeObject::createStructure): + * runtime/JSVariableObject.h: + (JSC::JSVariableObject::createStructure): + * runtime/JSWrapperObject.h: + (JSC::JSWrapperObject::createStructure): + * runtime/MathObject.h: + (JSC::MathObject::createStructure): + * runtime/NumberConstructor.h: + (JSC::NumberConstructor::createStructure): + * runtime/NumberObject.h: + (JSC::NumberObject::createStructure): + * runtime/RegExpConstructor.h: + (JSC::RegExpConstructor::createStructure): + * runtime/RegExpObject.h: + (JSC::RegExpObject::createStructure): + * runtime/StringObject.h: + (JSC::StringObject::createStructure): + * runtime/StringObjectThatMasqueradesAsUndefined.h: + (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): + +2009-10-16 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Fast for-in enumeration: Cache JSPropertyNameIterator; cache JSStrings + in JSPropertyNameIterator; inline more code. + + 1.024x as fast on SunSpider (fasta: 1.43x as fast). + + * bytecode/CodeBlock.cpp: + (JSC::CodeBlock::dump): + * bytecode/Opcode.h: + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitGetPropertyNames): + (JSC::BytecodeGenerator::emitNextPropertyName): + * bytecompiler/BytecodeGenerator.h: Added a few extra operands to + op_get_pnames and op_next_pname so that we can track iteration state + in the register file instead of in the JSPropertyNameIterator. (To be + cacheable, the JSPropertyNameIterator must be stateless.) + + * interpreter/Interpreter.cpp: + (JSC::Interpreter::tryCachePutByID): + (JSC::Interpreter::tryCacheGetByID): Updated for rename to + "normalizePrototypeChain" and removal of "isCacheable". + + (JSC::Interpreter::privateExecute): Updated for in-RegisterFile + iteration state tracking. + + * jit/JIT.cpp: + (JSC::JIT::privateCompileMainPass): + * jit/JIT.h: + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_get_pnames): Updated for in-RegisterFile + iteration state tracking. + + (JSC::JIT::emit_op_next_pname): Inlined code generation for op_next_pname. + + * jit/JITStubs.cpp: + (JSC::JITThunks::tryCachePutByID): + (JSC::JITThunks::tryCacheGetByID): Updated for rename to + "normalizePrototypeChain" and removal of "isCacheable". + + (JSC::DEFINE_STUB_FUNCTION): + * jit/JITStubs.h: + (JSC::): Added has_property and to_object stubs. Removed op_next_pname + stub, since has_property is all we need anymore. + + * parser/Nodes.cpp: + (JSC::ForInNode::emitBytecode): Updated for in-RegisterFile + iteration state tracking. + + * runtime/JSCell.h: + * runtime/JSObject.cpp: + (JSC::JSObject::getPropertyNames): Don't do caching at this layer + anymore, since we don't create a JSPropertyNameIterator at this layer. + + * runtime/JSPropertyNameIterator.cpp: + (JSC::JSPropertyNameIterator::create): Do do caching at this layer. + (JSC::JSPropertyNameIterator::get): Updated for in-RegisterFile + iteration state tracking. + (JSC::JSPropertyNameIterator::markChildren): Mark our JSStrings. + + * runtime/JSPropertyNameIterator.h: + (JSC::JSPropertyNameIterator::size): + (JSC::JSPropertyNameIterator::setCachedStructure): + (JSC::JSPropertyNameIterator::cachedStructure): + (JSC::JSPropertyNameIterator::setCachedPrototypeChain): + (JSC::JSPropertyNameIterator::cachedPrototypeChain): + (JSC::JSPropertyNameIterator::JSPropertyNameIterator): + (JSC::Structure::setEnumerationCache): Don't store iteration state in + a JSPropertyNameIterator. Do cache a JSPropertyNameIterator in a + Structure. + + * runtime/JSValue.h: + (JSC::asCell): + * runtime/MarkStack.h: Make those mischievous #include gods happy. + + * runtime/ObjectConstructor.cpp: + + * runtime/Operations.h: + (JSC::normalizePrototypeChain): Renamed countPrototypeChainEntriesAndCheckForProxies + to normalizePrototypeChain, since it changes dictionary prototypes to + non-dictionary objects. + + * runtime/PropertyNameArray.cpp: + (JSC::PropertyNameArray::add): + * runtime/PropertyNameArray.h: + (JSC::PropertyNameArrayData::PropertyNameArrayData): + (JSC::PropertyNameArray::data): + (JSC::PropertyNameArray::size): + (JSC::PropertyNameArray::begin): + (JSC::PropertyNameArray::end): Simplified some code here to help with + current and future refactoring. + + * runtime/Protect.h: + * runtime/Structure.cpp: + (JSC::Structure::~Structure): + (JSC::Structure::addPropertyWithoutTransition): + (JSC::Structure::removePropertyWithoutTransition): No need to clear + the enumeration cache with adding / removing properties without + transition. It is an error to add / remove properties without transition + once an object has been observed, and we can ASSERT to catch that. + + * runtime/Structure.h: + (JSC::Structure::enumerationCache): Changed the enumeration cache to + hold a JSPropertyNameIterator. + + * runtime/StructureChain.cpp: + * runtime/StructureChain.h: + (JSC::StructureChain::head): Removed StructureChain::isCacheable because + it was wrong-headed in two ways: (1) It gave up when a prototype was a + dictionary, but instead we want un-dictionary heavily accessed + prototypes; (2) It folded a test for hasDefaultGetPropertyNames() into + a generic test for "cacheable-ness", but hasDefaultGetPropertyNames() + is only releavant to for-in caching. + +2009-10-16 Steve Falkenburg + + Reviewed by Adam Roben. + + Add a Debug_All configuration to build entire stack as debug. + Change Debug_Internal to: + - stop using _debug suffix for all WebKit/Safari binaries + - not use _debug as a DLL naming suffix + - use non-debug C runtime lib. + + * JavaScriptCore.vcproj/JavaScriptCore.make: Debug build in makefile should build Debug_All. + * JavaScriptCore.vcproj/JavaScriptCore.sln: Add Debug_All configuration. + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add Debug_All configuration. + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Renamed single configuration from "Release" to "all". + * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Add Debug_All configuration. + * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add Debug_All configuration. + * JavaScriptCore.vcproj/jsc/jsc.vcproj: Add Debug_All configuration. + * JavaScriptCore.vcproj/testapi/testapi.vcproj: Add Debug_All configuration. + +2009-10-16 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Make typeinfo flags default to false + https://bugs.webkit.org/show_bug.cgi?id=30372 + + Last part -- replace HasDefaultGetPropertyNames with OverridesGetPropertyNames + flag. + + * API/JSCallbackConstructor.h: + (JSC::JSCallbackConstructor::createStructure): + * API/JSCallbackObject.h: + (JSC::JSCallbackObject::createStructure): + * debugger/DebuggerActivation.h: + (JSC::DebuggerActivation::createStructure): + * runtime/Arguments.h: + (JSC::Arguments::createStructure): + * runtime/BooleanObject.h: + (JSC::BooleanObject::createStructure): + * runtime/DatePrototype.h: + (JSC::DatePrototype::createStructure): + * runtime/FunctionPrototype.h: + (JSC::FunctionPrototype::createStructure): + * runtime/GlobalEvalFunction.h: + (JSC::GlobalEvalFunction::createStructure): + * runtime/JSAPIValueWrapper.h: + (JSC::JSAPIValueWrapper::createStructure): + * runtime/JSActivation.h: + (JSC::JSActivation::createStructure): + * runtime/JSArray.h: + (JSC::JSArray::createStructure): + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::createStructure): + * runtime/JSFunction.h: + (JSC::JSFunction::createStructure): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::createStructure): + * runtime/JSNotAnObject.h: + (JSC::JSNotAnObject::createStructure): + * runtime/JSONObject.h: + (JSC::JSONObject::createStructure): + * runtime/JSObject.cpp: + (JSC::JSObject::getPropertyNames): + * runtime/JSObject.h: + (JSC::JSObject::createStructure): + * runtime/JSStaticScopeObject.h: + (JSC::JSStaticScopeObject::createStructure): + * runtime/JSTypeInfo.h: + (JSC::TypeInfo::overridesGetPropertyNames): + * runtime/JSVariableObject.h: + (JSC::JSVariableObject::createStructure): + * runtime/JSWrapperObject.h: + (JSC::JSWrapperObject::createStructure): + * runtime/MathObject.h: + (JSC::MathObject::createStructure): + * runtime/NumberConstructor.h: + (JSC::NumberConstructor::createStructure): + * runtime/NumberObject.h: + (JSC::NumberObject::createStructure): + * runtime/RegExpConstructor.h: + (JSC::RegExpConstructor::createStructure): + * runtime/RegExpObject.h: + (JSC::RegExpObject::createStructure): + * runtime/StringObject.h: + (JSC::StringObject::createStructure): + * runtime/StringObjectThatMasqueradesAsUndefined.h: + (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): + * runtime/StructureChain.cpp: + (JSC::StructureChain::isCacheable): + +2009-10-16 Kevin Ollivier + + wxMSW build fix, we can't use the simple hash there because the PlatformModuleVersion + structure differs. + + * wtf/Platform.h: + +2009-10-16 Laszlo Gombos + + Reviewed by Simon Hausmann. + + [Qt] Implement ExecutableAllocator for Symbian + https://bugs.webkit.org/show_bug.cgi?id=29946 + + Tested with YARR JIT enabled for Symbian; + This patch does not (yet) enable YARR JIT by default. + + * JavaScriptCore.pri: + * jit/ExecutableAllocator.h: + * jit/ExecutableAllocatorSymbian.cpp: Added. + (JSC::ExecutableAllocator::intializePageSize): + (JSC::ExecutablePool::systemAlloc): + (JSC::ExecutablePool::systemRelease): + +2009-10-15 Oliver Hunt + + Reviewed by Darin Adler. + + Make typeinfo flags default to false + https://bugs.webkit.org/show_bug.cgi?id=30372 + + Part 2 -- Reverse the TypeInfo HasDefaultMark flag to OverridesMarkChildren, etc + + * API/JSCallbackConstructor.h: + (JSC::JSCallbackConstructor::createStructure): + * API/JSCallbackFunction.h: + (JSC::JSCallbackFunction::createStructure): + * API/JSCallbackObject.h: + (JSC::JSCallbackObject::createStructure): + * debugger/DebuggerActivation.h: + (JSC::DebuggerActivation::createStructure): + * runtime/Arguments.h: + (JSC::Arguments::createStructure): + * runtime/BooleanObject.h: + (JSC::BooleanObject::createStructure): + * runtime/DatePrototype.h: + (JSC::DatePrototype::createStructure): + * runtime/FunctionPrototype.h: + (JSC::FunctionPrototype::createStructure): + * runtime/GetterSetter.h: + (JSC::GetterSetter::createStructure): + * runtime/GlobalEvalFunction.h: + (JSC::GlobalEvalFunction::createStructure): + * runtime/InternalFunction.h: + (JSC::InternalFunction::createStructure): + * runtime/JSAPIValueWrapper.h: + (JSC::JSAPIValueWrapper::createStructure): + * runtime/JSActivation.h: + (JSC::JSActivation::createStructure): + * runtime/JSArray.h: + (JSC::JSArray::createStructure): + (JSC::MarkStack::markChildren): + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::createStructure): + * runtime/JSFunction.h: + (JSC::JSFunction::createStructure): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::createStructure): + * runtime/JSNotAnObject.h: + (JSC::JSNotAnObject::createStructure): + * runtime/JSNumberCell.h: + (JSC::JSNumberCell::createStructure): + * runtime/JSONObject.h: + (JSC::JSONObject::createStructure): + * runtime/JSObject.h: + (JSC::JSObject::createStructure): + * runtime/JSPropertyNameIterator.h: + (JSC::JSPropertyNameIterator::createStructure): + * runtime/JSStaticScopeObject.h: + (JSC::JSStaticScopeObject::createStructure): + * runtime/JSString.h: + (JSC::JSString::createStructure): + * runtime/JSTypeInfo.h: + (JSC::TypeInfo::overridesMarkChildren): + * runtime/JSVariableObject.h: + (JSC::JSVariableObject::createStructure): + * runtime/JSWrapperObject.h: + (JSC::JSWrapperObject::createStructure): + * runtime/MathObject.h: + (JSC::MathObject::createStructure): + * runtime/NumberConstructor.h: + (JSC::NumberConstructor::createStructure): + * runtime/NumberObject.h: + (JSC::NumberObject::createStructure): + * runtime/RegExpConstructor.h: + (JSC::RegExpConstructor::createStructure): + * runtime/RegExpObject.h: + (JSC::RegExpObject::createStructure): + * runtime/StringObject.h: + (JSC::StringObject::createStructure): + * runtime/StringObjectThatMasqueradesAsUndefined.h: + (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): + +2009-10-14 Oliver Hunt + + Reviewed by Geoff Garen. + + Make typeinfo flags default to false + https://bugs.webkit.org/show_bug.cgi?id=30372 + + Part 1. Reverse the HasStandardGetOwnPropertySlot flag. + + * API/JSCallbackConstructor.h: + (JSC::JSCallbackConstructor::createStructure): + * API/JSCallbackFunction.h: + (JSC::JSCallbackFunction::createStructure): + * API/JSCallbackObject.h: + (JSC::JSCallbackObject::createStructure): + * debugger/DebuggerActivation.h: + (JSC::DebuggerActivation::createStructure): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * runtime/Arguments.h: + (JSC::Arguments::createStructure): + * runtime/BooleanObject.h: + (JSC::BooleanObject::createStructure): + * runtime/DatePrototype.h: + (JSC::DatePrototype::createStructure): + * runtime/FunctionPrototype.h: + (JSC::FunctionPrototype::createStructure): + * runtime/GlobalEvalFunction.h: + (JSC::GlobalEvalFunction::createStructure): + * runtime/InternalFunction.h: + (JSC::InternalFunction::createStructure): + * runtime/JSActivation.h: + (JSC::JSActivation::createStructure): + * runtime/JSArray.h: + (JSC::JSArray::createStructure): + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::createStructure): + * runtime/JSFunction.h: + (JSC::JSFunction::createStructure): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::createStructure): + * runtime/JSNumberCell.h: + (JSC::JSNumberCell::createStructure): + * runtime/JSONObject.h: + (JSC::JSONObject::createStructure): + * runtime/JSObject.h: + (JSC::JSObject::createStructure): + (JSC::JSCell::fastGetOwnPropertySlot): + * runtime/JSStaticScopeObject.h: + (JSC::JSStaticScopeObject::createStructure): + * runtime/JSString.h: + (JSC::JSString::createStructure): + * runtime/JSTypeInfo.h: + (JSC::TypeInfo::overridesGetOwnPropertySlot): + * runtime/JSVariableObject.h: + (JSC::JSVariableObject::createStructure): + * runtime/JSWrapperObject.h: + (JSC::JSWrapperObject::createStructure): + * runtime/MathObject.h: + (JSC::MathObject::createStructure): + * runtime/NumberConstructor.h: + (JSC::NumberConstructor::createStructure): + * runtime/NumberObject.h: + (JSC::NumberObject::createStructure): + * runtime/RegExpConstructor.h: + (JSC::RegExpConstructor::createStructure): + * runtime/RegExpObject.h: + (JSC::RegExpObject::createStructure): + * runtime/StringObject.h: + (JSC::StringObject::createStructure): + * runtime/StringObjectThatMasqueradesAsUndefined.h: + (JSC::StringObjectThatMasqueradesAsUndefined::createStructure): + +2009-10-14 Kevin Ollivier +2009-10-14 Darin Adler + + Additions so fix for https://bugs.webkit.org/show_bug.cgi?id=18994 + can build on Windows. + + * wtf/MathExtras.h: Added llround and llroundf for Windows. + +2009-10-14 Kevin Ollivier + + wx build fix. Set ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH for plugins while we're still building stubs. + + * wtf/Platform.h: + +2009-10-13 Laszlo Gombos + + Reviewed by Simon Hausmann. + + Refactor ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH + https://bugs.webkit.org/show_bug.cgi?id=30278 + + Move the definition of ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH + from the make system into common code. + + * wtf/Platform.h: + +2009-10-13 Laszlo Gombos + + Reviewed by Darin Adler. + + ARM compiler does not understand reinterpret_cast + https://bugs.webkit.org/show_bug.cgi?id=29034 + + Change reinterpret_cast to regular C style (void*) cast + for the ARM RVCT compiler. + + * assembler/MacroAssemblerCodeRef.h: + (JSC::FunctionPtr::FunctionPtr): + * jit/JITOpcodes.cpp: Cast to FunctionPtr first + instead of directly casting to reinterpret_cast + * jit/JITStubCall.h: Ditto + change the type of m_stub + from void* to FunctionPtr. + (JSC::JITStubCall::JITStubCall): + (JSC::JITStubCall::call): + * jit/JITStubs.cpp: Ditto. + (JSC::DEFINE_STUB_FUNCTION(EncodedJSValue, op_throw)): + +2009-10-11 Oliver Hunt + + Re-enable the JIT. + + * wtf/Platform.h: + +2009-10-10 Oliver Hunt + + Reviewed by Maciej Stachowiak. + + Support for String.trim(), String.trimLeft() and String.trimRight() methods + https://bugs.webkit.org/show_bug.cgi?id=26590 + + Implement trim, trimLeft, and trimRight + + * runtime/StringPrototype.cpp: + (JSC::isTrimWhitespace): + Our normal string whitespace function does not include U+200B which + is needed for compatibility with mozilla's implementation of trim. + U+200B does not appear to be expected according to spec, however I am + choosing to be lax, and match mozilla behavior so have added this + exception. + (JSC::trimString): + +2009-10-09 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Eliminated some legacy bytecode weirdness. + + Use vPC[x] subscripting instead of ++vPC to access instruction operands. + This is simpler, and often more efficient. + + To support this, and to remove use of hard-coded offsets in bytecode and + JIT code generation and dumping, calculate jump offsets from the beginning + of an instruction, rather than the middle or end. + + Also, use OPCODE_LENGTH instead of hard-coded constants for the sizes of + opcodes. + + SunSpider reports no change in JIT mode, and a 1.01x speedup in Interpreter + mode. + + * bytecode/CodeBlock.cpp: + (JSC::printConditionalJump): + (JSC::CodeBlock::dump): + * bytecompiler/BytecodeGenerator.cpp: + (JSC::BytecodeGenerator::emitJump): + (JSC::BytecodeGenerator::emitJumpIfTrue): + (JSC::BytecodeGenerator::emitJumpIfFalse): + (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall): + (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply): + (JSC::BytecodeGenerator::emitComplexJumpScopes): + (JSC::BytecodeGenerator::emitJumpScopes): + (JSC::BytecodeGenerator::emitNextPropertyName): + (JSC::BytecodeGenerator::emitCatch): + (JSC::BytecodeGenerator::emitJumpSubroutine): + (JSC::prepareJumpTableForImmediateSwitch): + (JSC::prepareJumpTableForCharacterSwitch): + (JSC::prepareJumpTableForStringSwitch): + (JSC::BytecodeGenerator::endSwitch): + * bytecompiler/Label.h: + (JSC::Label::setLocation): + (JSC::Label::bind): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::resolve): + (JSC::Interpreter::resolveSkip): + (JSC::Interpreter::resolveGlobal): + (JSC::Interpreter::resolveBase): + (JSC::Interpreter::resolveBaseAndProperty): + (JSC::Interpreter::createExceptionScope): + (JSC::Interpreter::privateExecute): + * interpreter/Interpreter.h: + * jit/JIT.cpp: + (JSC::JIT::privateCompile): + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_jnless): + (JSC::JIT::emitSlow_op_jnless): + (JSC::JIT::emit_op_jnlesseq): + (JSC::JIT::emitSlow_op_jnlesseq): + (JSC::JIT::emitBinaryDoubleOp): + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_jmp): + (JSC::JIT::emit_op_loop): + (JSC::JIT::emit_op_loop_if_less): + (JSC::JIT::emitSlow_op_loop_if_less): + (JSC::JIT::emit_op_loop_if_lesseq): + (JSC::JIT::emitSlow_op_loop_if_lesseq): + (JSC::JIT::emit_op_loop_if_true): + (JSC::JIT::emitSlow_op_loop_if_true): + (JSC::JIT::emit_op_jfalse): + (JSC::JIT::emitSlow_op_jfalse): + (JSC::JIT::emit_op_jtrue): + (JSC::JIT::emitSlow_op_jtrue): + (JSC::JIT::emit_op_jeq_null): + (JSC::JIT::emit_op_jneq_null): + (JSC::JIT::emit_op_jneq_ptr): + (JSC::JIT::emit_op_jsr): + (JSC::JIT::emit_op_next_pname): + (JSC::JIT::emit_op_jmp_scopes): + +2009-10-09 Geoffrey Garen + + Reviewed by Sam Weinig. + + Migrated some code that didn't belong out of Structure. + + SunSpider says maybe 1.03x faster. + + * runtime/JSCell.h: Nixed Structure::markAggregate, and made marking of + a Structure's prototype the direct responsility of the object using it. + (Giving Structure a mark function was misleading because it implied that + all live structures get marked during GC, when they don't.) + + * runtime/JSGlobalObject.cpp: + (JSC::markIfNeeded): + (JSC::JSGlobalObject::markChildren): Added code to mark prototypes stored + on the global object. Maybe this wasn't necessary, but now we don't have + to wonder. + + * runtime/JSObject.cpp: + (JSC::JSObject::getPropertyNames): + (JSC::JSObject::getOwnPropertyNames): + (JSC::JSObject::getEnumerableNamesFromClassInfoTable): + * runtime/JSObject.h: + (JSC::JSObject::markChildrenDirect): + * runtime/PropertyNameArray.h: + * runtime/Structure.cpp: + * runtime/Structure.h: + (JSC::Structure::setEnumerationCache): + (JSC::Structure::enumerationCache): Moved property name gathering code + from Structure to JSObject because having a Structure iterate its JSObject + was a layering violation. A JSObject is implemented using a Structure; not + the other way around. + +2009-10-09 Mark Rowe + + Attempt to fix the GTK release build. + + * GNUmakefile.am: Include Grammar.cpp in release builds now that + AllInOneFile.cpp is gone. + +2009-10-09 Gabor Loki + + Rubber-stamped by Eric Seidel. + + Add ARM JIT support for Gtk port (disabled by default) + https://bugs.webkit.org/show_bug.cgi?id=30228 + + * GNUmakefile.am: + +2009-10-08 Geoffrey Garen + + Tiger build fix: added a few more variable initializations. + + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncReplace): + (JSC::stringProtoFuncSearch): + +2009-10-08 Geoffrey Garen + + Qt build fix: added missing #include. + + * jsc.cpp: + +2009-10-08 Geoffrey Garen + + Tiger build fix: initialize variable whose initialization the compiler + can't otherwise figure out. + + * runtime/RegExpObject.cpp: + (JSC::RegExpObject::match): + +2009-10-08 Geoffrey Garen + + Windows build fix: updated exports. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-10-08 Geoffrey Garen + + Tiger build fix: fixed file name case. + + * JavaScriptCore.xcodeproj/project.pbxproj: + +2009-10-08 Geoffrey Garen + + Reviewed by Maciej Stachowiak. + + At long last, I pronounce the death of AllInOneFile.cpp. + + SunSpider reports a 1.01x speedup. + + * AllInOneFile.cpp: Removed. + * GNUmakefile.am: + * JavaScriptCore.exp: + * JavaScriptCore.gypi: + * JavaScriptCore.xcodeproj/project.pbxproj: Added missing project files + to compilation stages. + + * parser/Grammar.y: + * parser/Lexer.cpp: + * parser/Lexer.h: + (JSC::jscyylex): + * runtime/ArrayConstructor.cpp: + (JSC::constructArrayWithSizeQuirk): + * runtime/Collector.h: + * runtime/JSCell.cpp: + (JSC::JSCell::operator new): + * runtime/JSCell.h: + (JSC::JSCell::operator new): + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::operator new): + * runtime/JSNumberCell.h: + (JSC::JSNumberCell::operator new): + * runtime/JSString.cpp: + * runtime/JSString.h: + (JSC::jsString): + (JSC::jsSubstring): + (JSC::jsOwnedString): + * runtime/RegExpConstructor.cpp: + * runtime/RegExpConstructor.h: + (JSC::RegExpConstructorPrivate::RegExpConstructorPrivate): + (JSC::RegExpConstructorPrivate::lastOvector): + (JSC::RegExpConstructorPrivate::tempOvector): + (JSC::RegExpConstructorPrivate::changeLastOvector): + (JSC::RegExpConstructor::performMatch): + * runtime/StringPrototype.cpp: + (JSC::stringProtoFuncMatch): + * yarr/RegexJIT.cpp: + * yarr/RegexJIT.h: + (JSC::Yarr::executeRegex): Inlined a few things that Shark said + were hot, on the presumption that AllInOneFile.cpp used to inline them + automatically. + +2009-10-08 Zoltan Herczeg + + Reviewed by Gavin Barraclough. + + Fix for JIT'ed op_call instructions (evals, constructs, etc.) + when !ENABLE(JIT_OPTIMIZE_CALL) && USE(JSVALUE32_64) + + https://bugs.webkit.org/show_bug.cgi?id=30201 + + * jit/JITCall.cpp: + (JSC::JIT::compileOpCall): + +2009-10-07 Geoffrey Garen + + Windows build fix: removed no longer exported symbol. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-10-07 Geoffrey Garen + + Reviewed by Oliver Hunt. + + Fixed Database code takes JSLock on secondary + thread, permanently slowing down JavaScript + + Removed the optional lock from Heap::protect, Heap::unprotect, and friends, + since WebCore no longer uses it. + + * JavaScriptCore.exp: + * runtime/Collector.cpp: + (JSC::Heap::protect): + (JSC::Heap::unprotect): + (JSC::Heap::markProtectedObjects): + (JSC::Heap::protectedGlobalObjectCount): + (JSC::Heap::protectedObjectCount): + (JSC::Heap::protectedObjectTypeCounts): + * runtime/Collector.h: + +2009-10-07 Zoltan Horvath + + Reviewed by Darin Adler. + + Allow custom memory allocation control for JavaScriptCore's IdentifierArena + https://bugs.webkit.org/show_bug.cgi?id=30158 + + Inherits IdentifierArena class from FastAllocBase because it has been + instantiated by 'new' in JavaScriptCore/parser/ParserArena.cpp:36. + + * parser/ParserArena.h: + +2009-10-07 Adam Roben + + Export DateInstance::info in a way that works on Windows + + Fixes + fast/dom/Window/window-postmessage-clone.html fails on Windows + + Reviewed by Anders Carlsson. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + Removed the export of DateInstance::info from here. + + * runtime/DateInstance.h: Use JS_EXPORTDATA to export + DateInstance::info, which is the required way of exporting data on + Windows. + +2009-10-07 Jørgen Lind + + Reviewed by Simon Hausmann. + + When enabling or disabling the JIT through .qmake.cache, make sure + to also toggle ENABLE_YARR_JIT. + + * JavaScriptCore.pri: + +2009-10-06 Priit Laes + + Reviewed by Gavin Barraclough. + + Linking fails with "relocation R_X86_64_PC32 against symbol + `cti_vm_throw'" + https://bugs.webkit.org/show_bug.cgi?id=28422 + + * jit/JITStubs.cpp: + Mark cti_vm_throw symbol as PLT-indirect symbol, so it doesn't end up + in text segment causing relocation errors on amd64 architecture. + Introduced new define SYMBOL_STRING_RELOCATION for such symbols. + +2009-10-06 Oliver Hunt + + Windows linking fix + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-10-06 Oliver Hunt + + Reviewed by NOBODY (build fix). + + Windows build fix. + + * runtime/DateInstance.cpp: + +2009-10-05 Oliver Hunt + + Reviewed by Gavin Barraclough. + + It should be possible to post (clone) built-in JS objects to Workers + https://bugs.webkit.org/show_bug.cgi?id=22878 + + Expose helpers to throw correct exceptions during object graph walk + used for cloning and add a helper function to create Date instances + without going through the JS Date constructor function. + + * JavaScriptCore.exp: + * JavaScriptCore.xcodeproj/project.pbxproj: + * runtime/DateInstance.cpp: + (JSC::DateInstance::DateInstance): + * runtime/DateInstance.h: + * runtime/ExceptionHelpers.cpp: + (JSC::createTypeError): + * runtime/ExceptionHelpers.h: + +2009-10-06 David Levin + + Reviewed by Oliver Hunt. + + StringImpl needs a method to get an instance for another thread which doesn't copy the underlying buffer. + https://bugs.webkit.org/show_bug.cgi?id=30095 + + * wtf/CrossThreadRefCounted.h: + Removed an unused function and assert improvement. + (WTF::CrossThreadRefCounted::isOwnedByCurrentThread): Moved out common code from asserts. + (WTF::CrossThreadRefCounted::ref): Changed assert to use the common method. + (WTF::CrossThreadRefCounted::deref): Changed assert to use the common method. + (WTF::CrossThreadRefCounted::crossThreadCopy): Since this includes a potentially + non-threadsafe operation, add an assert that the class is owned by the current thread. + +2009-10-05 Kevin Ollivier + + wx build fix. Add Symbian files to the list of excludes. + + * wscript: + +2009-10-05 Jocelyn Turcotte + + Reviewed by Simon Hausmann. + + [Qt] Remove precompiled header from JavaScriptCore compilation to + prevent qmake warning during autonomous compilation. + https://bugs.webkit.org/show_bug.cgi?id=30069 + + * JavaScriptCore.pro: + 2009-10-02 Geoffrey Garen Reviewed by Sam Weinig. @@ -88,6 +7495,62 @@ (JSC::JSValue::operator bool): Test for the empty value tag, instead of testing for the cell tag with a 0 payload. +2009-10-02 Steve Falkenburg + + Reviewed by Mark Rowe. + + + Safari version number shouldn't be exposed in WebKit code + + For a WebKit version of 532.3.4: + Product version is: 5.32.3.4 (was 4.0.3.0) + File version is: 5.32.3.4 (was 4.532.3.4) + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: + +2009-10-02 Tor Arne Vestbø + + Rubber-stamped by Simon Hausmann. + + Fix the Qt on Mac OS X build. + + * wtf/FastMalloc.cpp: + +2009-10-02 Jørgen Lind + + Reviewed by Simon Hausmann. + + Allow enabling and disabling of the JIT through a qmake variable. + + Qt's configure may set this variable through .qmake.cache if a + commandline option is given and/or the compile test for hwcap.h + failed/succeeded. + + * JavaScriptCore.pri: + +2009-10-01 Mark Rowe + + Fix the Tiger build. Don't unconditionally enable 3D canvas as it is not supported on Tiger. + + * Configurations/FeatureDefines.xcconfig: + +2009-10-01 Yongjun Zhang + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=29187 + + Don't inline ~ListRefPtr() to work around winscw compiler forward declaration + bug regarding templated classes. + + The compiler bug is reported at: + https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812 + + The change will be reverted when the above bug is fixed in winscw compiler. + + * wtf/ListRefPtr.h: + (WTF::::~ListRefPtr): + 2009-10-01 Zoltan Horvath Reviewed by Simon Hausmann. @@ -109,6 +7572,25 @@ (WTF::sleep): * wtf/FastMalloc.h: +2009-09-30 Gabor Loki + + Reviewed by George Staikos. + + Defines two pseudo-platforms for ARM and Thumb-2 instruction set. + https://bugs.webkit.org/show_bug.cgi?id=29122 + + Introduces WTF_PLATFORM_ARM_TRADITIONAL and WTF_PLATFORM_ARM_THUMB2 + macros on ARM platforms. The PLATFORM(ARM_THUMB2) should be used + when Thumb-2 instruction set is the required target. The + PLATFORM(ARM_TRADITIONAL) is for generic ARM instruction set. In + case where the code is common the PLATFORM(ARM) have to be used. + + Modified by George Wright to correctly work + with the RVCT-defined __TARGET_ARCH_ARM and __TARGET_ARCH_THUMB + compiler macros, as well as adding readability changes. + + * wtf/Platform.h: + 2009-09-30 Oliver Hunt Reviewed by Geoff Garen. @@ -143,12 +7625,106 @@ Reviewed by Simon Hausmann. + Reduce heap size on Symbian from 64MB to 8MB. + + This is not a perfect fix, it requires more fine tuning. + But this makes it possible again to debug in the emulator, + which is more important in order to be able to fix other + run-time issues. + + * runtime/Collector.h: + +2009-09-30 Janne Koskinen + + Reviewed by Simon Hausmann. + Fix CRASH() macro for Symbian build. * wtf/Assertions.h: Added missing } 2009-09-29 Geoffrey Garen + Reviewed by Gavin Barraclough. + + Inlined a few math operations. + + ~1% SunSpider speedup. + + * jit/JIT.h: + * jit/JITArithmetic.cpp: + (JSC::JIT::compileBinaryArithOpSlowCase): + (JSC::JIT::emitSlow_op_add): + (JSC::JIT::emitSlow_op_mul): + (JSC::JIT::emit_op_sub): + (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on + a constant int and a double. + +2009-09-28 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Tidy up codeblock sampler + https://bugs.webkit.org/show_bug.cgi?id=29836 + + Some rather simple refactoring of codeblock sampler so that + it's easier for us to use it to find problems in non-jsc + environments + + * JavaScriptCore.exp: + * bytecode/SamplingTool.h: + * debugger/Debugger.cpp: + (JSC::evaluateInGlobalCallFrame): + * debugger/DebuggerCallFrame.cpp: + (JSC::DebuggerCallFrame::evaluate): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::Interpreter): + (JSC::Interpreter::execute): + (JSC::Interpreter::privateExecute): + (JSC::Interpreter::enableSampler): + (JSC::Interpreter::dumpSampleData): + (JSC::Interpreter::startSampling): + (JSC::Interpreter::stopSampling): + * interpreter/Interpreter.h: + (JSC::Interpreter::sampler): + * jit/JIT.h: + * jsc.cpp: + (runWithScripts): + * runtime/Completion.cpp: + (JSC::checkSyntax): + (JSC::evaluate): + * runtime/Executable.h: + (JSC::EvalExecutable::EvalExecutable): + (JSC::ProgramExecutable::create): + (JSC::ProgramExecutable::ProgramExecutable): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::startSampling): + (JSC::JSGlobalData::stopSampling): + (JSC::JSGlobalData::dumpSampleData): + * runtime/JSGlobalData.h: + * runtime/JSGlobalObjectFunctions.cpp: + (JSC::globalFuncEval): + +2009-09-29 Jeremy Orlow + + Reviewed by Dimitri Glazkov. + + Add GYP generated files to svn:ignore + https://bugs.webkit.org/show_bug.cgi?id=29895 + + The following files are generated by JavaScriptCore's GYP file and should be ignored: + + pcre.mk + wtf.scons + wtf.mk + SConstruct + wtf_config.scons + wtf_config.mk + pcre.scons + + * JavaScriptCore.gyp: Changed property svn:ignore. + +2009-09-29 Geoffrey Garen + Reviewed by Sam Weinig. Standardized an optimization for adding non-numbers. @@ -159,6 +7735,32 @@ (JSC::JIT::emit_op_add): (JSC::JIT::emitSlow_op_add): +2009-09-29 Geoffrey Garen + + Windows build fix: export a new symbol. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-28 Geoffrey Garen + + Reviewed by Sam Weinig. + + Removed virtual destructor from JSGlobalObjectData to eliminate pointer + fix-ups when accessing JSGlobalObject::d. + + Replaced with an explicit destructor function pointer. + + 6% speedup on bench-alloc-nonretained.js. + + * JavaScriptCore.exp: + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::~JSGlobalObject): + (JSC::JSGlobalObject::destroyJSGlobalObjectData): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): + (JSC::JSGlobalObject::JSGlobalObject): + 2009-09-29 Janne Koskinen Reviewed by David Kilzer. @@ -187,6 +7789,12 @@ 2009-09-28 Mark Rowe + Fix the PowerPC build. + + * JavaScriptCore.exp: + +2009-09-28 Mark Rowe + Reviewed by Gavin Barraclough. JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC. @@ -195,22 +7803,175 @@ (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer to ensure that we correctly interpret the contents of registers during marking. -2009-09-29 Geoffrey Garen +2009-09-28 Geoffrey Garen - Reviewed by Gavin Barraclough. + Windows build fix: added new exports. - Inlined a few math operations. - - ~1% SunSpider speedup. + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: - * jit/JIT.h: - * jit/JITArithmetic.cpp: - (JSC::JIT::compileBinaryArithOpSlowCase): - (JSC::JIT::emitSlow_op_add): - (JSC::JIT::emitSlow_op_mul): - (JSC::JIT::emit_op_sub): - (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on - a constant int and a double. +2009-09-28 Geoffrey Garen + + Windows build fix: removed exports that no longer exist. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-28 Geoffrey Garen + + Reviewed by Darin Adler. + + NotNullPassRefPtr: smart pointer optimized for passing references that are not null + https://bugs.webkit.org/show_bug.cgi?id=29822 + + Added NotNullPassRefPtr, and deployed it in all places that initialize + JavaScript objects. + + 2.2% speedup on bench-allocate-nonretained.js. + + * API/JSCallbackConstructor.cpp: + (JSC::JSCallbackConstructor::JSCallbackConstructor): + * API/JSCallbackConstructor.h: + * API/JSCallbackObject.h: + * API/JSCallbackObjectFunctions.h: + (JSC::JSCallbackObject::JSCallbackObject): + * JavaScriptCore.exp: + * bytecode/CodeBlock.h: + (JSC::CodeBlock::addFunctionDecl): + (JSC::CodeBlock::addFunctionExpr): + * runtime/ArrayConstructor.cpp: + (JSC::ArrayConstructor::ArrayConstructor): + * runtime/ArrayConstructor.h: + * runtime/ArrayPrototype.cpp: + (JSC::ArrayPrototype::ArrayPrototype): + * runtime/ArrayPrototype.h: + * runtime/BooleanConstructor.cpp: + (JSC::BooleanConstructor::BooleanConstructor): + * runtime/BooleanConstructor.h: + * runtime/BooleanObject.cpp: + (JSC::BooleanObject::BooleanObject): + * runtime/BooleanObject.h: + * runtime/BooleanPrototype.cpp: + (JSC::BooleanPrototype::BooleanPrototype): + * runtime/BooleanPrototype.h: + * runtime/DateConstructor.cpp: + (JSC::DateConstructor::DateConstructor): + * runtime/DateConstructor.h: + * runtime/DateInstance.cpp: + (JSC::DateInstance::DateInstance): + * runtime/DateInstance.h: + * runtime/DatePrototype.cpp: + (JSC::DatePrototype::DatePrototype): + * runtime/DatePrototype.h: + * runtime/ErrorConstructor.cpp: + (JSC::ErrorConstructor::ErrorConstructor): + * runtime/ErrorConstructor.h: + * runtime/ErrorInstance.cpp: + (JSC::ErrorInstance::ErrorInstance): + * runtime/ErrorInstance.h: + * runtime/ErrorPrototype.cpp: + (JSC::ErrorPrototype::ErrorPrototype): + * runtime/ErrorPrototype.h: + * runtime/FunctionConstructor.cpp: + (JSC::FunctionConstructor::FunctionConstructor): + * runtime/FunctionConstructor.h: + * runtime/FunctionPrototype.cpp: + (JSC::FunctionPrototype::FunctionPrototype): + * runtime/FunctionPrototype.h: + * runtime/GlobalEvalFunction.cpp: + (JSC::GlobalEvalFunction::GlobalEvalFunction): + * runtime/GlobalEvalFunction.h: + * runtime/InternalFunction.cpp: + (JSC::InternalFunction::InternalFunction): + * runtime/InternalFunction.h: + (JSC::InternalFunction::InternalFunction): + * runtime/JSActivation.cpp: + (JSC::JSActivation::JSActivation): + * runtime/JSActivation.h: + (JSC::JSActivation::JSActivationData::JSActivationData): + * runtime/JSArray.cpp: + (JSC::JSArray::JSArray): + * runtime/JSArray.h: + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::JSByteArray): + * runtime/JSByteArray.h: + * runtime/JSFunction.cpp: + (JSC::JSFunction::JSFunction): + * runtime/JSFunction.h: + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObject): + * runtime/JSONObject.h: + (JSC::JSONObject::JSONObject): + * runtime/JSObject.h: + (JSC::JSObject::JSObject): + (JSC::JSObject::setStructure): + * runtime/JSVariableObject.h: + (JSC::JSVariableObject::JSVariableObject): + * runtime/JSWrapperObject.h: + (JSC::JSWrapperObject::JSWrapperObject): + * runtime/MathObject.cpp: + (JSC::MathObject::MathObject): + * runtime/MathObject.h: + * runtime/NativeErrorConstructor.cpp: + (JSC::NativeErrorConstructor::NativeErrorConstructor): + * runtime/NativeErrorConstructor.h: + * runtime/NativeErrorPrototype.cpp: + (JSC::NativeErrorPrototype::NativeErrorPrototype): + * runtime/NativeErrorPrototype.h: + * runtime/NumberConstructor.cpp: + (JSC::NumberConstructor::NumberConstructor): + * runtime/NumberConstructor.h: + * runtime/NumberObject.cpp: + (JSC::NumberObject::NumberObject): + * runtime/NumberObject.h: + * runtime/NumberPrototype.cpp: + (JSC::NumberPrototype::NumberPrototype): + * runtime/NumberPrototype.h: + * runtime/ObjectConstructor.cpp: + (JSC::ObjectConstructor::ObjectConstructor): + * runtime/ObjectConstructor.h: + * runtime/ObjectPrototype.cpp: + (JSC::ObjectPrototype::ObjectPrototype): + * runtime/ObjectPrototype.h: + * runtime/PropertyNameArray.h: + (JSC::PropertyNameArrayData::setCachedPrototypeChain): + * runtime/PrototypeFunction.cpp: + (JSC::PrototypeFunction::PrototypeFunction): + * runtime/PrototypeFunction.h: + * runtime/RegExpConstructor.cpp: + (JSC::RegExpConstructor::RegExpConstructor): + * runtime/RegExpConstructor.h: + * runtime/RegExpObject.cpp: + (JSC::RegExpObject::RegExpObject): + * runtime/RegExpObject.h: + (JSC::RegExpObject::RegExpObjectData::RegExpObjectData): + * runtime/RegExpPrototype.cpp: + (JSC::RegExpPrototype::RegExpPrototype): + * runtime/RegExpPrototype.h: + * runtime/StringConstructor.cpp: + (JSC::StringConstructor::StringConstructor): + * runtime/StringConstructor.h: + * runtime/StringObject.cpp: + (JSC::StringObject::StringObject): + * runtime/StringObject.h: + * runtime/StringObjectThatMasqueradesAsUndefined.h: + (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): + * runtime/StringPrototype.cpp: + (JSC::StringPrototype::StringPrototype): + * runtime/StringPrototype.h: + * wtf/PassRefPtr.h: + (WTF::NotNullPassRefPtr::NotNullPassRefPtr): + (WTF::NotNullPassRefPtr::~NotNullPassRefPtr): + (WTF::NotNullPassRefPtr::get): + (WTF::NotNullPassRefPtr::clear): + (WTF::NotNullPassRefPtr::releaseRef): + (WTF::NotNullPassRefPtr::operator*): + (WTF::NotNullPassRefPtr::operator->): + (WTF::NotNullPassRefPtr::operator!): + (WTF::NotNullPassRefPtr::operator UnspecifiedBoolType): + * wtf/RefPtr.h: + (WTF::RefPtr::RefPtr): + (WTF::operator==): 2009-09-28 Oliver Hunt @@ -249,28 +8010,6 @@ * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define. -2009-09-28 Yongjun Zhang - - Reviewed by Eric Seidel. - - https://bugs.webkit.org/show_bug.cgi?id=28054 - - Use derefInNotNull() to work around winscw compiler forward declaration bug - regarding templated classes. - - The compiler bug is reported at - https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812. - - The change should be reverted when the above bug is fixed in winscw compiler. - - Add parenthesis around (RefPtr::*UnspecifiedBoolType) to make winscw compiler - work with the default UnSpecifiedBoolType() operator, which removes the winscw hack. - - * wtf/RefPtr.h: - (WTF::RefPtr::~RefPtr): - (WTF::RefPtr::clear): - (WTF::RefPtr::operator UnspecifiedBoolType): - 2009-09-28 Gabor Loki Reviewed by Simon Hausmann. @@ -351,6 +8090,81 @@ * yarr/RegexJIT.cpp: (JSC::Yarr::RegexGenerator::generatePatternCharacterPair): +2009-09-25 Jeremy Orlow + + This is breaking Chromium try bots, so I'm counting this as a build fix. + + Add more svn:ignore exceptions. On different platforms, these files are + generated with different case for JavaScriptCore. Also there are some + wtf project files that get built apparently. + + * JavaScriptCore.gyp: Changed property svn:ignore. + +2009-09-25 Ada Chan + + Build fix. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-25 Geoffrey Garen + + Reviewed by Darin Adler. + + Inlined some object creation code, including lexicalGlobalObject access + https://bugs.webkit.org/show_bug.cgi?id=29750 + + SunSpider says 0.5% faster. + + 0.8% speedup on bench-alloc-nonretained.js. + 2.5% speedup on v8-splay.js. + + * interpreter/CachedCall.h: + (JSC::CachedCall::CachedCall): + * interpreter/CallFrame.h: + (JSC::ExecState::lexicalGlobalObject): + (JSC::ExecState::globalThisValue): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::dumpRegisters): + (JSC::Interpreter::execute): + (JSC::Interpreter::privateExecute): + * jit/JITStubs.cpp: + (JSC::DEFINE_STUB_FUNCTION): + * runtime/FunctionConstructor.cpp: + (JSC::constructFunction): + * runtime/ScopeChain.cpp: + (JSC::ScopeChainNode::print): + * runtime/ScopeChain.h: + (JSC::ScopeChainNode::ScopeChainNode): + (JSC::ScopeChainNode::~ScopeChainNode): + (JSC::ScopeChainNode::push): + (JSC::ScopeChain::ScopeChain): + (JSC::ScopeChain::globalObject): Added a globalObject data member to ScopeChainNode. + Replaced accessor function for globalObject() with data member. Replaced + globalThisObject() accessor with direct access to globalThis, to match. + + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::init): + * runtime/JSGlobalObject.h: Inlined array and object construction. + +2009-09-25 Laszlo Gombos + + Reviewed by Gavin Barraclough. + + Add ARM version detection rules for Symbian + https://bugs.webkit.org/show_bug.cgi?id=29715 + + * wtf/Platform.h: + +2009-09-24 Xan Lopez + + Reviewed by Mark "Do It!" Rowe. + + Some GCC versions don't like C++-style comments in preprocessor + directives, change to C-style to shut them up. + + * wtf/Platform.h: + 2009-09-24 Oliver Hunt Reviewed by Gavin Barraclough. @@ -375,6 +8189,33 @@ (JSC::JIT::emitLoadInt32ToDouble): (JSC::JIT::emitJumpSlowCaseIfNotImmediateNumber): +2009-09-24 Jeremy Orlow + + Reviewed by Dimitri Glazkov. + + Add GYP generated files to svn:ignore + https://bugs.webkit.org/show_bug.cgi?id=29724 + + Adding the following files to the svn:ignore list (all in the + JavaScriptCore/JavaScriptCore.gyp directory) + + JavaScriptCore.xcodeproj + JavaScriptCore.sln + JavaScriptCore.vcproj + JavaScriptCore_Debug.rules + JavaScriptCore_Release.rules + JavaScriptCore_Release - no tcmalloc.rules + JavaScriptCore_Purify.rules + JavaScriptCore.mk + JavaScriptCore_Debug_rules.mk + JavaScriptCore_Release_rules.mk + JavaScriptCore_Release - no tcmalloc_rules.mk + JavaScriptCore_Purify_rules.mk + JavaScriptCore.scons + JavaScriptCore_main.scons + + * JavaScriptCore.gyp: Changed property svn:ignore. + 2009-09-24 Yong Li Reviewed by Adam Barth. @@ -391,17 +8232,6 @@ 2009-09-24 Mark Rowe - Reviewed by Gavin Barraclough. - - Fix FastMalloc to build with assertions enabled. - - * wtf/FastMalloc.cpp: - (WTF::TCMalloc_Central_FreeList::ReleaseToSpans): - * wtf/TCSpinLock.h: - (TCMalloc_SpinLock::IsHeld): - -2009-09-24 Mark Rowe - Reviewed by Sam Weinig. FastMalloc scavenging thread should be named @@ -414,12 +8244,87 @@ 2009-09-24 Geoffrey Garen + Reviewed by Sam Weinig. + + Renamed clear to removeAll, as suggested by Darin Adler. + + * wtf/HashCountedSet.h: + (WTF::::removeAll): + +2009-09-24 Mark Rowe + + Reviewed by Gavin Barraclough. + + Fix FastMalloc to build with assertions enabled. + + * wtf/FastMalloc.cpp: + (WTF::TCMalloc_Central_FreeList::ReleaseToSpans): + * wtf/TCSpinLock.h: + (TCMalloc_SpinLock::IsHeld): + +2009-09-24 Geoffrey Garen + Suggested by Darin Adler. Removed some unnecessary parameter names. * wtf/HashCountedSet.h: +2009-09-24 Janne Koskinen + + Reviewed by Simon Hausmann. + + On Windows JSChar is typedef'ed to wchar_t. + + When building with WINSCW for Symbian we need to do the + same typedef. + + * API/JSStringRef.h: + +2009-09-23 Geoffrey Garen + + A piece of my last patch that I forgot. + + * wtf/HashCountedSet.h: + (WTF::::clear): Added HashCountedSet::clear. + +2009-09-24 Gabor Loki + + Reviewed by Gavin Barraclough. + + Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set + https://bugs.webkit.org/show_bug.cgi?id=28886 + + There are some GCC packages (for example GCC-2006q3 from CodeSourcery) + which contain __clear_cache built-in function only for C while the C++ + version of __clear_cache is missing on ARM architectures. + + Fixed a small bug in the inline assembly of cacheFlush function on + ARM_TRADITIONAL. + + * jit/ExecutableAllocator.h: + (JSC::ExecutableAllocator::cacheFlush): + +2009-09-23 Geoffrey Garen + + Reviewed by Sam Weinig. + + Added the ability to swap vectors with inline capacities, so you can + store a vector with inline capacity in a hash table. + + * wtf/Vector.h: + (WTF::swap): + (WTF::VectorBuffer::swap): + +2009-09-23 David Kilzer + + Move definition of USE(PLUGIN_HOST_PROCESS) from WebKitPrefix.h to Platform.h + + Reviewed by Mark Rowe. + + * wtf/Platform.h: Define WTF_USE_PLUGIN_HOST_PROCESS to 1 when + building on 64-bit SnowLeopard. Define to 0 elsewhere. + 2009-09-22 Oliver Hunt Reviewed by Geoff Garen. @@ -474,71 +8379,84 @@ * wtf/Forward.h: Added PassOwnPtr. -2009-09-22 Simon Hausmann +2009-09-22 Yaar Schnitman - Unreviewed build fix for Windows CE < 5 + Reviewed by David Levin. - Define WINCEBASIC to disable the IsDebuggerPresent() code in - wtf/Assertions.cpp. + Ported chromium.org's javascriptcore.gyp for the webkit chromium port. - * JavaScriptCore.pri: + https://bugs.webkit.org/show_bug.cgi?id=29617 -2009-10-02 Tor Arne Vestbø + * JavaScriptCore.gyp/JavaScriptCore.gyp: Added. - Rubber-stamped by Simon Hausmann. +2009-09-22 Thiago Macieira - Fix the Qt on Mac OS X build. + Reviewed by Simon Hausmann. - * wtf/FastMalloc.cpp: + Fix compilation with WINSCW: no varargs macros -2009-10-02 Jørgen Lind + Disable variadic arguments for WINSCW just like we do + for MSVC7. + + * wtf/Assertions.h: + +2009-09-22 Kent Hansen Reviewed by Simon Hausmann. - Allow enabling and disabling of the JIT through a qmake variable. + Disable variadic macros on MSVC7. - Qt's configure may set this variable through .qmake.cache if a - commandline option is given and/or the compile test for hwcap.h - failed/succeeded. + This was originally added in r26589 but not extended + when LOG_DISABLED/ASSERT_DISABLED was introduced. + + * wtf/Assertions.h: + +2009-09-22 Simon Hausmann + + Unreviewed build fix for Windows CE < 5 + + Define WINCEBASIC to disable the IsDebuggerPresent() code in + wtf/Assertions.cpp. * JavaScriptCore.pri: -2009-09-23 Geoffrey Garen +2009-09-22 Joerg Bornemann - A piece of my last patch that I forgot. + Reviewed by Simon Hausmann. - * wtf/HashCountedSet.h: - (WTF::::clear): Added HashCountedSet::clear. + Fix major memory leak in JavaScriptCore RegisterFile on Windows CE -2009-09-24 Gabor Loki + https://bugs.webkit.org/show_bug.cgi?id=29367 - Reviewed by Gavin Barraclough. + On Widows CE we must decommit all committed pages before we release + them. See VirtualFree documentation. + Desktop Windows behaves much smoother in this situation. - Reduce heap size on Symbian from 64MB to 8MB. + * interpreter/RegisterFile.cpp: + (JSC::RegisterFile::~RegisterFile): - This is not a perfect fix, it requires more fine tuning. - But this makes it possible again to debug in the emulator, - which is more important in order to be able to fix other - run-time issues. +2009-09-21 Greg Bolsinga - * runtime/Collector.h: + Reviewed by Simon Fraser & Sam Weinig. -2009-09-30 Janne Koskinen + Add ENABLE(ORIENTATION_EVENTS) + https://bugs.webkit.org/show_bug.cgi?id=29508 - Reviewed by Simon Hausmann. + * wtf/Platform.h: Also sort PLATFORM(IPHONE) #defines. - Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set - https://bugs.webkit.org/show_bug.cgi?id=28886 +2009-09-21 Jedrzej Nowacki - There are some GCC packages (for example GCC-2006q3 from CodeSourcery) - which contain __clear_cache built-in function only for C while the C++ - version of __clear_cache is missing on ARM architectures. + Reviewed by Eric Seidel. - Fixed a small bug in the inline assembly of cacheFlush function on - ARM_TRADITIONAL. + [Fix] SourceCode's uninitialized member + + Potential source of crashes and bugs was fixed. Default constructor + didn't initialized m_provider member. - * jit/ExecutableAllocator.h: - (JSC::ExecutableAllocator::cacheFlush): + https://bugs.webkit.org/show_bug.cgi?id=29364 + + * parser/SourceCode.h: + (JSC::SourceCode::SourceCode): 2009-09-21 Oliver Hunt diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/Info.plist b/src/3rdparty/javascriptcore/JavaScriptCore/Info.plist index 17949b0..77c9eb8 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/Info.plist +++ b/src/3rdparty/javascriptcore/JavaScriptCore/Info.plist @@ -1,5 +1,5 @@ - + CFBundleDevelopmentRegion @@ -7,7 +7,7 @@ CFBundleExecutable ${PRODUCT_NAME} CFBundleGetInfoString - ${BUNDLE_VERSION}, Copyright 2003-2009 Apple Inc.; Copyright 1999-2001 Harri Porten <porten@kde.org>; Copyright 2001 Peter Kelly <pmk@post.com>; Copyright 1997-2005 University of Cambridge; Copyright 1991, 2000, 2001 by Lucent Technologies. + ${BUNDLE_VERSION}, Copyright 2003-2010 Apple Inc.; Copyright 1999-2001 Harri Porten <porten@kde.org>; Copyright 2001 Peter Kelly <pmk@post.com>; Copyright 1997-2005 University of Cambridge; Copyright 1991, 2000, 2001 by Lucent Technologies. CFBundleIdentifier com.apple.${PRODUCT_NAME} CFBundleInfoDictionaryVersion diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.gypi b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.gypi index 15a0c0f..24577da 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.gypi +++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.gypi @@ -1,7 +1,6 @@ { 'variables': { 'javascriptcore_files': [ - 'AllInOneFile.cpp', 'API/APICast.h', 'API/JavaScript.h', 'API/JavaScriptCore.h', @@ -19,6 +18,7 @@ 'API/JSClassRef.h', 'API/JSContextRef.cpp', 'API/JSContextRef.h', + 'API/JSContextRefPrivate.h', 'API/JSObjectRef.cpp', 'API/JSObjectRef.h', 'API/JSProfilerPrivate.cpp', @@ -64,6 +64,7 @@ 'bytecode/StructureStubInfo.h', 'bytecompiler/BytecodeGenerator.cpp', 'bytecompiler/BytecodeGenerator.h', + 'bytecompiler/NodesCodegen.cpp', 'bytecompiler/Label.h', 'bytecompiler/LabelScope.h', 'bytecompiler/RegisterID.h', @@ -148,8 +149,6 @@ 'pcre/ucpinternal.h', 'pcre/ucptable.cpp', 'profiler/CallIdentifier.h', - 'profiler/HeavyProfile.cpp', - 'profiler/HeavyProfile.h', 'profiler/Profile.cpp', 'profiler/Profile.h', 'profiler/ProfileGenerator.cpp', @@ -159,8 +158,6 @@ 'profiler/Profiler.cpp', 'profiler/Profiler.h', 'profiler/ProfilerServer.h', - 'profiler/TreeProfile.cpp', - 'profiler/TreeProfile.h', 'runtime/ArgList.cpp', 'runtime/ArgList.h', 'runtime/Arguments.cpp', @@ -194,6 +191,7 @@ 'runtime/DateConversion.h', 'runtime/DateInstance.cpp', 'runtime/DateInstance.h', + 'runtime/DateInstanceCache.h', 'runtime/DatePrototype.cpp', 'runtime/DatePrototype.h', 'runtime/Error.cpp', @@ -331,6 +329,7 @@ 'runtime/Tracing.h', 'runtime/UString.cpp', 'runtime/UString.h', + 'runtime/WeakRandom.h', 'wrec/CharacterClass.cpp', 'wrec/CharacterClass.h', 'wrec/CharacterClassConstructor.cpp', @@ -368,8 +367,8 @@ 'wtf/FastMalloc.h', 'wtf/Forward.h', 'wtf/GetPtr.h', - 'wtf/GOwnPtr.cpp', - 'wtf/GOwnPtr.h', + 'wtf/gtk/GOwnPtr.cpp', + 'wtf/gtk/GOwnPtr.h', 'wtf/gtk/MainThreadGtk.cpp', 'wtf/gtk/ThreadingGtk.cpp', 'wtf/HashCountedSet.h', @@ -399,8 +398,6 @@ 'wtf/PassRefPtr.h', 'wtf/Platform.h', 'wtf/PtrAndFlags.h', - 'wtf/qt/MainThreadQt.cpp', - 'wtf/qt/ThreadingQt.cpp', 'wtf/RandomNumber.cpp', 'wtf/RandomNumber.h', 'wtf/RandomNumberSeed.h', @@ -413,11 +410,16 @@ 'wtf/SegmentedVector.h', 'wtf/StdLibExtras.h', 'wtf/StringExtras.h', + 'wtf/StringHashFunctions.h', 'wtf/TCPackedCache.h', + 'wtf/qt/MainThreadQt.cpp', + 'wtf/qt/ThreadingQt.cpp', 'wtf/TCPageMap.h', 'wtf/TCSpinLock.h', 'wtf/TCSystemAlloc.cpp', 'wtf/TCSystemAlloc.h', + 'wtf/ThreadIdentifierDataPthreads.cpp', + 'wtf/ThreadIdentifierDataPthreads.h', 'wtf/Threading.cpp', 'wtf/Threading.h', 'wtf/ThreadingNone.cpp', diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.order b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.order index 3ae3ec6..d6f6caa 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.order +++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.order @@ -1625,7 +1625,6 @@ __ZN3JSC18EmptyStatementNode12emitBytecodeERNS_17BytecodeGeneratorEPNS_10Registe __ZN3JSCL27compareByStringPairForQSortEPKvS1_ __Z22jsc_pcre_ucp_othercasej __ZN3JSCL35objectProtoFuncPropertyIsEnumerableEPNS_9ExecStateEPNS_8JSObjectENS_7JSValueERKNS_7ArgListE -__ZNK3JSC8JSObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj __ZN3WTF7HashMapIjN3JSC7JSValueENS_7IntHashIjEENS_10HashTraitsIjEENS5_IS2_EEE3setERKjRKS2_ __ZN3WTF9HashTableIjSt4pairIjN3JSC7JSValueEENS_18PairFirstExtractorIS4_EENS_7IntHashIjEENS_14PairHashTraitsINS_10HashTraitsIjEE __ZN3JSC12RegisterFile21releaseExcessCapacityEv @@ -1841,7 +1840,6 @@ __ZN3JSC6JSCell14toThisJSStringEPNS_9ExecStateE __ZNK3JSC6JSCell12toThisStringEPNS_9ExecStateE __ZN3JSCL27objectProtoFuncLookupSetterEPNS_9ExecStateEPNS_8JSObjectENS_7JSValueERKNS_7ArgListE __ZN3JSC8JSObject12lookupSetterEPNS_9ExecStateERKNS_10IdentifierE -__ZNK3JSC16JSVariableObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj __ZN3JSC9ExecState22regExpConstructorTableEPS0_ __ZN3JSCL24regExpConstructorDollar7EPNS_9ExecStateERKNS_10IdentifierERKNS_12PropertySlotE __ZN3JSCL24regExpConstructorDollar8EPNS_9ExecStateERKNS_10IdentifierERKNS_12PropertySlotE diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri index a6fb2f8..75737ae 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri +++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri @@ -1,14 +1,23 @@ # JavaScriptCore - Qt4 build info VPATH += $$PWD +CONFIG(standalone_package) { + isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated +} else { + isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = generated +} + CONFIG(debug, debug|release) { - isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = generated$${QMAKE_DIR_SEP}debug OBJECTS_DIR = obj/debug } else { # Release - isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = generated$${QMAKE_DIR_SEP}release OBJECTS_DIR = obj/release } +symbian: { + # Need to guarantee this comes before system includes of /epoc32/include + MMP_RULES += "USERINCLUDE ../JavaScriptCore/profiler" +} + INCLUDEPATH = \ $$PWD \ $$PWD/.. \ @@ -19,6 +28,7 @@ INCLUDEPATH = \ $$PWD/interpreter \ $$PWD/jit \ $$PWD/parser \ + $$PWD/pcre \ $$PWD/profiler \ $$PWD/runtime \ $$PWD/wrec \ @@ -27,12 +37,11 @@ INCLUDEPATH = \ $$PWD/yarr \ $$PWD/API \ $$PWD/ForwardingHeaders \ - $$GENERATED_SOURCES_DIR \ + $$JSC_GENERATED_SOURCES_DIR \ $$INCLUDEPATH DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF -GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP} win32-* { LIBS += -lwinmm } @@ -47,11 +56,6 @@ contains(JAVASCRIPTCORE_JIT,no) { DEFINES+=ENABLE_YARR=0 } -# In debug mode JIT disabled until crash fixed -win32-* { - CONFIG(debug):!contains(DEFINES, ENABLE_JIT=1): DEFINES+=ENABLE_JIT=0 -} - # Rules when JIT enabled (not disabled) !contains(DEFINES, ENABLE_JIT=0) { linux*-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) { @@ -68,33 +72,7 @@ wince* { include(pcre/pcre.pri) -LUT_FILES += \ - runtime/DatePrototype.cpp \ - runtime/JSONObject.cpp \ - runtime/NumberConstructor.cpp \ - runtime/StringPrototype.cpp \ - runtime/ArrayPrototype.cpp \ - runtime/MathObject.cpp \ - runtime/RegExpConstructor.cpp \ - runtime/RegExpObject.cpp - -KEYWORDLUT_FILES += \ - parser/Keywords.table - -JSCBISON += \ - parser/Grammar.y - SOURCES += \ - wtf/Assertions.cpp \ - wtf/ByteArray.cpp \ - wtf/HashTable.cpp \ - wtf/MainThread.cpp \ - wtf/RandomNumber.cpp \ - wtf/RefCountedLeakCounter.cpp \ - wtf/TypeTraits.cpp \ - wtf/unicode/CollatorDefault.cpp \ - wtf/unicode/icu/CollatorICU.cpp \ - wtf/unicode/UTF8.cpp \ API/JSBase.cpp \ API/JSCallbackConstructor.cpp \ API/JSCallbackFunction.cpp \ @@ -105,55 +83,39 @@ SOURCES += \ API/JSStringRef.cpp \ API/JSValueRef.cpp \ API/OpaqueJSString.cpp \ - runtime/InitializeThreading.cpp \ - runtime/JSGlobalData.cpp \ - runtime/JSGlobalObject.cpp \ - runtime/JSStaticScopeObject.cpp \ - runtime/JSVariableObject.cpp \ - runtime/JSActivation.cpp \ - runtime/JSNotAnObject.cpp \ - runtime/JSONObject.cpp \ - runtime/LiteralParser.cpp \ - runtime/MarkStack.cpp \ - runtime/TimeoutChecker.cpp \ - bytecode/CodeBlock.cpp \ - bytecode/StructureStubInfo.cpp \ - bytecode/JumpTable.cpp \ assembler/ARMAssembler.cpp \ assembler/MacroAssemblerARM.cpp \ - jit/JIT.cpp \ - jit/JITCall.cpp \ + bytecode/CodeBlock.cpp \ + bytecode/JumpTable.cpp \ + bytecode/Opcode.cpp \ + bytecode/SamplingTool.cpp \ + bytecode/StructureStubInfo.cpp \ + bytecompiler/BytecodeGenerator.cpp \ + bytecompiler/NodesCodegen.cpp \ + debugger/DebuggerActivation.cpp \ + debugger/DebuggerCallFrame.cpp \ + debugger/Debugger.cpp \ + interpreter/CallFrame.cpp \ + interpreter/Interpreter.cpp \ + interpreter/RegisterFile.cpp \ + jit/ExecutableAllocatorPosix.cpp \ + jit/ExecutableAllocatorSymbian.cpp \ + jit/ExecutableAllocatorWin.cpp \ + jit/ExecutableAllocator.cpp \ jit/JITArithmetic.cpp \ + jit/JITCall.cpp \ + jit/JIT.cpp \ jit/JITOpcodes.cpp \ jit/JITPropertyAccess.cpp \ - jit/ExecutableAllocator.cpp \ jit/JITStubs.cpp \ - bytecompiler/BytecodeGenerator.cpp \ - runtime/ExceptionHelpers.cpp \ - runtime/JSPropertyNameIterator.cpp \ - interpreter/Interpreter.cpp \ - bytecode/Opcode.cpp \ - bytecode/SamplingTool.cpp \ - yarr/RegexCompiler.cpp \ - yarr/RegexInterpreter.cpp \ - yarr/RegexJIT.cpp \ - interpreter/RegisterFile.cpp - -win32-*|wince* { - SOURCES += jit/ExecutableAllocatorWin.cpp \ - runtime/MarkStackWin.cpp -} else { - SOURCES += jit/ExecutableAllocatorPosix.cpp \ - runtime/MarkStackPosix.cpp -} - -!contains(DEFINES, USE_SYSTEM_MALLOC) { - SOURCES += wtf/TCSystemAlloc.cpp -} - -# AllInOneFile.cpp helps gcc analize and optimize code -# Other compilers may be able to do this at link time -SOURCES += \ + parser/Lexer.cpp \ + parser/Nodes.cpp \ + parser/ParserArena.cpp \ + parser/Parser.cpp \ + profiler/Profile.cpp \ + profiler/ProfileGenerator.cpp \ + profiler/ProfileNode.cpp \ + profiler/Profiler.cpp \ runtime/ArgList.cpp \ runtime/Arguments.cpp \ runtime/ArrayConstructor.cpp \ @@ -164,62 +126,67 @@ SOURCES += \ runtime/CallData.cpp \ runtime/Collector.cpp \ runtime/CommonIdentifiers.cpp \ + runtime/Completion.cpp \ runtime/ConstructData.cpp \ - wtf/CurrentTime.cpp \ runtime/DateConstructor.cpp \ runtime/DateConversion.cpp \ runtime/DateInstance.cpp \ runtime/DatePrototype.cpp \ - debugger/Debugger.cpp \ - debugger/DebuggerCallFrame.cpp \ - debugger/DebuggerActivation.cpp \ - wtf/dtoa.cpp \ - runtime/Error.cpp \ runtime/ErrorConstructor.cpp \ + runtime/Error.cpp \ runtime/ErrorInstance.cpp \ runtime/ErrorPrototype.cpp \ - interpreter/CallFrame.cpp \ + runtime/ExceptionHelpers.cpp \ runtime/Executable.cpp \ runtime/FunctionConstructor.cpp \ runtime/FunctionPrototype.cpp \ runtime/GetterSetter.cpp \ runtime/GlobalEvalFunction.cpp \ runtime/Identifier.cpp \ + runtime/InitializeThreading.cpp \ runtime/InternalFunction.cpp \ - runtime/Completion.cpp \ - runtime/JSArray.cpp \ + runtime/JSActivation.cpp \ runtime/JSAPIValueWrapper.cpp \ + runtime/JSArray.cpp \ runtime/JSByteArray.cpp \ runtime/JSCell.cpp \ runtime/JSFunction.cpp \ + runtime/JSGlobalData.cpp \ + runtime/JSGlobalObject.cpp \ runtime/JSGlobalObjectFunctions.cpp \ runtime/JSImmediate.cpp \ runtime/JSLock.cpp \ + runtime/JSNotAnObject.cpp \ runtime/JSNumberCell.cpp \ runtime/JSObject.cpp \ + runtime/JSONObject.cpp \ + runtime/JSPropertyNameIterator.cpp \ + runtime/JSStaticScopeObject.cpp \ runtime/JSString.cpp \ runtime/JSValue.cpp \ + runtime/JSVariableObject.cpp \ runtime/JSWrapperObject.cpp \ - parser/Lexer.cpp \ + runtime/LiteralParser.cpp \ runtime/Lookup.cpp \ + runtime/MarkStackPosix.cpp \ + runtime/MarkStackSymbian.cpp \ + runtime/MarkStackWin.cpp \ + runtime/MarkStack.cpp \ runtime/MathObject.cpp \ runtime/NativeErrorConstructor.cpp \ runtime/NativeErrorPrototype.cpp \ - parser/Nodes.cpp \ runtime/NumberConstructor.cpp \ runtime/NumberObject.cpp \ runtime/NumberPrototype.cpp \ runtime/ObjectConstructor.cpp \ runtime/ObjectPrototype.cpp \ runtime/Operations.cpp \ - parser/Parser.cpp \ - parser/ParserArena.cpp \ runtime/PropertyDescriptor.cpp \ runtime/PropertyNameArray.cpp \ runtime/PropertySlot.cpp \ runtime/PrototypeFunction.cpp \ - runtime/RegExp.cpp \ runtime/RegExpConstructor.cpp \ + runtime/RegExp.cpp \ runtime/RegExpObject.cpp \ runtime/RegExpPrototype.cpp \ runtime/ScopeChain.cpp \ @@ -227,50 +194,38 @@ SOURCES += \ runtime/StringConstructor.cpp \ runtime/StringObject.cpp \ runtime/StringPrototype.cpp \ - runtime/Structure.cpp \ runtime/StructureChain.cpp \ + runtime/Structure.cpp \ + runtime/TimeoutChecker.cpp \ runtime/UString.cpp \ - profiler/HeavyProfile.cpp \ - profiler/Profile.cpp \ - profiler/ProfileGenerator.cpp \ - profiler/ProfileNode.cpp \ - profiler/Profiler.cpp \ - profiler/TreeProfile.cpp \ + runtime/UStringImpl.cpp \ + wtf/Assertions.cpp \ + wtf/ByteArray.cpp \ + wtf/CurrentTime.cpp \ wtf/DateMath.cpp \ + wtf/dtoa.cpp \ wtf/FastMalloc.cpp \ + wtf/HashTable.cpp \ + wtf/MainThread.cpp \ + wtf/qt/MainThreadQt.cpp \ + wtf/qt/ThreadingQt.cpp \ + wtf/RandomNumber.cpp \ + wtf/RefCountedLeakCounter.cpp \ + wtf/ThreadingNone.cpp \ wtf/Threading.cpp \ - wtf/qt/MainThreadQt.cpp - -!contains(DEFINES, ENABLE_SINGLE_THREADED=1) { - SOURCES += wtf/qt/ThreadingQt.cpp -} else { - DEFINES += ENABLE_JSC_MULTIPLE_THREADS=0 - SOURCES += wtf/ThreadingNone.cpp -} - -# GENERATOR 1-A: LUT creator -lut.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.lut.h -lut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT} -lut.depend = ${QMAKE_FILE_NAME} -lut.input = LUT_FILES -lut.CONFIG += no_link -addExtraCompiler(lut) + wtf/TypeTraits.cpp \ + wtf/unicode/CollatorDefault.cpp \ + wtf/unicode/icu/CollatorICU.cpp \ + wtf/unicode/UTF8.cpp \ + yarr/RegexCompiler.cpp \ + yarr/RegexInterpreter.cpp \ + yarr/RegexJIT.cpp -# GENERATOR 1-B: particular LUT creator (for 1 file only) -keywordlut.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}Lexer.lut.h -keywordlut.commands = perl $$PWD/create_hash_table ${QMAKE_FILE_NAME} -i > ${QMAKE_FILE_OUT} -keywordlut.depend = ${QMAKE_FILE_NAME} -keywordlut.input = KEYWORDLUT_FILES -keywordlut.CONFIG += no_link -addExtraCompiler(keywordlut) +# Generated files, simply list them for JavaScriptCore +SOURCES += \ + $${JSC_GENERATED_SOURCES_DIR}/Grammar.cpp -# GENERATOR 2: bison grammar -jscbison.output = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.cpp -jscbison.commands = bison -d -p jscyy ${QMAKE_FILE_NAME} -o $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c && $(MOVE) $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.c ${QMAKE_FILE_OUT} && $(MOVE) $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.tab.h $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}${QMAKE_FILE_BASE}.h -jscbison.depend = ${QMAKE_FILE_NAME} -jscbison.input = JSCBISON -jscbison.variable_out = GENERATED_SOURCES -jscbison.dependency_type = TYPE_C -jscbison.CONFIG = target_predeps -addExtraCompilerWithHeader(jscbison) +!contains(DEFINES, USE_SYSTEM_MALLOC) { + SOURCES += wtf/TCSystemAlloc.cpp +} diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMAssembler.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMAssembler.cpp index 1324586..6dd2b87 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMAssembler.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMAssembler.cpp @@ -26,7 +26,7 @@ #include "config.h" -#if ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL) +#if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) #include "ARMAssembler.h" @@ -34,39 +34,6 @@ namespace JSC { // Patching helpers -ARMWord* ARMAssembler::getLdrImmAddress(ARMWord* insn, uint32_t* constPool) -{ - // Must be an ldr ..., [pc +/- imm] - ASSERT((*insn & 0x0f7f0000) == 0x051f0000); - - if (constPool && (*insn & 0x1)) - return reinterpret_cast(constPool + ((*insn & SDT_OFFSET_MASK) >> 1)); - - ARMWord addr = reinterpret_cast(insn) + 2 * sizeof(ARMWord); - if (*insn & DT_UP) - return reinterpret_cast(addr + (*insn & SDT_OFFSET_MASK)); - else - return reinterpret_cast(addr - (*insn & SDT_OFFSET_MASK)); -} - -void ARMAssembler::linkBranch(void* code, JmpSrc from, void* to, int useConstantPool) -{ - ARMWord* insn = reinterpret_cast(code) + (from.m_offset / sizeof(ARMWord)); - - if (!useConstantPool) { - int diff = reinterpret_cast(to) - reinterpret_cast(insn + 2); - - if ((diff <= BOFFSET_MAX && diff >= BOFFSET_MIN)) { - *insn = B | getConditionalField(*insn) | (diff & BRANCH_MASK); - ExecutableAllocator::cacheFlush(insn, sizeof(ARMWord)); - return; - } - } - ARMWord* addr = getLdrImmAddress(insn); - *addr = reinterpret_cast(to); - ExecutableAllocator::cacheFlush(addr, sizeof(ARMWord)); -} - void ARMAssembler::patchConstantPoolLoad(void* loadAddr, void* constPoolAddr) { ARMWord *ldr = reinterpret_cast(loadAddr); @@ -118,7 +85,7 @@ ARMWord ARMAssembler::getOp2(ARMWord imm) if ((imm & 0x00ffffff) == 0) return OP2_IMM | (imm >> 24) | (rol << 8); - return 0; + return INVALID_IMM; } int ARMAssembler::genInt(int reg, ARMWord imm, bool positive) @@ -236,25 +203,18 @@ ARMWord ARMAssembler::getImm(ARMWord imm, int tmpReg, bool invert) // Do it by 1 instruction tmp = getOp2(imm); - if (tmp) + if (tmp != INVALID_IMM) return tmp; tmp = getOp2(~imm); - if (tmp) { + if (tmp != INVALID_IMM) { if (invert) return tmp | OP2_INV_IMM; mvn_r(tmpReg, tmp); return tmpReg; } - // Do it by 2 instruction - if (genInt(tmpReg, imm, true)) - return tmpReg; - if (genInt(tmpReg, ~imm, false)) - return tmpReg; - - ldr_imm(tmpReg, imm); - return tmpReg; + return encodeComplexImm(imm, tmpReg); } void ARMAssembler::moveImm(ARMWord imm, int dest) @@ -263,24 +223,41 @@ void ARMAssembler::moveImm(ARMWord imm, int dest) // Do it by 1 instruction tmp = getOp2(imm); - if (tmp) { + if (tmp != INVALID_IMM) { mov_r(dest, tmp); return; } tmp = getOp2(~imm); - if (tmp) { + if (tmp != INVALID_IMM) { mvn_r(dest, tmp); return; } + encodeComplexImm(imm, dest); +} + +ARMWord ARMAssembler::encodeComplexImm(ARMWord imm, int dest) +{ +#if WTF_ARM_ARCH_AT_LEAST(7) + ARMWord tmp = getImm16Op2(imm); + if (tmp != INVALID_IMM) { + movw_r(dest, tmp); + return dest; + } + movw_r(dest, getImm16Op2(imm & 0xffff)); + movt_r(dest, getImm16Op2(imm >> 16)); + return dest; +#else // Do it by 2 instruction if (genInt(dest, imm, true)) - return; + return dest; if (genInt(dest, ~imm, false)) - return; + return dest; ldr_imm(dest, imm); + return dest; +#endif } // Memory load/store helpers @@ -378,10 +355,17 @@ void* ARMAssembler::executableCopy(ExecutablePool* allocator) // The last bit is set if the constant must be placed on constant pool. int pos = (*iter) & (~0x1); ARMWord* ldrAddr = reinterpret_cast(data + pos); - ARMWord offset = *getLdrImmAddress(ldrAddr); - if (offset != 0xffffffff) { - JmpSrc jmpSrc(pos); - linkBranch(data, jmpSrc, data + offset, ((*iter) & 1)); + ARMWord* addr = getLdrImmAddress(ldrAddr); + if (*addr != 0xffffffff) { + if (!(*iter & 1)) { + int diff = reinterpret_cast(data + *addr) - (ldrAddr + DefaultPrefetching); + + if ((diff <= BOFFSET_MAX && diff >= BOFFSET_MIN)) { + *ldrAddr = B | getConditionalField(*ldrAddr) | (diff & BRANCH_MASK); + continue; + } + } + *addr = reinterpret_cast(data + *addr); } } @@ -390,4 +374,4 @@ void* ARMAssembler::executableCopy(ExecutablePool* allocator) } // namespace JSC -#endif // ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL) +#endif // ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMAssembler.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMAssembler.h index 9f9a450..6967b37 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMAssembler.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMAssembler.h @@ -29,7 +29,7 @@ #include -#if ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL) +#if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) #include "AssemblerBufferWithConstantPool.h" #include @@ -121,6 +121,7 @@ namespace JSC { MUL = 0x00000090, MULL = 0x00c00090, FADDD = 0x0e300b00, + FDIVD = 0x0e800b00, FSUBD = 0x0e300b40, FMULD = 0x0e200b00, FCMPD = 0x0eb40b40, @@ -133,12 +134,18 @@ namespace JSC { B = 0x0a000000, BL = 0x0b000000, FMSR = 0x0e000a10, + FMRS = 0x0e100a10, FSITOD = 0x0eb80bc0, + FTOSID = 0x0ebd0b40, FMSTAT = 0x0ef1fa10, -#if ARM_ARCH_VERSION >= 5 +#if WTF_ARM_ARCH_AT_LEAST(5) CLZ = 0x016f0f10, BKPT = 0xe120070, #endif +#if WTF_ARM_ARCH_AT_LEAST(7) + MOVW = 0x03000000, + MOVT = 0x03400000, +#endif }; enum { @@ -175,6 +182,9 @@ namespace JSC { padForAlign32 = 0xee120070, }; + static const ARMWord INVALID_IMM = 0xf0000000; + static const int DefaultPrefetching = 2; + class JmpSrc { friend class ARMAssembler; public: @@ -333,6 +343,20 @@ namespace JSC { emitInst(static_cast(cc) | MOV, rd, ARMRegisters::r0, op2); } +#if WTF_ARM_ARCH_AT_LEAST(7) + void movw_r(int rd, ARMWord op2, Condition cc = AL) + { + ASSERT((op2 | 0xf0fff) == 0xf0fff); + m_buffer.putInt(static_cast(cc) | MOVW | RD(rd) | op2); + } + + void movt_r(int rd, ARMWord op2, Condition cc = AL) + { + ASSERT((op2 | 0xf0fff) == 0xf0fff); + m_buffer.putInt(static_cast(cc) | MOVT | RD(rd) | op2); + } +#endif + void movs_r(int rd, ARMWord op2, Condition cc = AL) { emitInst(static_cast(cc) | MOV | SET_CC, rd, ARMRegisters::r0, op2); @@ -378,6 +402,11 @@ namespace JSC { emitInst(static_cast(cc) | FADDD, dd, dn, dm); } + void fdivd_r(int dd, int dn, int dm, Condition cc = AL) + { + emitInst(static_cast(cc) | FDIVD, dd, dn, dm); + } + void fsubd_r(int dd, int dn, int dm, Condition cc = AL) { emitInst(static_cast(cc) | FSUBD, dd, dn, dm); @@ -482,17 +511,27 @@ namespace JSC { emitInst(static_cast(cc) | FMSR, rn, dd, 0); } + void fmrs_r(int rd, int dn, Condition cc = AL) + { + emitInst(static_cast(cc) | FMRS, rd, dn, 0); + } + void fsitod_r(int dd, int dm, Condition cc = AL) { emitInst(static_cast(cc) | FSITOD, dd, 0, dm); } + void ftosid_r(int fd, int dm, Condition cc = AL) + { + emitInst(static_cast(cc) | FTOSID, fd, 0, dm); + } + void fmstat(Condition cc = AL) { m_buffer.putInt(static_cast(cc) | FMSTAT); } -#if ARM_ARCH_VERSION >= 5 +#if WTF_ARM_ARCH_AT_LEAST(5) void clz_r(int rd, int rm, Condition cc = AL) { m_buffer.putInt(static_cast(cc) | CLZ | RD(rd) | RM(rm)); @@ -501,7 +540,7 @@ namespace JSC { void bkpt(ARMWord value) { -#if ARM_ARCH_VERSION >= 5 +#if WTF_ARM_ARCH_AT_LEAST(5) m_buffer.putInt(BKPT | ((value & 0xff0) << 4) | (value & 0xf)); #else // Cannot access to Zero memory address @@ -594,15 +633,32 @@ namespace JSC { // Patching helpers - static ARMWord* getLdrImmAddress(ARMWord* insn, uint32_t* constPool = 0); - static void linkBranch(void* code, JmpSrc from, void* to, int useConstantPool = 0); + static ARMWord* getLdrImmAddress(ARMWord* insn) + { + // Must be an ldr ..., [pc +/- imm] + ASSERT((*insn & 0x0f7f0000) == 0x051f0000); + + ARMWord addr = reinterpret_cast(insn) + DefaultPrefetching * sizeof(ARMWord); + if (*insn & DT_UP) + return reinterpret_cast(addr + (*insn & SDT_OFFSET_MASK)); + return reinterpret_cast(addr - (*insn & SDT_OFFSET_MASK)); + } + + static ARMWord* getLdrImmAddressOnPool(ARMWord* insn, uint32_t* constPool) + { + // Must be an ldr ..., [pc +/- imm] + ASSERT((*insn & 0x0f7f0000) == 0x051f0000); + + if (*insn & 0x1) + return reinterpret_cast(constPool + ((*insn & SDT_OFFSET_MASK) >> 1)); + return getLdrImmAddress(insn); + } static void patchPointerInternal(intptr_t from, void* to) { ARMWord* insn = reinterpret_cast(from); ARMWord* addr = getLdrImmAddress(insn); *addr = reinterpret_cast(to); - ExecutableAllocator::cacheFlush(addr, sizeof(ARMWord)); } static ARMWord patchConstantPoolLoad(ARMWord load, ARMWord value) @@ -647,12 +703,13 @@ namespace JSC { void linkJump(JmpSrc from, JmpDst to) { ARMWord* insn = reinterpret_cast(m_buffer.data()) + (from.m_offset / sizeof(ARMWord)); - *getLdrImmAddress(insn, m_buffer.poolAddress()) = static_cast(to.m_offset); + ARMWord* addr = getLdrImmAddressOnPool(insn, m_buffer.poolAddress()); + *addr = static_cast(to.m_offset); } static void linkJump(void* code, JmpSrc from, void* to) { - linkBranch(code, from, to); + patchPointerInternal(reinterpret_cast(code) + from.m_offset, to); } static void relinkJump(void* from, void* to) @@ -662,12 +719,12 @@ namespace JSC { static void linkCall(void* code, JmpSrc from, void* to) { - linkBranch(code, from, to, true); + patchPointerInternal(reinterpret_cast(code) + from.m_offset, to); } static void relinkCall(void* from, void* to) { - relinkJump(from, to); + patchPointerInternal(reinterpret_cast(from) - sizeof(ARMWord), to); } // Address operations @@ -708,8 +765,18 @@ namespace JSC { } static ARMWord getOp2(ARMWord imm); + +#if WTF_ARM_ARCH_AT_LEAST(7) + static ARMWord getImm16Op2(ARMWord imm) + { + if (imm <= 0xffff) + return (imm & 0xf000) << 4 | (imm & 0xfff); + return INVALID_IMM; + } +#endif ARMWord getImm(ARMWord imm, int tmpReg, bool invert = false); void moveImm(ARMWord imm, int dest); + ARMWord encodeComplexImm(ARMWord imm, int dest); // Memory load/store helpers @@ -764,6 +831,6 @@ namespace JSC { } // namespace JSC -#endif // ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL) +#endif // ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) #endif // ARMAssembler_h diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMv7Assembler.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMv7Assembler.h index 078de44..6cde63b 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMv7Assembler.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMv7Assembler.h @@ -28,7 +28,7 @@ #include -#if ENABLE(ASSEMBLER) && PLATFORM(ARM_THUMB2) +#if ENABLE(ASSEMBLER) && CPU(ARM_THUMB2) #include "AssemblerBuffer.h" #include @@ -236,6 +236,11 @@ class ARMThumbImmediate { ARMThumbImmediate(ThumbImmediateType type, uint16_t value) : m_type(TypeUInt16) { + // Make sure this constructor is only reached with type TypeUInt16; + // this extra parameter makes the code a little clearer by making it + // explicit at call sites which type is being constructed + ASSERT_UNUSED(type, type == TypeUInt16); + m_value.asInt = value; } @@ -407,6 +412,11 @@ register writeback class ARMv7Assembler { public: + ~ARMv7Assembler() + { + ASSERT(m_jumpsToLink.isEmpty()); + } + typedef ARMRegisters::RegisterID RegisterID; typedef ARMRegisters::FPRegisterID FPRegisterID; @@ -477,6 +487,17 @@ public: private: + struct LinkRecord { + LinkRecord(intptr_t from, intptr_t to) + : from(from) + , to(to) + { + } + + intptr_t from; + intptr_t to; + }; + // ARMv7, Appx-A.6.3 bool BadReg(RegisterID reg) { @@ -574,6 +595,7 @@ private: OP_SUB_SP_imm_T1 = 0xB080, OP_BKPT = 0xBE00, OP_IT = 0xBF00, + OP_NOP_T1 = 0xBF00, } OpcodeID; typedef enum { @@ -608,6 +630,7 @@ private: OP_MOV_imm_T3 = 0xF240, OP_SUB_imm_T4 = 0xF2A0, OP_MOVT = 0xF2C0, + OP_NOP_T2a = 0xF3AF, OP_LDRH_reg_T2 = 0xF830, OP_LDRH_imm_T3 = 0xF830, OP_STR_imm_T4 = 0xF840, @@ -626,6 +649,7 @@ private: typedef enum { OP_B_T4b = 0x9000, + OP_NOP_T2b = 0x8000, } OpcodeID2; struct FourFours { @@ -1481,6 +1505,15 @@ public: void* executableCopy(ExecutablePool* allocator) { void* copy = m_formatter.executableCopy(allocator); + + unsigned jumpCount = m_jumpsToLink.size(); + for (unsigned i = 0; i < jumpCount; ++i) { + uint16_t* location = reinterpret_cast(reinterpret_cast(copy) + m_jumpsToLink[i].from); + uint16_t* target = reinterpret_cast(reinterpret_cast(copy) + m_jumpsToLink[i].to); + linkJumpAbsolute(location, target); + } + m_jumpsToLink.clear(); + ASSERT(copy); return copy; } @@ -1503,11 +1536,7 @@ public: { ASSERT(to.m_offset != -1); ASSERT(from.m_offset != -1); - - uint16_t* location = reinterpret_cast(reinterpret_cast(m_formatter.data()) + from.m_offset); - intptr_t relative = to.m_offset - from.m_offset; - - linkWithOffset(location, relative); + m_jumpsToLink.append(LinkRecord(from.m_offset, to.m_offset)); } static void linkJump(void* code, JmpSrc from, void* to) @@ -1515,9 +1544,7 @@ public: ASSERT(from.m_offset != -1); uint16_t* location = reinterpret_cast(reinterpret_cast(code) + from.m_offset); - intptr_t relative = reinterpret_cast(to) - reinterpret_cast(location); - - linkWithOffset(location, relative); + linkJumpAbsolute(location, to); } // bah, this mathod should really be static, since it is used by the LinkBuffer. @@ -1541,10 +1568,9 @@ public: ASSERT(!(reinterpret_cast(from) & 1)); ASSERT(!(reinterpret_cast(to) & 1)); - intptr_t relative = reinterpret_cast(to) - reinterpret_cast(from); - linkWithOffset(reinterpret_cast(from), relative); + linkJumpAbsolute(reinterpret_cast(from), to); - ExecutableAllocator::cacheFlush(reinterpret_cast(from) - 2, 2 * sizeof(uint16_t)); + ExecutableAllocator::cacheFlush(reinterpret_cast(from) - 5, 5 * sizeof(uint16_t)); } static void relinkCall(void* from, void* to) @@ -1613,14 +1639,14 @@ private: static void setInt32(void* code, uint32_t value) { uint16_t* location = reinterpret_cast(code); + ASSERT(isMOV_imm_T3(location - 4) && isMOVT(location - 2)); - uint16_t lo16 = value; - uint16_t hi16 = value >> 16; - - spliceHi5(location - 4, lo16); - spliceLo11(location - 3, lo16); - spliceHi5(location - 2, hi16); - spliceLo11(location - 1, hi16); + ARMThumbImmediate lo16 = ARMThumbImmediate::makeUInt16(static_cast(value)); + ARMThumbImmediate hi16 = ARMThumbImmediate::makeUInt16(static_cast(value >> 16)); + location[-4] = twoWordOp5i6Imm4Reg4EncodedImmFirst(OP_MOV_imm_T3, lo16); + location[-3] = twoWordOp5i6Imm4Reg4EncodedImmSecond((location[-3] >> 8) & 0xf, lo16); + location[-2] = twoWordOp5i6Imm4Reg4EncodedImmFirst(OP_MOVT, hi16); + location[-1] = twoWordOp5i6Imm4Reg4EncodedImmSecond((location[-1] >> 8) & 0xf, hi16); ExecutableAllocator::cacheFlush(location - 4, 4 * sizeof(uint16_t)); } @@ -1630,41 +1656,89 @@ private: setInt32(code, reinterpret_cast(value)); } - // Linking & patching: - // This method assumes that the JmpSrc being linked is a T4 b instruction. - static void linkWithOffset(uint16_t* instruction, intptr_t relative) - { - // Currently branches > 16m = mostly deathy. - if (((relative << 7) >> 7) != relative) { - // FIXME: This CRASH means we cannot turn the JIT on by default on arm-v7. - fprintf(stderr, "Error: Cannot link T4b.\n"); - CRASH(); - } - - // ARM encoding for the top two bits below the sign bit is 'peculiar'. - if (relative >= 0) - relative ^= 0xC00000; + static bool isB(void* address) + { + uint16_t* instruction = static_cast(address); + return ((instruction[0] & 0xf800) == OP_B_T4a) && ((instruction[1] & 0xd000) == OP_B_T4b); + } - // All branch offsets should be an even distance. - ASSERT(!(relative & 1)); + static bool isBX(void* address) + { + uint16_t* instruction = static_cast(address); + return (instruction[0] & 0xff87) == OP_BX; + } - int word1 = ((relative & 0x1000000) >> 14) | ((relative & 0x3ff000) >> 12); - int word2 = ((relative & 0x800000) >> 10) | ((relative & 0x400000) >> 11) | ((relative & 0xffe) >> 1); + static bool isMOV_imm_T3(void* address) + { + uint16_t* instruction = static_cast(address); + return ((instruction[0] & 0xFBF0) == OP_MOV_imm_T3) && ((instruction[1] & 0x8000) == 0); + } - instruction[-2] = OP_B_T4a | word1; - instruction[-1] = OP_B_T4b | word2; + static bool isMOVT(void* address) + { + uint16_t* instruction = static_cast(address); + return ((instruction[0] & 0xFBF0) == OP_MOVT) && ((instruction[1] & 0x8000) == 0); } - // These functions can be used to splice 16-bit immediates back into previously generated instructions. - static void spliceHi5(uint16_t* where, uint16_t what) + static bool isNOP_T1(void* address) { - uint16_t pattern = (what >> 12) | ((what & 0x0800) >> 1); - *where = (*where & 0xFBF0) | pattern; + uint16_t* instruction = static_cast(address); + return instruction[0] == OP_NOP_T1; } - static void spliceLo11(uint16_t* where, uint16_t what) + + static bool isNOP_T2(void* address) { - uint16_t pattern = ((what & 0x0700) << 4) | (what & 0x00FF); - *where = (*where & 0x8F00) | pattern; + uint16_t* instruction = static_cast(address); + return (instruction[0] == OP_NOP_T2a) && (instruction[1] == OP_NOP_T2b); + } + + static void linkJumpAbsolute(uint16_t* instruction, void* target) + { + // FIMXE: this should be up in the MacroAssembler layer. :-( + const uint16_t JUMP_TEMPORARY_REGISTER = ARMRegisters::ip; + + ASSERT(!(reinterpret_cast(instruction) & 1)); + ASSERT(!(reinterpret_cast(target) & 1)); + + ASSERT( (isMOV_imm_T3(instruction - 5) && isMOVT(instruction - 3) && isBX(instruction - 1)) + || (isNOP_T1(instruction - 5) && isNOP_T2(instruction - 4) && isB(instruction - 2)) ); + + intptr_t relative = reinterpret_cast(target) - (reinterpret_cast(instruction)); + if (((relative << 7) >> 7) == relative) { + // ARM encoding for the top two bits below the sign bit is 'peculiar'. + if (relative >= 0) + relative ^= 0xC00000; + + // All branch offsets should be an even distance. + ASSERT(!(relative & 1)); + // There may be a better way to fix this, but right now put the NOPs first, since in the + // case of an conditional branch this will be coming after an ITTT predicating *three* + // instructions! Looking backwards to modify the ITTT to an IT is not easy, due to + // variable wdith encoding - the previous instruction might *look* like an ITTT but + // actually be the second half of a 2-word op. + instruction[-5] = OP_NOP_T1; + instruction[-4] = OP_NOP_T2a; + instruction[-3] = OP_NOP_T2b; + instruction[-2] = OP_B_T4a | ((relative & 0x1000000) >> 14) | ((relative & 0x3ff000) >> 12); + instruction[-1] = OP_B_T4b | ((relative & 0x800000) >> 10) | ((relative & 0x400000) >> 11) | ((relative & 0xffe) >> 1); + } else { + ARMThumbImmediate lo16 = ARMThumbImmediate::makeUInt16(static_cast(reinterpret_cast(target) + 1)); + ARMThumbImmediate hi16 = ARMThumbImmediate::makeUInt16(static_cast(reinterpret_cast(target) >> 16)); + instruction[-5] = twoWordOp5i6Imm4Reg4EncodedImmFirst(OP_MOV_imm_T3, lo16); + instruction[-4] = twoWordOp5i6Imm4Reg4EncodedImmSecond(JUMP_TEMPORARY_REGISTER, lo16); + instruction[-3] = twoWordOp5i6Imm4Reg4EncodedImmFirst(OP_MOVT, hi16); + instruction[-2] = twoWordOp5i6Imm4Reg4EncodedImmSecond(JUMP_TEMPORARY_REGISTER, hi16); + instruction[-1] = OP_BX | (JUMP_TEMPORARY_REGISTER << 3); + } + } + + static uint16_t twoWordOp5i6Imm4Reg4EncodedImmFirst(uint16_t op, ARMThumbImmediate imm) + { + return op | (imm.m_value.i << 10) | imm.m_value.imm4; + } + static uint16_t twoWordOp5i6Imm4Reg4EncodedImmSecond(uint16_t rd, ARMThumbImmediate imm) + { + return (imm.m_value.imm3 << 12) | (rd << 8) | imm.m_value.imm8; } class ARMInstructionFormatter { @@ -1723,8 +1797,11 @@ private: void twoWordOp5i6Imm4Reg4EncodedImm(OpcodeID1 op, int imm4, RegisterID rd, ARMThumbImmediate imm) { - m_buffer.putShort(op | (imm.m_value.i << 10) | imm4); - m_buffer.putShort((imm.m_value.imm3 << 12) | (rd << 8) | imm.m_value.imm8); + ARMThumbImmediate newImm = imm; + newImm.m_value.imm4 = imm4; + + m_buffer.putShort(ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmFirst(op, newImm)); + m_buffer.putShort(ARMv7Assembler::twoWordOp5i6Imm4Reg4EncodedImmSecond(rd, newImm)); } void twoWordOp12Reg4Reg4Imm12(OpcodeID1 op, RegisterID reg1, RegisterID reg2, uint16_t imm) @@ -1749,10 +1826,12 @@ private: private: AssemblerBuffer m_buffer; } m_formatter; + + Vector m_jumpsToLink; }; } // namespace JSC -#endif // ENABLE(ASSEMBLER) && PLATFORM(ARM_THUMB2) +#endif // ENABLE(ASSEMBLER) && CPU(ARM_THUMB2) #endif // ARMAssembler_h diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/AbstractMacroAssembler.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/AbstractMacroAssembler.h index 525fe98..198e8d1 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/AbstractMacroAssembler.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/AbstractMacroAssembler.h @@ -173,16 +173,16 @@ public: struct Imm32 { explicit Imm32(int32_t value) : m_value(value) -#if PLATFORM(ARM) +#if CPU(ARM) , m_isPointer(false) #endif { } -#if !PLATFORM(X86_64) +#if !CPU(X86_64) explicit Imm32(ImmPtr ptr) : m_value(ptr.asIntptr()) -#if PLATFORM(ARM) +#if CPU(ARM) , m_isPointer(true) #endif { @@ -190,7 +190,7 @@ public: #endif int32_t m_value; -#if PLATFORM(ARM) +#if CPU(ARM) // We rely on being able to regenerate code to recover exception handling // information. Since ARMv7 supports 16-bit immediates there is a danger // that if pointer values change the layout of the generated code will change. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssembler.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssembler.h index 2743ab4..76bd205 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssembler.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssembler.h @@ -30,19 +30,19 @@ #if ENABLE(ASSEMBLER) -#if PLATFORM(ARM_THUMB2) +#if CPU(ARM_THUMB2) #include "MacroAssemblerARMv7.h" namespace JSC { typedef MacroAssemblerARMv7 MacroAssemblerBase; }; -#elif PLATFORM(ARM_TRADITIONAL) +#elif CPU(ARM_TRADITIONAL) #include "MacroAssemblerARM.h" namespace JSC { typedef MacroAssemblerARM MacroAssemblerBase; }; -#elif PLATFORM(X86) +#elif CPU(X86) #include "MacroAssemblerX86.h" namespace JSC { typedef MacroAssemblerX86 MacroAssemblerBase; }; -#elif PLATFORM(X86_64) +#elif CPU(X86_64) #include "MacroAssemblerX86_64.h" namespace JSC { typedef MacroAssemblerX86_64 MacroAssemblerBase; }; @@ -60,7 +60,7 @@ public: using MacroAssemblerBase::jump; using MacroAssemblerBase::branch32; using MacroAssemblerBase::branch16; -#if PLATFORM(X86_64) +#if CPU(X86_64) using MacroAssemblerBase::branchPtr; using MacroAssemblerBase::branchTestPtr; #endif @@ -133,7 +133,8 @@ public: // Ptr methods // On 32-bit platforms (i.e. x86), these methods directly map onto their 32-bit equivalents. -#if !PLATFORM(X86_64) + // FIXME: should this use a test for 32-bitness instead of this specific exception? +#if !CPU(X86_64) void addPtr(RegisterID src, RegisterID dest) { add32(src, dest); @@ -179,16 +180,6 @@ public: or32(imm, dest); } - void rshiftPtr(RegisterID shift_amount, RegisterID dest) - { - rshift32(shift_amount, dest); - } - - void rshiftPtr(Imm32 imm, RegisterID dest) - { - rshift32(imm, dest); - } - void subPtr(RegisterID src, RegisterID dest) { sub32(src, dest); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp index d726ecd..b5b20fa 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp @@ -26,11 +26,11 @@ #include "config.h" -#if ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL) +#if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) #include "MacroAssemblerARM.h" -#if PLATFORM(LINUX) +#if OS(LINUX) #include #include #include @@ -43,7 +43,7 @@ namespace JSC { static bool isVFPPresent() { -#if PLATFORM(LINUX) +#if OS(LINUX) int fd = open("/proc/self/auxv", O_RDONLY); if (fd > 0) { Elf32_auxv_t aux; @@ -62,7 +62,8 @@ static bool isVFPPresent() const bool MacroAssemblerARM::s_isVFPPresent = isVFPPresent(); -#if defined(ARM_REQUIRE_NATURAL_ALIGNMENT) && ARM_REQUIRE_NATURAL_ALIGNMENT +#if CPU(ARMV5_OR_LOWER) +/* On ARMv5 and below, natural alignment is required. */ void MacroAssemblerARM::load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest) { ARMWord op2; @@ -91,4 +92,4 @@ void MacroAssemblerARM::load32WithUnalignedHalfWords(BaseIndex address, Register } -#endif // ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL) +#endif // ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h index aa8cbb0..21b8de8 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h @@ -30,7 +30,7 @@ #include -#if ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL) +#if ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) #include "ARMAssembler.h" #include "AbstractMacroAssembler.h" @@ -38,6 +38,9 @@ namespace JSC { class MacroAssemblerARM : public AbstractMacroAssembler { + static const int DoubleConditionMask = 0x0f; + static const int DoubleConditionBitSpecial = 0x10; + COMPILE_ASSERT(!(DoubleConditionBitSpecial & DoubleConditionMask), DoubleConditionBitSpecial_should_not_interfere_with_ARMAssembler_Condition_codes); public: enum Condition { Equal = ARMAssembler::EQ, @@ -57,14 +60,24 @@ public: }; enum DoubleCondition { + // These conditions will only evaluate to true if the comparison is ordered - i.e. neither operand is NaN. DoubleEqual = ARMAssembler::EQ, + DoubleNotEqual = ARMAssembler::NE | DoubleConditionBitSpecial, DoubleGreaterThan = ARMAssembler::GT, DoubleGreaterThanOrEqual = ARMAssembler::GE, - DoubleLessThan = ARMAssembler::LT, - DoubleLessThanOrEqual = ARMAssembler::LE, + DoubleLessThan = ARMAssembler::CC, + DoubleLessThanOrEqual = ARMAssembler::LS, + // If either operand is NaN, these conditions always evaluate to true. + DoubleEqualOrUnordered = ARMAssembler::EQ | DoubleConditionBitSpecial, + DoubleNotEqualOrUnordered = ARMAssembler::NE, + DoubleGreaterThanOrUnordered = ARMAssembler::HI, + DoubleGreaterThanOrEqualOrUnordered = ARMAssembler::CS, + DoubleLessThanOrUnordered = ARMAssembler::LT, + DoubleLessThanOrEqualOrUnordered = ARMAssembler::LE, }; static const RegisterID stackPointerRegister = ARMRegisters::sp; + static const RegisterID linkRegister = ARMRegisters::lr; static const Scale ScalePtr = TimesFour; @@ -105,14 +118,18 @@ public: m_assembler.ands_r(dest, dest, w); } - void lshift32(Imm32 imm, RegisterID dest) + void lshift32(RegisterID shift_amount, RegisterID dest) { - m_assembler.movs_r(dest, m_assembler.lsl(dest, imm.m_value & 0x1f)); + 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.lsl_r(dest, ARMRegisters::S0)); } - void lshift32(RegisterID shift_amount, RegisterID dest) + void lshift32(Imm32 imm, RegisterID dest) { - m_assembler.movs_r(dest, m_assembler.lsl_r(dest, shift_amount)); + m_assembler.movs_r(dest, m_assembler.lsl(dest, imm.m_value & 0x1f)); } void mul32(RegisterID src, RegisterID dest) @@ -130,6 +147,11 @@ public: m_assembler.muls_r(dest, src, ARMRegisters::S0); } + void neg32(RegisterID srcDest) + { + m_assembler.rsbs_r(srcDest, srcDest, ARMAssembler::getOp2(0)); + } + void not32(RegisterID dest) { m_assembler.mvns_r(dest, dest); @@ -147,7 +169,11 @@ public: void rshift32(RegisterID shift_amount, RegisterID dest) { - m_assembler.movs_r(dest, m_assembler.asr_r(dest, shift_amount)); + 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.asr_r(dest, ARMRegisters::S0)); } void rshift32(Imm32 imm, RegisterID dest) @@ -198,7 +224,7 @@ public: m_assembler.baseIndexTransfer32(true, dest, address.base, address.index, static_cast(address.scale), address.offset); } -#if defined(ARM_REQUIRE_NATURAL_ALIGNMENT) && ARM_REQUIRE_NATURAL_ALIGNMENT +#if CPU(ARMV5_OR_LOWER) void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest); #else void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest) @@ -504,6 +530,13 @@ public: return Jump(m_assembler.jmp(ARMCondition(cond))); } + Jump branchOr32(Condition cond, RegisterID src, RegisterID dest) + { + ASSERT((cond == Signed) || (cond == Zero) || (cond == NonZero)); + or32(src, dest); + return Jump(m_assembler.jmp(ARMCondition(cond))); + } + void breakpoint() { m_assembler.bkpt(0); @@ -530,7 +563,7 @@ public: void ret() { - pop(ARMRegisters::pc); + m_assembler.mov_r(ARMRegisters::pc, linkRegister); } void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest) @@ -547,6 +580,25 @@ public: m_assembler.mov_r(dest, ARMAssembler::getOp2(1), ARMCondition(cond)); } + void set8(Condition cond, RegisterID left, RegisterID right, RegisterID dest) + { + // ARM doesn't have byte registers + set32(cond, left, right, dest); + } + + void set8(Condition cond, Address left, RegisterID right, RegisterID dest) + { + // ARM doesn't have byte registers + load32(left, ARMRegisters::S1); + set32(cond, ARMRegisters::S1, right, dest); + } + + void set8(Condition cond, RegisterID left, Imm32 right, RegisterID dest) + { + // ARM doesn't have byte registers + set32(cond, left, right, dest); + } + void setTest32(Condition cond, Address address, Imm32 mask, RegisterID dest) { load32(address, ARMRegisters::S1); @@ -558,6 +610,12 @@ public: m_assembler.mov_r(dest, ARMAssembler::getOp2(1), ARMCondition(cond)); } + void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest) + { + // ARM doesn't have byte registers + setTest32(cond, address, mask, dest); + } + void add32(Imm32 imm, RegisterID src, RegisterID dest) { m_assembler.add_r(dest, src, m_assembler.getImm(imm.m_value, ARMRegisters::S0)); @@ -665,6 +723,12 @@ public: m_assembler.doubleTransfer(true, dest, address.base, address.offset); } + void loadDouble(void* address, FPRegisterID dest) + { + m_assembler.ldr_un_imm(ARMRegisters::S0, (ARMWord)address); + m_assembler.fdtr_u(true, dest, ARMRegisters::S0, 0); + } + void storeDouble(FPRegisterID src, ImplicitAddress address) { m_assembler.doubleTransfer(false, src, address.base, address.offset); @@ -681,6 +745,18 @@ public: addDouble(ARMRegisters::SD0, dest); } + void divDouble(FPRegisterID src, FPRegisterID dest) + { + m_assembler.fdivd_r(dest, dest, src); + } + + void divDouble(Address src, FPRegisterID dest) + { + ASSERT_NOT_REACHED(); // Untested + loadDouble(src, ARMRegisters::SD0); + divDouble(ARMRegisters::SD0, dest); + } + void subDouble(FPRegisterID src, FPRegisterID dest) { m_assembler.fsubd_r(dest, dest, src); @@ -709,11 +785,30 @@ public: m_assembler.fsitod_r(dest, dest); } + void convertInt32ToDouble(Address src, FPRegisterID dest) + { + ASSERT_NOT_REACHED(); // Untested + // flds does not worth the effort here + load32(src, ARMRegisters::S1); + convertInt32ToDouble(ARMRegisters::S1, dest); + } + + void convertInt32ToDouble(AbsoluteAddress src, FPRegisterID dest) + { + ASSERT_NOT_REACHED(); // Untested + // flds does not worth the effort here + m_assembler.ldr_un_imm(ARMRegisters::S1, (ARMWord)src.m_ptr); + m_assembler.dtr_u(true, ARMRegisters::S1, ARMRegisters::S1, 0); + convertInt32ToDouble(ARMRegisters::S1, dest); + } + Jump branchDouble(DoubleCondition cond, FPRegisterID left, FPRegisterID right) { m_assembler.fcmpd_r(left, right); m_assembler.fmstat(); - return Jump(m_assembler.jmp(static_cast(cond))); + if (cond & DoubleConditionBitSpecial) + m_assembler.cmp_r(ARMRegisters::S0, ARMRegisters::S0, ARMAssembler::VS); + return Jump(m_assembler.jmp(static_cast(cond & ~DoubleConditionMask))); } // Truncates 'src' to an integer, and places the resulting 'dest'. @@ -728,6 +823,29 @@ public: return jump(); } + // Convert 'src' to an integer, and places the resulting 'dest'. + // If the result is not representable as a 32 bit value, branch. + // May also branch for some values that are representable in 32 bits + // (specifically, in this case, 0). + void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp) + { + m_assembler.ftosid_r(ARMRegisters::SD0, src); + m_assembler.fmrs_r(dest, ARMRegisters::SD0); + + // Convert the integer result back to float & compare to the original value - if not equal or unordered (NaN) then jump. + m_assembler.fsitod_r(ARMRegisters::SD0, ARMRegisters::SD0); + failureCases.append(branchDouble(DoubleNotEqualOrUnordered, src, ARMRegisters::SD0)); + + // If the result is zero, it might have been -0.0, and 0.0 equals to -0.0 + failureCases.append(branchTest32(Zero, dest)); + } + + void zeroDouble(FPRegisterID srcDest) + { + m_assembler.mov_r(ARMRegisters::S0, ARMAssembler::getOp2(0)); + convertInt32ToDouble(ARMRegisters::S0, srcDest); + } + protected: ARMAssembler::Condition ARMCondition(Condition cond) { @@ -746,11 +864,9 @@ protected: void prepareCall() { - ensureSpace(3 * sizeof(ARMWord), sizeof(ARMWord)); + ensureSpace(2 * sizeof(ARMWord), sizeof(ARMWord)); - // S0 might be used for parameter passing - m_assembler.add_r(ARMRegisters::S1, ARMRegisters::pc, ARMAssembler::OP2_IMM | 0x4); - m_assembler.push_r(ARMRegisters::S1); + m_assembler.mov_r(linkRegister, ARMRegisters::pc); } void call32(RegisterID base, int32_t offset) @@ -812,6 +928,6 @@ private: } -#endif // ENABLE(ASSEMBLER) && PLATFORM(ARM_TRADITIONAL) +#endif // ENABLE(ASSEMBLER) && CPU(ARM_TRADITIONAL) #endif // MacroAssemblerARM_h diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h index a549604..532a9cf 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARMv7.h @@ -93,13 +93,21 @@ public: Zero = ARMv7Assembler::ConditionEQ, NonZero = ARMv7Assembler::ConditionNE }; - enum DoubleCondition { + // These conditions will only evaluate to true if the comparison is ordered - i.e. neither operand is NaN. DoubleEqual = ARMv7Assembler::ConditionEQ, + DoubleNotEqual = ARMv7Assembler::ConditionVC, // Not the right flag! check for this & handle differently. DoubleGreaterThan = ARMv7Assembler::ConditionGT, DoubleGreaterThanOrEqual = ARMv7Assembler::ConditionGE, DoubleLessThan = ARMv7Assembler::ConditionLO, DoubleLessThanOrEqual = ARMv7Assembler::ConditionLS, + // If either operand is NaN, these conditions always evaluate to true. + DoubleEqualOrUnordered = ARMv7Assembler::ConditionVS, // Not the right flag! check for this & handle differently. + DoubleNotEqualOrUnordered = ARMv7Assembler::ConditionNE, + DoubleGreaterThanOrUnordered = ARMv7Assembler::ConditionHI, + DoubleGreaterThanOrEqualOrUnordered = ARMv7Assembler::ConditionHS, + DoubleLessThanOrUnordered = ARMv7Assembler::ConditionLT, + DoubleLessThanOrEqualOrUnordered = ARMv7Assembler::ConditionLE, }; static const RegisterID stackPointerRegister = ARMRegisters::sp; @@ -189,14 +197,19 @@ public: } } - void lshift32(Imm32 imm, RegisterID dest) + void lshift32(RegisterID shift_amount, RegisterID dest) { - m_assembler.lsl(dest, dest, imm.m_value); + // 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.lsl(dest, dest, dataTempRegister); } - void lshift32(RegisterID shift_amount, RegisterID dest) + void lshift32(Imm32 imm, RegisterID dest) { - m_assembler.lsl(dest, dest, shift_amount); + m_assembler.lsl(dest, dest, imm.m_value & 0x1f); } void mul32(RegisterID src, RegisterID dest) @@ -233,12 +246,17 @@ public: void rshift32(RegisterID shift_amount, RegisterID dest) { - m_assembler.asr(dest, dest, shift_amount); + // 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.asr(dest, dest, dataTempRegister); } void rshift32(Imm32 imm, RegisterID dest) { - m_assembler.asr(dest, dest, imm.m_value); + m_assembler.asr(dest, dest, imm.m_value & 0x1f); } void sub32(RegisterID src, RegisterID dest) @@ -531,6 +549,23 @@ public: { m_assembler.vcmp_F64(left, right); m_assembler.vmrs_APSR_nzcv_FPSCR(); + + if (cond == DoubleNotEqual) { + // ConditionNE jumps if NotEqual *or* unordered - force the unordered cases not to jump. + Jump unordered = makeBranch(ARMv7Assembler::ConditionVS); + Jump result = makeBranch(ARMv7Assembler::ConditionNE); + unordered.link(this); + return result; + } + if (cond == DoubleEqualOrUnordered) { + Jump unordered = makeBranch(ARMv7Assembler::ConditionVS); + Jump notEqual = makeBranch(ARMv7Assembler::ConditionNE); + unordered.link(this); + // We get here if either unordered, or equal. + Jump result = makeJump(); + notEqual.link(this); + return result; + } return makeBranch(cond); } @@ -990,13 +1025,15 @@ public: protected: ARMv7Assembler::JmpSrc makeJump() { - return m_assembler.b(); + moveFixedWidthEncoding(Imm32(0), dataTempRegister); + return m_assembler.bx(dataTempRegister); } ARMv7Assembler::JmpSrc makeBranch(ARMv7Assembler::Condition cond) { - m_assembler.it(cond); - return m_assembler.b(); + m_assembler.it(cond, true, true); + moveFixedWidthEncoding(Imm32(0), dataTempRegister); + return m_assembler.bx(dataTempRegister); } ARMv7Assembler::JmpSrc makeBranch(Condition cond) { return makeBranch(armV7Condition(cond)); } ARMv7Assembler::JmpSrc makeBranch(DoubleCondition cond) { return makeBranch(armV7Condition(cond)); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerCodeRef.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerCodeRef.h index 568260a..cae8bf6 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerCodeRef.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerCodeRef.h @@ -37,7 +37,7 @@ // ASSERT_VALID_CODE_POINTER checks that ptr is a non-null pointer, and that it is a valid // instruction address on the platform (for example, check any alignment requirements). -#if PLATFORM(ARM_THUMB2) +#if CPU(ARM_THUMB2) // ARM/thumb instructions must be 16-bit aligned, but all code pointers to be loaded // into the processor are decorated with the bottom bit set, indicating that this is // thumb code (as oposed to 32-bit traditional ARM). The first test checks for both @@ -69,7 +69,13 @@ public: template explicit FunctionPtr(FunctionType* value) +#if COMPILER(RVCT) + // RVTC compiler needs C-style cast as it fails with the following error + // Error: #694: reinterpret_cast cannot cast away const or other type qualifiers + : m_value((void*)(value)) +#else : m_value(reinterpret_cast(value)) +#endif { ASSERT_VALID_CODE_POINTER(m_value); } @@ -124,7 +130,7 @@ public: } explicit MacroAssemblerCodePtr(void* value) -#if PLATFORM(ARM_THUMB2) +#if CPU(ARM_THUMB2) // Decorate the pointer as a thumb code pointer. : m_value(reinterpret_cast(value) + 1) #else @@ -141,7 +147,7 @@ public: } void* executableAddress() const { return m_value; } -#if PLATFORM(ARM_THUMB2) +#if CPU(ARM_THUMB2) // To use this pointer as a data address remove the decoration. void* dataLocation() const { ASSERT_VALID_CODE_POINTER(m_value); return reinterpret_cast(m_value) - 1; } #else diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86.h index 6e96240..ca7c31a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86.h @@ -28,7 +28,7 @@ #include -#if ENABLE(ASSEMBLER) && PLATFORM(X86) +#if ENABLE(ASSEMBLER) && CPU(X86) #include "MacroAssemblerX86Common.h" diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h index 5ebefa7..449df86 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86Common.h @@ -36,6 +36,10 @@ namespace JSC { class MacroAssemblerX86Common : public AbstractMacroAssembler { + static const int DoubleConditionBitInvert = 0x10; + static const int DoubleConditionBitSpecial = 0x20; + static const int DoubleConditionBits = DoubleConditionBitInvert | DoubleConditionBitSpecial; + public: enum Condition { @@ -56,13 +60,24 @@ public: }; enum DoubleCondition { - DoubleEqual = X86Assembler::ConditionE, + // These conditions will only evaluate to true if the comparison is ordered - i.e. neither operand is NaN. + DoubleEqual = X86Assembler::ConditionE | DoubleConditionBitSpecial, DoubleNotEqual = X86Assembler::ConditionNE, DoubleGreaterThan = X86Assembler::ConditionA, DoubleGreaterThanOrEqual = X86Assembler::ConditionAE, - DoubleLessThan = X86Assembler::ConditionB, - DoubleLessThanOrEqual = X86Assembler::ConditionBE, + DoubleLessThan = X86Assembler::ConditionA | DoubleConditionBitInvert, + DoubleLessThanOrEqual = X86Assembler::ConditionAE | DoubleConditionBitInvert, + // If either operand is NaN, these conditions always evaluate to true. + DoubleEqualOrUnordered = X86Assembler::ConditionE, + DoubleNotEqualOrUnordered = X86Assembler::ConditionNE | DoubleConditionBitSpecial, + DoubleGreaterThanOrUnordered = X86Assembler::ConditionB | DoubleConditionBitInvert, + DoubleGreaterThanOrEqualOrUnordered = X86Assembler::ConditionBE | DoubleConditionBitInvert, + DoubleLessThanOrUnordered = X86Assembler::ConditionB, + DoubleLessThanOrEqualOrUnordered = X86Assembler::ConditionBE, }; + COMPILE_ASSERT( + !((X86Assembler::ConditionE | X86Assembler::ConditionNE | X86Assembler::ConditionA | X86Assembler::ConditionAE | X86Assembler::ConditionB | X86Assembler::ConditionBE) & DoubleConditionBits), + DoubleConditionBits_should_not_interfere_with_X86Assembler_Condition_codes); static const RegisterID stackPointerRegister = X86Registers::esp; @@ -416,20 +431,35 @@ public: void convertInt32ToDouble(Address src, FPRegisterID dest) { + ASSERT(isSSE2Present()); m_assembler.cvtsi2sd_mr(src.offset, src.base, dest); } Jump branchDouble(DoubleCondition cond, FPRegisterID left, FPRegisterID right) { ASSERT(isSSE2Present()); - m_assembler.ucomisd_rr(right, left); - return Jump(m_assembler.jCC(x86Condition(cond))); - } - Jump branchDouble(DoubleCondition cond, FPRegisterID left, Address right) - { - m_assembler.ucomisd_mr(right.offset, right.base, left); - return Jump(m_assembler.jCC(x86Condition(cond))); + if (cond & DoubleConditionBitInvert) + m_assembler.ucomisd_rr(left, right); + else + m_assembler.ucomisd_rr(right, left); + + if (cond == DoubleEqual) { + Jump isUnordered(m_assembler.jp()); + Jump result = Jump(m_assembler.je()); + isUnordered.link(this); + return result; + } else if (cond == DoubleNotEqualOrUnordered) { + Jump isUnordered(m_assembler.jp()); + Jump isEqual(m_assembler.je()); + isUnordered.link(this); + Jump result = jump(); + isEqual.link(this); + return result; + } + + ASSERT(!(cond & DoubleConditionBitSpecial)); + return Jump(m_assembler.jCC(static_cast(cond & ~DoubleConditionBits))); } // Truncates 'src' to an integer, and places the resulting 'dest'. @@ -443,6 +473,25 @@ public: return branch32(Equal, dest, Imm32(0x80000000)); } + // Convert 'src' to an integer, and places the resulting 'dest'. + // If the result is not representable as a 32 bit value, branch. + // May also branch for some values that are representable in 32 bits + // (specifically, in this case, 0). + void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp) + { + ASSERT(isSSE2Present()); + m_assembler.cvttsd2si_rr(src, dest); + + // If the result is zero, it might have been -0.0, and the double comparison won't catch this! + failureCases.append(branchTest32(Zero, dest)); + + // Convert the integer result back to float & compare to the original value - if not equal or unordered (NaN) then jump. + convertInt32ToDouble(dest, fpTemp); + m_assembler.ucomisd_rr(fpTemp, src); + failureCases.append(m_assembler.jp()); + failureCases.append(m_assembler.jne()); + } + void zeroDouble(FPRegisterID srcDest) { ASSERT(isSSE2Present()); @@ -493,7 +542,7 @@ public: m_assembler.movl_i32r(imm.m_value, dest); } -#if PLATFORM(X86_64) +#if CPU(X86_64) void move(RegisterID src, RegisterID dest) { // Note: on 64-bit this is is a full register move; perhaps it would be @@ -509,7 +558,8 @@ public: void swap(RegisterID reg1, RegisterID reg2) { - m_assembler.xchgq_rr(reg1, reg2); + if (reg1 != reg2) + m_assembler.xchgq_rr(reg1, reg2); } void signExtend32ToPtr(RegisterID src, RegisterID dest) @@ -889,18 +939,13 @@ protected: return static_cast(cond); } - X86Assembler::Condition x86Condition(DoubleCondition cond) - { - return static_cast(cond); - } - private: // Only MacroAssemblerX86 should be using the following method; SSE2 is always available on // x86_64, and clients & subclasses of MacroAssembler should be using 'supportsFloatingPoint()'. friend class MacroAssemblerX86; -#if PLATFORM(X86) -#if PLATFORM(MAC) +#if CPU(X86) +#if OS(MAC_OS_X) // All X86 Macs are guaranteed to support at least SSE2, static bool isSSE2Present() @@ -908,7 +953,7 @@ private: return true; } -#else // PLATFORM(MAC) +#else // OS(MAC_OS_X) enum SSE2CheckState { NotCheckedSSE2, @@ -951,8 +996,8 @@ private: static SSE2CheckState s_sse2CheckState; -#endif // PLATFORM(MAC) -#elif !defined(NDEBUG) // PLATFORM(X86) +#endif // OS(MAC_OS_X) +#elif !defined(NDEBUG) // CPU(X86) // On x86-64 we should never be checking for SSE2 in a non-debug build, // but non debug add this method to keep the asserts above happy. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86_64.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86_64.h index 0f95fe6..ec93f8c 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86_64.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86_64.h @@ -28,7 +28,7 @@ #include -#if ENABLE(ASSEMBLER) && PLATFORM(X86_64) +#if ENABLE(ASSEMBLER) && CPU(X86_64) #include "MacroAssemblerX86Common.h" @@ -192,33 +192,6 @@ public: m_assembler.orq_ir(imm.m_value, dest); } - void rshiftPtr(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 "shll %eax, %eax" -> "xchgl %eax, %ecx; shll %ecx, %ecx; xchgl %eax, %ecx" - if (dest == shift_amount) - m_assembler.sarq_CLr(X86Registers::ecx); - // E.g. transform "shll %eax, %ecx" -> "xchgl %eax, %ecx; shll %ecx, %eax; xchgl %eax, %ecx" - else if (dest == X86Registers::ecx) - m_assembler.sarq_CLr(shift_amount); - // E.g. transform "shll %eax, %ebx" -> "xchgl %eax, %ecx; shll %ecx, %ebx; xchgl %eax, %ecx" - else - m_assembler.sarq_CLr(dest); - - swap(shift_amount, X86Registers::ecx); - } else - m_assembler.sarq_CLr(dest); - } - - void rshiftPtr(Imm32 imm, RegisterID dest) - { - m_assembler.sarq_i8r(imm.m_value, dest); - } - void subPtr(RegisterID src, RegisterID dest) { m_assembler.subq_rr(src, dest); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/X86Assembler.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/X86Assembler.h index cbbaaa5..ab3d05f 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/X86Assembler.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/X86Assembler.h @@ -28,7 +28,7 @@ #include -#if ENABLE(ASSEMBLER) && (PLATFORM(X86) || PLATFORM(X86_64)) +#if ENABLE(ASSEMBLER) && (CPU(X86) || CPU(X86_64)) #include "AssemblerBuffer.h" #include @@ -50,7 +50,7 @@ namespace X86Registers { esi, edi, -#if PLATFORM(X86_64) +#if CPU(X86_64) r8, r9, r10, @@ -118,12 +118,12 @@ private: OP_XOR_GvEv = 0x33, OP_CMP_EvGv = 0x39, OP_CMP_GvEv = 0x3B, -#if PLATFORM(X86_64) +#if CPU(X86_64) PRE_REX = 0x40, #endif OP_PUSH_EAX = 0x50, OP_POP_EAX = 0x58, -#if PLATFORM(X86_64) +#if CPU(X86_64) OP_MOVSXD_GvEv = 0x63, #endif PRE_OPERAND_SIZE = 0x66, @@ -296,7 +296,7 @@ public: // Arithmetic operations: -#if !PLATFORM(X86_64) +#if !CPU(X86_64) void adcl_im(int imm, void* addr) { if (CAN_SIGN_EXTEND_8_32(imm)) { @@ -346,7 +346,7 @@ public: } } -#if PLATFORM(X86_64) +#if CPU(X86_64) void addq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_ADD_EvGv, src, dst); @@ -423,7 +423,7 @@ public: } } -#if PLATFORM(X86_64) +#if CPU(X86_64) void andq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_AND_EvGv, src, dst); @@ -509,7 +509,7 @@ public: } } -#if PLATFORM(X86_64) +#if CPU(X86_64) void orq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_OR_EvGv, src, dst); @@ -575,7 +575,7 @@ public: } } -#if PLATFORM(X86_64) +#if CPU(X86_64) void subq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_SUB_EvGv, src, dst); @@ -641,7 +641,7 @@ public: } } -#if PLATFORM(X86_64) +#if CPU(X86_64) void xorq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_XOR_EvGv, src, dst); @@ -689,7 +689,7 @@ public: m_formatter.oneByteOp(OP_GROUP2_EvCL, GROUP2_OP_SHL, dst); } -#if PLATFORM(X86_64) +#if CPU(X86_64) void sarq_CLr(RegisterID dst) { m_formatter.oneByteOp64(OP_GROUP2_EvCL, GROUP2_OP_SAR, dst); @@ -789,7 +789,7 @@ public: m_formatter.immediate32(imm); } -#if PLATFORM(X86_64) +#if CPU(X86_64) void cmpq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_CMP_EvGv, src, dst); @@ -897,7 +897,7 @@ public: m_formatter.immediate32(imm); } -#if PLATFORM(X86_64) +#if CPU(X86_64) void testq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_TEST_EvGv, src, dst); @@ -971,7 +971,7 @@ public: m_formatter.oneByteOp(OP_XCHG_EvGv, src, dst); } -#if PLATFORM(X86_64) +#if CPU(X86_64) void xchgq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_XCHG_EvGv, src, dst); @@ -1001,7 +1001,7 @@ public: void movl_mEAX(void* addr) { m_formatter.oneByteOp(OP_MOV_EAXOv); -#if PLATFORM(X86_64) +#if CPU(X86_64) m_formatter.immediate64(reinterpret_cast(addr)); #else m_formatter.immediate32(reinterpret_cast(addr)); @@ -1038,14 +1038,14 @@ public: void movl_EAXm(void* addr) { m_formatter.oneByteOp(OP_MOV_OvEAX); -#if PLATFORM(X86_64) +#if CPU(X86_64) m_formatter.immediate64(reinterpret_cast(addr)); #else m_formatter.immediate32(reinterpret_cast(addr)); #endif } -#if PLATFORM(X86_64) +#if CPU(X86_64) void movq_rr(RegisterID src, RegisterID dst) { m_formatter.oneByteOp64(OP_MOV_EvGv, src, dst); @@ -1157,7 +1157,7 @@ public: { m_formatter.oneByteOp(OP_LEA, dst, base, offset); } -#if PLATFORM(X86_64) +#if CPU(X86_64) void leaq_mr(int offset, RegisterID base, RegisterID dst) { m_formatter.oneByteOp64(OP_LEA, dst, base, offset); @@ -1323,7 +1323,7 @@ public: m_formatter.twoByteOp(OP2_CVTSI2SD_VsdEd, (RegisterID)dst, base, offset); } -#if !PLATFORM(X86_64) +#if !CPU(X86_64) void cvtsi2sd_mr(void* address, XMMRegisterID dst) { m_formatter.prefix(PRE_SSE_F2); @@ -1343,7 +1343,7 @@ public: m_formatter.twoByteOp(OP2_MOVD_EdVd, (RegisterID)src, dst); } -#if PLATFORM(X86_64) +#if CPU(X86_64) void movq_rr(XMMRegisterID src, RegisterID dst) { m_formatter.prefix(PRE_SSE_66); @@ -1369,7 +1369,7 @@ public: m_formatter.twoByteOp(OP2_MOVSD_VsdWsd, (RegisterID)dst, base, offset); } -#if !PLATFORM(X86_64) +#if !CPU(X86_64) void movsd_mr(void* address, XMMRegisterID dst) { m_formatter.prefix(PRE_SSE_F2); @@ -1535,7 +1535,7 @@ public: static void repatchLoadPtrToLEA(void* where) { -#if PLATFORM(X86_64) +#if CPU(X86_64) // On x86-64 pointer memory accesses require a 64-bit operand, and as such a REX prefix. // Skip over the prefix byte. where = reinterpret_cast(where) + 1; @@ -1679,7 +1679,7 @@ private: memoryModRM(reg, base, index, scale, offset); } -#if !PLATFORM(X86_64) +#if !CPU(X86_64) void oneByteOp(OneByteOpcodeID opcode, int reg, void* address) { m_buffer.ensureSpace(maxInstructionSize); @@ -1722,7 +1722,7 @@ private: memoryModRM(reg, base, index, scale, offset); } -#if !PLATFORM(X86_64) +#if !CPU(X86_64) void twoByteOp(TwoByteOpcodeID opcode, int reg, void* address) { m_buffer.ensureSpace(maxInstructionSize); @@ -1732,7 +1732,7 @@ private: } #endif -#if PLATFORM(X86_64) +#if CPU(X86_64) // Quad-word-sized operands: // // Used to format 64-bit operantions, planting a REX.w prefix. @@ -1891,7 +1891,7 @@ private: static const RegisterID noBase = X86Registers::ebp; static const RegisterID hasSib = X86Registers::esp; static const RegisterID noIndex = X86Registers::esp; -#if PLATFORM(X86_64) +#if CPU(X86_64) static const RegisterID noBase2 = X86Registers::r13; static const RegisterID hasSib2 = X86Registers::r12; @@ -1967,7 +1967,7 @@ private: void memoryModRM(int reg, RegisterID base, int offset) { // A base of esp or r12 would be interpreted as a sib, so force a sib with no index & put the base in there. -#if PLATFORM(X86_64) +#if CPU(X86_64) if ((base == hasSib) || (base == hasSib2)) { #else if (base == hasSib) { @@ -1982,7 +1982,7 @@ private: m_buffer.putIntUnchecked(offset); } } else { -#if PLATFORM(X86_64) +#if CPU(X86_64) if (!offset && (base != noBase) && (base != noBase2)) #else if (!offset && (base != noBase)) @@ -2001,7 +2001,7 @@ private: void memoryModRM_disp32(int reg, RegisterID base, int offset) { // A base of esp or r12 would be interpreted as a sib, so force a sib with no index & put the base in there. -#if PLATFORM(X86_64) +#if CPU(X86_64) if ((base == hasSib) || (base == hasSib2)) { #else if (base == hasSib) { @@ -2018,7 +2018,7 @@ private: { ASSERT(index != noIndex); -#if PLATFORM(X86_64) +#if CPU(X86_64) if (!offset && (base != noBase) && (base != noBase2)) #else if (!offset && (base != noBase)) @@ -2033,7 +2033,7 @@ private: } } -#if !PLATFORM(X86_64) +#if !CPU(X86_64) void memoryModRM(int reg, void* address) { // noBase + ModRmMemoryNoDisp means noBase + ModRmMemoryDisp32! @@ -2048,6 +2048,6 @@ private: } // namespace JSC -#endif // ENABLE(ASSEMBLER) && PLATFORM(X86) +#endif // ENABLE(ASSEMBLER) && CPU(X86) #endif // X86Assembler_h diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.cpp index 7e5f6cf..2256583 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.cpp @@ -51,7 +51,7 @@ static UString escapeQuotes(const UString& str) UString result = str; int pos = 0; while ((pos = result.find('\"', pos)) >= 0) { - result = result.substr(0, pos) + "\"\\\"\"" + result.substr(pos + 1); + result = makeString(result.substr(0, pos), "\"\\\"\"", result.substr(pos + 1)); pos += 4; } return result; @@ -62,49 +62,50 @@ static UString valueToSourceString(ExecState* exec, JSValue val) if (!val) return "0"; - if (val.isString()) { - UString result("\""); - result += escapeQuotes(val.toString(exec)) + "\""; - return result; - } + if (val.isString()) + return makeString("\"", escapeQuotes(val.toString(exec)), "\""); return val.toString(exec); } -static CString registerName(int r) +static CString constantName(ExecState* exec, int k, JSValue value) { - if (r == missingThisObjectMarker()) - return ""; - - return (UString("r") + UString::from(r)).UTF8String(); + return makeString(valueToSourceString(exec, value), "(@k", UString::from(k - FirstConstantRegisterIndex), ")").UTF8String(); } -static CString constantName(ExecState* exec, int k, JSValue value) +static CString idName(int id0, const Identifier& ident) { - return (valueToSourceString(exec, value) + "(@k" + UString::from(k) + ")").UTF8String(); + return makeString(ident.ustring(), "(@id", UString::from(id0), ")").UTF8String(); } -static CString idName(int id0, const Identifier& ident) +CString CodeBlock::registerName(ExecState* exec, int r) const { - return (ident.ustring() + "(@id" + UString::from(id0) +")").UTF8String(); + if (r == missingThisObjectMarker()) + return ""; + + if (isConstantRegisterIndex(r)) + return constantName(exec, r, getConstant(r)); + + return makeString("r", UString::from(r)).UTF8String(); } static UString regexpToSourceString(RegExp* regExp) { - UString pattern = UString("/") + regExp->pattern() + "/"; + char postfix[5] = { '/', 0, 0, 0, 0 }; + int index = 1; if (regExp->global()) - pattern += "g"; + postfix[index++] = 'g'; if (regExp->ignoreCase()) - pattern += "i"; + postfix[index++] = 'i'; if (regExp->multiline()) - pattern += "m"; + postfix[index] = 'm'; - return pattern; + return makeString("/", regExp->pattern(), postfix); } static CString regexpName(int re, RegExp* regexp) { - return (regexpToSourceString(regexp) + "(@re" + UString::from(re) + ")").UTF8String(); + return makeString(regexpToSourceString(regexp), "(@re", UString::from(re), ")").UTF8String(); } static UString pointerToSourceString(void* p) @@ -135,49 +136,44 @@ NEVER_INLINE static const char* debugHookName(int debugHookID) return ""; } -static int locationForOffset(const Vector::const_iterator& begin, Vector::const_iterator& it, int offset) -{ - return it - begin + offset; -} - -static void printUnaryOp(int location, Vector::const_iterator& it, const char* op) +void CodeBlock::printUnaryOp(ExecState* exec, int location, Vector::const_iterator& it, const char* op) const { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] %s\t\t %s, %s\n", location, op, registerName(r0).c_str(), registerName(r1).c_str()); + printf("[%4d] %s\t\t %s, %s\n", location, op, registerName(exec, r0).c_str(), registerName(exec, r1).c_str()); } -static void printBinaryOp(int location, Vector::const_iterator& it, const char* op) +void CodeBlock::printBinaryOp(ExecState* exec, int location, Vector::const_iterator& it, const char* op) const { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int r2 = (++it)->u.operand; - printf("[%4d] %s\t\t %s, %s, %s\n", location, op, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str()); + printf("[%4d] %s\t\t %s, %s, %s\n", location, op, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str()); } -static void printConditionalJump(const Vector::const_iterator& begin, Vector::const_iterator& it, int location, const char* op) +void CodeBlock::printConditionalJump(ExecState* exec, const Vector::const_iterator&, Vector::const_iterator& it, int location, const char* op) const { int r0 = (++it)->u.operand; int offset = (++it)->u.operand; - printf("[%4d] %s\t\t %s, %d(->%d)\n", location, op, registerName(r0).c_str(), offset, locationForOffset(begin, it, offset)); + printf("[%4d] %s\t\t %s, %d(->%d)\n", location, op, registerName(exec, r0).c_str(), offset, location + offset); } -static void printGetByIdOp(int location, Vector::const_iterator& it, const Vector& m_identifiers, const char* op) +void CodeBlock::printGetByIdOp(ExecState* exec, int location, Vector::const_iterator& it, const char* op) const { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int id0 = (++it)->u.operand; - printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, m_identifiers[id0]).c_str()); + printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), idName(id0, m_identifiers[id0]).c_str()); it += 4; } -static void printPutByIdOp(int location, Vector::const_iterator& it, const Vector& m_identifiers, const char* op) +void CodeBlock::printPutByIdOp(ExecState* exec, int location, Vector::const_iterator& it, const char* op) const { int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(r1).c_str()); + printf("[%4d] %s\t %s, %s, %s\n", location, op, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(exec, r1).c_str()); it += 4; } @@ -362,7 +358,7 @@ void CodeBlock::dump(ExecState* exec) const unsigned registerIndex = m_numVars; size_t i = 0; do { - printf(" r%u = %s\n", registerIndex, valueToSourceString(exec, m_constantRegisters[i].jsValue()).ascii()); + printf(" k%u = %s\n", registerIndex, valueToSourceString(exec, m_constantRegisters[i].jsValue()).ascii()); ++i; ++registerIndex; } while (i < m_constantRegisters.size()); @@ -486,7 +482,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& } case op_enter_with_activation: { int r0 = (++it)->u.operand; - printf("[%4d] enter_with_activation %s\n", location, registerName(r0).c_str()); + printf("[%4d] enter_with_activation %s\n", location, registerName(exec, r0).c_str()); break; } case op_create_arguments: { @@ -499,148 +495,148 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& } case op_convert_this: { int r0 = (++it)->u.operand; - printf("[%4d] convert_this %s\n", location, registerName(r0).c_str()); + printf("[%4d] convert_this %s\n", location, registerName(exec, r0).c_str()); break; } case op_new_object: { int r0 = (++it)->u.operand; - printf("[%4d] new_object\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] new_object\t %s\n", location, registerName(exec, r0).c_str()); break; } case op_new_array: { int dst = (++it)->u.operand; int argv = (++it)->u.operand; int argc = (++it)->u.operand; - printf("[%4d] new_array\t %s, %s, %d\n", location, registerName(dst).c_str(), registerName(argv).c_str(), argc); + printf("[%4d] new_array\t %s, %s, %d\n", location, registerName(exec, dst).c_str(), registerName(exec, argv).c_str(), argc); break; } case op_new_regexp: { int r0 = (++it)->u.operand; int re0 = (++it)->u.operand; - printf("[%4d] new_regexp\t %s, %s\n", location, registerName(r0).c_str(), regexpName(re0, regexp(re0)).c_str()); + printf("[%4d] new_regexp\t %s, %s\n", location, registerName(exec, r0).c_str(), regexpName(re0, regexp(re0)).c_str()); break; } case op_mov: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] mov\t\t %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str()); + printf("[%4d] mov\t\t %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str()); break; } case op_not: { - printUnaryOp(location, it, "not"); + printUnaryOp(exec, location, it, "not"); break; } case op_eq: { - printBinaryOp(location, it, "eq"); + printBinaryOp(exec, location, it, "eq"); break; } case op_eq_null: { - printUnaryOp(location, it, "eq_null"); + printUnaryOp(exec, location, it, "eq_null"); break; } case op_neq: { - printBinaryOp(location, it, "neq"); + printBinaryOp(exec, location, it, "neq"); break; } case op_neq_null: { - printUnaryOp(location, it, "neq_null"); + printUnaryOp(exec, location, it, "neq_null"); break; } case op_stricteq: { - printBinaryOp(location, it, "stricteq"); + printBinaryOp(exec, location, it, "stricteq"); break; } case op_nstricteq: { - printBinaryOp(location, it, "nstricteq"); + printBinaryOp(exec, location, it, "nstricteq"); break; } case op_less: { - printBinaryOp(location, it, "less"); + printBinaryOp(exec, location, it, "less"); break; } case op_lesseq: { - printBinaryOp(location, it, "lesseq"); + printBinaryOp(exec, location, it, "lesseq"); break; } case op_pre_inc: { int r0 = (++it)->u.operand; - printf("[%4d] pre_inc\t\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] pre_inc\t\t %s\n", location, registerName(exec, r0).c_str()); break; } case op_pre_dec: { int r0 = (++it)->u.operand; - printf("[%4d] pre_dec\t\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] pre_dec\t\t %s\n", location, registerName(exec, r0).c_str()); break; } case op_post_inc: { - printUnaryOp(location, it, "post_inc"); + printUnaryOp(exec, location, it, "post_inc"); break; } case op_post_dec: { - printUnaryOp(location, it, "post_dec"); + printUnaryOp(exec, location, it, "post_dec"); break; } case op_to_jsnumber: { - printUnaryOp(location, it, "to_jsnumber"); + printUnaryOp(exec, location, it, "to_jsnumber"); break; } case op_negate: { - printUnaryOp(location, it, "negate"); + printUnaryOp(exec, location, it, "negate"); break; } case op_add: { - printBinaryOp(location, it, "add"); + printBinaryOp(exec, location, it, "add"); ++it; break; } case op_mul: { - printBinaryOp(location, it, "mul"); + printBinaryOp(exec, location, it, "mul"); ++it; break; } case op_div: { - printBinaryOp(location, it, "div"); + printBinaryOp(exec, location, it, "div"); ++it; break; } case op_mod: { - printBinaryOp(location, it, "mod"); + printBinaryOp(exec, location, it, "mod"); break; } case op_sub: { - printBinaryOp(location, it, "sub"); + printBinaryOp(exec, location, it, "sub"); ++it; break; } case op_lshift: { - printBinaryOp(location, it, "lshift"); + printBinaryOp(exec, location, it, "lshift"); break; } case op_rshift: { - printBinaryOp(location, it, "rshift"); + printBinaryOp(exec, location, it, "rshift"); break; } case op_urshift: { - printBinaryOp(location, it, "urshift"); + printBinaryOp(exec, location, it, "urshift"); break; } case op_bitand: { - printBinaryOp(location, it, "bitand"); + printBinaryOp(exec, location, it, "bitand"); ++it; break; } case op_bitxor: { - printBinaryOp(location, it, "bitxor"); + printBinaryOp(exec, location, it, "bitxor"); ++it; break; } case op_bitor: { - printBinaryOp(location, it, "bitor"); + printBinaryOp(exec, location, it, "bitor"); ++it; break; } case op_bitnot: { - printUnaryOp(location, it, "bitnot"); + printUnaryOp(exec, location, it, "bitnot"); break; } case op_instanceof: { @@ -648,59 +644,59 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r1 = (++it)->u.operand; int r2 = (++it)->u.operand; int r3 = (++it)->u.operand; - printf("[%4d] instanceof\t\t %s, %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str(), registerName(r3).c_str()); + printf("[%4d] instanceof\t\t %s, %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str(), registerName(exec, r3).c_str()); break; } case op_typeof: { - printUnaryOp(location, it, "typeof"); + printUnaryOp(exec, location, it, "typeof"); break; } case op_is_undefined: { - printUnaryOp(location, it, "is_undefined"); + printUnaryOp(exec, location, it, "is_undefined"); break; } case op_is_boolean: { - printUnaryOp(location, it, "is_boolean"); + printUnaryOp(exec, location, it, "is_boolean"); break; } case op_is_number: { - printUnaryOp(location, it, "is_number"); + printUnaryOp(exec, location, it, "is_number"); break; } case op_is_string: { - printUnaryOp(location, it, "is_string"); + printUnaryOp(exec, location, it, "is_string"); break; } case op_is_object: { - printUnaryOp(location, it, "is_object"); + printUnaryOp(exec, location, it, "is_object"); break; } case op_is_function: { - printUnaryOp(location, it, "is_function"); + printUnaryOp(exec, location, it, "is_function"); break; } case op_in: { - printBinaryOp(location, it, "in"); + printBinaryOp(exec, location, it, "in"); break; } case op_resolve: { int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; - printf("[%4d] resolve\t\t %s, %s\n", location, registerName(r0).c_str(), idName(id0, m_identifiers[id0]).c_str()); + printf("[%4d] resolve\t\t %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str()); break; } case op_resolve_skip: { int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; int skipLevels = (++it)->u.operand; - printf("[%4d] resolve_skip\t %s, %s, %d\n", location, registerName(r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), skipLevels); + printf("[%4d] resolve_skip\t %s, %s, %d\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), skipLevels); break; } case op_resolve_global: { int r0 = (++it)->u.operand; JSValue scope = JSValue((++it)->u.jsCell); int id0 = (++it)->u.operand; - printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(r0).c_str(), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0]).c_str()); + printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0]).c_str()); it += 2; break; } @@ -708,244 +704,265 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r0 = (++it)->u.operand; int index = (++it)->u.operand; int skipLevels = (++it)->u.operand; - printf("[%4d] get_scoped_var\t %s, %d, %d\n", location, registerName(r0).c_str(), index, skipLevels); + printf("[%4d] get_scoped_var\t %s, %d, %d\n", location, registerName(exec, r0).c_str(), index, skipLevels); break; } case op_put_scoped_var: { int index = (++it)->u.operand; int skipLevels = (++it)->u.operand; int r0 = (++it)->u.operand; - printf("[%4d] put_scoped_var\t %d, %d, %s\n", location, index, skipLevels, registerName(r0).c_str()); + printf("[%4d] put_scoped_var\t %d, %d, %s\n", location, index, skipLevels, registerName(exec, r0).c_str()); break; } case op_get_global_var: { int r0 = (++it)->u.operand; JSValue scope = JSValue((++it)->u.jsCell); int index = (++it)->u.operand; - printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(r0).c_str(), valueToSourceString(exec, scope).ascii(), index); + printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(exec, r0).c_str(), valueToSourceString(exec, scope).ascii(), index); break; } case op_put_global_var: { JSValue scope = JSValue((++it)->u.jsCell); int index = (++it)->u.operand; int r0 = (++it)->u.operand; - printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).ascii(), index, registerName(r0).c_str()); + printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).ascii(), index, registerName(exec, r0).c_str()); break; } case op_resolve_base: { int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; - printf("[%4d] resolve_base\t %s, %s\n", location, registerName(r0).c_str(), idName(id0, m_identifiers[id0]).c_str()); + printf("[%4d] resolve_base\t %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str()); break; } case op_resolve_with_base: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int id0 = (++it)->u.operand; - printf("[%4d] resolve_with_base %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, m_identifiers[id0]).c_str()); + printf("[%4d] resolve_with_base %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), idName(id0, m_identifiers[id0]).c_str()); break; } case op_get_by_id: { - printGetByIdOp(location, it, m_identifiers, "get_by_id"); + printGetByIdOp(exec, location, it, "get_by_id"); break; } case op_get_by_id_self: { - printGetByIdOp(location, it, m_identifiers, "get_by_id_self"); + printGetByIdOp(exec, location, it, "get_by_id_self"); break; } case op_get_by_id_self_list: { - printGetByIdOp(location, it, m_identifiers, "get_by_id_self_list"); + printGetByIdOp(exec, location, it, "get_by_id_self_list"); break; } case op_get_by_id_proto: { - printGetByIdOp(location, it, m_identifiers, "get_by_id_proto"); + printGetByIdOp(exec, location, it, "get_by_id_proto"); break; } case op_get_by_id_proto_list: { - printGetByIdOp(location, it, m_identifiers, "op_get_by_id_proto_list"); + printGetByIdOp(exec, location, it, "op_get_by_id_proto_list"); break; } case op_get_by_id_chain: { - printGetByIdOp(location, it, m_identifiers, "get_by_id_chain"); + printGetByIdOp(exec, location, it, "get_by_id_chain"); break; } case op_get_by_id_generic: { - printGetByIdOp(location, it, m_identifiers, "get_by_id_generic"); + printGetByIdOp(exec, location, it, "get_by_id_generic"); break; } case op_get_array_length: { - printGetByIdOp(location, it, m_identifiers, "get_array_length"); + printGetByIdOp(exec, location, it, "get_array_length"); break; } case op_get_string_length: { - printGetByIdOp(location, it, m_identifiers, "get_string_length"); + printGetByIdOp(exec, location, it, "get_string_length"); break; } case op_put_by_id: { - printPutByIdOp(location, it, m_identifiers, "put_by_id"); + printPutByIdOp(exec, location, it, "put_by_id"); break; } case op_put_by_id_replace: { - printPutByIdOp(location, it, m_identifiers, "put_by_id_replace"); + printPutByIdOp(exec, location, it, "put_by_id_replace"); break; } case op_put_by_id_transition: { - printPutByIdOp(location, it, m_identifiers, "put_by_id_transition"); + printPutByIdOp(exec, location, it, "put_by_id_transition"); break; } case op_put_by_id_generic: { - printPutByIdOp(location, it, m_identifiers, "put_by_id_generic"); + printPutByIdOp(exec, location, it, "put_by_id_generic"); break; } case op_put_getter: { int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] put_getter\t %s, %s, %s\n", location, registerName(r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(r1).c_str()); + printf("[%4d] put_getter\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(exec, r1).c_str()); break; } case op_put_setter: { int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] put_setter\t %s, %s, %s\n", location, registerName(r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(r1).c_str()); + printf("[%4d] put_setter\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(exec, r1).c_str()); break; } case op_method_check: { - printf("[%4d] op_method_check\n", location); + printf("[%4d] method_check\n", location); break; } case op_del_by_id: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int id0 = (++it)->u.operand; - printf("[%4d] del_by_id\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), idName(id0, m_identifiers[id0]).c_str()); + printf("[%4d] del_by_id\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), idName(id0, m_identifiers[id0]).c_str()); break; } case op_get_by_val: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int r2 = (++it)->u.operand; - printf("[%4d] get_by_val\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str()); + printf("[%4d] get_by_val\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str()); + break; + } + case op_get_by_pname: { + int r0 = (++it)->u.operand; + int r1 = (++it)->u.operand; + int r2 = (++it)->u.operand; + int r3 = (++it)->u.operand; + int r4 = (++it)->u.operand; + int r5 = (++it)->u.operand; + printf("[%4d] get_by_pname\t %s, %s, %s, %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str(), registerName(exec, r3).c_str(), registerName(exec, r4).c_str(), registerName(exec, r5).c_str()); break; } case op_put_by_val: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int r2 = (++it)->u.operand; - printf("[%4d] put_by_val\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str()); + printf("[%4d] put_by_val\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str()); break; } case op_del_by_val: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int r2 = (++it)->u.operand; - printf("[%4d] del_by_val\t %s, %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str(), registerName(r2).c_str()); + printf("[%4d] del_by_val\t %s, %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str()); break; } case op_put_by_index: { int r0 = (++it)->u.operand; unsigned n0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] put_by_index\t %s, %u, %s\n", location, registerName(r0).c_str(), n0, registerName(r1).c_str()); + printf("[%4d] put_by_index\t %s, %u, %s\n", location, registerName(exec, r0).c_str(), n0, registerName(exec, r1).c_str()); break; } case op_jmp: { int offset = (++it)->u.operand; - printf("[%4d] jmp\t\t %d(->%d)\n", location, offset, locationForOffset(begin, it, offset)); + printf("[%4d] jmp\t\t %d(->%d)\n", location, offset, location + offset); break; } case op_loop: { int offset = (++it)->u.operand; - printf("[%4d] loop\t\t %d(->%d)\n", location, offset, locationForOffset(begin, it, offset)); + printf("[%4d] loop\t\t %d(->%d)\n", location, offset, location + offset); break; } case op_jtrue: { - printConditionalJump(begin, it, location, "jtrue"); + printConditionalJump(exec, begin, it, location, "jtrue"); break; } case op_loop_if_true: { - printConditionalJump(begin, it, location, "loop_if_true"); + printConditionalJump(exec, begin, it, location, "loop_if_true"); + break; + } + case op_loop_if_false: { + printConditionalJump(exec, begin, it, location, "loop_if_false"); break; } case op_jfalse: { - printConditionalJump(begin, it, location, "jfalse"); + printConditionalJump(exec, begin, it, location, "jfalse"); break; } case op_jeq_null: { - printConditionalJump(begin, it, location, "jeq_null"); + printConditionalJump(exec, begin, it, location, "jeq_null"); break; } case op_jneq_null: { - printConditionalJump(begin, it, location, "jneq_null"); + printConditionalJump(exec, begin, it, location, "jneq_null"); break; } case op_jneq_ptr: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int offset = (++it)->u.operand; - printf("[%4d] jneq_ptr\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, locationForOffset(begin, it, offset)); + printf("[%4d] jneq_ptr\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset); break; } case op_jnless: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int offset = (++it)->u.operand; - printf("[%4d] jnless\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, locationForOffset(begin, it, offset)); + printf("[%4d] jnless\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset); break; } case op_jnlesseq: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int offset = (++it)->u.operand; - printf("[%4d] jnlesseq\t\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, locationForOffset(begin, it, offset)); + printf("[%4d] jnlesseq\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset); break; } case op_loop_if_less: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int offset = (++it)->u.operand; - printf("[%4d] loop_if_less\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, locationForOffset(begin, it, offset)); + printf("[%4d] loop_if_less\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset); + break; + } + case op_jless: { + int r0 = (++it)->u.operand; + int r1 = (++it)->u.operand; + int offset = (++it)->u.operand; + printf("[%4d] jless\t\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset); break; } case op_loop_if_lesseq: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int offset = (++it)->u.operand; - printf("[%4d] loop_if_lesseq\t %s, %s, %d(->%d)\n", location, registerName(r0).c_str(), registerName(r1).c_str(), offset, locationForOffset(begin, it, offset)); + printf("[%4d] loop_if_lesseq\t %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), offset, location + offset); break; } case op_switch_imm: { int tableIndex = (++it)->u.operand; int defaultTarget = (++it)->u.operand; int scrutineeRegister = (++it)->u.operand; - printf("[%4d] switch_imm\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, locationForOffset(begin, it, defaultTarget), registerName(scrutineeRegister).c_str()); + printf("[%4d] switch_imm\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).c_str()); break; } case op_switch_char: { int tableIndex = (++it)->u.operand; int defaultTarget = (++it)->u.operand; int scrutineeRegister = (++it)->u.operand; - printf("[%4d] switch_char\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, locationForOffset(begin, it, defaultTarget), registerName(scrutineeRegister).c_str()); + printf("[%4d] switch_char\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).c_str()); break; } case op_switch_string: { int tableIndex = (++it)->u.operand; int defaultTarget = (++it)->u.operand; int scrutineeRegister = (++it)->u.operand; - printf("[%4d] switch_string\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, locationForOffset(begin, it, defaultTarget), registerName(scrutineeRegister).c_str()); + printf("[%4d] switch_string\t %d, %d(->%d), %s\n", location, tableIndex, defaultTarget, location + defaultTarget, registerName(exec, scrutineeRegister).c_str()); break; } case op_new_func: { int r0 = (++it)->u.operand; int f0 = (++it)->u.operand; - printf("[%4d] new_func\t\t %s, f%d\n", location, registerName(r0).c_str(), f0); + printf("[%4d] new_func\t\t %s, f%d\n", location, registerName(exec, r0).c_str(), f0); break; } case op_new_func_exp: { int r0 = (++it)->u.operand; int f0 = (++it)->u.operand; - printf("[%4d] new_func_exp\t %s, f%d\n", location, registerName(r0).c_str(), f0); + printf("[%4d] new_func_exp\t %s, f%d\n", location, registerName(exec, r0).c_str(), f0); break; } case op_call: { @@ -953,7 +970,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int func = (++it)->u.operand; int argCount = (++it)->u.operand; int registerOffset = (++it)->u.operand; - printf("[%4d] call\t\t %s, %s, %d, %d\n", location, registerName(dst).c_str(), registerName(func).c_str(), argCount, registerOffset); + printf("[%4d] call\t\t %s, %s, %d, %d\n", location, registerName(exec, dst).c_str(), registerName(exec, func).c_str(), argCount, registerOffset); break; } case op_call_eval: { @@ -961,7 +978,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int func = (++it)->u.operand; int argCount = (++it)->u.operand; int registerOffset = (++it)->u.operand; - printf("[%4d] call_eval\t %s, %s, %d, %d\n", location, registerName(dst).c_str(), registerName(func).c_str(), argCount, registerOffset); + printf("[%4d] call_eval\t %s, %s, %d, %d\n", location, registerName(exec, dst).c_str(), registerName(exec, func).c_str(), argCount, registerOffset); break; } case op_call_varargs: { @@ -969,16 +986,16 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int func = (++it)->u.operand; int argCount = (++it)->u.operand; int registerOffset = (++it)->u.operand; - printf("[%4d] call_varargs\t %s, %s, %s, %d\n", location, registerName(dst).c_str(), registerName(func).c_str(), registerName(argCount).c_str(), registerOffset); + printf("[%4d] call_varargs\t %s, %s, %s, %d\n", location, registerName(exec, dst).c_str(), registerName(exec, func).c_str(), registerName(exec, argCount).c_str(), registerOffset); break; } case op_load_varargs: { - printUnaryOp(location, it, "load_varargs"); + printUnaryOp(exec, location, it, "load_varargs"); break; } case op_tear_off_activation: { int r0 = (++it)->u.operand; - printf("[%4d] tear_off_activation\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] tear_off_activation\t %s\n", location, registerName(exec, r0).c_str()); break; } case op_tear_off_arguments: { @@ -987,7 +1004,7 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& } case op_ret: { int r0 = (++it)->u.operand; - printf("[%4d] ret\t\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] ret\t\t %s\n", location, registerName(exec, r0).c_str()); break; } case op_construct: { @@ -997,44 +1014,49 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int registerOffset = (++it)->u.operand; int proto = (++it)->u.operand; int thisRegister = (++it)->u.operand; - printf("[%4d] construct\t %s, %s, %d, %d, %s, %s\n", location, registerName(dst).c_str(), registerName(func).c_str(), argCount, registerOffset, registerName(proto).c_str(), registerName(thisRegister).c_str()); + printf("[%4d] construct\t %s, %s, %d, %d, %s, %s\n", location, registerName(exec, dst).c_str(), registerName(exec, func).c_str(), argCount, registerOffset, registerName(exec, proto).c_str(), registerName(exec, thisRegister).c_str()); break; } case op_construct_verify: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] construct_verify\t %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str()); + printf("[%4d] construct_verify\t %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str()); break; } case op_strcat: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; int count = (++it)->u.operand; - printf("[%4d] op_strcat\t %s, %s, %d\n", location, registerName(r0).c_str(), registerName(r1).c_str(), count); + printf("[%4d] strcat\t\t %s, %s, %d\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), count); break; } case op_to_primitive: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] op_to_primitive\t %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str()); + printf("[%4d] to_primitive\t %s, %s\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str()); break; } case op_get_pnames: { - int r0 = (++it)->u.operand; - int r1 = (++it)->u.operand; - printf("[%4d] get_pnames\t %s, %s\n", location, registerName(r0).c_str(), registerName(r1).c_str()); + int r0 = it[1].u.operand; + int r1 = it[2].u.operand; + int r2 = it[3].u.operand; + int r3 = it[4].u.operand; + int offset = it[5].u.operand; + printf("[%4d] get_pnames\t %s, %s, %s, %s, %d(->%d)\n", location, registerName(exec, r0).c_str(), registerName(exec, r1).c_str(), registerName(exec, r2).c_str(), registerName(exec, r3).c_str(), offset, location + offset); + it += OPCODE_LENGTH(op_get_pnames) - 1; break; } case op_next_pname: { - int dest = (++it)->u.operand; - int iter = (++it)->u.operand; - int offset = (++it)->u.operand; - printf("[%4d] next_pname\t %s, %s, %d(->%d)\n", location, registerName(dest).c_str(), registerName(iter).c_str(), offset, locationForOffset(begin, it, offset)); + int dest = it[1].u.operand; + int iter = it[4].u.operand; + int offset = it[5].u.operand; + printf("[%4d] next_pname\t %s, %s, %d(->%d)\n", location, registerName(exec, dest).c_str(), registerName(exec, iter).c_str(), offset, location + offset); + it += OPCODE_LENGTH(op_next_pname) - 1; break; } case op_push_scope: { int r0 = (++it)->u.operand; - printf("[%4d] push_scope\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] push_scope\t %s\n", location, registerName(exec, r0).c_str()); break; } case op_pop_scope: { @@ -1045,64 +1067,63 @@ void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& int r0 = (++it)->u.operand; int id0 = (++it)->u.operand; int r1 = (++it)->u.operand; - printf("[%4d] push_new_scope \t%s, %s, %s\n", location, registerName(r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(r1).c_str()); + printf("[%4d] push_new_scope \t%s, %s, %s\n", location, registerName(exec, r0).c_str(), idName(id0, m_identifiers[id0]).c_str(), registerName(exec, r1).c_str()); break; } case op_jmp_scopes: { int scopeDelta = (++it)->u.operand; int offset = (++it)->u.operand; - printf("[%4d] jmp_scopes\t^%d, %d(->%d)\n", location, scopeDelta, offset, locationForOffset(begin, it, offset)); + printf("[%4d] jmp_scopes\t^%d, %d(->%d)\n", location, scopeDelta, offset, location + offset); break; } case op_catch: { int r0 = (++it)->u.operand; - printf("[%4d] catch\t\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] catch\t\t %s\n", location, registerName(exec, r0).c_str()); break; } case op_throw: { int r0 = (++it)->u.operand; - printf("[%4d] throw\t\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] throw\t\t %s\n", location, registerName(exec, r0).c_str()); break; } case op_new_error: { int r0 = (++it)->u.operand; int errorType = (++it)->u.operand; int k0 = (++it)->u.operand; - printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(r0).c_str(), errorType, constantName(exec, k0, getConstant(k0)).c_str()); + printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(exec, r0).c_str(), errorType, constantName(exec, k0, getConstant(k0)).c_str()); break; } case op_jsr: { int retAddrDst = (++it)->u.operand; int offset = (++it)->u.operand; - printf("[%4d] jsr\t\t %s, %d(->%d)\n", location, registerName(retAddrDst).c_str(), offset, locationForOffset(begin, it, offset)); + printf("[%4d] jsr\t\t %s, %d(->%d)\n", location, registerName(exec, retAddrDst).c_str(), offset, location + offset); break; } case op_sret: { int retAddrSrc = (++it)->u.operand; - printf("[%4d] sret\t\t %s\n", location, registerName(retAddrSrc).c_str()); + printf("[%4d] sret\t\t %s\n", location, registerName(exec, retAddrSrc).c_str()); break; } case op_debug: { int debugHookID = (++it)->u.operand; int firstLine = (++it)->u.operand; int lastLine = (++it)->u.operand; - int column = (++it)->u.operand; - printf("[%4d] debug\t\t %s, %d, %d, %d\n", location, debugHookName(debugHookID), firstLine, lastLine, column); + printf("[%4d] debug\t\t %s, %d, %d\n", location, debugHookName(debugHookID), firstLine, lastLine); break; } case op_profile_will_call: { int function = (++it)->u.operand; - printf("[%4d] profile_will_call %s\n", location, registerName(function).c_str()); + printf("[%4d] profile_will_call %s\n", location, registerName(exec, function).c_str()); break; } case op_profile_did_call: { int function = (++it)->u.operand; - printf("[%4d] profile_did_call\t %s\n", location, registerName(function).c_str()); + printf("[%4d] profile_did_call\t %s\n", location, registerName(exec, function).c_str()); break; } case op_end: { int r0 = (++it)->u.operand; - printf("[%4d] end\t\t %s\n", location, registerName(r0).c_str()); + printf("[%4d] end\t\t %s\n", location, registerName(exec, r0).c_str()); break; } } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.h index 0163540..eb874cc 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/CodeBlock.h @@ -438,13 +438,13 @@ namespace JSC { size_t numberOfConstantRegisters() const { return m_constantRegisters.size(); } void addConstantRegister(const Register& r) { return m_constantRegisters.append(r); } Register& constantRegister(int index) { return m_constantRegisters[index - FirstConstantRegisterIndex]; } - ALWAYS_INLINE bool isConstantRegisterIndex(int index) { return index >= FirstConstantRegisterIndex; } + ALWAYS_INLINE bool isConstantRegisterIndex(int index) const { return index >= FirstConstantRegisterIndex; } ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].jsValue(); } - unsigned addFunctionDecl(PassRefPtr n) { unsigned size = m_functionDecls.size(); m_functionDecls.append(n); return size; } + unsigned addFunctionDecl(NonNullPassRefPtr n) { unsigned size = m_functionDecls.size(); m_functionDecls.append(n); return size; } FunctionExecutable* functionDecl(int index) { return m_functionDecls[index].get(); } int numberOfFunctionDecls() { return m_functionDecls.size(); } - unsigned addFunctionExpr(PassRefPtr n) { unsigned size = m_functionExprs.size(); m_functionExprs.append(n); return size; } + unsigned addFunctionExpr(NonNullPassRefPtr n) { unsigned size = m_functionExprs.size(); m_functionExprs.append(n); return size; } FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); } unsigned addRegExp(RegExp* r) { createRareDataIfNecessary(); unsigned size = m_rareData->m_regexps.size(); m_rareData->m_regexps.append(r); return size; } @@ -482,6 +482,13 @@ namespace JSC { private: #if !defined(NDEBUG) || ENABLE(OPCODE_SAMPLING) void dump(ExecState*, const Vector::const_iterator& begin, Vector::const_iterator&) const; + + CString registerName(ExecState*, int r) const; + void printUnaryOp(ExecState*, int location, Vector::const_iterator&, const char* op) const; + void printBinaryOp(ExecState*, int location, Vector::const_iterator&, const char* op) const; + void printConditionalJump(ExecState*, const Vector::const_iterator&, Vector::const_iterator&, int location, const char* op) const; + void printGetByIdOp(ExecState*, int location, Vector::const_iterator&, const char* op) const; + void printPutByIdOp(ExecState*, int location, Vector::const_iterator&, const char* op) const; #endif void reparseForExceptionInfoIfNecessary(CallFrame*); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h index cf50442..d9b2153 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h @@ -113,6 +113,7 @@ namespace JSC { macro(op_put_by_id_generic, 8) \ macro(op_del_by_id, 4) \ macro(op_get_by_val, 4) \ + macro(op_get_by_pname, 7) \ macro(op_put_by_val, 4) \ macro(op_del_by_val, 4) \ macro(op_put_by_index, 4) \ @@ -127,9 +128,11 @@ namespace JSC { macro(op_jneq_ptr, 4) \ macro(op_jnless, 4) \ macro(op_jnlesseq, 4) \ + macro(op_jless, 4) \ macro(op_jmp_scopes, 3) \ macro(op_loop, 2) \ macro(op_loop_if_true, 3) \ + macro(op_loop_if_false, 3) \ macro(op_loop_if_less, 4) \ macro(op_loop_if_lesseq, 4) \ macro(op_switch_imm, 4) \ @@ -152,8 +155,8 @@ namespace JSC { macro(op_strcat, 4) \ macro(op_to_primitive, 3) \ \ - macro(op_get_pnames, 3) \ - macro(op_next_pname, 4) \ + macro(op_get_pnames, 6) \ + macro(op_next_pname, 7) \ \ macro(op_push_scope, 2) \ macro(op_pop_scope, 1) \ @@ -166,7 +169,7 @@ namespace JSC { macro(op_jsr, 3) \ macro(op_sret, 2) \ \ - macro(op_debug, 5) \ + macro(op_debug, 4) \ macro(op_profile_will_call, 2) \ macro(op_profile_did_call, 2) \ \ @@ -193,8 +196,12 @@ namespace JSC { #undef VERIFY_OPCODE_ID #if HAVE(COMPUTED_GOTO) +#if COMPILER(RVCT) typedef void* Opcode; #else + typedef const void* Opcode; +#endif +#else typedef OpcodeID Opcode; #endif diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp index 865c919..3f0babc 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp @@ -33,7 +33,7 @@ #include "Interpreter.h" #include "Opcode.h" -#if !PLATFORM(WIN_OS) +#if !OS(WINDOWS) #include #endif @@ -91,7 +91,7 @@ void SamplingFlags::stop() {} uint32_t SamplingFlags::s_flags = 1 << 15; -#if PLATFORM(WIN_OS) +#if OS(WINDOWS) static void sleepForMicroseconds(unsigned us) { diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h index 711b086..c3e6247 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h @@ -113,7 +113,11 @@ namespace JSC { void sample(CodeBlock*, Instruction*); +#if COMPILER(WINSCW) || COMPILER(ACC) ScriptExecutable* m_executable; +#else + RefPtr m_executable; +#endif CodeBlock* m_codeBlock; int m_sampleCount; int m_opcodeSampleCount; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 10a1136..b0a0877 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -534,7 +534,7 @@ PassRefPtr BytecodeGenerator::newLabelScope(LabelScope::Type type, c m_labelScopes.removeLast(); // Allocate new label scope. - LabelScope scope(type, name, scopeDepth(), newLabel(), type == LabelScope::Loop ? newLabel() : PassRefPtr