From 770f63fa3b22f343d1e0243f72a39305bfde643b Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 19 Oct 2023 15:24:41 +0300 Subject: [PATCH] drop script and declarative components aswell as tray support Signed-off-by: Ivailo Monev --- CMakeLists.txt | 14 +- README | 3 +- cmake/KatieConfig.cmake | 2 - cmake/modules/OptimizeHeaders.cmake | 2 - package/debian/control | 4 +- package/freebsd/pkg-plist | 91 - scripts/genmap.py | 2 - scripts/incfsck.py | 7 - scripts/namefsck.py | 41 - scripts/updatetranslations.py | 3 +- src/3rdparty/README | 4 +- src/3rdparty/javascriptcore/API/APICast.h | 155 - src/3rdparty/javascriptcore/API/APIShims.h | 82 - src/3rdparty/javascriptcore/API/JSBase.h | 66 - .../API/JSCallbackConstructor.cpp | 86 - .../API/JSCallbackConstructor.h | 60 - .../javascriptcore/API/JSCallbackFunction.cpp | 79 - .../javascriptcore/API/JSCallbackFunction.h | 58 - .../javascriptcore/API/JSCallbackObject.cpp | 37 - .../javascriptcore/API/JSCallbackObject.h | 116 - .../API/JSCallbackObjectFunctions.h | 603 --- .../javascriptcore/API/JSClassRef.cpp | 241 - src/3rdparty/javascriptcore/API/JSClassRef.h | 123 - .../javascriptcore/API/JSContextRef.cpp | 134 - .../javascriptcore/API/JSContextRef.h | 127 - .../javascriptcore/API/JSContextRefPrivate.h | 48 - .../javascriptcore/API/JSObjectRef.cpp | 496 -- src/3rdparty/javascriptcore/API/JSObjectRef.h | 690 --- src/3rdparty/javascriptcore/API/JSRetainPtr.h | 173 - .../javascriptcore/API/JSStringRef.cpp | 73 - src/3rdparty/javascriptcore/API/JSStringRef.h | 110 - .../javascriptcore/API/JSValueRef.cpp | 301 -- src/3rdparty/javascriptcore/API/JSValueRef.h | 270 - .../javascriptcore/API/JavaScriptCore.h | 36 - .../javascriptcore/API/OpaqueJSString.cpp | 55 - .../javascriptcore/API/OpaqueJSString.h | 81 - src/3rdparty/javascriptcore/AUTHORS | 2 - src/3rdparty/javascriptcore/COPYING.LIB | 488 -- .../javascriptcore/DerivedSources.make | 60 - src/3rdparty/javascriptcore/NOTE | 2 - src/3rdparty/javascriptcore/THANKS | 8 - .../javascriptcore/bytecode/CodeBlock.cpp | 1427 ----- .../javascriptcore/bytecode/CodeBlock.h | 398 -- .../javascriptcore/bytecode/EvalCodeCache.h | 77 - .../javascriptcore/bytecode/Instruction.h | 83 - .../javascriptcore/bytecode/JumpTable.cpp | 45 - .../javascriptcore/bytecode/JumpTable.h | 70 - .../javascriptcore/bytecode/Opcode.cpp | 186 - src/3rdparty/javascriptcore/bytecode/Opcode.h | 230 - .../javascriptcore/bytecode/SamplingTool.cpp | 371 -- .../javascriptcore/bytecode/SamplingTool.h | 414 -- .../bytecompiler/BytecodeGenerator.cpp | 1915 ------- .../bytecompiler/BytecodeGenerator.h | 529 -- .../javascriptcore/bytecompiler/Label.h | 90 - .../javascriptcore/bytecompiler/LabelScope.h | 79 - .../bytecompiler/NodesCodegen.cpp | 1989 ------- .../javascriptcore/bytecompiler/RegisterID.h | 121 - src/3rdparty/javascriptcore/create_hash_table | 274 - .../javascriptcore/debugger/Debugger.cpp | 100 - .../javascriptcore/debugger/Debugger.h | 104 - .../debugger/DebuggerCallFrame.cpp | 90 - .../debugger/DebuggerCallFrame.h | 68 - .../generated/ArrayPrototype.lut.h | 34 - .../generated/DatePrototype.lut.h | 59 - .../javascriptcore/generated/Grammar.cpp | 4512 ---------------- .../javascriptcore/generated/Grammar.hpp | 184 - .../javascriptcore/generated/JSONObject.lut.h | 15 - .../javascriptcore/generated/Lexer.lut.h | 47 - .../javascriptcore/generated/MathObject.lut.h | 31 - .../generated/NumberConstructor.lut.h | 18 - .../generated/RegExpConstructor.lut.h | 34 - .../generated/RegExpObject.lut.h | 18 - .../generated/StringPrototype.lut.h | 35 - .../javascriptcore/interpreter/CachedCall.h | 78 - .../javascriptcore/interpreter/CallFrame.cpp | 52 - .../javascriptcore/interpreter/CallFrame.h | 155 - .../interpreter/CallFrameClosure.h | 60 - .../interpreter/Interpreter.cpp | 3878 -------------- .../javascriptcore/interpreter/Interpreter.h | 142 - .../javascriptcore/interpreter/Register.h | 219 - .../interpreter/RegisterFile.cpp | 48 - .../javascriptcore/interpreter/RegisterFile.h | 208 - .../javascriptcore/make-generated-sources.sh | 8 - src/3rdparty/javascriptcore/parser/Grammar.y | 2093 -------- .../javascriptcore/parser/Keywords.table | 72 - src/3rdparty/javascriptcore/parser/Lexer.cpp | 1032 ---- src/3rdparty/javascriptcore/parser/Lexer.h | 144 - .../javascriptcore/parser/NodeConstructors.h | 895 ---- src/3rdparty/javascriptcore/parser/NodeInfo.h | 63 - src/3rdparty/javascriptcore/parser/Nodes.cpp | 192 - src/3rdparty/javascriptcore/parser/Nodes.h | 1593 ------ src/3rdparty/javascriptcore/parser/Parser.cpp | 78 - src/3rdparty/javascriptcore/parser/Parser.h | 103 - .../javascriptcore/parser/ParserArena.cpp | 135 - .../javascriptcore/parser/ParserArena.h | 123 - .../javascriptcore/parser/ResultType.h | 182 - .../javascriptcore/parser/SourceCode.h | 92 - .../javascriptcore/parser/SourceProvider.h | 79 - .../javascriptcore/runtime/ArgList.cpp | 77 - src/3rdparty/javascriptcore/runtime/ArgList.h | 237 - .../javascriptcore/runtime/Arguments.cpp | 291 - .../javascriptcore/runtime/Arguments.h | 259 - .../runtime/ArrayConstructor.cpp | 97 - .../javascriptcore/runtime/ArrayConstructor.h | 40 - .../javascriptcore/runtime/ArrayPrototype.cpp | 1071 ---- .../javascriptcore/runtime/ArrayPrototype.h | 42 - .../runtime/BatchedTransitionOptimizer.h | 55 - .../runtime/BooleanConstructor.cpp | 78 - .../runtime/BooleanConstructor.h | 44 - .../javascriptcore/runtime/BooleanObject.cpp | 35 - .../javascriptcore/runtime/BooleanObject.h | 51 - .../runtime/BooleanPrototype.cpp | 83 - .../javascriptcore/runtime/BooleanPrototype.h | 35 - .../javascriptcore/runtime/CallData.cpp | 60 - .../javascriptcore/runtime/CallData.h | 83 - .../javascriptcore/runtime/ClassInfo.h | 60 - .../javascriptcore/runtime/Collector.cpp | 670 --- .../javascriptcore/runtime/Collector.h | 255 - .../runtime/CollectorHeapIterator.h | 138 - .../runtime/CommonIdentifiers.cpp | 39 - .../runtime/CommonIdentifiers.h | 105 - .../javascriptcore/runtime/ConstructData.cpp | 59 - .../javascriptcore/runtime/ConstructData.h | 90 - .../runtime/DateConstructor.cpp | 170 - .../javascriptcore/runtime/DateConstructor.h | 43 - .../javascriptcore/runtime/DateConversion.cpp | 101 - .../javascriptcore/runtime/DateConversion.h | 63 - .../javascriptcore/runtime/DateInstance.cpp | 80 - .../javascriptcore/runtime/DateInstance.h | 81 - .../runtime/DateInstanceCache.h | 92 - .../javascriptcore/runtime/DatePrototype.cpp | 915 ---- .../javascriptcore/runtime/DatePrototype.h | 52 - src/3rdparty/javascriptcore/runtime/Error.cpp | 134 - src/3rdparty/javascriptcore/runtime/Error.h | 69 - .../runtime/ErrorConstructor.cpp | 73 - .../javascriptcore/runtime/ErrorConstructor.h | 44 - .../javascriptcore/runtime/ErrorInstance.cpp | 33 - .../javascriptcore/runtime/ErrorInstance.h | 38 - .../javascriptcore/runtime/ErrorPrototype.cpp | 66 - .../javascriptcore/runtime/ErrorPrototype.h | 37 - .../runtime/ExceptionHelpers.cpp | 191 - .../javascriptcore/runtime/ExceptionHelpers.h | 57 - .../javascriptcore/runtime/Executable.cpp | 221 - .../javascriptcore/runtime/Executable.h | 293 -- .../runtime/FunctionConstructor.cpp | 113 - .../runtime/FunctionConstructor.h | 44 - .../runtime/FunctionPrototype.cpp | 146 - .../runtime/FunctionPrototype.h | 46 - .../javascriptcore/runtime/GetterSetter.cpp | 46 - .../javascriptcore/runtime/GetterSetter.h | 73 - .../runtime/GlobalEvalFunction.cpp | 48 - .../runtime/GlobalEvalFunction.h | 54 - .../javascriptcore/runtime/Identifier.cpp | 302 -- .../javascriptcore/runtime/Identifier.h | 165 - .../runtime/InitializeThreading.cpp | 58 - .../runtime/InitializeThreading.h | 40 - .../runtime/InternalFunction.cpp | 71 - .../javascriptcore/runtime/InternalFunction.h | 68 - .../runtime/JSAPIValueWrapper.cpp | 31 - .../runtime/JSAPIValueWrapper.h | 64 - .../javascriptcore/runtime/JSActivation.cpp | 172 - .../javascriptcore/runtime/JSActivation.h | 108 - .../javascriptcore/runtime/JSArray.cpp | 1072 ---- src/3rdparty/javascriptcore/runtime/JSArray.h | 223 - .../javascriptcore/runtime/JSByteArray.cpp | 116 - .../javascriptcore/runtime/JSByteArray.h | 123 - .../javascriptcore/runtime/JSCell.cpp | 180 - src/3rdparty/javascriptcore/runtime/JSCell.h | 352 -- .../javascriptcore/runtime/JSFunction.cpp | 249 - .../javascriptcore/runtime/JSFunction.h | 133 - .../javascriptcore/runtime/JSGlobalData.cpp | 248 - .../javascriptcore/runtime/JSGlobalData.h | 177 - .../javascriptcore/runtime/JSGlobalObject.cpp | 456 -- .../javascriptcore/runtime/JSGlobalObject.h | 454 -- .../runtime/JSGlobalObjectFunctions.cpp | 439 -- .../runtime/JSGlobalObjectFunctions.h | 60 - .../javascriptcore/runtime/JSImmediate.cpp | 26 - .../javascriptcore/runtime/JSImmediate.h | 721 --- .../javascriptcore/runtime/JSNotAnObject.cpp | 141 - .../javascriptcore/runtime/JSNotAnObject.h | 101 - .../javascriptcore/runtime/JSNumberCell.cpp | 41 - .../javascriptcore/runtime/JSNumberCell.h | 192 - .../javascriptcore/runtime/JSONObject.cpp | 877 --- .../javascriptcore/runtime/JSONObject.h | 62 - .../javascriptcore/runtime/JSObject.cpp | 691 --- .../javascriptcore/runtime/JSObject.h | 696 --- .../runtime/JSPropertyNameIterator.cpp | 90 - .../runtime/JSPropertyNameIterator.h | 103 - .../runtime/JSStaticScopeObject.cpp | 77 - .../runtime/JSStaticScopeObject.h | 71 - .../javascriptcore/runtime/JSString.cpp | 251 - .../javascriptcore/runtime/JSString.h | 560 -- src/3rdparty/javascriptcore/runtime/JSType.h | 44 - .../javascriptcore/runtime/JSTypeInfo.h | 74 - .../javascriptcore/runtime/JSValue.cpp | 178 - src/3rdparty/javascriptcore/runtime/JSValue.h | 841 --- .../runtime/JSVariableObject.cpp | 71 - .../javascriptcore/runtime/JSVariableObject.h | 165 - .../runtime/JSWrapperObject.cpp | 36 - .../javascriptcore/runtime/JSWrapperObject.h | 67 - .../javascriptcore/runtime/JSZombie.cpp | 48 - .../javascriptcore/runtime/JSZombie.h | 78 - .../javascriptcore/runtime/LiteralParser.cpp | 455 -- .../javascriptcore/runtime/LiteralParser.h | 110 - .../javascriptcore/runtime/Lookup.cpp | 82 - src/3rdparty/javascriptcore/runtime/Lookup.h | 316 -- .../javascriptcore/runtime/MarkStack.cpp | 59 - .../javascriptcore/runtime/MarkStack.h | 180 - .../javascriptcore/runtime/MathObject.cpp | 239 - .../javascriptcore/runtime/MathObject.h | 49 - .../runtime/NativeErrorConstructor.cpp | 73 - .../runtime/NativeErrorConstructor.h | 51 - .../runtime/NativeErrorPrototype.cpp | 39 - .../runtime/NativeErrorPrototype.h | 39 - .../runtime/NumberConstructor.cpp | 128 - .../runtime/NumberConstructor.h | 59 - .../javascriptcore/runtime/NumberObject.cpp | 51 - .../javascriptcore/runtime/NumberObject.h | 52 - .../runtime/NumberPrototype.cpp | 452 -- .../javascriptcore/runtime/NumberPrototype.h | 35 - .../javascriptcore/runtime/NumericStrings.h | 74 - .../runtime/ObjectConstructor.cpp | 317 -- .../runtime/ObjectConstructor.h | 41 - .../runtime/ObjectPrototype.cpp | 154 - .../javascriptcore/runtime/ObjectPrototype.h | 43 - .../javascriptcore/runtime/Operations.cpp | 111 - .../javascriptcore/runtime/Operations.h | 412 -- .../runtime/PropertyDescriptor.cpp | 195 - .../runtime/PropertyDescriptor.h | 80 - .../runtime/PropertyMapHashTable.h | 91 - .../runtime/PropertyNameArray.cpp | 53 - .../runtime/PropertyNameArray.h | 95 - .../javascriptcore/runtime/PropertySlot.cpp | 44 - .../javascriptcore/runtime/PropertySlot.h | 214 - src/3rdparty/javascriptcore/runtime/Protect.h | 215 - .../runtime/PrototypeFunction.cpp | 57 - .../runtime/PrototypeFunction.h | 45 - .../javascriptcore/runtime/PutPropertySlot.h | 77 - .../javascriptcore/runtime/RegExp.cpp | 154 - src/3rdparty/javascriptcore/runtime/RegExp.h | 68 - .../runtime/RegExpConstructor.cpp | 354 -- .../runtime/RegExpConstructor.h | 133 - .../runtime/RegExpMatchesArray.h | 94 - .../javascriptcore/runtime/RegExpObject.cpp | 173 - .../javascriptcore/runtime/RegExpObject.h | 87 - .../runtime/RegExpPrototype.cpp | 122 - .../javascriptcore/runtime/RegExpPrototype.h | 38 - .../javascriptcore/runtime/ScopeChain.cpp | 68 - .../javascriptcore/runtime/ScopeChain.h | 241 - .../javascriptcore/runtime/ScopeChainMark.h | 36 - .../javascriptcore/runtime/SmallStrings.cpp | 114 - .../javascriptcore/runtime/SmallStrings.h | 74 - .../javascriptcore/runtime/StringBuilder.h | 81 - .../runtime/StringConstructor.cpp | 91 - .../runtime/StringConstructor.h | 40 - .../javascriptcore/runtime/StringObject.cpp | 99 - .../javascriptcore/runtime/StringObject.h | 69 - .../runtime/StringPrototype.cpp | 754 --- .../javascriptcore/runtime/StringPrototype.h | 43 - .../javascriptcore/runtime/Structure.cpp | 1194 ----- .../javascriptcore/runtime/Structure.h | 322 -- .../javascriptcore/runtime/StructureChain.cpp | 49 - .../javascriptcore/runtime/StructureChain.h | 51 - .../runtime/StructureTransitionTable.h | 214 - .../javascriptcore/runtime/SymbolTable.h | 130 - .../javascriptcore/runtime/TimeoutChecker.cpp | 116 - .../javascriptcore/runtime/TimeoutChecker.h | 77 - .../javascriptcore/runtime/UString.cpp | 795 --- src/3rdparty/javascriptcore/runtime/UString.h | 567 -- .../javascriptcore/runtime/UStringImpl.cpp | 84 - .../javascriptcore/runtime/UStringImpl.h | 266 - .../javascriptcore/runtime/WeakGCMap.h | 122 - .../javascriptcore/runtime/WeakGCPtr.h | 124 - src/3rdparty/javascriptcore/wtf/ASCIICType.h | 166 - src/3rdparty/javascriptcore/wtf/AVLTree.h | 959 ---- .../javascriptcore/wtf/AlwaysInline.h | 37 - src/3rdparty/javascriptcore/wtf/Assertions.h | 43 - src/3rdparty/javascriptcore/wtf/ByteArray.cpp | 38 - src/3rdparty/javascriptcore/wtf/ByteArray.h | 93 - .../wtf/CrossThreadRefCounted.h | 171 - src/3rdparty/javascriptcore/wtf/CurrentTime.h | 68 - src/3rdparty/javascriptcore/wtf/DateMath.cpp | 945 ---- src/3rdparty/javascriptcore/wtf/DateMath.h | 226 - .../javascriptcore/wtf/FastAllocBase.h | 181 - .../javascriptcore/wtf/FastMalloc.cpp | 108 - src/3rdparty/javascriptcore/wtf/FastMalloc.h | 48 - src/3rdparty/javascriptcore/wtf/Forward.h | 42 - src/3rdparty/javascriptcore/wtf/GetPtr.h | 33 - .../javascriptcore/wtf/HashCountedSet.h | 225 - .../javascriptcore/wtf/HashFunctions.h | 176 - .../javascriptcore/wtf/HashIterators.h | 216 - src/3rdparty/javascriptcore/wtf/HashMap.h | 401 -- src/3rdparty/javascriptcore/wtf/HashSet.h | 296 -- src/3rdparty/javascriptcore/wtf/HashTable.cpp | 65 - src/3rdparty/javascriptcore/wtf/HashTable.h | 1144 ---- src/3rdparty/javascriptcore/wtf/HashTraits.h | 112 - src/3rdparty/javascriptcore/wtf/Noncopyable.h | 52 - src/3rdparty/javascriptcore/wtf/NotFound.h | 37 - src/3rdparty/javascriptcore/wtf/OwnArrayPtr.h | 71 - .../javascriptcore/wtf/OwnFastMallocPtr.h | 52 - src/3rdparty/javascriptcore/wtf/OwnPtr.h | 114 - src/3rdparty/javascriptcore/wtf/PassRefPtr.h | 256 - src/3rdparty/javascriptcore/wtf/Platform.h | 65 - src/3rdparty/javascriptcore/wtf/PtrAndFlags.h | 79 - src/3rdparty/javascriptcore/wtf/RefCounted.h | 131 - src/3rdparty/javascriptcore/wtf/RefPtr.h | 230 - .../javascriptcore/wtf/SegmentedVector.h | 255 - .../javascriptcore/wtf/StdLibExtras.h | 64 - .../javascriptcore/wtf/StringHashFunctions.h | 157 - src/3rdparty/javascriptcore/wtf/Threading.cpp | 164 - src/3rdparty/javascriptcore/wtf/Threading.h | 152 - .../javascriptcore/wtf/TypeTraits.cpp | 134 - src/3rdparty/javascriptcore/wtf/TypeTraits.h | 366 -- src/3rdparty/javascriptcore/wtf/Vector.h | 949 ---- .../javascriptcore/wtf/VectorTraits.h | 104 - src/3rdparty/javascriptcore/wtf/dtoa.cpp | 2427 --------- src/3rdparty/javascriptcore/wtf/dtoa.h | 43 - .../javascriptcore/wtf/unicode/UTF8.cpp | 117 - .../javascriptcore/wtf/unicode/UTF8.h | 46 - .../javascriptcore/wtf/unicode/Unicode.h | 48 - src/core/global/qconfig.cpp.cmake | 1 - src/core/global/qconfig.h.cmake | 1 - src/core/global/qglobal.h | 12 - src/core/global/qlibraryinfo.cpp | 3 - src/core/global/qlibraryinfo.h | 3 +- src/core/kernel/qabstractitemmodel.cpp | 7 +- src/core/kernel/qmetaobject.cpp | 3 +- src/core/kernel/qobject.cpp | 16 - src/core/kernel/qobject_p.h | 15 +- src/core/tools/qregexp.cpp | 46 +- src/declarative/CMakeLists.txt | 341 -- .../graphicsitems/qdeclarativeanchors.cpp | 1144 ---- .../graphicsitems/qdeclarativeanchors_p.h | 181 - .../graphicsitems/qdeclarativeanchors_p_p.h | 150 - .../qdeclarativeanimatedimage.cpp | 310 -- .../qdeclarativeanimatedimage_p.h | 92 - .../qdeclarativeanimatedimage_p_p.h | 64 - .../graphicsitems/qdeclarativeborderimage.cpp | 449 -- .../graphicsitems/qdeclarativeborderimage_p.h | 79 - .../qdeclarativeborderimage_p_p.h | 81 - .../graphicsitems/qdeclarativeevents.cpp | 218 - .../graphicsitems/qdeclarativeevents_p_p.h | 121 - .../graphicsitems/qdeclarativeflickable.cpp | 1772 ------- .../graphicsitems/qdeclarativeflickable_p.h | 206 - .../graphicsitems/qdeclarativeflickable_p_p.h | 220 - .../graphicsitems/qdeclarativeflipable.cpp | 235 - .../graphicsitems/qdeclarativeflipable_p.h | 77 - .../graphicsitems/qdeclarativefocuspanel.cpp | 70 - .../graphicsitems/qdeclarativefocuspanel_p.h | 55 - .../graphicsitems/qdeclarativefocusscope.cpp | 54 - .../graphicsitems/qdeclarativefocusscope_p.h | 46 - .../qdeclarativegraphicswidget.cpp | 105 - .../qdeclarativegraphicswidget_p.h | 67 - .../graphicsitems/qdeclarativegridview.cpp | 3137 ----------- .../graphicsitems/qdeclarativegridview_p.h | 263 - .../graphicsitems/qdeclarativeimage.cpp | 555 -- .../graphicsitems/qdeclarativeimage_p.h | 75 - .../graphicsitems/qdeclarativeimage_p_p.h | 59 - .../graphicsitems/qdeclarativeimagebase.cpp | 265 - .../graphicsitems/qdeclarativeimagebase_p.h | 94 - .../graphicsitems/qdeclarativeimagebase_p_p.h | 72 - .../qdeclarativeimplicitsizeitem.cpp | 73 - .../qdeclarativeimplicitsizeitem_p.h | 78 - .../qdeclarativeimplicitsizeitem_p_p.h | 70 - .../graphicsitems/qdeclarativeitem.cpp | 3572 ------------- .../graphicsitems/qdeclarativeitem.h | 208 - .../graphicsitems/qdeclarativeitem_p.h | 544 -- .../qdeclarativeitemchangelistener_p.h | 56 - .../graphicsitems/qdeclarativeitemsmodule.cpp | 176 - .../graphicsitems/qdeclarativeitemsmodule_p.h | 40 - .../graphicsitems/qdeclarativelayoutitem.cpp | 93 - .../graphicsitems/qdeclarativelayoutitem_p.h | 71 - .../graphicsitems/qdeclarativelistview.cpp | 3623 ------------- .../graphicsitems/qdeclarativelistview_p.h | 347 -- .../graphicsitems/qdeclarativeloader.cpp | 577 -- .../graphicsitems/qdeclarativeloader_p.h | 85 - .../graphicsitems/qdeclarativeloader_p_p.h | 71 - .../graphicsitems/qdeclarativemousearea.cpp | 949 ---- .../graphicsitems/qdeclarativemousearea_p.h | 195 - .../graphicsitems/qdeclarativemousearea_p_p.h | 106 - .../graphicsitems/qdeclarativepainteditem.cpp | 434 -- .../graphicsitems/qdeclarativepainteditem_p.h | 91 - .../qdeclarativepainteditem_p_p.h | 69 - .../graphicsitems/qdeclarativepath.cpp | 902 ---- .../graphicsitems/qdeclarativepath_p.h | 263 - .../graphicsitems/qdeclarativepath_p_p.h | 62 - .../graphicsitems/qdeclarativepathview.cpp | 1727 ------ .../graphicsitems/qdeclarativepathview_p.h | 229 - .../graphicsitems/qdeclarativepathview_p_p.h | 172 - .../graphicsitems/qdeclarativepositioners.cpp | 1352 ----- .../graphicsitems/qdeclarativepositioners_p.h | 210 - .../qdeclarativepositioners_p_p.h | 153 - .../graphicsitems/qdeclarativerectangle.cpp | 547 -- .../graphicsitems/qdeclarativerectangle_p.h | 165 - .../graphicsitems/qdeclarativerectangle_p_p.h | 92 - .../graphicsitems/qdeclarativerepeater.cpp | 435 -- .../graphicsitems/qdeclarativerepeater_p.h | 87 - .../graphicsitems/qdeclarativerepeater_p_p.h | 62 - .../graphicsitems/qdeclarativescalegrid.cpp | 84 - .../graphicsitems/qdeclarativescalegrid_p_p.h | 81 - .../graphicsitems/qdeclarativetext.cpp | 1550 ------ .../graphicsitems/qdeclarativetext_p.h | 188 - .../graphicsitems/qdeclarativetext_p_p.h | 120 - .../graphicsitems/qdeclarativetextedit.cpp | 1765 ------- .../graphicsitems/qdeclarativetextedit_p.h | 267 - .../graphicsitems/qdeclarativetextedit_p_p.h | 108 - .../graphicsitems/qdeclarativetextinput.cpp | 1730 ------ .../graphicsitems/qdeclarativetextinput_p.h | 264 - .../graphicsitems/qdeclarativetextinput_p_p.h | 125 - .../graphicsitems/qdeclarativetranslate.cpp | 106 - .../graphicsitems/qdeclarativetranslate_p.h | 66 - .../qdeclarativevisualitemmodel.cpp | 1406 ----- .../qdeclarativevisualitemmodel_p.h | 234 - src/declarative/qdeclarativecommon_p.h | 47 - src/declarative/qml/parser/make-parser.sh | 33 - src/declarative/qml/parser/qdeclarativejs.g | 3106 ----------- .../qml/parser/qdeclarativejsast.cpp | 936 ---- .../qml/parser/qdeclarativejsast_p.h | 2522 --------- .../qml/parser/qdeclarativejsastfwd_p.h | 167 - .../qml/parser/qdeclarativejsastvisitor.cpp | 38 - .../qml/parser/qdeclarativejsastvisitor_p.h | 315 -- .../qml/parser/qdeclarativejsengine_p.cpp | 163 - .../qml/parser/qdeclarativejsengine_p.h | 142 - .../qml/parser/qdeclarativejsgrammar.cpp | 27 - .../qml/parser/qdeclarativejsgrammar_p.h | 1151 ---- .../qml/parser/qdeclarativejslexer.cpp | 1229 ----- .../qml/parser/qdeclarativejslexer_p.h | 229 - .../qml/parser/qdeclarativejsmemorypool_p.h | 71 - .../qml/parser/qdeclarativejsnodepool_p.h | 115 - .../qml/parser/qdeclarativejsparser.cpp | 1882 ------- .../qml/parser/qdeclarativejsparser_p.h | 223 - src/declarative/qml/qdeclarative.h | 392 -- src/declarative/qml/qdeclarativebinding.cpp | 534 -- src/declarative/qml/qdeclarativebinding_p.h | 202 - src/declarative/qml/qdeclarativebinding_p_p.h | 63 - .../qml/qdeclarativeboundsignal.cpp | 301 -- .../qml/qdeclarativeboundsignal_p.h | 111 - src/declarative/qml/qdeclarativecleanup.cpp | 67 - src/declarative/qml/qdeclarativecleanup_p.h | 59 - .../qml/qdeclarativecompiledbindings.cpp | 2431 --------- .../qml/qdeclarativecompiledbindings_p.h | 94 - .../qml/qdeclarativecompileddata.cpp | 220 - src/declarative/qml/qdeclarativecompiler.cpp | 3106 ----------- src/declarative/qml/qdeclarativecompiler_p.h | 322 -- src/declarative/qml/qdeclarativecomponent.cpp | 1010 ---- src/declarative/qml/qdeclarativecomponent.h | 113 - src/declarative/qml/qdeclarativecomponent_p.h | 139 - src/declarative/qml/qdeclarativecontext.cpp | 753 --- src/declarative/qml/qdeclarativecontext.h | 91 - src/declarative/qml/qdeclarativecontext_p.h | 272 - .../qml/qdeclarativecontextscriptclass.cpp | 315 -- .../qml/qdeclarativecontextscriptclass_p.h | 84 - .../qml/qdeclarativecustomparser.cpp | 297 -- .../qml/qdeclarativecustomparser_p.h | 143 - .../qml/qdeclarativecustomparser_p_p.h | 69 - src/declarative/qml/qdeclarativedata_p.h | 148 - src/declarative/qml/qdeclarativedirparser.cpp | 233 - src/declarative/qml/qdeclarativedirparser_p.h | 112 - src/declarative/qml/qdeclarativeengine.cpp | 2310 -------- src/declarative/qml/qdeclarativeengine.h | 96 - src/declarative/qml/qdeclarativeengine_p.h | 339 -- src/declarative/qml/qdeclarativeerror.cpp | 266 - src/declarative/qml/qdeclarativeerror.h | 63 - .../qml/qdeclarativeexpression.cpp | 862 --- src/declarative/qml/qdeclarativeexpression.h | 95 - .../qml/qdeclarativeexpression_p.h | 213 - .../qml/qdeclarativeextensioninterface.h | 44 - .../qml/qdeclarativeextensionplugin.cpp | 153 - .../qml/qdeclarativeextensionplugin.h | 53 - src/declarative/qml/qdeclarativeglobal_p.h | 66 - .../qml/qdeclarativeglobalscriptclass.cpp | 127 - .../qml/qdeclarativeglobalscriptclass_p.h | 66 - src/declarative/qml/qdeclarativeguard_p.h | 193 - .../qml/qdeclarativeimageprovider.cpp | 241 - .../qml/qdeclarativeimageprovider.h | 57 - src/declarative/qml/qdeclarativeimport.cpp | 946 ---- src/declarative/qml/qdeclarativeimport_p.h | 121 - src/declarative/qml/qdeclarativeinclude.cpp | 226 - src/declarative/qml/qdeclarativeinclude_p.h | 86 - src/declarative/qml/qdeclarativeinfo.cpp | 182 - src/declarative/qml/qdeclarativeinfo.h | 56 - .../qml/qdeclarativeinstruction.cpp | 207 - .../qml/qdeclarativeinstruction_p.h | 333 -- .../qml/qdeclarativeintegercache.cpp | 76 - .../qml/qdeclarativeintegercache_p.h | 92 - src/declarative/qml/qdeclarativelist.cpp | 397 -- src/declarative/qml/qdeclarativelist.h | 125 - src/declarative/qml/qdeclarativelist_p.h | 65 - .../qml/qdeclarativelistscriptclass.cpp | 129 - .../qml/qdeclarativelistscriptclass_p.h | 67 - src/declarative/qml/qdeclarativemetatype.cpp | 1518 ------ src/declarative/qml/qdeclarativemetatype_p.h | 154 - src/declarative/qml/qdeclarativenotifier.cpp | 109 - src/declarative/qml/qdeclarativenotifier_p.h | 272 - .../qml/qdeclarativeobjectscriptclass.cpp | 1200 ----- .../qml/qdeclarativeobjectscriptclass_p.h | 146 - src/declarative/qml/qdeclarativeparser.cpp | 423 -- src/declarative/qml/qdeclarativeparser_p.h | 358 -- .../qml/qdeclarativeparserstatus.cpp | 87 - .../qml/qdeclarativeparserstatus.h | 53 - src/declarative/qml/qdeclarativeprivate.h | 311 -- src/declarative/qml/qdeclarativeproperty.cpp | 1621 ------ src/declarative/qml/qdeclarativeproperty.h | 120 - src/declarative/qml/qdeclarativeproperty_p.h | 127 - .../qml/qdeclarativepropertycache.cpp | 450 -- .../qml/qdeclarativepropertycache_p.h | 219 - .../qdeclarativepropertyvalueinterceptor.cpp | 59 - .../qdeclarativepropertyvalueinterceptor.h | 46 - .../qml/qdeclarativepropertyvaluesource.cpp | 56 - .../qml/qdeclarativepropertyvaluesource.h | 45 - .../qml/qdeclarativeproxymetaobject.cpp | 104 - .../qml/qdeclarativeproxymetaobject_p.h | 77 - src/declarative/qml/qdeclarativerefcount.cpp | 50 - src/declarative/qml/qdeclarativerefcount_p.h | 57 - src/declarative/qml/qdeclarativerewrite.cpp | 253 - src/declarative/qml/qdeclarativerewrite_p.h | 107 - .../qml/qdeclarativescriptparser.cpp | 1187 ----- .../qml/qdeclarativescriptparser_p.h | 125 - .../qml/qdeclarativescriptstring.cpp | 146 - .../qml/qdeclarativescriptstring.h | 64 - .../qml/qdeclarativestringconverters.cpp | 259 - .../qml/qdeclarativestringconverters_p.h | 71 - .../qml/qdeclarativetypeloader.cpp | 1063 ---- .../qml/qdeclarativetypeloader_p.h | 302 -- .../qml/qdeclarativetypenamecache.cpp | 98 - .../qml/qdeclarativetypenamecache_p.h | 99 - .../qml/qdeclarativetypenamescriptclass.cpp | 145 - .../qml/qdeclarativetypenamescriptclass_p.h | 72 - .../qml/qdeclarativetypenotavailable.cpp | 34 - .../qml/qdeclarativetypenotavailable_p.h | 42 - src/declarative/qml/qdeclarativevaluetype.cpp | 899 ---- src/declarative/qml/qdeclarativevaluetype_p.h | 495 -- .../qml/qdeclarativevaluetypescriptclass.cpp | 222 - .../qml/qdeclarativevaluetypescriptclass_p.h | 67 - src/declarative/qml/qdeclarativevme.cpp | 1061 ---- src/declarative/qml/qdeclarativevme_p.h | 71 - .../qml/qdeclarativevmemetaobject.cpp | 882 ---- .../qml/qdeclarativevmemetaobject_p.h | 177 - .../qml/qdeclarativeworkerscript.cpp | 715 --- .../qml/qdeclarativeworkerscript_p.h | 106 - src/declarative/qml/qmetaobjectbuilder.cpp | 2506 --------- src/declarative/qml/qmetaobjectbuilder_p.h | 305 -- src/declarative/qml/qpodvector_p.h | 144 - src/declarative/qml/rewriter/textwriter.cpp | 83 - src/declarative/qml/rewriter/textwriter_p.h | 57 - .../util/qdeclarativeanimation.cpp | 2930 ----------- .../util/qdeclarativeanimation_p.h | 505 -- .../util/qdeclarativeanimation_p_p.h | 379 -- .../util/qdeclarativeapplication.cpp | 93 - .../util/qdeclarativeapplication_p.h | 63 - src/declarative/util/qdeclarativebehavior.cpp | 211 - src/declarative/util/qdeclarativebehavior_p.h | 75 - src/declarative/util/qdeclarativebind.cpp | 195 - src/declarative/util/qdeclarativebind_p.h | 73 - .../util/qdeclarativeconnections.cpp | 270 - .../util/qdeclarativeconnections_p.h | 80 - .../util/qdeclarativelistaccessor.cpp | 114 - .../util/qdeclarativelistaccessor_p.h | 57 - .../util/qdeclarativelistmodel.cpp | 1611 ------ .../util/qdeclarativelistmodel_p.h | 135 - .../util/qdeclarativelistmodel_p_p.h | 258 - .../util/qdeclarativelistmodelworkeragent.cpp | 259 - .../util/qdeclarativelistmodelworkeragent_p.h | 143 - .../util/qdeclarativenullablevalue_p_p.h | 61 - .../util/qdeclarativeopenmetaobject.cpp | 360 -- .../util/qdeclarativeopenmetaobject_p.h | 106 - src/declarative/util/qdeclarativepackage.cpp | 182 - src/declarative/util/qdeclarativepackage_p.h | 75 - .../util/qdeclarativepixmapcache.cpp | 980 ---- .../util/qdeclarativepixmapcache_p.h | 101 - .../util/qdeclarativepropertychanges.cpp | 767 --- .../util/qdeclarativepropertychanges_p.h | 89 - .../util/qdeclarativepropertymap.cpp | 277 - .../util/qdeclarativepropertymap.h | 67 - .../util/qdeclarativesmoothedanimation.cpp | 474 -- .../util/qdeclarativesmoothedanimation_p.h | 80 - .../util/qdeclarativesmoothedanimation_p_p.h | 115 - .../util/qdeclarativespringanimation.cpp | 443 -- .../util/qdeclarativespringanimation_p.h | 88 - src/declarative/util/qdeclarativestate.cpp | 713 --- src/declarative/util/qdeclarativestate_p.h | 189 - src/declarative/util/qdeclarativestate_p_p.h | 235 - .../util/qdeclarativestategroup.cpp | 479 -- .../util/qdeclarativestategroup_p.h | 72 - .../util/qdeclarativestateoperations.cpp | 1567 ------ .../util/qdeclarativestateoperations_p.h | 275 - .../util/qdeclarativestyledtext.cpp | 327 -- .../util/qdeclarativestyledtext_p.h | 49 - .../util/qdeclarativesystempalette.cpp | 293 -- .../util/qdeclarativesystempalette_p.h | 99 - src/declarative/util/qdeclarativetimeline.cpp | 895 ---- .../util/qdeclarativetimeline_p_p.h | 176 - src/declarative/util/qdeclarativetimer.cpp | 305 -- src/declarative/util/qdeclarativetimer_p.h | 92 - .../util/qdeclarativetransition.cpp | 326 -- .../util/qdeclarativetransition_p.h | 83 - .../util/qdeclarativetransitionmanager.cpp | 253 - .../util/qdeclarativetransitionmanager_p_p.h | 65 - .../util/qdeclarativeutilmodule.cpp | 100 - .../util/qdeclarativeutilmodule_p.h | 41 - src/declarative/util/qdeclarativeview.cpp | 650 --- src/declarative/util/qdeclarativeview.h | 95 - src/declarative/util/qlistmodelinterface.cpp | 86 - src/declarative/util/qlistmodelinterface_p.h | 61 - src/gui/CMakeLists.txt | 6 - src/gui/graphicsview/qgraphicsitem.cpp | 4 - src/gui/kernel/qapplication_x11.cpp | 4 - src/gui/kernel/qt_x11_p.h | 4 - src/gui/kernel/qwidget.cpp | 5 - src/gui/util/qsystemtrayicon.cpp | 609 --- src/gui/util/qsystemtrayicon.h | 107 - src/gui/util/qsystemtrayicon_p.h | 158 - src/gui/util/qsystemtrayicon_x11.cpp | 373 -- src/gui/widgets/qabstractscrollarea.cpp | 6 +- src/imports/CMakeLists.txt | 30 - src/imports/folderlistmodel/CMakeLists.txt | 29 - .../folderlistmodel/folderlistmodel.cpp | 46 - .../qdeclarativefolderlistmodel.cpp | 461 -- .../qdeclarativefolderlistmodel.h | 136 - src/imports/folderlistmodel/qmldir | 1 - src/imports/particles/CMakeLists.txt | 29 - src/imports/particles/particles.cpp | 48 - .../particles/qdeclarativeparticles.cpp | 1263 ----- .../particles/qdeclarativeparticles_p.h | 235 - src/imports/particles/qmldir | 1 - src/plugins/CMakeLists.txt | 13 - .../designer/qdeclarativeview/CMakeLists.txt | 24 - .../qdeclarativeview_plugin.cpp | 127 - .../qdeclarativeview_plugin.h | 66 - src/plugins/script/qtdbus/CMakeLists.txt | 24 - src/plugins/script/qtdbus/dbmain.cpp | 379 -- src/plugins/script/qtdbus/dbmain.h | 163 - src/script/CMakeLists.txt | 267 - src/script/api/qscriptable.cpp | 162 - src/script/api/qscriptable.h | 61 - src/script/api/qscriptable_p.h | 56 - src/script/api/qscriptclass.cpp | 373 -- src/script/api/qscriptclass.h | 94 - .../api/qscriptclasspropertyiterator.cpp | 198 - src/script/api/qscriptclasspropertyiterator.h | 68 - src/script/api/qscriptcontext.cpp | 780 --- src/script/api/qscriptcontext.h | 99 - src/script/api/qscriptcontext_p.h | 56 - src/script/api/qscriptcontextinfo.cpp | 513 -- src/script/api/qscriptcontextinfo.h | 98 - src/script/api/qscriptengine.cpp | 4288 --------------- src/script/api/qscriptengine.h | 386 -- src/script/api/qscriptengine_p.h | 1074 ---- src/script/api/qscriptengineagent.cpp | 509 -- src/script/api/qscriptengineagent.h | 84 - src/script/api/qscriptengineagent_p.h | 123 - src/script/api/qscriptextensioninterface.h | 44 - src/script/api/qscriptextensionplugin.cpp | 125 - src/script/api/qscriptextensionplugin.h | 50 - src/script/api/qscriptprogram.cpp | 213 - src/script/api/qscriptprogram.h | 63 - src/script/api/qscriptprogram_p.h | 77 - src/script/api/qscriptstring.cpp | 212 - src/script/api/qscriptstring.h | 63 - src/script/api/qscriptstring_p.h | 105 - src/script/api/qscriptvalue.cpp | 2084 -------- src/script/api/qscriptvalue.h | 207 - src/script/api/qscriptvalue_p.h | 141 - src/script/api/qscriptvalueiterator.cpp | 361 -- src/script/api/qscriptvalueiterator.h | 72 - src/script/bridge/qscriptactivationobject.cpp | 152 - src/script/bridge/qscriptactivationobject_p.h | 90 - src/script/bridge/qscriptclassobject.cpp | 275 - src/script/bridge/qscriptclassobject_p.h | 102 - src/script/bridge/qscriptdeclarativeclass.cpp | 591 --- src/script/bridge/qscriptdeclarativeclass_p.h | 153 - .../bridge/qscriptdeclarativeobject.cpp | 185 - .../bridge/qscriptdeclarativeobject_p.h | 106 - src/script/bridge/qscriptfunction.cpp | 172 - src/script/bridge/qscriptfunction_p.h | 115 - src/script/bridge/qscriptglobalobject.cpp | 156 - src/script/bridge/qscriptglobalobject_p.h | 125 - src/script/bridge/qscriptobject.cpp | 220 - src/script/bridge/qscriptobject_p.h | 174 - src/script/bridge/qscriptqobject.cpp | 2427 --------- src/script/bridge/qscriptqobject_p.h | 343 -- .../bridge/qscriptstaticscopeobject.cpp | 155 - .../bridge/qscriptstaticscopeobject_p.h | 101 - src/script/bridge/qscriptvariant.cpp | 142 - src/script/bridge/qscriptvariant_p.h | 73 - src/script/parser/make-parser.sh | 33 - src/script/parser/qscript.g | 2044 ------- src/script/parser/qscriptast.cpp | 471 -- src/script/parser/qscriptast_p.h | 1475 ------ src/script/parser/qscriptastfwd_p.h | 125 - src/script/parser/qscriptgrammar.cpp | 27 - src/script/parser/qscriptgrammar_p.h | 1076 ---- src/script/parser/qscriptlexer.cpp | 1075 ---- src/script/parser/qscriptlexer_p.h | 218 - src/script/parser/qscriptparser.cpp | 1137 ---- src/script/parser/qscriptparser_p.h | 144 - src/script/parser/qscriptsyntaxchecker.cpp | 194 - src/script/parser/qscriptsyntaxchecker_p.h | 94 - src/script/qscriptcommon_p.h | 12 - src/tools/CMakeLists.txt | 1 - src/tools/qscript/CMakeLists.txt | 35 - src/tools/qscript/qscript.1 | 108 - src/tools/qscript/qscript.cpp | 205 - src/tools/qscript/qscript.pod | 34 - src/tools/uic/cpp/cppwriteincludes.cpp | 33 - .../auto/qdeclarativeproperty/CMakeLists.txt | 5 - .../qdeclarativeproperty/data/TestType.qml | 6 - .../data/aliasPropertyBindings.qml | 19 - .../data/readSynthesizedObject.qml | 9 - .../tst_qdeclarativeproperty.cpp | 1463 ----- tests/auto/qscriptvalue/CMakeLists.txt | 6 - tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 3924 -------------- tests/auto/qscriptvalue/tst_qscriptvalue.h | 175 - .../auto/qscriptvalueiterator/CMakeLists.txt | 5 - .../tst_qscriptvalueiterator.cpp | 691 --- tests/auto/qsystemtrayicon/CMakeLists.txt | 3 - tests/auto/qsystemtrayicon/icons/icon.png | Bin 1086 -> 0 bytes .../qsystemtrayicon/tst_qsystemtrayicon.cpp | 132 - .../core/tools/qregexp/CMakeLists.txt | 2 - tests/benchmarks/core/tools/qregexp/main.cpp | 83 +- .../declarative/binding/CMakeLists.txt | 7 - .../declarative/binding/data/idproperty.txt | 9 - .../binding/data/localproperty.txt | 5 - .../binding/data/objectproperty.txt | 7 - .../declarative/binding/testtypes.cpp | 26 - .../declarative/binding/testtypes.h | 63 - .../declarative/binding/tst_binding.cpp | 141 - .../declarative/compilation/CMakeLists.txt | 5 - .../compilation/data/BoomBlock.qml | 86 - .../compilation/tst_compilation.cpp | 65 - .../declarative/creation/CMakeLists.txt | 5 - .../declarative/creation/data/item.qml | 55 - .../declarative/creation/data/qobject.qml | 25 - .../declarative/creation/tst_creation.cpp | 338 -- .../declarative/pointers/CMakeLists.txt | 5 - .../declarative/pointers/tst_pointers.cpp | 58 - .../qdeclarativecomponent/CMakeLists.txt | 7 - .../data/myqmlobject.qml | 24 - .../data/myqmlobject_binding.qml | 27 - .../qdeclarativecomponent/data/object.qml | 24 - .../qdeclarativecomponent/data/object_id.qml | 27 - .../data/synthesized_properties.2.qml | 36 - .../data/synthesized_properties.qml | 26 - .../qdeclarativecomponent/testtypes.cpp | 26 - .../qdeclarativecomponent/testtypes.h | 63 - .../tst_qdeclarativecomponent.cpp | 97 - .../qdeclarativeimage/CMakeLists.txt | 5 - .../declarative/qdeclarativeimage/image.png | Bin 611 -> 0 bytes .../tst_qdeclarativeimage.cpp | 88 - .../qdeclarativemetaproperty/CMakeLists.txt | 5 - .../qdeclarativemetaproperty/data/object.qml | 24 - .../data/synthesized_object.qml | 27 - .../tst_qdeclarativemetaproperty.cpp | 90 - .../qmltime/CMakeLists.txt.interactive | 5 - .../declarative/qmltime/example.qml | 35 - .../declarative/qmltime/qmltime.cpp | 262 - .../qmltime/tests/anchors/empty.qml | 55 - .../qmltime/tests/anchors/fill.qml | 62 - .../qmltime/tests/anchors/null.qml | 48 - .../qmltime/tests/animation/large.qml | 62 - .../qmltime/tests/animation/largeNoProps.qml | 62 - .../qmltime/tests/item_creation/children.qml | 55 - .../qmltime/tests/item_creation/data.qml | 55 - .../tests/item_creation/no_creation.qml | 33 - .../qmltime/tests/item_creation/resources.qml | 55 - .../qmltime/tests/loader/Loaded.qml | 28 - .../qmltime/tests/loader/component_loader.qml | 37 - .../qmltime/tests/loader/empty_loader.qml | 36 - .../qmltime/tests/loader/no_loader.qml | 35 - .../qmltime/tests/loader/source_loader.qml | 37 - .../positioner_creation/no_positioner.qml | 58 - .../positioner_creation/null_positioner.qml | 55 - .../tests/positioner_creation/positioner.qml | 58 - .../qmltime/tests/vmemetaobject/null.qml | 34 - .../qmltime/tests/vmemetaobject/property.qml | 39 - .../declarative/script/CMakeLists.txt | 5 - .../declarative/script/data/CustomObject.qml | 28 - .../declarative/script/data/block.qml | 55 - .../declarative/script/data/global.js | 34 - .../declarative/script/data/global_prop.qml | 33 - .../declarative/script/data/signal_args.qml | 27 - .../declarative/script/data/signal_qml.qml | 27 - .../script/data/signal_unconnected.qml | 25 - .../script/data/signal_unusedArgs.qml | 27 - .../declarative/script/data/slot_complex.qml | 37 - .../script/data/slot_complex_js.js | 8 - .../script/data/slot_complex_js.qml | 29 - .../declarative/script/data/slot_simple.qml | 30 - .../declarative/script/data/slot_simple_js.js | 3 - .../script/data/slot_simple_js.qml | 28 - .../declarative/script/tst_script.cpp | 722 --- .../declarative/typeimports/CMakeLists.txt | 5 - .../typeimports/data/QmlTestType1.qml | 23 - .../typeimports/data/QmlTestType2.qml | 23 - .../typeimports/data/QmlTestType3.qml | 23 - .../typeimports/data/QmlTestType4.qml | 23 - .../declarative/typeimports/data/cpp.qml | 36 - .../declarative/typeimports/data/qml.qml | 34 - .../typeimports/tst_typeimports.cpp | 112 - .../script/qscriptclass/CMakeLists.txt | 5 - .../script/qscriptclass/tst_qscriptclass.cpp | 267 - .../script/qscriptengine/CMakeLists.txt | 5 - .../qscriptengine/tst_qscriptengine.cpp | 553 -- .../script/qscriptqobject/CMakeLists.txt | 5 - .../qscriptqobject/tst_qscriptqobject.cpp | 1244 ----- .../script/qscriptvalue/CMakeLists.txt | 5 - .../script/qscriptvalue/tst_qscriptvalue.cpp | 1001 ---- .../qscriptvalueiterator/CMakeLists.txt | 5 - .../tst_qscriptvalueiterator.cpp | 272 - .../script/sunspider/CMakeLists.txt | 5 - .../script/sunspider/tests/3d-cube.js | 337 -- .../script/sunspider/tests/3d-morph.js | 54 - .../script/sunspider/tests/3d-raytrace.js | 441 -- .../benchmarks/script/sunspider/tests/VERSION | 1 - .../sunspider/tests/access-binary-trees.js | 50 - .../script/sunspider/tests/access-fannkuch.js | 66 - .../script/sunspider/tests/access-nbody.js | 169 - .../script/sunspider/tests/access-nsieve.js | 38 - .../tests/bitops-3bit-bits-in-byte.js | 32 - .../sunspider/tests/bitops-bits-in-byte.js | 21 - .../sunspider/tests/bitops-bitwise-and.js | 28 - .../sunspider/tests/bitops-nsieve-bits.js | 32 - .../sunspider/tests/controlflow-recursive.js | 25 - .../script/sunspider/tests/crypto-aes.js | 422 -- .../script/sunspider/tests/crypto-md5.js | 286 - .../script/sunspider/tests/crypto-sha1.js | 224 - .../sunspider/tests/date-format-tofte.js | 299 -- .../sunspider/tests/date-format-xparb.js | 417 -- .../script/sunspider/tests/math-cordic.js | 95 - .../sunspider/tests/math-partial-sums.js | 33 - .../sunspider/tests/math-spectral-norm.js | 51 - .../script/sunspider/tests/regexp-dna.js | 1712 ------ .../script/sunspider/tests/string-base64.js | 135 - .../script/sunspider/tests/string-fasta.js | 85 - .../script/sunspider/tests/string-tagcloud.js | 265 - .../sunspider/tests/string-unpack-code.js | 68 - .../sunspider/tests/string-validate-input.js | 89 - .../script/sunspider/tst_sunspider.cpp | 107 - tests/benchmarks/script/v8/CMakeLists.txt | 5 - tests/benchmarks/script/v8/tests/README.txt | 79 - tests/benchmarks/script/v8/tests/base.js | 284 - tests/benchmarks/script/v8/tests/crypto.js | 1698 ------ tests/benchmarks/script/v8/tests/deltablue.js | 880 ---- .../script/v8/tests/earley-boyer.js | 4684 ----------------- tests/benchmarks/script/v8/tests/raytrace.js | 904 ---- tests/benchmarks/script/v8/tests/regexp.js | 1764 ------- tests/benchmarks/script/v8/tests/richards.js | 539 -- tests/benchmarks/script/v8/tests/splay.js | 394 -- tests/benchmarks/script/v8/tst_v8.cpp | 116 - translations/qt.pot | 915 +--- translations/qt_tools.pot | 2 +- 851 files changed, 83 insertions(+), 244922 deletions(-) delete mode 100644 src/3rdparty/javascriptcore/API/APICast.h delete mode 100644 src/3rdparty/javascriptcore/API/APIShims.h delete mode 100644 src/3rdparty/javascriptcore/API/JSBase.h delete mode 100644 src/3rdparty/javascriptcore/API/JSCallbackConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/API/JSCallbackConstructor.h delete mode 100644 src/3rdparty/javascriptcore/API/JSCallbackFunction.cpp delete mode 100644 src/3rdparty/javascriptcore/API/JSCallbackFunction.h delete mode 100644 src/3rdparty/javascriptcore/API/JSCallbackObject.cpp delete mode 100644 src/3rdparty/javascriptcore/API/JSCallbackObject.h delete mode 100644 src/3rdparty/javascriptcore/API/JSCallbackObjectFunctions.h delete mode 100644 src/3rdparty/javascriptcore/API/JSClassRef.cpp delete mode 100644 src/3rdparty/javascriptcore/API/JSClassRef.h delete mode 100644 src/3rdparty/javascriptcore/API/JSContextRef.cpp delete mode 100644 src/3rdparty/javascriptcore/API/JSContextRef.h delete mode 100644 src/3rdparty/javascriptcore/API/JSContextRefPrivate.h delete mode 100644 src/3rdparty/javascriptcore/API/JSObjectRef.cpp delete mode 100644 src/3rdparty/javascriptcore/API/JSObjectRef.h delete mode 100644 src/3rdparty/javascriptcore/API/JSRetainPtr.h delete mode 100644 src/3rdparty/javascriptcore/API/JSStringRef.cpp delete mode 100644 src/3rdparty/javascriptcore/API/JSStringRef.h delete mode 100644 src/3rdparty/javascriptcore/API/JSValueRef.cpp delete mode 100644 src/3rdparty/javascriptcore/API/JSValueRef.h delete mode 100644 src/3rdparty/javascriptcore/API/JavaScriptCore.h delete mode 100644 src/3rdparty/javascriptcore/API/OpaqueJSString.cpp delete mode 100644 src/3rdparty/javascriptcore/API/OpaqueJSString.h delete mode 100644 src/3rdparty/javascriptcore/AUTHORS delete mode 100644 src/3rdparty/javascriptcore/COPYING.LIB delete mode 100644 src/3rdparty/javascriptcore/DerivedSources.make delete mode 100644 src/3rdparty/javascriptcore/NOTE delete mode 100644 src/3rdparty/javascriptcore/THANKS delete mode 100644 src/3rdparty/javascriptcore/bytecode/CodeBlock.cpp delete mode 100644 src/3rdparty/javascriptcore/bytecode/CodeBlock.h delete mode 100644 src/3rdparty/javascriptcore/bytecode/EvalCodeCache.h delete mode 100644 src/3rdparty/javascriptcore/bytecode/Instruction.h delete mode 100644 src/3rdparty/javascriptcore/bytecode/JumpTable.cpp delete mode 100644 src/3rdparty/javascriptcore/bytecode/JumpTable.h delete mode 100644 src/3rdparty/javascriptcore/bytecode/Opcode.cpp delete mode 100644 src/3rdparty/javascriptcore/bytecode/Opcode.h delete mode 100644 src/3rdparty/javascriptcore/bytecode/SamplingTool.cpp delete mode 100644 src/3rdparty/javascriptcore/bytecode/SamplingTool.h delete mode 100644 src/3rdparty/javascriptcore/bytecompiler/BytecodeGenerator.cpp delete mode 100644 src/3rdparty/javascriptcore/bytecompiler/BytecodeGenerator.h delete mode 100644 src/3rdparty/javascriptcore/bytecompiler/Label.h delete mode 100644 src/3rdparty/javascriptcore/bytecompiler/LabelScope.h delete mode 100644 src/3rdparty/javascriptcore/bytecompiler/NodesCodegen.cpp delete mode 100644 src/3rdparty/javascriptcore/bytecompiler/RegisterID.h delete mode 100755 src/3rdparty/javascriptcore/create_hash_table delete mode 100644 src/3rdparty/javascriptcore/debugger/Debugger.cpp delete mode 100644 src/3rdparty/javascriptcore/debugger/Debugger.h delete mode 100644 src/3rdparty/javascriptcore/debugger/DebuggerCallFrame.cpp delete mode 100644 src/3rdparty/javascriptcore/debugger/DebuggerCallFrame.h delete mode 100644 src/3rdparty/javascriptcore/generated/ArrayPrototype.lut.h delete mode 100644 src/3rdparty/javascriptcore/generated/DatePrototype.lut.h delete mode 100644 src/3rdparty/javascriptcore/generated/Grammar.cpp delete mode 100644 src/3rdparty/javascriptcore/generated/Grammar.hpp delete mode 100644 src/3rdparty/javascriptcore/generated/JSONObject.lut.h delete mode 100644 src/3rdparty/javascriptcore/generated/Lexer.lut.h delete mode 100644 src/3rdparty/javascriptcore/generated/MathObject.lut.h delete mode 100644 src/3rdparty/javascriptcore/generated/NumberConstructor.lut.h delete mode 100644 src/3rdparty/javascriptcore/generated/RegExpConstructor.lut.h delete mode 100644 src/3rdparty/javascriptcore/generated/RegExpObject.lut.h delete mode 100644 src/3rdparty/javascriptcore/generated/StringPrototype.lut.h delete mode 100644 src/3rdparty/javascriptcore/interpreter/CachedCall.h delete mode 100644 src/3rdparty/javascriptcore/interpreter/CallFrame.cpp delete mode 100644 src/3rdparty/javascriptcore/interpreter/CallFrame.h delete mode 100644 src/3rdparty/javascriptcore/interpreter/CallFrameClosure.h delete mode 100644 src/3rdparty/javascriptcore/interpreter/Interpreter.cpp delete mode 100644 src/3rdparty/javascriptcore/interpreter/Interpreter.h delete mode 100644 src/3rdparty/javascriptcore/interpreter/Register.h delete mode 100644 src/3rdparty/javascriptcore/interpreter/RegisterFile.cpp delete mode 100644 src/3rdparty/javascriptcore/interpreter/RegisterFile.h delete mode 100755 src/3rdparty/javascriptcore/make-generated-sources.sh delete mode 100644 src/3rdparty/javascriptcore/parser/Grammar.y delete mode 100644 src/3rdparty/javascriptcore/parser/Keywords.table delete mode 100644 src/3rdparty/javascriptcore/parser/Lexer.cpp delete mode 100644 src/3rdparty/javascriptcore/parser/Lexer.h delete mode 100644 src/3rdparty/javascriptcore/parser/NodeConstructors.h delete mode 100644 src/3rdparty/javascriptcore/parser/NodeInfo.h delete mode 100644 src/3rdparty/javascriptcore/parser/Nodes.cpp delete mode 100644 src/3rdparty/javascriptcore/parser/Nodes.h delete mode 100644 src/3rdparty/javascriptcore/parser/Parser.cpp delete mode 100644 src/3rdparty/javascriptcore/parser/Parser.h delete mode 100644 src/3rdparty/javascriptcore/parser/ParserArena.cpp delete mode 100644 src/3rdparty/javascriptcore/parser/ParserArena.h delete mode 100644 src/3rdparty/javascriptcore/parser/ResultType.h delete mode 100644 src/3rdparty/javascriptcore/parser/SourceCode.h delete mode 100644 src/3rdparty/javascriptcore/parser/SourceProvider.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ArgList.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ArgList.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Arguments.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/Arguments.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ArrayConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ArrayConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ArrayPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ArrayPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/BatchedTransitionOptimizer.h delete mode 100644 src/3rdparty/javascriptcore/runtime/BooleanConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/BooleanConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/BooleanObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/BooleanObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/BooleanPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/BooleanPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/CallData.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/CallData.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ClassInfo.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Collector.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/Collector.h delete mode 100644 src/3rdparty/javascriptcore/runtime/CollectorHeapIterator.h delete mode 100644 src/3rdparty/javascriptcore/runtime/CommonIdentifiers.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/CommonIdentifiers.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ConstructData.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ConstructData.h delete mode 100644 src/3rdparty/javascriptcore/runtime/DateConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/DateConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/DateConversion.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/DateConversion.h delete mode 100644 src/3rdparty/javascriptcore/runtime/DateInstance.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/DateInstance.h delete mode 100644 src/3rdparty/javascriptcore/runtime/DateInstanceCache.h delete mode 100644 src/3rdparty/javascriptcore/runtime/DatePrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/DatePrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Error.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/Error.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ErrorConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ErrorConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ErrorInstance.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ErrorInstance.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ErrorPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ErrorPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ExceptionHelpers.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ExceptionHelpers.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Executable.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/Executable.h delete mode 100644 src/3rdparty/javascriptcore/runtime/FunctionConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/FunctionConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/FunctionPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/FunctionPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/GetterSetter.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/GetterSetter.h delete mode 100644 src/3rdparty/javascriptcore/runtime/GlobalEvalFunction.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/GlobalEvalFunction.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Identifier.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/Identifier.h delete mode 100644 src/3rdparty/javascriptcore/runtime/InitializeThreading.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/InitializeThreading.h delete mode 100644 src/3rdparty/javascriptcore/runtime/InternalFunction.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/InternalFunction.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSAPIValueWrapper.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSAPIValueWrapper.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSActivation.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSActivation.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSArray.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSArray.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSByteArray.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSByteArray.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSCell.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSCell.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSFunction.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSFunction.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSGlobalData.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSGlobalData.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSGlobalObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSGlobalObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSGlobalObjectFunctions.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSGlobalObjectFunctions.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSImmediate.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSImmediate.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSNotAnObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSNotAnObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSNumberCell.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSNumberCell.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSONObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSONObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSPropertyNameIterator.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSPropertyNameIterator.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSStaticScopeObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSStaticScopeObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSString.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSString.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSType.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSTypeInfo.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSValue.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSValue.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSVariableObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSVariableObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSWrapperObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSWrapperObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/JSZombie.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/JSZombie.h delete mode 100644 src/3rdparty/javascriptcore/runtime/LiteralParser.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/LiteralParser.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Lookup.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/Lookup.h delete mode 100644 src/3rdparty/javascriptcore/runtime/MarkStack.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/MarkStack.h delete mode 100644 src/3rdparty/javascriptcore/runtime/MathObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/MathObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/NativeErrorConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/NativeErrorConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/NativeErrorPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/NativeErrorPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/NumberConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/NumberConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/NumberObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/NumberObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/NumberPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/NumberPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/NumericStrings.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ObjectConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ObjectConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ObjectPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ObjectPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Operations.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/Operations.h delete mode 100644 src/3rdparty/javascriptcore/runtime/PropertyDescriptor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/PropertyDescriptor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/PropertyMapHashTable.h delete mode 100644 src/3rdparty/javascriptcore/runtime/PropertyNameArray.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/PropertyNameArray.h delete mode 100644 src/3rdparty/javascriptcore/runtime/PropertySlot.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/PropertySlot.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Protect.h delete mode 100644 src/3rdparty/javascriptcore/runtime/PrototypeFunction.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/PrototypeFunction.h delete mode 100644 src/3rdparty/javascriptcore/runtime/PutPropertySlot.h delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExp.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExp.h delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExpConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExpConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExpMatchesArray.h delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExpObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExpObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExpPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/RegExpPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ScopeChain.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/ScopeChain.h delete mode 100644 src/3rdparty/javascriptcore/runtime/ScopeChainMark.h delete mode 100644 src/3rdparty/javascriptcore/runtime/SmallStrings.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/SmallStrings.h delete mode 100644 src/3rdparty/javascriptcore/runtime/StringBuilder.h delete mode 100644 src/3rdparty/javascriptcore/runtime/StringConstructor.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/StringConstructor.h delete mode 100644 src/3rdparty/javascriptcore/runtime/StringObject.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/StringObject.h delete mode 100644 src/3rdparty/javascriptcore/runtime/StringPrototype.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/StringPrototype.h delete mode 100644 src/3rdparty/javascriptcore/runtime/Structure.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/Structure.h delete mode 100644 src/3rdparty/javascriptcore/runtime/StructureChain.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/StructureChain.h delete mode 100644 src/3rdparty/javascriptcore/runtime/StructureTransitionTable.h delete mode 100644 src/3rdparty/javascriptcore/runtime/SymbolTable.h delete mode 100644 src/3rdparty/javascriptcore/runtime/TimeoutChecker.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/TimeoutChecker.h delete mode 100644 src/3rdparty/javascriptcore/runtime/UString.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/UString.h delete mode 100644 src/3rdparty/javascriptcore/runtime/UStringImpl.cpp delete mode 100644 src/3rdparty/javascriptcore/runtime/UStringImpl.h delete mode 100644 src/3rdparty/javascriptcore/runtime/WeakGCMap.h delete mode 100644 src/3rdparty/javascriptcore/runtime/WeakGCPtr.h delete mode 100644 src/3rdparty/javascriptcore/wtf/ASCIICType.h delete mode 100644 src/3rdparty/javascriptcore/wtf/AVLTree.h delete mode 100644 src/3rdparty/javascriptcore/wtf/AlwaysInline.h delete mode 100644 src/3rdparty/javascriptcore/wtf/Assertions.h delete mode 100644 src/3rdparty/javascriptcore/wtf/ByteArray.cpp delete mode 100644 src/3rdparty/javascriptcore/wtf/ByteArray.h delete mode 100644 src/3rdparty/javascriptcore/wtf/CrossThreadRefCounted.h delete mode 100644 src/3rdparty/javascriptcore/wtf/CurrentTime.h delete mode 100644 src/3rdparty/javascriptcore/wtf/DateMath.cpp delete mode 100644 src/3rdparty/javascriptcore/wtf/DateMath.h delete mode 100644 src/3rdparty/javascriptcore/wtf/FastAllocBase.h delete mode 100644 src/3rdparty/javascriptcore/wtf/FastMalloc.cpp delete mode 100644 src/3rdparty/javascriptcore/wtf/FastMalloc.h delete mode 100644 src/3rdparty/javascriptcore/wtf/Forward.h delete mode 100644 src/3rdparty/javascriptcore/wtf/GetPtr.h delete mode 100644 src/3rdparty/javascriptcore/wtf/HashCountedSet.h delete mode 100644 src/3rdparty/javascriptcore/wtf/HashFunctions.h delete mode 100644 src/3rdparty/javascriptcore/wtf/HashIterators.h delete mode 100644 src/3rdparty/javascriptcore/wtf/HashMap.h delete mode 100644 src/3rdparty/javascriptcore/wtf/HashSet.h delete mode 100644 src/3rdparty/javascriptcore/wtf/HashTable.cpp delete mode 100644 src/3rdparty/javascriptcore/wtf/HashTable.h delete mode 100644 src/3rdparty/javascriptcore/wtf/HashTraits.h delete mode 100644 src/3rdparty/javascriptcore/wtf/Noncopyable.h delete mode 100644 src/3rdparty/javascriptcore/wtf/NotFound.h delete mode 100644 src/3rdparty/javascriptcore/wtf/OwnArrayPtr.h delete mode 100644 src/3rdparty/javascriptcore/wtf/OwnFastMallocPtr.h delete mode 100644 src/3rdparty/javascriptcore/wtf/OwnPtr.h delete mode 100644 src/3rdparty/javascriptcore/wtf/PassRefPtr.h delete mode 100644 src/3rdparty/javascriptcore/wtf/Platform.h delete mode 100644 src/3rdparty/javascriptcore/wtf/PtrAndFlags.h delete mode 100644 src/3rdparty/javascriptcore/wtf/RefCounted.h delete mode 100644 src/3rdparty/javascriptcore/wtf/RefPtr.h delete mode 100644 src/3rdparty/javascriptcore/wtf/SegmentedVector.h delete mode 100644 src/3rdparty/javascriptcore/wtf/StdLibExtras.h delete mode 100644 src/3rdparty/javascriptcore/wtf/StringHashFunctions.h delete mode 100644 src/3rdparty/javascriptcore/wtf/Threading.cpp delete mode 100644 src/3rdparty/javascriptcore/wtf/Threading.h delete mode 100644 src/3rdparty/javascriptcore/wtf/TypeTraits.cpp delete mode 100644 src/3rdparty/javascriptcore/wtf/TypeTraits.h delete mode 100644 src/3rdparty/javascriptcore/wtf/Vector.h delete mode 100644 src/3rdparty/javascriptcore/wtf/VectorTraits.h delete mode 100644 src/3rdparty/javascriptcore/wtf/dtoa.cpp delete mode 100644 src/3rdparty/javascriptcore/wtf/dtoa.h delete mode 100644 src/3rdparty/javascriptcore/wtf/unicode/UTF8.cpp delete mode 100644 src/3rdparty/javascriptcore/wtf/unicode/UTF8.h delete mode 100644 src/3rdparty/javascriptcore/wtf/unicode/Unicode.h delete mode 100644 src/declarative/CMakeLists.txt delete mode 100644 src/declarative/graphicsitems/qdeclarativeanchors.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeanchors_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeanchors_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeanimatedimage_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeanimatedimage_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeborderimage.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeborderimage_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeborderimage_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeevents.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeevents_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeflickable.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeflickable_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeflickable_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeflipable.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeflipable_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativefocuspanel.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativefocuspanel_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativefocusscope.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativefocusscope_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativegraphicswidget_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativegridview.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativegridview_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeimage.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeimage_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeimage_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeimagebase.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeimagebase_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeimplicitsizeitem.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeimplicitsizeitem_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeitem.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeitem.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeitem_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeitemchangelistener_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeitemsmodule_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativelayoutitem.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativelayoutitem_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativelistview.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativelistview_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeloader.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativeloader_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativeloader_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativemousearea.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativemousearea_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativemousearea_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativepainteditem.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativepainteditem_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativepainteditem_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativepath.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativepath_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativepath_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativepathview.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativepathview_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativepathview_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativepositioners.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativepositioners_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativepositioners_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativerectangle.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativerectangle_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativerectangle_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativerepeater.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativerepeater_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativerepeater_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativescalegrid.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativescalegrid_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativetext.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativetext_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativetext_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativetextedit.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativetextedit_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativetextedit_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativetextinput.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativetextinput_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativetextinput_p_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativetranslate.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativetranslate_p.h delete mode 100644 src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp delete mode 100644 src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h delete mode 100644 src/declarative/qdeclarativecommon_p.h delete mode 100755 src/declarative/qml/parser/make-parser.sh delete mode 100644 src/declarative/qml/parser/qdeclarativejs.g delete mode 100644 src/declarative/qml/parser/qdeclarativejsast.cpp delete mode 100644 src/declarative/qml/parser/qdeclarativejsast_p.h delete mode 100644 src/declarative/qml/parser/qdeclarativejsastfwd_p.h delete mode 100644 src/declarative/qml/parser/qdeclarativejsastvisitor.cpp delete mode 100644 src/declarative/qml/parser/qdeclarativejsastvisitor_p.h delete mode 100644 src/declarative/qml/parser/qdeclarativejsengine_p.cpp delete mode 100644 src/declarative/qml/parser/qdeclarativejsengine_p.h delete mode 100644 src/declarative/qml/parser/qdeclarativejsgrammar.cpp delete mode 100644 src/declarative/qml/parser/qdeclarativejsgrammar_p.h delete mode 100644 src/declarative/qml/parser/qdeclarativejslexer.cpp delete mode 100644 src/declarative/qml/parser/qdeclarativejslexer_p.h delete mode 100644 src/declarative/qml/parser/qdeclarativejsmemorypool_p.h delete mode 100644 src/declarative/qml/parser/qdeclarativejsnodepool_p.h delete mode 100644 src/declarative/qml/parser/qdeclarativejsparser.cpp delete mode 100644 src/declarative/qml/parser/qdeclarativejsparser_p.h delete mode 100644 src/declarative/qml/qdeclarative.h delete mode 100644 src/declarative/qml/qdeclarativebinding.cpp delete mode 100644 src/declarative/qml/qdeclarativebinding_p.h delete mode 100644 src/declarative/qml/qdeclarativebinding_p_p.h delete mode 100644 src/declarative/qml/qdeclarativeboundsignal.cpp delete mode 100644 src/declarative/qml/qdeclarativeboundsignal_p.h delete mode 100644 src/declarative/qml/qdeclarativecleanup.cpp delete mode 100644 src/declarative/qml/qdeclarativecleanup_p.h delete mode 100644 src/declarative/qml/qdeclarativecompiledbindings.cpp delete mode 100644 src/declarative/qml/qdeclarativecompiledbindings_p.h delete mode 100644 src/declarative/qml/qdeclarativecompileddata.cpp delete mode 100644 src/declarative/qml/qdeclarativecompiler.cpp delete mode 100644 src/declarative/qml/qdeclarativecompiler_p.h delete mode 100644 src/declarative/qml/qdeclarativecomponent.cpp delete mode 100644 src/declarative/qml/qdeclarativecomponent.h delete mode 100644 src/declarative/qml/qdeclarativecomponent_p.h delete mode 100644 src/declarative/qml/qdeclarativecontext.cpp delete mode 100644 src/declarative/qml/qdeclarativecontext.h delete mode 100644 src/declarative/qml/qdeclarativecontext_p.h delete mode 100644 src/declarative/qml/qdeclarativecontextscriptclass.cpp delete mode 100644 src/declarative/qml/qdeclarativecontextscriptclass_p.h delete mode 100644 src/declarative/qml/qdeclarativecustomparser.cpp delete mode 100644 src/declarative/qml/qdeclarativecustomparser_p.h delete mode 100644 src/declarative/qml/qdeclarativecustomparser_p_p.h delete mode 100644 src/declarative/qml/qdeclarativedata_p.h delete mode 100644 src/declarative/qml/qdeclarativedirparser.cpp delete mode 100644 src/declarative/qml/qdeclarativedirparser_p.h delete mode 100644 src/declarative/qml/qdeclarativeengine.cpp delete mode 100644 src/declarative/qml/qdeclarativeengine.h delete mode 100644 src/declarative/qml/qdeclarativeengine_p.h delete mode 100644 src/declarative/qml/qdeclarativeerror.cpp delete mode 100644 src/declarative/qml/qdeclarativeerror.h delete mode 100644 src/declarative/qml/qdeclarativeexpression.cpp delete mode 100644 src/declarative/qml/qdeclarativeexpression.h delete mode 100644 src/declarative/qml/qdeclarativeexpression_p.h delete mode 100644 src/declarative/qml/qdeclarativeextensioninterface.h delete mode 100644 src/declarative/qml/qdeclarativeextensionplugin.cpp delete mode 100644 src/declarative/qml/qdeclarativeextensionplugin.h delete mode 100644 src/declarative/qml/qdeclarativeglobal_p.h delete mode 100644 src/declarative/qml/qdeclarativeglobalscriptclass.cpp delete mode 100644 src/declarative/qml/qdeclarativeglobalscriptclass_p.h delete mode 100644 src/declarative/qml/qdeclarativeguard_p.h delete mode 100644 src/declarative/qml/qdeclarativeimageprovider.cpp delete mode 100644 src/declarative/qml/qdeclarativeimageprovider.h delete mode 100644 src/declarative/qml/qdeclarativeimport.cpp delete mode 100644 src/declarative/qml/qdeclarativeimport_p.h delete mode 100644 src/declarative/qml/qdeclarativeinclude.cpp delete mode 100644 src/declarative/qml/qdeclarativeinclude_p.h delete mode 100644 src/declarative/qml/qdeclarativeinfo.cpp delete mode 100644 src/declarative/qml/qdeclarativeinfo.h delete mode 100644 src/declarative/qml/qdeclarativeinstruction.cpp delete mode 100644 src/declarative/qml/qdeclarativeinstruction_p.h delete mode 100644 src/declarative/qml/qdeclarativeintegercache.cpp delete mode 100644 src/declarative/qml/qdeclarativeintegercache_p.h delete mode 100644 src/declarative/qml/qdeclarativelist.cpp delete mode 100644 src/declarative/qml/qdeclarativelist.h delete mode 100644 src/declarative/qml/qdeclarativelist_p.h delete mode 100644 src/declarative/qml/qdeclarativelistscriptclass.cpp delete mode 100644 src/declarative/qml/qdeclarativelistscriptclass_p.h delete mode 100644 src/declarative/qml/qdeclarativemetatype.cpp delete mode 100644 src/declarative/qml/qdeclarativemetatype_p.h delete mode 100644 src/declarative/qml/qdeclarativenotifier.cpp delete mode 100644 src/declarative/qml/qdeclarativenotifier_p.h delete mode 100644 src/declarative/qml/qdeclarativeobjectscriptclass.cpp delete mode 100644 src/declarative/qml/qdeclarativeobjectscriptclass_p.h delete mode 100644 src/declarative/qml/qdeclarativeparser.cpp delete mode 100644 src/declarative/qml/qdeclarativeparser_p.h delete mode 100644 src/declarative/qml/qdeclarativeparserstatus.cpp delete mode 100644 src/declarative/qml/qdeclarativeparserstatus.h delete mode 100644 src/declarative/qml/qdeclarativeprivate.h delete mode 100644 src/declarative/qml/qdeclarativeproperty.cpp delete mode 100644 src/declarative/qml/qdeclarativeproperty.h delete mode 100644 src/declarative/qml/qdeclarativeproperty_p.h delete mode 100644 src/declarative/qml/qdeclarativepropertycache.cpp delete mode 100644 src/declarative/qml/qdeclarativepropertycache_p.h delete mode 100644 src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp delete mode 100644 src/declarative/qml/qdeclarativepropertyvalueinterceptor.h delete mode 100644 src/declarative/qml/qdeclarativepropertyvaluesource.cpp delete mode 100644 src/declarative/qml/qdeclarativepropertyvaluesource.h delete mode 100644 src/declarative/qml/qdeclarativeproxymetaobject.cpp delete mode 100644 src/declarative/qml/qdeclarativeproxymetaobject_p.h delete mode 100644 src/declarative/qml/qdeclarativerefcount.cpp delete mode 100644 src/declarative/qml/qdeclarativerefcount_p.h delete mode 100644 src/declarative/qml/qdeclarativerewrite.cpp delete mode 100644 src/declarative/qml/qdeclarativerewrite_p.h delete mode 100644 src/declarative/qml/qdeclarativescriptparser.cpp delete mode 100644 src/declarative/qml/qdeclarativescriptparser_p.h delete mode 100644 src/declarative/qml/qdeclarativescriptstring.cpp delete mode 100644 src/declarative/qml/qdeclarativescriptstring.h delete mode 100644 src/declarative/qml/qdeclarativestringconverters.cpp delete mode 100644 src/declarative/qml/qdeclarativestringconverters_p.h delete mode 100644 src/declarative/qml/qdeclarativetypeloader.cpp delete mode 100644 src/declarative/qml/qdeclarativetypeloader_p.h delete mode 100644 src/declarative/qml/qdeclarativetypenamecache.cpp delete mode 100644 src/declarative/qml/qdeclarativetypenamecache_p.h delete mode 100644 src/declarative/qml/qdeclarativetypenamescriptclass.cpp delete mode 100644 src/declarative/qml/qdeclarativetypenamescriptclass_p.h delete mode 100644 src/declarative/qml/qdeclarativetypenotavailable.cpp delete mode 100644 src/declarative/qml/qdeclarativetypenotavailable_p.h delete mode 100644 src/declarative/qml/qdeclarativevaluetype.cpp delete mode 100644 src/declarative/qml/qdeclarativevaluetype_p.h delete mode 100644 src/declarative/qml/qdeclarativevaluetypescriptclass.cpp delete mode 100644 src/declarative/qml/qdeclarativevaluetypescriptclass_p.h delete mode 100644 src/declarative/qml/qdeclarativevme.cpp delete mode 100644 src/declarative/qml/qdeclarativevme_p.h delete mode 100644 src/declarative/qml/qdeclarativevmemetaobject.cpp delete mode 100644 src/declarative/qml/qdeclarativevmemetaobject_p.h delete mode 100644 src/declarative/qml/qdeclarativeworkerscript.cpp delete mode 100644 src/declarative/qml/qdeclarativeworkerscript_p.h delete mode 100644 src/declarative/qml/qmetaobjectbuilder.cpp delete mode 100644 src/declarative/qml/qmetaobjectbuilder_p.h delete mode 100644 src/declarative/qml/qpodvector_p.h delete mode 100644 src/declarative/qml/rewriter/textwriter.cpp delete mode 100644 src/declarative/qml/rewriter/textwriter_p.h delete mode 100644 src/declarative/util/qdeclarativeanimation.cpp delete mode 100644 src/declarative/util/qdeclarativeanimation_p.h delete mode 100644 src/declarative/util/qdeclarativeanimation_p_p.h delete mode 100644 src/declarative/util/qdeclarativeapplication.cpp delete mode 100644 src/declarative/util/qdeclarativeapplication_p.h delete mode 100644 src/declarative/util/qdeclarativebehavior.cpp delete mode 100644 src/declarative/util/qdeclarativebehavior_p.h delete mode 100644 src/declarative/util/qdeclarativebind.cpp delete mode 100644 src/declarative/util/qdeclarativebind_p.h delete mode 100644 src/declarative/util/qdeclarativeconnections.cpp delete mode 100644 src/declarative/util/qdeclarativeconnections_p.h delete mode 100644 src/declarative/util/qdeclarativelistaccessor.cpp delete mode 100644 src/declarative/util/qdeclarativelistaccessor_p.h delete mode 100644 src/declarative/util/qdeclarativelistmodel.cpp delete mode 100644 src/declarative/util/qdeclarativelistmodel_p.h delete mode 100644 src/declarative/util/qdeclarativelistmodel_p_p.h delete mode 100644 src/declarative/util/qdeclarativelistmodelworkeragent.cpp delete mode 100644 src/declarative/util/qdeclarativelistmodelworkeragent_p.h delete mode 100644 src/declarative/util/qdeclarativenullablevalue_p_p.h delete mode 100644 src/declarative/util/qdeclarativeopenmetaobject.cpp delete mode 100644 src/declarative/util/qdeclarativeopenmetaobject_p.h delete mode 100644 src/declarative/util/qdeclarativepackage.cpp delete mode 100644 src/declarative/util/qdeclarativepackage_p.h delete mode 100644 src/declarative/util/qdeclarativepixmapcache.cpp delete mode 100644 src/declarative/util/qdeclarativepixmapcache_p.h delete mode 100644 src/declarative/util/qdeclarativepropertychanges.cpp delete mode 100644 src/declarative/util/qdeclarativepropertychanges_p.h delete mode 100644 src/declarative/util/qdeclarativepropertymap.cpp delete mode 100644 src/declarative/util/qdeclarativepropertymap.h delete mode 100644 src/declarative/util/qdeclarativesmoothedanimation.cpp delete mode 100644 src/declarative/util/qdeclarativesmoothedanimation_p.h delete mode 100644 src/declarative/util/qdeclarativesmoothedanimation_p_p.h delete mode 100644 src/declarative/util/qdeclarativespringanimation.cpp delete mode 100644 src/declarative/util/qdeclarativespringanimation_p.h delete mode 100644 src/declarative/util/qdeclarativestate.cpp delete mode 100644 src/declarative/util/qdeclarativestate_p.h delete mode 100644 src/declarative/util/qdeclarativestate_p_p.h delete mode 100644 src/declarative/util/qdeclarativestategroup.cpp delete mode 100644 src/declarative/util/qdeclarativestategroup_p.h delete mode 100644 src/declarative/util/qdeclarativestateoperations.cpp delete mode 100644 src/declarative/util/qdeclarativestateoperations_p.h delete mode 100644 src/declarative/util/qdeclarativestyledtext.cpp delete mode 100644 src/declarative/util/qdeclarativestyledtext_p.h delete mode 100644 src/declarative/util/qdeclarativesystempalette.cpp delete mode 100644 src/declarative/util/qdeclarativesystempalette_p.h delete mode 100644 src/declarative/util/qdeclarativetimeline.cpp delete mode 100644 src/declarative/util/qdeclarativetimeline_p_p.h delete mode 100644 src/declarative/util/qdeclarativetimer.cpp delete mode 100644 src/declarative/util/qdeclarativetimer_p.h delete mode 100644 src/declarative/util/qdeclarativetransition.cpp delete mode 100644 src/declarative/util/qdeclarativetransition_p.h delete mode 100644 src/declarative/util/qdeclarativetransitionmanager.cpp delete mode 100644 src/declarative/util/qdeclarativetransitionmanager_p_p.h delete mode 100644 src/declarative/util/qdeclarativeutilmodule.cpp delete mode 100644 src/declarative/util/qdeclarativeutilmodule_p.h delete mode 100644 src/declarative/util/qdeclarativeview.cpp delete mode 100644 src/declarative/util/qdeclarativeview.h delete mode 100644 src/declarative/util/qlistmodelinterface.cpp delete mode 100644 src/declarative/util/qlistmodelinterface_p.h delete mode 100644 src/gui/util/qsystemtrayicon.cpp delete mode 100644 src/gui/util/qsystemtrayicon.h delete mode 100644 src/gui/util/qsystemtrayicon_p.h delete mode 100644 src/gui/util/qsystemtrayicon_x11.cpp delete mode 100644 src/imports/CMakeLists.txt delete mode 100644 src/imports/folderlistmodel/CMakeLists.txt delete mode 100644 src/imports/folderlistmodel/folderlistmodel.cpp delete mode 100644 src/imports/folderlistmodel/qdeclarativefolderlistmodel.cpp delete mode 100644 src/imports/folderlistmodel/qdeclarativefolderlistmodel.h delete mode 100644 src/imports/folderlistmodel/qmldir delete mode 100644 src/imports/particles/CMakeLists.txt delete mode 100644 src/imports/particles/particles.cpp delete mode 100644 src/imports/particles/qdeclarativeparticles.cpp delete mode 100644 src/imports/particles/qdeclarativeparticles_p.h delete mode 100644 src/imports/particles/qmldir delete mode 100644 src/plugins/designer/qdeclarativeview/CMakeLists.txt delete mode 100644 src/plugins/designer/qdeclarativeview/qdeclarativeview_plugin.cpp delete mode 100644 src/plugins/designer/qdeclarativeview/qdeclarativeview_plugin.h delete mode 100644 src/plugins/script/qtdbus/CMakeLists.txt delete mode 100644 src/plugins/script/qtdbus/dbmain.cpp delete mode 100644 src/plugins/script/qtdbus/dbmain.h delete mode 100644 src/script/CMakeLists.txt delete mode 100644 src/script/api/qscriptable.cpp delete mode 100644 src/script/api/qscriptable.h delete mode 100644 src/script/api/qscriptable_p.h delete mode 100644 src/script/api/qscriptclass.cpp delete mode 100644 src/script/api/qscriptclass.h delete mode 100644 src/script/api/qscriptclasspropertyiterator.cpp delete mode 100644 src/script/api/qscriptclasspropertyiterator.h delete mode 100644 src/script/api/qscriptcontext.cpp delete mode 100644 src/script/api/qscriptcontext.h delete mode 100644 src/script/api/qscriptcontext_p.h delete mode 100644 src/script/api/qscriptcontextinfo.cpp delete mode 100644 src/script/api/qscriptcontextinfo.h delete mode 100644 src/script/api/qscriptengine.cpp delete mode 100644 src/script/api/qscriptengine.h delete mode 100644 src/script/api/qscriptengine_p.h delete mode 100644 src/script/api/qscriptengineagent.cpp delete mode 100644 src/script/api/qscriptengineagent.h delete mode 100644 src/script/api/qscriptengineagent_p.h delete mode 100644 src/script/api/qscriptextensioninterface.h delete mode 100644 src/script/api/qscriptextensionplugin.cpp delete mode 100644 src/script/api/qscriptextensionplugin.h delete mode 100644 src/script/api/qscriptprogram.cpp delete mode 100644 src/script/api/qscriptprogram.h delete mode 100644 src/script/api/qscriptprogram_p.h delete mode 100644 src/script/api/qscriptstring.cpp delete mode 100644 src/script/api/qscriptstring.h delete mode 100644 src/script/api/qscriptstring_p.h delete mode 100644 src/script/api/qscriptvalue.cpp delete mode 100644 src/script/api/qscriptvalue.h delete mode 100644 src/script/api/qscriptvalue_p.h delete mode 100644 src/script/api/qscriptvalueiterator.cpp delete mode 100644 src/script/api/qscriptvalueiterator.h delete mode 100644 src/script/bridge/qscriptactivationobject.cpp delete mode 100644 src/script/bridge/qscriptactivationobject_p.h delete mode 100644 src/script/bridge/qscriptclassobject.cpp delete mode 100644 src/script/bridge/qscriptclassobject_p.h delete mode 100644 src/script/bridge/qscriptdeclarativeclass.cpp delete mode 100644 src/script/bridge/qscriptdeclarativeclass_p.h delete mode 100644 src/script/bridge/qscriptdeclarativeobject.cpp delete mode 100644 src/script/bridge/qscriptdeclarativeobject_p.h delete mode 100644 src/script/bridge/qscriptfunction.cpp delete mode 100644 src/script/bridge/qscriptfunction_p.h delete mode 100644 src/script/bridge/qscriptglobalobject.cpp delete mode 100644 src/script/bridge/qscriptglobalobject_p.h delete mode 100644 src/script/bridge/qscriptobject.cpp delete mode 100644 src/script/bridge/qscriptobject_p.h delete mode 100644 src/script/bridge/qscriptqobject.cpp delete mode 100644 src/script/bridge/qscriptqobject_p.h delete mode 100644 src/script/bridge/qscriptstaticscopeobject.cpp delete mode 100644 src/script/bridge/qscriptstaticscopeobject_p.h delete mode 100644 src/script/bridge/qscriptvariant.cpp delete mode 100644 src/script/bridge/qscriptvariant_p.h delete mode 100755 src/script/parser/make-parser.sh delete mode 100644 src/script/parser/qscript.g delete mode 100644 src/script/parser/qscriptast.cpp delete mode 100644 src/script/parser/qscriptast_p.h delete mode 100644 src/script/parser/qscriptastfwd_p.h delete mode 100644 src/script/parser/qscriptgrammar.cpp delete mode 100644 src/script/parser/qscriptgrammar_p.h delete mode 100644 src/script/parser/qscriptlexer.cpp delete mode 100644 src/script/parser/qscriptlexer_p.h delete mode 100644 src/script/parser/qscriptparser.cpp delete mode 100644 src/script/parser/qscriptparser_p.h delete mode 100644 src/script/parser/qscriptsyntaxchecker.cpp delete mode 100644 src/script/parser/qscriptsyntaxchecker_p.h delete mode 100644 src/script/qscriptcommon_p.h delete mode 100644 src/tools/qscript/CMakeLists.txt delete mode 100644 src/tools/qscript/qscript.1 delete mode 100644 src/tools/qscript/qscript.cpp delete mode 100644 src/tools/qscript/qscript.pod delete mode 100644 tests/auto/qdeclarativeproperty/CMakeLists.txt delete mode 100644 tests/auto/qdeclarativeproperty/data/TestType.qml delete mode 100644 tests/auto/qdeclarativeproperty/data/aliasPropertyBindings.qml delete mode 100644 tests/auto/qdeclarativeproperty/data/readSynthesizedObject.qml delete mode 100644 tests/auto/qdeclarativeproperty/tst_qdeclarativeproperty.cpp delete mode 100644 tests/auto/qscriptvalue/CMakeLists.txt delete mode 100644 tests/auto/qscriptvalue/tst_qscriptvalue.cpp delete mode 100644 tests/auto/qscriptvalue/tst_qscriptvalue.h delete mode 100644 tests/auto/qscriptvalueiterator/CMakeLists.txt delete mode 100644 tests/auto/qscriptvalueiterator/tst_qscriptvalueiterator.cpp delete mode 100644 tests/auto/qsystemtrayicon/CMakeLists.txt delete mode 100644 tests/auto/qsystemtrayicon/icons/icon.png delete mode 100644 tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp delete mode 100644 tests/benchmarks/declarative/binding/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/binding/data/idproperty.txt delete mode 100644 tests/benchmarks/declarative/binding/data/localproperty.txt delete mode 100644 tests/benchmarks/declarative/binding/data/objectproperty.txt delete mode 100644 tests/benchmarks/declarative/binding/testtypes.cpp delete mode 100644 tests/benchmarks/declarative/binding/testtypes.h delete mode 100644 tests/benchmarks/declarative/binding/tst_binding.cpp delete mode 100644 tests/benchmarks/declarative/compilation/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/compilation/data/BoomBlock.qml delete mode 100644 tests/benchmarks/declarative/compilation/tst_compilation.cpp delete mode 100644 tests/benchmarks/declarative/creation/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/creation/data/item.qml delete mode 100644 tests/benchmarks/declarative/creation/data/qobject.qml delete mode 100644 tests/benchmarks/declarative/creation/tst_creation.cpp delete mode 100644 tests/benchmarks/declarative/pointers/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/pointers/tst_pointers.cpp delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/data/myqmlobject.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/data/myqmlobject_binding.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/data/object.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/data/object_id.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.2.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/data/synthesized_properties.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/testtypes.cpp delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/testtypes.h delete mode 100644 tests/benchmarks/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp delete mode 100644 tests/benchmarks/declarative/qdeclarativeimage/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/qdeclarativeimage/image.png delete mode 100644 tests/benchmarks/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp delete mode 100644 tests/benchmarks/declarative/qdeclarativemetaproperty/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/qdeclarativemetaproperty/data/object.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativemetaproperty/data/synthesized_object.qml delete mode 100644 tests/benchmarks/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp delete mode 100644 tests/benchmarks/declarative/qmltime/CMakeLists.txt.interactive delete mode 100644 tests/benchmarks/declarative/qmltime/example.qml delete mode 100644 tests/benchmarks/declarative/qmltime/qmltime.cpp delete mode 100644 tests/benchmarks/declarative/qmltime/tests/anchors/empty.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/anchors/fill.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/anchors/null.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/animation/large.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/animation/largeNoProps.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/item_creation/children.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/item_creation/data.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/item_creation/no_creation.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/item_creation/resources.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/Loaded.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/component_loader.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/empty_loader.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/no_loader.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/loader/source_loader.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/positioner_creation/no_positioner.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/positioner_creation/null_positioner.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/positioner_creation/positioner.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/vmemetaobject/null.qml delete mode 100644 tests/benchmarks/declarative/qmltime/tests/vmemetaobject/property.qml delete mode 100644 tests/benchmarks/declarative/script/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/script/data/CustomObject.qml delete mode 100644 tests/benchmarks/declarative/script/data/block.qml delete mode 100644 tests/benchmarks/declarative/script/data/global.js delete mode 100644 tests/benchmarks/declarative/script/data/global_prop.qml delete mode 100644 tests/benchmarks/declarative/script/data/signal_args.qml delete mode 100644 tests/benchmarks/declarative/script/data/signal_qml.qml delete mode 100644 tests/benchmarks/declarative/script/data/signal_unconnected.qml delete mode 100644 tests/benchmarks/declarative/script/data/signal_unusedArgs.qml delete mode 100644 tests/benchmarks/declarative/script/data/slot_complex.qml delete mode 100644 tests/benchmarks/declarative/script/data/slot_complex_js.js delete mode 100644 tests/benchmarks/declarative/script/data/slot_complex_js.qml delete mode 100644 tests/benchmarks/declarative/script/data/slot_simple.qml delete mode 100644 tests/benchmarks/declarative/script/data/slot_simple_js.js delete mode 100644 tests/benchmarks/declarative/script/data/slot_simple_js.qml delete mode 100644 tests/benchmarks/declarative/script/tst_script.cpp delete mode 100644 tests/benchmarks/declarative/typeimports/CMakeLists.txt delete mode 100644 tests/benchmarks/declarative/typeimports/data/QmlTestType1.qml delete mode 100644 tests/benchmarks/declarative/typeimports/data/QmlTestType2.qml delete mode 100644 tests/benchmarks/declarative/typeimports/data/QmlTestType3.qml delete mode 100644 tests/benchmarks/declarative/typeimports/data/QmlTestType4.qml delete mode 100644 tests/benchmarks/declarative/typeimports/data/cpp.qml delete mode 100644 tests/benchmarks/declarative/typeimports/data/qml.qml delete mode 100644 tests/benchmarks/declarative/typeimports/tst_typeimports.cpp delete mode 100644 tests/benchmarks/script/qscriptclass/CMakeLists.txt delete mode 100644 tests/benchmarks/script/qscriptclass/tst_qscriptclass.cpp delete mode 100644 tests/benchmarks/script/qscriptengine/CMakeLists.txt delete mode 100644 tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp delete mode 100644 tests/benchmarks/script/qscriptqobject/CMakeLists.txt delete mode 100644 tests/benchmarks/script/qscriptqobject/tst_qscriptqobject.cpp delete mode 100644 tests/benchmarks/script/qscriptvalue/CMakeLists.txt delete mode 100644 tests/benchmarks/script/qscriptvalue/tst_qscriptvalue.cpp delete mode 100644 tests/benchmarks/script/qscriptvalueiterator/CMakeLists.txt delete mode 100644 tests/benchmarks/script/qscriptvalueiterator/tst_qscriptvalueiterator.cpp delete mode 100644 tests/benchmarks/script/sunspider/CMakeLists.txt delete mode 100644 tests/benchmarks/script/sunspider/tests/3d-cube.js delete mode 100644 tests/benchmarks/script/sunspider/tests/3d-morph.js delete mode 100644 tests/benchmarks/script/sunspider/tests/3d-raytrace.js delete mode 100644 tests/benchmarks/script/sunspider/tests/VERSION delete mode 100644 tests/benchmarks/script/sunspider/tests/access-binary-trees.js delete mode 100644 tests/benchmarks/script/sunspider/tests/access-fannkuch.js delete mode 100644 tests/benchmarks/script/sunspider/tests/access-nbody.js delete mode 100644 tests/benchmarks/script/sunspider/tests/access-nsieve.js delete mode 100644 tests/benchmarks/script/sunspider/tests/bitops-3bit-bits-in-byte.js delete mode 100644 tests/benchmarks/script/sunspider/tests/bitops-bits-in-byte.js delete mode 100644 tests/benchmarks/script/sunspider/tests/bitops-bitwise-and.js delete mode 100644 tests/benchmarks/script/sunspider/tests/bitops-nsieve-bits.js delete mode 100644 tests/benchmarks/script/sunspider/tests/controlflow-recursive.js delete mode 100644 tests/benchmarks/script/sunspider/tests/crypto-aes.js delete mode 100644 tests/benchmarks/script/sunspider/tests/crypto-md5.js delete mode 100644 tests/benchmarks/script/sunspider/tests/crypto-sha1.js delete mode 100644 tests/benchmarks/script/sunspider/tests/date-format-tofte.js delete mode 100644 tests/benchmarks/script/sunspider/tests/date-format-xparb.js delete mode 100644 tests/benchmarks/script/sunspider/tests/math-cordic.js delete mode 100644 tests/benchmarks/script/sunspider/tests/math-partial-sums.js delete mode 100644 tests/benchmarks/script/sunspider/tests/math-spectral-norm.js delete mode 100644 tests/benchmarks/script/sunspider/tests/regexp-dna.js delete mode 100644 tests/benchmarks/script/sunspider/tests/string-base64.js delete mode 100644 tests/benchmarks/script/sunspider/tests/string-fasta.js delete mode 100644 tests/benchmarks/script/sunspider/tests/string-tagcloud.js delete mode 100644 tests/benchmarks/script/sunspider/tests/string-unpack-code.js delete mode 100644 tests/benchmarks/script/sunspider/tests/string-validate-input.js delete mode 100644 tests/benchmarks/script/sunspider/tst_sunspider.cpp delete mode 100644 tests/benchmarks/script/v8/CMakeLists.txt delete mode 100644 tests/benchmarks/script/v8/tests/README.txt delete mode 100644 tests/benchmarks/script/v8/tests/base.js delete mode 100644 tests/benchmarks/script/v8/tests/crypto.js delete mode 100644 tests/benchmarks/script/v8/tests/deltablue.js delete mode 100644 tests/benchmarks/script/v8/tests/earley-boyer.js delete mode 100644 tests/benchmarks/script/v8/tests/raytrace.js delete mode 100644 tests/benchmarks/script/v8/tests/regexp.js delete mode 100644 tests/benchmarks/script/v8/tests/richards.js delete mode 100644 tests/benchmarks/script/v8/tests/splay.js delete mode 100644 tests/benchmarks/script/v8/tst_v8.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index fe653b81e..698989e0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,14 +98,13 @@ endif() set(KATIE_TYPE SHARED CACHE STRING "Build type") # components and tools that will be build, changed depending on the requirements availability -set(KATIE_COMPONENTS "Core Gui Declarative Network Svg Xml Script Test UiTools") -set(KATIE_TOOLS "moc uic qscript") +set(KATIE_COMPONENTS "Core Gui Network Svg Xml Test UiTools") +set(KATIE_TOOLS "moc uic") set(KATIE_HEADERS_PATH "${CMAKE_INSTALL_FULL_INCLUDEDIR}/katie" CACHE PATH "Headers installation path") set(KATIE_LIBRARIES_PATH "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE PATH "Libraries installation path") set(KATIE_BINARIES_PATH "${CMAKE_INSTALL_FULL_BINDIR}" CACHE PATH "Binaries installation path") set(KATIE_PLUGINS_PATH "${KATIE_LIBRARIES_PATH}/katie/plugins" CACHE PATH "Plugins installation path") -set(KATIE_IMPORTS_PATH "${KATIE_LIBRARIES_PATH}/katie/imports" CACHE PATH "Declarative imports installation path") set(KATIE_TRANSLATIONS_PATH "${CMAKE_INSTALL_FULL_DATADIR}/translations" CACHE PATH "Translations installation path") set(KATIE_CMAKE_PATH "${KATIE_LIBRARIES_PATH}/cmake/Katie" CACHE PATH "CMake aware modules installation path") set(KATIE_LDCONF_PATH "${CMAKE_INSTALL_FULL_SYSCONFDIR}/ld.so.conf.d" CACHE PATH "Run-time linker/loader configs installation path") @@ -317,22 +316,18 @@ if(NSL_LIBRARY) ) endif() -# used in components, tests and JavaScriptCore +# used in components and tests katie_check_header("cxxabi.h") -katie_check_function(posix_memalign "stdlib.h") katie_check_function(getprogname "stdlib.h") katie_check_function(arc4random_uniform "stdlib.h") katie_check_function(get_current_dir_name "unistd.h") katie_check_function(prctl "sys/prctl.h") katie_check_function(feenableexcept "fenv.h") -katie_check_function(madvise "sys/mman.h") -katie_check_function(timegm "time.h") katie_check_function(pipe2 "unistd.h") katie_check_function(getdomainname "unistd.h") katie_check_function(renameat2 "stdio.h") katie_check_function(program_invocation_short_name "errno.h") katie_check_function(flock "sys/file.h") -katie_check_struct(tm tm_gmtoff "time.h") katie_check_struct(tm tm_zone "time.h") katie_check_struct(dirent d_type "dirent.h") @@ -437,12 +432,9 @@ add_subdirectory(src/xml) if(WITH_DBUS AND DBUS_FOUND) add_subdirectory(src/dbus) endif() -add_subdirectory(src/declarative) add_subdirectory(src/gui) -add_subdirectory(src/imports) add_subdirectory(src/network) add_subdirectory(src/plugins) -add_subdirectory(src/script) add_subdirectory(src/svg) add_subdirectory(src/test) add_subdirectory(src/uitools) diff --git a/README b/README index 612761082..55aa628b1 100644 --- a/README +++ b/README @@ -8,7 +8,8 @@ There are several things you should be aware before considering Katie: - QMake, Linguist, Assistant, checksdk, macdeployqt, pixeltool, qconfig, qdoc, qev, qvfb, runonphone, designer and other non-essential - Qt3Support, QtWebKit, QtHelp, QtXmlPatterns, QtOpenGL, ActiveQt, Phonon, - QtMultimedia, QtSql, QtDesigner, QtDesignerComponents and QtScriptTtools + QtMultimedia, QtSql, QtDesigner, QtDesignerComponents, QtScriptTtools, + QtScript and QtDeclarative - some things have changed: - QMake build system replaced with CMake diff --git a/cmake/KatieConfig.cmake b/cmake/KatieConfig.cmake index d249c4183..8bc517a5d 100644 --- a/cmake/KatieConfig.cmake +++ b/cmake/KatieConfig.cmake @@ -29,7 +29,6 @@ if(NOT KATIE_FOUND) set(KATIE_LIBRARIES_PATH "@KATIE_LIBRARIES_PATH@") set(KATIE_BINARIES_PATH "@KATIE_BINARIES_PATH@") set(KATIE_PLUGINS_PATH "@KATIE_PLUGINS_PATH@") - set(KATIE_IMPORTS_PATH "@KATIE_IMPORTS_PATH@") set(KATIE_TRANSLATIONS_PATH "@KATIE_TRANSLATIONS_PATH@") set(KATIE_LDCONF_PATH "@KATIE_LDCONF_PATH@") set(KATIE_PROFILE_PATH "@KATIE_PROFILE_PATH@") @@ -98,7 +97,6 @@ if(NOT KATIE_FOUND) set(QT_LIBRARY_DIR ${KATIE_LIBRARIES_PATH}) set(QT_BINARY_DIR ${KATIE_BINARIES_PATH}) set(QT_PLUGINS_DIR ${KATIE_PLUGINS_PATH}) - set(QT_IMPORTS_DIR ${KATIE_IMPORTS_PATH}) set(QT_TRANSLATIONS_DIR ${KATIE_TRANSLATIONS_PATH}) # those are exceptions because they have "q" prefix which the macros from Qt4Macros do not expect diff --git a/cmake/modules/OptimizeHeaders.cmake b/cmake/modules/OptimizeHeaders.cmake index a9a79e92d..8d703ce89 100644 --- a/cmake/modules/OptimizeHeaders.cmake +++ b/cmake/modules/OptimizeHeaders.cmake @@ -35,9 +35,7 @@ set(unifdef_arguments -UKtNetwork_EXPORTS -UKtSvg_EXPORTS -UKtTest_EXPORTS - -UKtDeclarative_EXPORTS -UKtXml_EXPORTS - -UKtScript_EXPORTS -UKtDBus_EXPORTS -UKtUiTools_EXPORTS ) diff --git a/package/debian/control b/package/debian/control index ab5b1accd..7327af5eb 100644 --- a/package/debian/control +++ b/package/debian/control @@ -31,8 +31,8 @@ Description: C++ toolkit derived from the Qt 4.8 framework clean it up, fix some bugs and backport some features from Qt5. It is based on the latest Git revision of Qt v4.8. . - This package includes designer, moc, qdbus, qdbuscpp2xml, qdbusviewer, - qdbusxml2cpp, qscript, trc, rcc, and uic + This package includes moc, qdbus, qdbuscpp2xml, qdbusxml2cpp, qdbusviewer, + trc, rcc, and uic Package: katie-dev Architecture: amd64 arm64 armel armhf i386 mips mips64el mipsel ppc64el s390x hurd-i386 diff --git a/package/freebsd/pkg-plist b/package/freebsd/pkg-plist index 6a3f18185..4cdd82537 100644 --- a/package/freebsd/pkg-plist +++ b/package/freebsd/pkg-plist @@ -3,7 +3,6 @@ bin/qdbus-katie bin/qdbuscpp2xml-katie bin/qdbusviewer-katie bin/qdbusxml2cpp-katie -bin/qscript-katie bin/trc-katie bin/uic-katie include/katie/QtCore/QAbstractEventDispatcher @@ -297,49 +296,6 @@ include/katie/QtDBus/qdbusreply.h include/katie/QtDBus/qdbusserver.h include/katie/QtDBus/qdbusservicewatcher.h include/katie/QtDBus/qdbusunixfiledescriptor.h -include/katie/QtDeclarative/QDeclarativeAttachedPropertiesFunc -include/katie/QtDeclarative/QDeclarativeComponent -include/katie/QtDeclarative/QDeclarativeContext -include/katie/QtDeclarative/QDeclarativeEngine -include/katie/QtDeclarative/QDeclarativeError -include/katie/QtDeclarative/QDeclarativeExpression -include/katie/QtDeclarative/QDeclarativeExtensionInterface -include/katie/QtDeclarative/QDeclarativeExtensionPlugin -include/katie/QtDeclarative/QDeclarativeImageProvider -include/katie/QtDeclarative/QDeclarativeInfo -include/katie/QtDeclarative/QDeclarativeItem -include/katie/QtDeclarative/QDeclarativeListProperty -include/katie/QtDeclarative/QDeclarativeListReference -include/katie/QtDeclarative/QDeclarativeParserStatus -include/katie/QtDeclarative/QDeclarativeProperties -include/katie/QtDeclarative/QDeclarativeProperty -include/katie/QtDeclarative/QDeclarativePropertyMap -include/katie/QtDeclarative/QDeclarativePropertyValueInterceptor -include/katie/QtDeclarative/QDeclarativePropertyValueSource -include/katie/QtDeclarative/QDeclarativeScriptString -include/katie/QtDeclarative/QDeclarativeTypeInfo -include/katie/QtDeclarative/QDeclarativeView -include/katie/QtDeclarative/QtDeclarative -include/katie/QtDeclarative/qdeclarative.h -include/katie/QtDeclarative/qdeclarativecomponent.h -include/katie/QtDeclarative/qdeclarativecontext.h -include/katie/QtDeclarative/qdeclarativeengine.h -include/katie/QtDeclarative/qdeclarativeerror.h -include/katie/QtDeclarative/qdeclarativeexpression.h -include/katie/QtDeclarative/qdeclarativeextensioninterface.h -include/katie/QtDeclarative/qdeclarativeextensionplugin.h -include/katie/QtDeclarative/qdeclarativeimageprovider.h -include/katie/QtDeclarative/qdeclarativeinfo.h -include/katie/QtDeclarative/qdeclarativeitem.h -include/katie/QtDeclarative/qdeclarativelist.h -include/katie/QtDeclarative/qdeclarativeparserstatus.h -include/katie/QtDeclarative/qdeclarativeprivate.h -include/katie/QtDeclarative/qdeclarativeproperty.h -include/katie/QtDeclarative/qdeclarativepropertymap.h -include/katie/QtDeclarative/qdeclarativepropertyvalueinterceptor.h -include/katie/QtDeclarative/qdeclarativepropertyvaluesource.h -include/katie/QtDeclarative/qdeclarativescriptstring.h -include/katie/QtDeclarative/qdeclarativeview.h include/katie/QtGui/QAbstractAnimation include/katie/QtGui/QAbstractButton include/katie/QtGui/QAbstractGraphicsShapeItem @@ -606,7 +562,6 @@ include/katie/QtGui/QStylePainter include/katie/QtGui/QStylePlugin include/katie/QtGui/QStyledItemDelegate include/katie/QtGui/QSyntaxHighlighter -include/katie/QtGui/QSystemTrayIcon include/katie/QtGui/QTabBar include/katie/QtGui/QTabWidget include/katie/QtGui/QTableView @@ -836,7 +791,6 @@ include/katie/QtGui/qstyleoption.h include/katie/QtGui/qstylepainter.h include/katie/QtGui/qstyleplugin.h include/katie/QtGui/qsyntaxhighlighter.h -include/katie/QtGui/qsystemtrayicon.h include/katie/QtGui/qtabbar.h include/katie/QtGui/qtableview.h include/katie/QtGui/qtablewidget.h @@ -901,36 +855,6 @@ include/katie/QtNetwork/qnetworkinterface.h include/katie/QtNetwork/qtcpserver.h include/katie/QtNetwork/qtcpsocket.h include/katie/QtNetwork/qudpsocket.h -include/katie/QtScript/QScriptClass -include/katie/QtScript/QScriptClassPropertyIterator -include/katie/QtScript/QScriptContext -include/katie/QtScript/QScriptContextInfo -include/katie/QtScript/QScriptContextInfoList -include/katie/QtScript/QScriptEngine -include/katie/QtScript/QScriptEngineAgent -include/katie/QtScript/QScriptExtensionInterface -include/katie/QtScript/QScriptExtensionPlugin -include/katie/QtScript/QScriptProgram -include/katie/QtScript/QScriptString -include/katie/QtScript/QScriptSyntaxCheckResult -include/katie/QtScript/QScriptValue -include/katie/QtScript/QScriptValueIterator -include/katie/QtScript/QScriptValueList -include/katie/QtScript/QScriptable -include/katie/QtScript/QtScript -include/katie/QtScript/qscriptable.h -include/katie/QtScript/qscriptclass.h -include/katie/QtScript/qscriptclasspropertyiterator.h -include/katie/QtScript/qscriptcontext.h -include/katie/QtScript/qscriptcontextinfo.h -include/katie/QtScript/qscriptengine.h -include/katie/QtScript/qscriptengineagent.h -include/katie/QtScript/qscriptextensioninterface.h -include/katie/QtScript/qscriptextensionplugin.h -include/katie/QtScript/qscriptprogram.h -include/katie/QtScript/qscriptstring.h -include/katie/QtScript/qscriptvalue.h -include/katie/QtScript/qscriptvalueiterator.h include/katie/QtSvg/QSvgRenderer include/katie/QtSvg/QtSvg include/katie/QtSvg/qsvgrenderer.h @@ -1036,31 +960,19 @@ lib/cmake/Katie/KatieConfigVersion.cmake lib/cmake/Katie/KatieTargets-%%CMAKE_BUILD_TYPE%%.cmake lib/cmake/Katie/KatieTargets.cmake lib/cmake/Katie/Qt4UseFile.cmake -lib/katie/imports/Qt/labs/folderlistmodel/libqmlfolderlistmodelplugin.so -lib/katie/imports/Qt/labs/folderlistmodel/qmldir -lib/katie/imports/Qt/labs/particles/libqmlparticlesplugin.so -lib/katie/imports/Qt/labs/particles/qmldir -lib/katie/plugins/designer/qdeclarativeview.so lib/katie/plugins/imageformats/svg.so -lib/katie/plugins/script/qtscriptdbus.so lib/libKtCore.so lib/libKtCore.so.4.14 lib/libKtCore.so.4.14.0 lib/libKtDBus.so lib/libKtDBus.so.4.14 lib/libKtDBus.so.4.14.0 -lib/libKtDeclarative.so -lib/libKtDeclarative.so.4.14 -lib/libKtDeclarative.so.4.14.0 lib/libKtGui.so lib/libKtGui.so.4.14 lib/libKtGui.so.4.14.0 lib/libKtNetwork.so lib/libKtNetwork.so.4.14 lib/libKtNetwork.so.4.14.0 -lib/libKtScript.so -lib/libKtScript.so.4.14 -lib/libKtScript.so.4.14.0 lib/libKtSvg.so lib/libKtSvg.so.4.14 lib/libKtSvg.so.4.14.0 @@ -1075,10 +987,8 @@ lib/libKtXml.so.4.14 lib/libKtXml.so.4.14.0 libdata/pkgconfig/KtCore.pc libdata/pkgconfig/KtDBus.pc -libdata/pkgconfig/KtDeclarative.pc libdata/pkgconfig/KtGui.pc libdata/pkgconfig/KtNetwork.pc -libdata/pkgconfig/KtScript.pc libdata/pkgconfig/KtSvg.pc libdata/pkgconfig/KtTest.pc libdata/pkgconfig/KtUiTools.pc @@ -1088,7 +998,6 @@ share/man/man1/moc-katie.1.gz share/man/man1/qdbus-katie.1.gz share/man/man1/qdbuscpp2xml-katie.1.gz share/man/man1/qdbusxml2cpp-katie.1.gz -share/man/man1/qscript-katie.1.gz share/man/man1/trc-katie.1.gz share/man/man1/uic-katie.1.gz share/pixmaps/qdbusviewer-katie.png diff --git a/scripts/genmap.py b/scripts/genmap.py index 5d1955a2a..051ed15dc 100755 --- a/scripts/genmap.py +++ b/scripts/genmap.py @@ -7,11 +7,9 @@ components = { 'Core': 'Q_CORE_EXPORT', 'Gui': 'Q_GUI_EXPORT', 'DBus': 'Q_DBUS_EXPORT', - 'Declarative': 'Q_DECLARATIVE_EXPORT', 'Network': 'Q_NETWORK_EXPORT', 'Svg': 'Q_SVG_EXPORT', 'Xml': 'Q_XML_EXPORT', - 'Script': 'Q_SCRIPT_EXPORT', 'Test': 'Q_TEST_EXPORT', 'UiTools': 'Q_UITOOLS_EXPORT', } diff --git a/scripts/incfsck.py b/scripts/incfsck.py index 1d81453f2..f73bab01f 100755 --- a/scripts/incfsck.py +++ b/scripts/incfsck.py @@ -100,13 +100,6 @@ incmap = { 'QDBusSignature': 'qdbusextratypes.h', 'QDBusVariant': 'qdbusextratypes.h', }, - 'QtDeclarative': { - 'QDeclarativeAttachedPropertiesFunc': 'qdeclarativeprivate.h', - 'QDeclarativeListProperty': 'qdeclarativelist.h', - 'QDeclarativeListReference': 'qdeclarativelist.h', - 'QDeclarativeProperties': 'qdeclarativeproperty.h', - 'QDeclarativeTypeInfo': 'qdeclarativeprivate.h', - }, 'QtGui': { 'QAbstractGraphicsShapeItem': 'qgraphicsitem.h', 'QAbstractUndoItem': 'qtextdocument.h', diff --git a/scripts/namefsck.py b/scripts/namefsck.py index c272c6700..04e533d75 100755 --- a/scripts/namefsck.py +++ b/scripts/namefsck.py @@ -94,28 +94,6 @@ classlist = [ "QDateTime", "QDateTimeEdit", "QDebug", - "QDeclarativeAttachedPropertiesFunc", - "QDeclarativeComponent", - "QDeclarativeContext", - "QDeclarativeEngine", - "QDeclarativeError", - "QDeclarativeExpression", - "QDeclarativeExtensionInterface", - "QDeclarativeExtensionPlugin", - "QDeclarativeImageProvider", - "QDeclarativeInfo", - "QDeclarativeItem", - "QDeclarativeListProperty", - "QDeclarativeListReference", - "QDeclarativeParserStatus", - "QDeclarativeProperties", - "QDeclarativeProperty", - "QDeclarativePropertyMap", - "QDeclarativePropertyValueInterceptor", - "QDeclarativePropertyValueSource", - "QDeclarativeScriptString", - "QDeclarativeTypeInfo", - "QDeclarativeView", "QDesktopWidget", "QDial", "QDialog", @@ -381,22 +359,6 @@ classlist = [ "QScopedPointer", "QScopedPointerPodDeleter", "QScopedValueRollback", - "QScriptClass", - "QScriptClassPropertyIterator", - "QScriptContext", - "QScriptContextInfo", - "QScriptContextInfoList", - "QScriptEngine", - "QScriptEngineAgent", - "QScriptExtensionInterface", - "QScriptExtensionPlugin", - "QScriptProgram", - "QScriptString", - "QScriptSyntaxCheckResult", - "QScriptValue", - "QScriptValueIterator", - "QScriptValueList", - "QScriptable", "QScrollArea", "QScrollBar", "QSemaphore", @@ -487,7 +449,6 @@ classlist = [ "QStyledItemDelegate", "QSvgRenderer", "QSyntaxHighlighter", - "QSystemTrayIcon", "QTabBar", "QTabWidget", "QTableView", @@ -645,7 +606,6 @@ classlist = [ "QtCore", "QtDBus", "QtDebug", - "QtDeclarative", "QtEndian", "QtEvents", "QtGlobal", @@ -654,7 +614,6 @@ classlist = [ "QtNetwork", "QtPlugin", "QtPluginInstanceFunction", - "QtScript", "QtSvg", "QtTest", "QtTestGui", diff --git a/scripts/updatetranslations.py b/scripts/updatetranslations.py index 951800640..2ccd0d778 100755 --- a/scripts/updatetranslations.py +++ b/scripts/updatetranslations.py @@ -2,8 +2,7 @@ import os, glob, subprocess -components = ('core', 'dbus', 'declarative', 'gui', 'network', 'plugins', - 'script', 'scripttools', 'svg', 'test', 'uitools', 'xml') +components = ('core', 'dbus', 'gui', 'network', 'plugins', 'svg', 'test', 'uitools', 'xml') cfiles = [] tfiles = [] diff --git a/src/3rdparty/README b/src/3rdparty/README index ed69b9424..33d1ba265 100644 --- a/src/3rdparty/README +++ b/src/3rdparty/README @@ -7,5 +7,5 @@ are irrelevant to Katie may not be included here. Typically, those are the standalone library configuration and make files, tools, test files, contribs, documentation, and similar. -javascriptcore and easing are maintained as part of Katie now with a -lot of changes specific to it. +easing is maintained as part of Katie now with a lot of changes specific +to it. diff --git a/src/3rdparty/javascriptcore/API/APICast.h b/src/3rdparty/javascriptcore/API/APICast.h deleted file mode 100644 index c5918ae1a..000000000 --- a/src/3rdparty/javascriptcore/API/APICast.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (C) 2006 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 APICast_h -#define APICast_h - -#include "JSAPIValueWrapper.h" -#include "JSGlobalObject.h" -#include "JSValue.h" -#include - -namespace JSC { - class ExecState; - class PropertyNameArray; - class JSGlobalData; - class JSObject; - class JSValue; -} - -typedef const struct OpaqueJSContextGroup* JSContextGroupRef; -typedef const struct OpaqueJSContext* JSContextRef; -typedef struct OpaqueJSContext* JSGlobalContextRef; -typedef struct OpaqueJSPropertyNameAccumulator* JSPropertyNameAccumulatorRef; -typedef const struct OpaqueJSValue* JSValueRef; -typedef struct OpaqueJSValue* JSObjectRef; - -/* Opaque typing convenience methods */ - -inline JSC::ExecState* toJS(JSContextRef c) -{ - Q_ASSERT(c); - return reinterpret_cast(const_cast(c)); -} - -inline JSC::ExecState* toJS(JSGlobalContextRef c) -{ - Q_ASSERT(c); - return reinterpret_cast(c); -} - -inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v) -{ - Q_UNUSED(exec); - Q_ASSERT(exec); - Q_ASSERT(v); -#if USE(JSVALUE32_64) - JSC::JSCell* jsCell = reinterpret_cast(const_cast(v)); - if (!jsCell) - return JSC::JSValue(); - if (jsCell->isAPIValueWrapper()) - return static_cast(jsCell)->value(); - return jsCell; -#else - return JSC::JSValue::decode(reinterpret_cast(const_cast(v))); -#endif -} - -inline JSC::JSValue toJSForGC(JSC::ExecState* exec, JSValueRef v) -{ - Q_UNUSED(exec); - Q_ASSERT(exec); - Q_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); -} - -inline JSC::PropertyNameArray* toJS(JSPropertyNameAccumulatorRef a) -{ - return reinterpret_cast(a); -} - -inline JSC::JSGlobalData* toJS(JSContextGroupRef g) -{ - return reinterpret_cast(const_cast(g)); -} - -inline JSValueRef toRef(JSC::ExecState* exec, JSC::JSValue v) -{ -#if USE(JSVALUE32_64) - if (!v) - return 0; - if (!v.isCell()) - return reinterpret_cast(JSC::jsAPIValueWrapper(exec, v).asCell()); - return reinterpret_cast(v.asCell()); -#else - Q_UNUSED(exec); - return reinterpret_cast(JSC::JSValue::encode(v)); -#endif -} - -inline JSObjectRef toRef(JSC::JSObject* o) -{ - return reinterpret_cast(o); -} - -inline JSObjectRef toRef(const JSC::JSObject* o) -{ - return reinterpret_cast(const_cast(o)); -} - -inline JSContextRef toRef(JSC::ExecState* e) -{ - return reinterpret_cast(e); -} - -inline JSGlobalContextRef toGlobalRef(JSC::ExecState* e) -{ - Q_ASSERT(e == e->lexicalGlobalObject()->globalExec()); - return reinterpret_cast(e); -} - -inline JSPropertyNameAccumulatorRef toRef(JSC::PropertyNameArray* l) -{ - return reinterpret_cast(l); -} - -inline JSContextGroupRef toRef(JSC::JSGlobalData* g) -{ - return reinterpret_cast(g); -} - -#endif // APICast_h diff --git a/src/3rdparty/javascriptcore/API/APIShims.h b/src/3rdparty/javascriptcore/API/APIShims.h deleted file mode 100644 index d08d8fe5e..000000000 --- a/src/3rdparty/javascriptcore/API/APIShims.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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" - -namespace JSC { - -class APIEntryShim { -public: - // Normal API entry - APIEntryShim(ExecState* exec) - : m_globalData(&exec->globalData()) - , m_entryIdentifierTable(setCurrentIdentifierTable(m_globalData->identifierTable)) - { - m_globalData->timeoutChecker->start(); - } - - // JSPropertyNameAccumulator only has a globalData. - APIEntryShim(JSGlobalData* globalData) - : m_globalData(globalData) - , m_entryIdentifierTable(setCurrentIdentifierTable(globalData->identifierTable)) - { - } - - ~APIEntryShim() - { - m_globalData->timeoutChecker->stop(); - setCurrentIdentifierTable(m_entryIdentifierTable); - } - -private: - JSGlobalData* m_globalData; - IdentifierTable* m_entryIdentifierTable; -}; - -class APICallbackShim { -public: - APICallbackShim(ExecState* exec) - : m_globalData(&exec->globalData()) - { - resetCurrentIdentifierTable(); - m_globalData->timeoutChecker->start(); - } - - ~APICallbackShim() - { - m_globalData->timeoutChecker->stop(); - setCurrentIdentifierTable(m_globalData->identifierTable); - } - -private: - JSGlobalData* m_globalData; -}; - -} - -#endif diff --git a/src/3rdparty/javascriptcore/API/JSBase.h b/src/3rdparty/javascriptcore/API/JSBase.h deleted file mode 100644 index ad96bd3cf..000000000 --- a/src/3rdparty/javascriptcore/API/JSBase.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2006 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 JSBase_h -#define JSBase_h - -/* JavaScript engine interface */ - -/*! @typedef JSContextGroupRef A group that associates JavaScript contexts with one another. Contexts in the same group may share and exchange JavaScript objects. */ -typedef const struct OpaqueJSContextGroup* JSContextGroupRef; - -/*! @typedef JSContextRef A JavaScript execution context. Holds the global object and other execution state. */ -typedef const struct OpaqueJSContext* JSContextRef; - -/*! @typedef JSGlobalContextRef A global JavaScript execution context. A JSGlobalContext is a JSContext. */ -typedef struct OpaqueJSContext* JSGlobalContextRef; - -/*! @typedef JSStringRef A UTF16 character buffer. The fundamental string representation in JavaScript. */ -typedef struct OpaqueJSString* JSStringRef; - -/*! @typedef JSClassRef A JavaScript class. Used with JSObjectMake to construct objects with custom behavior. */ -typedef struct OpaqueJSClass* JSClassRef; - -/*! @typedef JSPropertyNameArrayRef An array of JavaScript property names. */ -typedef struct OpaqueJSPropertyNameArray* JSPropertyNameArrayRef; - -/*! @typedef JSPropertyNameAccumulatorRef An ordered set used to collect the names of a JavaScript object's properties. */ -typedef struct OpaqueJSPropertyNameAccumulator* JSPropertyNameAccumulatorRef; - - -/* JavaScript data types */ - -/*! @typedef JSValueRef A JavaScript value. The base type for all JavaScript values, and polymorphic functions on them. */ -typedef const struct OpaqueJSValue* JSValueRef; - -/*! @typedef JSObjectRef A JavaScript object. A JSObject is a JSValue. */ -typedef struct OpaqueJSValue* JSObjectRef; - -/* JavaScript symbol are not exported */ - -#undef JS_EXPORT -#define JS_EXPORT - -#endif /* JSBase_h */ diff --git a/src/3rdparty/javascriptcore/API/JSCallbackConstructor.cpp b/src/3rdparty/javascriptcore/API/JSCallbackConstructor.cpp deleted file mode 100644 index eaed71912..000000000 --- a/src/3rdparty/javascriptcore/API/JSCallbackConstructor.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 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. - */ - -#include "Platform.h" -#include "JSCallbackConstructor.h" - -#include "APIShims.h" -#include "APICast.h" -#include -#include -#include - -namespace JSC { - -const ClassInfo JSCallbackConstructor::info = { "CallbackConstructor", 0, 0 }; - -JSCallbackConstructor::JSCallbackConstructor(NonNullPassRefPtr structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) - : JSObject(structure) - , m_class(jsClass) - , m_callback(callback) -{ - if (m_class) - JSClassRetain(jsClass); -} - -JSCallbackConstructor::~JSCallbackConstructor() -{ - if (m_class) - JSClassRelease(m_class); -} - -static JSObject* constructJSCallback(ExecState* exec, JSObject* constructor, const ArgList& args) -{ - JSContextRef ctx = toRef(exec); - JSObjectRef constructorRef = toRef(constructor); - - JSObjectCallAsConstructorCallback callback = static_cast(constructor)->callback(); - if (callback) { - int argumentCount = static_cast(args.size()); - Vector arguments(argumentCount); - for (int i = 0; i < argumentCount; i++) - arguments[i] = toRef(exec, args.at(i)); - - JSValueRef exception = 0; - JSObjectRef result; - { - APICallbackShim callbackShim(exec); - result = callback(ctx, constructorRef, argumentCount, arguments.data(), &exception); - } - if (exception) - exec->setException(toJS(exec, exception)); - return toJS(result); - } - - return toJS(JSObjectMake(ctx, static_cast(constructor)->classRef(), 0)); -} - -ConstructType JSCallbackConstructor::getConstructData(ConstructData& constructData) -{ - constructData.native.function = constructJSCallback; - return ConstructTypeHost; -} - -} // namespace JSC diff --git a/src/3rdparty/javascriptcore/API/JSCallbackConstructor.h b/src/3rdparty/javascriptcore/API/JSCallbackConstructor.h deleted file mode 100644 index c4bd7ad3c..000000000 --- a/src/3rdparty/javascriptcore/API/JSCallbackConstructor.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2006, 2008 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 JSCallbackConstructor_h -#define JSCallbackConstructor_h - -#include "JSObjectRef.h" -#include - -namespace JSC { - -class JSCallbackConstructor : public JSObject { -public: - JSCallbackConstructor(NonNullPassRefPtr, JSClassRef, JSObjectCallAsConstructorCallback); - virtual ~JSCallbackConstructor(); - JSClassRef classRef() const { return m_class; } - JSObjectCallAsConstructorCallback callback() const { return m_callback; } - static const ClassInfo info; - - static PassRefPtr createStructure(JSValue proto) - { - 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; } - - JSClassRef m_class; - JSObjectCallAsConstructorCallback m_callback; -}; - -} // namespace JSC - -#endif // JSCallbackConstructor_h diff --git a/src/3rdparty/javascriptcore/API/JSCallbackFunction.cpp b/src/3rdparty/javascriptcore/API/JSCallbackFunction.cpp deleted file mode 100644 index 33cb2d920..000000000 --- a/src/3rdparty/javascriptcore/API/JSCallbackFunction.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2006, 2008 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. - */ - -#include "Platform.h" -#include -#include "JSCallbackFunction.h" - -#include "APIShims.h" -#include "APICast.h" -#include "CodeBlock.h" -#include "JSFunction.h" -#include "FunctionPrototype.h" -#include -#include - -namespace JSC { - -ASSERT_CLASS_FITS_IN_CELL(JSCallbackFunction); - -const ClassInfo JSCallbackFunction::info = { "CallbackFunction", &InternalFunction::info, 0 }; - -JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSObjectCallAsFunctionCallback callback, const Identifier& name) - : InternalFunction(&exec->globalData(), exec->lexicalGlobalObject()->callbackFunctionStructure(), name) - , m_callback(callback) -{ -} - -JSValue JSCallbackFunction::call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args) -{ - JSContextRef execRef = toRef(exec); - JSObjectRef functionRef = toRef(functionObject); - JSObjectRef thisObjRef = toRef(thisValue.toThisObject(exec)); - - int argumentCount = static_cast(args.size()); - Vector arguments(argumentCount); - for (int i = 0; i < argumentCount; i++) - arguments[i] = toRef(exec, args.at(i)); - - JSValueRef exception = 0; - JSValueRef result; - { - APICallbackShim callbackShim(exec); - result = static_cast(functionObject)->m_callback(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception); - } - if (exception) - exec->setException(toJS(exec, exception)); - - return toJS(exec, result); -} - -CallType JSCallbackFunction::getCallData(CallData& callData) -{ - callData.native.function = call; - return CallTypeHost; -} - -} // namespace JSC diff --git a/src/3rdparty/javascriptcore/API/JSCallbackFunction.h b/src/3rdparty/javascriptcore/API/JSCallbackFunction.h deleted file mode 100644 index d2731e1d2..000000000 --- a/src/3rdparty/javascriptcore/API/JSCallbackFunction.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2006, 2008 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 JSCallbackFunction_h -#define JSCallbackFunction_h - -#include "InternalFunction.h" -#include "JSObjectRef.h" - -namespace JSC { - -class JSCallbackFunction : public InternalFunction { -public: - JSCallbackFunction(ExecState*, JSObjectCallAsFunctionCallback, const Identifier& name); - - static const ClassInfo info; - - // InternalFunction mish-mashes constructor and function behavior -- we should - // refactor the code so this override isn't necessary - static PassRefPtr createStructure(JSValue proto) - { - return Structure::create(proto, TypeInfo(ObjectType, StructureFlags)); - } - -private: - virtual CallType getCallData(CallData&); - virtual const ClassInfo* classInfo() const { return &info; } - - static JSValue QT_FASTCALL call(ExecState*, JSObject*, JSValue, const ArgList&); - - JSObjectCallAsFunctionCallback m_callback; -}; - -} // namespace JSC - -#endif // JSCallbackFunction_h diff --git a/src/3rdparty/javascriptcore/API/JSCallbackObject.cpp b/src/3rdparty/javascriptcore/API/JSCallbackObject.cpp deleted file mode 100644 index 9a2254dc4..000000000 --- a/src/3rdparty/javascriptcore/API/JSCallbackObject.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2007 Eric Seidel - * - * 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. - */ - -#include "Platform.h" -#include "JSCallbackObject.h" - -#include "Collector.h" - -namespace JSC { - -ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject); -ASSERT_CLASS_FITS_IN_CELL(JSCallbackObject); - -} // namespace JSC diff --git a/src/3rdparty/javascriptcore/API/JSCallbackObject.h b/src/3rdparty/javascriptcore/API/JSCallbackObject.h deleted file mode 100644 index 225851e62..000000000 --- a/src/3rdparty/javascriptcore/API/JSCallbackObject.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2007 Eric Seidel - * - * 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 JSCallbackObject_h -#define JSCallbackObject_h - -#include "JSObjectRef.h" -#include "JSValueRef.h" -#include "JSObject.h" - -namespace JSC { - -template -class JSCallbackObject : public Base { -public: - JSCallbackObject(ExecState*, NonNullPassRefPtr, JSClassRef, void* data); - JSCallbackObject(JSClassRef); - virtual ~JSCallbackObject(); - - void setPrivate(void* data); - void* getPrivate(); - - JSClassRef classRef() const { return m_callbackObjectData->jsClass; } - bool inherits(JSClassRef) const; - - static PassRefPtr createStructure(JSValue proto) - { - 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&); - virtual bool deleteProperty(ExecState*, unsigned); - - virtual bool hasInstance(ExecState* exec, JSValue value, JSValue proto); - - virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); - - virtual double toNumber(ExecState*) const; - virtual UString toString(ExecState*) const; - - virtual ConstructType getConstructData(ConstructData&); - virtual CallType getCallData(CallData&); - virtual const ClassInfo* classInfo() const { return &Base::info; } - - void init(ExecState*); - - static JSCallbackObject* asCallbackObject(JSValue); - - static JSValue QT_FASTCALL call(ExecState*, JSObject* functionObject, JSValue thisValue, const ArgList&); - static JSObject* construct(ExecState*, JSObject* constructor, const ArgList&); - - static JSValue staticValueGetter(ExecState*, const Identifier&, const PropertySlot&); - static JSValue staticFunctionGetter(ExecState*, const Identifier&, const PropertySlot&); - static JSValue callbackGetter(ExecState*, const Identifier&, const PropertySlot&); - - struct JSCallbackObjectData { - JSCallbackObjectData(void* privateData, JSClassRef jsClass) - : privateData(privateData) - , jsClass(jsClass) - { - JSClassRetain(jsClass); - } - - ~JSCallbackObjectData() - { - JSClassRelease(jsClass); - } - - void* privateData; - JSClassRef jsClass; - }; - - OwnPtr m_callbackObjectData; -}; - -} // namespace JSC - -// include the actual template class implementation -#include "JSCallbackObjectFunctions.h" - -#endif // JSCallbackObject_h diff --git a/src/3rdparty/javascriptcore/API/JSCallbackObjectFunctions.h b/src/3rdparty/javascriptcore/API/JSCallbackObjectFunctions.h deleted file mode 100644 index e781b1961..000000000 --- a/src/3rdparty/javascriptcore/API/JSCallbackObjectFunctions.h +++ /dev/null @@ -1,603 +0,0 @@ -/* - * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2007 Eric Seidel - * - * 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. - */ - -#include "APIShims.h" -#include "APICast.h" -#include "Error.h" -#include "JSCallbackFunction.h" -#include "JSClassRef.h" -#include "JSGlobalObject.h" -#include "JSObjectRef.h" -#include "JSString.h" -#include "JSStringRef.h" -#include "OpaqueJSString.h" -#include "PropertyNameArray.h" -#include - -namespace JSC { - -template -inline JSCallbackObject* JSCallbackObject::asCallbackObject(JSValue value) -{ - Q_ASSERT(asObject(value)->inherits(&Base::info)); - return static_cast(asObject(value)); -} - -template -JSCallbackObject::JSCallbackObject(ExecState* exec, NonNullPassRefPtr structure, JSClassRef jsClass, void* data) - : Base(structure) - , m_callbackObjectData(new JSCallbackObjectData(data, jsClass)) -{ - init(exec); -} - -// Global object constructor. -// FIXME: Move this into a separate JSGlobalCallbackObject class derived from this one. -template -JSCallbackObject::JSCallbackObject(JSClassRef jsClass) - : Base() - , m_callbackObjectData(new JSCallbackObjectData(0, jsClass)) -{ - Q_ASSERT(Base::isGlobalObject()); - init(static_cast(this)->globalExec()); -} - -template -void JSCallbackObject::init(ExecState* exec) -{ - Q_ASSERT(exec); - - Vector initRoutines; - JSClassRef jsClass = classRef(); - do { - if (JSObjectInitializeCallback initialize = jsClass->initialize) - initRoutines.append(initialize); - } while ((jsClass = jsClass->parentClass)); - - // initialize from base to derived - for (int i = static_cast(initRoutines.size()) - 1; i >= 0; i--) { - APICallbackShim callbackShim(exec); - JSObjectInitializeCallback initialize = initRoutines[i]; - initialize(toRef(exec), toRef(this)); - } -} - -template -JSCallbackObject::~JSCallbackObject() -{ - JSObjectRef thisRef = toRef(this); - - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) - if (JSObjectFinalizeCallback finalize = jsClass->finalize) - finalize(thisRef); -} - -template -UString JSCallbackObject::className() const -{ - UString thisClassName = classRef()->className(); - if (!thisClassName.isEmpty()) - return thisClassName; - - return Base::className(); -} - -template -bool JSCallbackObject::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) -{ - JSContextRef ctx = toRef(exec); - JSObjectRef thisRef = toRef(this); - RefPtr propertyNameRef; - - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { - // optional optimization to bypass getProperty in cases when we only need to know if the property exists - if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - APICallbackShim callbackShim(exec); - if (hasProperty(ctx, thisRef, propertyNameRef.get())) { - slot.setCustom(this, callbackGetter); - return true; - } - } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - JSValueRef value; - { - APICallbackShim callbackShim(exec); - value = getProperty(ctx, thisRef, propertyNameRef.get(), &exception); - } - 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)) { - if (staticValues->contains(propertyName.ustring().rep())) { - slot.setCustom(this, staticValueGetter); - return true; - } - } - - if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { - if (staticFunctions->contains(propertyName.ustring().rep())) { - slot.setCustom(this, staticFunctionGetter); - return true; - } - } - } - - return Base::getOwnPropertySlot(exec, propertyName, slot); -} - -template -bool JSCallbackObject::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) -{ - return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot); -} - -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); - JSObjectRef thisRef = toRef(this); - RefPtr propertyNameRef; - JSValueRef valueRef = toRef(exec, value); - - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { - if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - bool result; - { - APICallbackShim callbackShim(exec); - result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); - } - if (exception) - exec->setException(toJS(exec, exception)); - if (result || exception) - return; - } - - if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { - if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) { - if (entry->attributes & kJSPropertyAttributeReadOnly) - return; - if (JSObjectSetPropertyCallback setProperty = entry->setProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - bool result; - { - APICallbackShim callbackShim(exec); - result = setProperty(ctx, thisRef, propertyNameRef.get(), valueRef, &exception); - } - if (exception) - exec->setException(toJS(exec, exception)); - if (result || exception) - return; - } else - throwError(exec, ReferenceError, "Attempt to set a property that is not settable."); - } - } - - if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { - if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) { - if (entry->attributes & kJSPropertyAttributeReadOnly) - return; - JSCallbackObject::putDirect(propertyName, value); // put as override property - return; - } - } - } - - return Base::put(exec, propertyName, value, slot); -} - -template -bool JSCallbackObject::deleteProperty(ExecState* exec, const Identifier& propertyName) -{ - JSContextRef ctx = toRef(exec); - JSObjectRef thisRef = toRef(this); - RefPtr propertyNameRef; - - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { - if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - bool result; - { - APICallbackShim callbackShim(exec); - result = deleteProperty(ctx, thisRef, propertyNameRef.get(), &exception); - } - if (exception) - exec->setException(toJS(exec, exception)); - if (result || exception) - return true; - } - - if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { - if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) { - if (entry->attributes & kJSPropertyAttributeDontDelete) - return false; - return true; - } - } - - if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { - if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) { - if (entry->attributes & kJSPropertyAttributeDontDelete) - return false; - return true; - } - } - } - - return Base::deleteProperty(exec, propertyName); -} - -template -bool JSCallbackObject::deleteProperty(ExecState* exec, unsigned propertyName) -{ - return deleteProperty(exec, Identifier::from(exec, propertyName)); -} - -template -ConstructType JSCallbackObject::getConstructData(ConstructData& constructData) -{ - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { - if (jsClass->callAsConstructor) { - constructData.native.function = construct; - return ConstructTypeHost; - } - } - return ConstructTypeNone; -} - -template -JSObject* JSCallbackObject::construct(ExecState* exec, JSObject* constructor, const ArgList& args) -{ - JSContextRef execRef = toRef(exec); - JSObjectRef constructorRef = toRef(constructor); - - for (JSClassRef jsClass = static_cast*>(constructor)->classRef(); jsClass; jsClass = jsClass->parentClass) { - if (JSObjectCallAsConstructorCallback callAsConstructor = jsClass->callAsConstructor) { - int argumentCount = static_cast(args.size()); - Vector arguments(argumentCount); - for (int i = 0; i < argumentCount; i++) - arguments[i] = toRef(exec, args.at(i)); - JSValueRef exception = 0; - JSObject* result; - { - APICallbackShim callbackShim(exec); - result = toJS(callAsConstructor(execRef, constructorRef, argumentCount, arguments.data(), &exception)); - } - if (exception) - exec->setException(toJS(exec, exception)); - return result; - } - } - - Q_UNREACHABLE(); // getConstructData should prevent us from reaching here - return 0; -} - -template -bool JSCallbackObject::hasInstance(ExecState* exec, JSValue value, JSValue) -{ - JSContextRef execRef = toRef(exec); - JSObjectRef thisRef = toRef(this); - - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { - if (JSObjectHasInstanceCallback hasInstance = jsClass->hasInstance) { - JSValueRef valueRef = toRef(exec, value); - JSValueRef exception = 0; - bool result; - { - APICallbackShim callbackShim(exec); - result = hasInstance(execRef, thisRef, valueRef, &exception); - } - if (exception) - exec->setException(toJS(exec, exception)); - return result; - } - } - return false; -} - -template -CallType JSCallbackObject::getCallData(CallData& callData) -{ - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { - if (jsClass->callAsFunction) { - callData.native.function = call; - return CallTypeHost; - } - } - return CallTypeNone; -} - -template -JSValue JSCallbackObject::call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args) -{ - JSContextRef execRef = toRef(exec); - JSObjectRef functionRef = toRef(functionObject); - JSObjectRef thisObjRef = toRef(thisValue.toThisObject(exec)); - - for (JSClassRef jsClass = static_cast*>(functionObject)->classRef(); jsClass; jsClass = jsClass->parentClass) { - if (JSObjectCallAsFunctionCallback callAsFunction = jsClass->callAsFunction) { - int argumentCount = static_cast(args.size()); - Vector arguments(argumentCount); - for (int i = 0; i < argumentCount; i++) - arguments[i] = toRef(exec, args.at(i)); - JSValueRef exception = 0; - JSValue result; - { - APICallbackShim callbackShim(exec); - result = toJS(exec, callAsFunction(execRef, functionRef, thisObjRef, argumentCount, arguments.data(), &exception)); - } - if (exception) - exec->setException(toJS(exec, exception)); - return result; - } - } - - Q_UNREACHABLE(); // getCallData should prevent us from reaching here - return JSValue(); -} - -template -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) { - APICallbackShim callbackShim(exec); - getPropertyNames(execRef, thisRef, toRef(&propertyNames)); - } - - if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) { - typedef OpaqueJSClassStaticValuesTable::const_iterator iterator; - iterator end = staticValues->end(); - for (iterator it = staticValues->begin(); it != end; ++it) { - UString::Rep* name = it->first.get(); - StaticValueEntry* entry = it->second; - if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties))) - propertyNames.add(Identifier(exec, name)); - } - } - - if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { - typedef OpaqueJSClassStaticFunctionsTable::const_iterator iterator; - iterator end = staticFunctions->end(); - for (iterator it = staticFunctions->begin(); it != end; ++it) { - UString::Rep* name = it->first.get(); - StaticFunctionEntry* entry = it->second; - if (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties)) - propertyNames.add(Identifier(exec, name)); - } - } - } - - Base::getOwnPropertyNames(exec, propertyNames, mode); -} - -template -double JSCallbackObject::toNumber(ExecState* exec) const -{ - // We need this check to guard against the case where this object is rhs of - // a binary expression where lhs threw an exception in its conversion to - // primitive - if (exec->hadException()) - return NaN; - JSContextRef ctx = toRef(exec); - JSObjectRef thisRef = toRef(this); - - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) - if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { - JSValueRef exception = 0; - JSValueRef value; - { - APICallbackShim callbackShim(exec); - value = convertToType(ctx, thisRef, NumberType, &exception); - } - if (exception) { - exec->setException(toJS(exec, exception)); - return 0; - } - - if (value) { - double dValue; - return toJS(exec, value).getNumber(dValue) ? dValue : NaN; - } - } - - return Base::toNumber(exec); -} - -template -UString JSCallbackObject::toString(ExecState* exec) const -{ - JSContextRef ctx = toRef(exec); - JSObjectRef thisRef = toRef(this); - - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) - if (JSObjectConvertToTypeCallback convertToType = jsClass->convertToType) { - JSValueRef exception = 0; - JSValueRef value; - { - APICallbackShim callbackShim(exec); - value = convertToType(ctx, thisRef, StringType, &exception); - } - if (exception) { - exec->setException(toJS(exec, exception)); - return ""; - } - if (value) - return toJS(exec, value).getString(exec); - } - - return Base::toString(exec); -} - -template -void JSCallbackObject::setPrivate(void* data) -{ - m_callbackObjectData->privateData = data; -} - -template -void* JSCallbackObject::getPrivate() -{ - return m_callbackObjectData->privateData; -} - -template -bool JSCallbackObject::inherits(JSClassRef c) const -{ - for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) - if (jsClass == c) - return true; - - return false; -} - -template -JSValue JSCallbackObject::staticValueGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot) -{ - JSCallbackObject* thisObj = asCallbackObject(slot.slotBase()); - - JSObjectRef thisRef = toRef(thisObj); - RefPtr propertyNameRef; - - for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) - if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) - if (StaticValueEntry* entry = staticValues->get(propertyName.ustring().rep())) - if (JSObjectGetPropertyCallback getProperty = entry->getProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - JSValueRef value; - { - APICallbackShim callbackShim(exec); - value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); - } - if (exception) { - exec->setException(toJS(exec, exception)); - return jsUndefined(); - } - if (value) - return toJS(exec, value); - } - - return throwError(exec, ReferenceError, "Static value property defined with NULL getProperty callback."); -} - -template -JSValue JSCallbackObject::staticFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot) -{ - JSCallbackObject* thisObj = asCallbackObject(slot.slotBase()); - - // Check for cached or override property. - PropertySlot slot2(thisObj); - if (thisObj->Base::getOwnPropertySlot(exec, propertyName, slot2)) - return slot2.getValue(exec, propertyName); - - for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) { - if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { - if (StaticFunctionEntry* entry = staticFunctions->get(propertyName.ustring().rep())) { - if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) { - JSObject* o = new (exec) JSCallbackFunction(exec, callAsFunction, propertyName); - thisObj->putDirect(propertyName, o, entry->attributes); - return o; - } - } - } - } - - return throwError(exec, ReferenceError, "Static function property defined with NULL callAsFunction callback."); -} - -template -JSValue JSCallbackObject::callbackGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot) -{ - JSCallbackObject* thisObj = asCallbackObject(slot.slotBase()); - - JSObjectRef thisRef = toRef(thisObj); - RefPtr propertyNameRef; - - for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) - if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) { - if (!propertyNameRef) - propertyNameRef = OpaqueJSString::create(propertyName.ustring()); - JSValueRef exception = 0; - JSValueRef value; - { - APICallbackShim callbackShim(exec); - value = getProperty(toRef(exec), thisRef, propertyNameRef.get(), &exception); - } - if (exception) { - exec->setException(toJS(exec, exception)); - return jsUndefined(); - } - if (value) - return toJS(exec, value); - } - - return throwError(exec, ReferenceError, "hasProperty callback returned true for a property that doesn't exist."); -} - -} // namespace JSC diff --git a/src/3rdparty/javascriptcore/API/JSClassRef.cpp b/src/3rdparty/javascriptcore/API/JSClassRef.cpp deleted file mode 100644 index ec225f345..000000000 --- a/src/3rdparty/javascriptcore/API/JSClassRef.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - */ - -#include "Platform.h" -#include "JSClassRef.h" - -#include "APICast.h" -#include "JSCallbackObject.h" -#include "JSObjectRef.h" -#include -#include -#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 }; - -OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* protoClass) - : parentClass(definition->parentClass) - , prototypeClass(0) - , initialize(definition->initialize) - , finalize(definition->finalize) - , hasProperty(definition->hasProperty) - , getProperty(definition->getProperty) - , setProperty(definition->setProperty) - , deleteProperty(definition->deleteProperty) - , getPropertyNames(definition->getPropertyNames) - , callAsFunction(definition->callAsFunction) - , callAsConstructor(definition->callAsConstructor) - , hasInstance(definition->hasInstance) - , convertToType(definition->convertToType) - , m_className(UString::createFromUTF8(definition->className).rep()->ref()) - , m_staticValues(0) - , m_staticFunctions(0) -{ - initializeThreading(); - - if (const JSStaticValue* staticValue = definition->staticValues) { - m_staticValues = new OpaqueJSClassStaticValuesTable(); - while (staticValue->name) { - // 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; - } - } - - if (const JSStaticFunction* staticFunction = definition->staticFunctions) { - m_staticFunctions = new OpaqueJSClassStaticFunctionsTable(); - while (staticFunction->name) { - // 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; - } - } - - if (protoClass) - prototypeClass = JSClassRetain(protoClass); -} - -OpaqueJSClass::~OpaqueJSClass() -{ - Q_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) { - Q_ASSERT(!it->first->isIdentifier()); - delete it->second; - } - delete m_staticValues; - } - - if (m_staticFunctions) { - OpaqueJSClassStaticFunctionsTable::const_iterator end = m_staticFunctions->end(); - for (OpaqueJSClassStaticFunctionsTable::const_iterator it = m_staticFunctions->begin(); it != end; ++it) { - Q_ASSERT(!it->first->isIdentifier()); - delete it->second; - } - delete m_staticFunctions; - } - - if (prototypeClass) - JSClassRelease(prototypeClass); -} - -PassRefPtr OpaqueJSClass::createNoAutomaticPrototype(const JSClassDefinition* definition) -{ - return adoptRef(new OpaqueJSClass(definition, 0)); -} - -static void clearReferenceToPrototype(JSObjectRef prototype) -{ - OpaqueJSClassContextData* jsClassData = static_cast(JSObjectGetPrivate(prototype)); - Q_ASSERT(jsClassData); - jsClassData->cachedPrototype = 0; -} - -PassRefPtr OpaqueJSClass::create(const JSClassDefinition* clientDefinition) -{ - JSClassDefinition definition = *clientDefinition; // Avoid modifying client copy. - - 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) -{ - 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) { - Q_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 - staticValues = 0; - - - if (jsClass->m_staticFunctions) { - staticFunctions = new OpaqueJSClassStaticFunctionsTable; - OpaqueJSClassStaticFunctionsTable::const_iterator end = jsClass->m_staticFunctions->end(); - for (OpaqueJSClassStaticFunctionsTable::const_iterator it = jsClass->m_staticFunctions->begin(); it != end; ++it) { - Q_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 - staticFunctions = 0; -} - -OpaqueJSClassContextData::~OpaqueJSClassContextData() -{ - if (staticValues) { - deleteAllValues(*staticValues); - delete staticValues; - } - - if (staticFunctions) { - deleteAllValues(*staticFunctions); - delete staticFunctions; - } -} - -OpaqueJSClassContextData& OpaqueJSClass::contextData(ExecState* exec) -{ - OpaqueJSClassContextData*& contextData = exec->globalData().opaqueJSClassData.add(this, 0).first->second; - if (!contextData) - contextData = new OpaqueJSClassContextData(this); - return *contextData; -} - -UString OpaqueJSClass::className() -{ - // Make a deep copy, so that the caller has no chance to put the original into IdentifierTable. - return UString(m_className.data(), m_className.size()); -} - -OpaqueJSClassStaticValuesTable* OpaqueJSClass::staticValues(JSC::ExecState* exec) -{ - OpaqueJSClassContextData& jsClassData = contextData(exec); - return jsClassData.staticValues; -} - -OpaqueJSClassStaticFunctionsTable* OpaqueJSClass::staticFunctions(JSC::ExecState* exec) -{ - OpaqueJSClassContextData& jsClassData = contextData(exec); - return jsClassData.staticFunctions; -} - -/*! -// Doc here in case we make this public. (Hopefully we won't.) -@function - @abstract Returns the prototype that will be used when constructing an object with a given class. - @param ctx The execution context to use. - @param jsClass A JSClass whose prototype you want to get. - @result The JSObject prototype that was automatically generated for jsClass, or NULL if no prototype was automatically generated. This is the prototype that will be used when constructing an object using jsClass. -*/ -JSObject* OpaqueJSClass::prototype(ExecState* exec) -{ - /* Class (C++) and prototype (JS) inheritance are parallel, so: - * (C++) | (JS) - * ParentClass | ParentClassPrototype - * ^ | ^ - * | | | - * DerivedClass | DerivedClassPrototype - */ - - if (!prototypeClass) - return 0; - - OpaqueJSClassContextData& jsClassData = contextData(exec); - - if (!jsClassData.cachedPrototype) { - // Recursive, but should be good enough for our purposes - jsClassData.cachedPrototype = new (exec) JSCallbackObject(exec, exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData); // set jsClassData as the object's private data, so it can clear our reference on destruction - if (parentClass) { - if (JSObject* prototype = parentClass->prototype(exec)) - jsClassData.cachedPrototype->setPrototype(prototype); - } - } - return jsClassData.cachedPrototype.get(); -} diff --git a/src/3rdparty/javascriptcore/API/JSClassRef.h b/src/3rdparty/javascriptcore/API/JSClassRef.h deleted file mode 100644 index ae60aadef..000000000 --- a/src/3rdparty/javascriptcore/API/JSClassRef.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2006 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 JSClassRef_h -#define JSClassRef_h - -#include "JSObjectRef.h" - -#include -#include -#include -#include -#include -#include - -struct StaticValueEntry : FastAllocBase { - StaticValueEntry(JSObjectGetPropertyCallback _getProperty, JSObjectSetPropertyCallback _setProperty, JSPropertyAttributes _attributes) - : getProperty(_getProperty), setProperty(_setProperty), attributes(_attributes) - { - } - - JSObjectGetPropertyCallback getProperty; - JSObjectSetPropertyCallback setProperty; - JSPropertyAttributes attributes; -}; - -struct StaticFunctionEntry : FastAllocBase { - StaticFunctionEntry(JSObjectCallAsFunctionCallback _callAsFunction, JSPropertyAttributes _attributes) - : callAsFunction(_callAsFunction), attributes(_attributes) - { - } - - JSObjectCallAsFunctionCallback callAsFunction; - JSPropertyAttributes attributes; -}; - -typedef HashMap, StaticValueEntry*> OpaqueJSClassStaticValuesTable; -typedef HashMap, StaticFunctionEntry*> OpaqueJSClassStaticFunctionsTable; - -struct OpaqueJSClass; - -// An OpaqueJSClass (JSClass) is created without a context, so it can be used with any context, even across context groups. -// This structure holds data members that vary across context groups. -struct OpaqueJSClassContextData : Noncopyable { - OpaqueJSClassContextData(OpaqueJSClass*); - ~OpaqueJSClassContextData(); - - // It is necessary to keep OpaqueJSClass alive because of the following rare scenario: - // 1. A class is created and used, so its context data is stored in JSGlobalData hash map. - // 2. The class is released, and when all JS objects that use it are collected, OpaqueJSClass - // is deleted (that's the part prevented by this RefPtr). - // 3. Another class is created at the same address. - // 4. When it is used, the old context data is found in JSGlobalData and used. - RefPtr m_class; - - OpaqueJSClassStaticValuesTable* staticValues; - OpaqueJSClassStaticFunctionsTable* staticFunctions; - JSC::WeakGCPtr cachedPrototype; -}; - -struct OpaqueJSClass : public ThreadSafeShared { - static PassRefPtr create(const JSClassDefinition*); - static PassRefPtr createNoAutomaticPrototype(const JSClassDefinition*); - ~OpaqueJSClass(); - - JSC::UString className(); - OpaqueJSClassStaticValuesTable* staticValues(JSC::ExecState*); - OpaqueJSClassStaticFunctionsTable* staticFunctions(JSC::ExecState*); - JSC::JSObject* prototype(JSC::ExecState*); - - OpaqueJSClass* parentClass; - OpaqueJSClass* prototypeClass; - - JSObjectInitializeCallback initialize; - JSObjectFinalizeCallback finalize; - JSObjectHasPropertyCallback hasProperty; - JSObjectGetPropertyCallback getProperty; - JSObjectSetPropertyCallback setProperty; - JSObjectDeletePropertyCallback deleteProperty; - JSObjectGetPropertyNamesCallback getPropertyNames; - JSObjectCallAsFunctionCallback callAsFunction; - JSObjectCallAsConstructorCallback callAsConstructor; - JSObjectHasInstanceCallback hasInstance; - JSObjectConvertToTypeCallback convertToType; - -private: - friend struct OpaqueJSClassContextData; - - OpaqueJSClass(); - OpaqueJSClass(const OpaqueJSClass&); - OpaqueJSClass(const JSClassDefinition*, OpaqueJSClass* protoClass); - - OpaqueJSClassContextData& contextData(JSC::ExecState*); - - // UStrings in these data members should not be put into any IdentifierTable. - JSC::UString m_className; - OpaqueJSClassStaticValuesTable* m_staticValues; - OpaqueJSClassStaticFunctionsTable* m_staticFunctions; -}; - -#endif // JSClassRef_h diff --git a/src/3rdparty/javascriptcore/API/JSContextRef.cpp b/src/3rdparty/javascriptcore/API/JSContextRef.cpp deleted file mode 100644 index f810e6bc7..000000000 --- a/src/3rdparty/javascriptcore/API/JSContextRef.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - */ - -#include "Platform.h" -#include "JSContextRef.h" -#include "JSContextRefPrivate.h" - -#include "APICast.h" -#include "InitializeThreading.h" -#include "JSCallbackObject.h" -#include "JSClassRef.h" -#include "JSGlobalObject.h" -#include "JSObject.h" -#include - -using namespace JSC; - -JSContextGroupRef JSContextGroupCreate() -{ - initializeThreading(); - return toRef(JSGlobalData::createNonDefault().releaseRef()); -} - -JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group) -{ - toJS(group)->ref(); - return group; -} - -void JSContextGroupRelease(JSContextGroupRef group) -{ - toJS(group)->deref(); -} - -JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass) -{ - initializeThreading(); - return JSGlobalContextCreateInGroup(0, globalObjectClass); -} - -JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClassRef globalObjectClass) -{ - initializeThreading(); - - RefPtr globalData = group ? PassRefPtr(toJS(group)) : JSGlobalData::createNonDefault(); - - APIEntryShim entryShim(globalData.get()); - - if (!globalObjectClass) { - JSGlobalObject* globalObject = new (globalData.get()) JSGlobalObject; - return JSGlobalContextRetain(toGlobalRef(globalObject->globalExec())); - } - - JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject(globalObjectClass); - ExecState* exec = globalObject->globalExec(); - JSValue prototype = globalObjectClass->prototype(exec); - if (!prototype) - prototype = jsNull(); - globalObject->resetPrototype(prototype); - return JSGlobalContextRetain(toGlobalRef(exec)); -} - -JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef ctx) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSGlobalData& globalData = exec->globalData(); - gcProtect(exec->dynamicGlobalObject()); - globalData.ref(); - return ctx; -} - -void JSGlobalContextRelease(JSGlobalContextRef ctx) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - 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. - globalData.heap.destroy(); - } else - globalData.heap.collectAllGarbage(); - - globalData.deref(); -} - -JSObjectRef JSContextGetGlobalObject(JSContextRef ctx) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - // It is necessary to call toThisObject to get the wrapper object when used with WebCore. - return toRef(exec->lexicalGlobalObject()->toThisObject(exec)); -} - -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/API/JSContextRef.h b/src/3rdparty/javascriptcore/API/JSContextRef.h deleted file mode 100644 index 2e0a0f17e..000000000 --- a/src/3rdparty/javascriptcore/API/JSContextRef.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2006 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 JSContextRef_h -#define JSContextRef_h - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/*! -@function -@abstract Creates a JavaScript context group. -@discussion A JSContextGroup associates JavaScript contexts with one another. - Contexts in the same group may share and exchange JavaScript objects. Sharing and/or exchanging - JavaScript objects between contexts in different groups will produce undefined behavior. - When objects from the same context group are used in multiple threads, explicit - synchronization is required. -@result The created JSContextGroup. -*/ -JS_EXPORT JSContextGroupRef JSContextGroupCreate(); - -/*! -@function -@abstract Retains a JavaScript context group. -@param group The JSContextGroup to retain. -@result A JSContextGroup that is the same as group. -*/ -JS_EXPORT JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group); - -/*! -@function -@abstract Releases a JavaScript context group. -@param group The JSContextGroup to release. -*/ -JS_EXPORT void JSContextGroupRelease(JSContextGroupRef group); - -/*! -@function -@abstract Creates a global JavaScript execution context. -@discussion JSGlobalContextCreate allocates a global object and populates it with all the - built-in JavaScript objects, such as Object, Function, String, and Array. - - In WebKit version 4.0 and later, the context is created in a unique context group. - Therefore, scripts may execute in it concurrently with scripts executing in other contexts. - However, you may not use values created in the context in other contexts. -@param globalObjectClass The class to use when creating the global object. Pass - NULL to use the default object class. -@result A JSGlobalContext with a global object of class globalObjectClass. -*/ -JS_EXPORT JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass); - -/*! -@function -@abstract Creates a global JavaScript execution context in the context group provided. -@discussion JSGlobalContextCreateInGroup allocates a global object and populates it with - all the built-in JavaScript objects, such as Object, Function, String, and Array. -@param globalObjectClass The class to use when creating the global object. Pass - NULL to use the default object class. -@param group The context group to use. The created global context retains the group. - Pass NULL to create a unique group for the context. -@result A JSGlobalContext with a global object of class globalObjectClass and a context - group equal to group. -*/ -JS_EXPORT JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClassRef globalObjectClass); - -/*! -@function -@abstract Retains a global JavaScript execution context. -@param ctx The JSGlobalContext to retain. -@result A JSGlobalContext that is the same as ctx. -*/ -JS_EXPORT JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef ctx); - -/*! -@function -@abstract Releases a global JavaScript execution context. -@param ctx The JSGlobalContext to release. -*/ -JS_EXPORT void JSGlobalContextRelease(JSGlobalContextRef ctx); - -/*! -@function -@abstract Gets the global object of a JavaScript execution context. -@param ctx The JSContext whose global object you want to get. -@result ctx's global object. -*/ -JS_EXPORT JSObjectRef JSContextGetGlobalObject(JSContextRef ctx); - -/*! -@function -@abstract Gets the context group to which a JavaScript execution context belongs. -@param ctx The JSContext whose group you want to get. -@result ctx's group. -*/ -JS_EXPORT JSContextGroupRef JSContextGetGroup(JSContextRef ctx); - -#ifdef __cplusplus -} -#endif - -#endif /* JSContextRef_h */ diff --git a/src/3rdparty/javascriptcore/API/JSContextRefPrivate.h b/src/3rdparty/javascriptcore/API/JSContextRefPrivate.h deleted file mode 100644 index deeb59864..000000000 --- a/src/3rdparty/javascriptcore/API/JSContextRefPrivate.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - -#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/API/JSObjectRef.cpp b/src/3rdparty/javascriptcore/API/JSObjectRef.cpp deleted file mode 100644 index 02f0b7ec3..000000000 --- a/src/3rdparty/javascriptcore/API/JSObjectRef.cpp +++ /dev/null @@ -1,496 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2008 Kelvin W Sherlock (ksherlock@gmail.com) - * - * 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. - */ - -#include "Platform.h" -#include "JSObjectRef.h" - -#include "APICast.h" -#include "CodeBlock.h" -#include "DateConstructor.h" -#include "ErrorConstructor.h" -#include "FunctionConstructor.h" -#include "Identifier.h" -#include "InitializeThreading.h" -#include "JSArray.h" -#include "JSCallbackConstructor.h" -#include "JSCallbackFunction.h" -#include "JSCallbackObject.h" -#include "JSClassRef.h" -#include "JSFunction.h" -#include "JSGlobalObject.h" -#include "JSObject.h" -#include "JSRetainPtr.h" -#include "JSString.h" -#include "JSValueRef.h" -#include "ObjectPrototype.h" -#include "PropertyNameArray.h" -#include "RegExpConstructor.h" -#include - -using namespace JSC; - -JSClassRef JSClassCreate(const JSClassDefinition* definition) -{ - initializeThreading(); - RefPtr jsClass = (definition->attributes & kJSClassAttributeNoAutomaticPrototype) - ? OpaqueJSClass::createNoAutomaticPrototype(definition) - : OpaqueJSClass::create(definition); - - return jsClass.release().releaseRef(); -} - -JSClassRef JSClassRetain(JSClassRef jsClass) -{ - jsClass->ref(); - return jsClass; -} - -void JSClassRelease(JSClassRef jsClass) -{ - jsClass->deref(); -} - -JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - if (!jsClass) - return toRef(new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure())); // slightly more efficient - - JSCallbackObject* object = new (exec) JSCallbackObject(exec, exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); - if (JSObject* prototype = jsClass->prototype(exec)) - object->setPrototype(prototype); - - return toRef(object); -} - -JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name, JSObjectCallAsFunctionCallback callAsFunction) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous"); - - return toRef(new (exec) JSCallbackFunction(exec, callAsFunction, nameID)); -} - -JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObjectCallAsConstructorCallback callAsConstructor) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsPrototype = jsClass ? jsClass->prototype(exec) : 0; - if (!jsPrototype) - jsPrototype = exec->lexicalGlobalObject()->objectPrototype(); - - JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor); - constructor->putDirect(exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly); - return toRef(constructor); -} - -JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned parameterCount, const JSStringRef parameterNames[], JSStringRef body, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous"); - - MarkedArgumentBuffer args; - for (unsigned i = 0; i < parameterCount; i++) - args.append(jsString(exec, parameterNames[i]->ustring())); - args.append(jsString(exec, body->ustring())); - - JSObject* result = constructFunction(exec, args, nameID, sourceURL->ustring(), startingLineNumber); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - result = 0; - } - return toRef(result); -} - -JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* result; - if (argumentCount) { - MarkedArgumentBuffer argList; - for (size_t i = 0; i < argumentCount; ++i) - argList.append(toJS(exec, arguments[i])); - - result = constructArray(exec, argList); - } else - result = constructEmptyArray(exec); - - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - result = 0; - } - - return toRef(result); -} - -JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - MarkedArgumentBuffer argList; - for (size_t i = 0; i < argumentCount; ++i) - argList.append(toJS(exec, arguments[i])); - - JSObject* result = constructDate(exec, argList); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - result = 0; - } - - return toRef(result); -} - -JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - MarkedArgumentBuffer argList; - for (size_t i = 0; i < argumentCount; ++i) - argList.append(toJS(exec, arguments[i])); - - JSObject* result = constructError(exec, argList); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - result = 0; - } - - return toRef(result); -} - -JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - MarkedArgumentBuffer argList; - for (size_t i = 0; i < argumentCount; ++i) - argList.append(toJS(exec, arguments[i])); - - JSObject* result = constructRegExp(exec, argList); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - result = 0; - } - - return toRef(result); -} - -JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - return toRef(exec, jsObject->prototype()); -} - -void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - JSValue jsValue = toJS(exec, value); - - jsObject->setPrototype(jsValue.isObject() ? jsValue : jsNull()); -} - -bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - - return jsObject->hasProperty(exec, propertyName->identifier(&exec->globalData())); -} - -JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - - JSValue jsValue = jsObject->get(exec, propertyName->identifier(&exec->globalData())); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - } - return toRef(exec, jsValue); -} - -void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - Identifier name(propertyName->identifier(&exec->globalData())); - JSValue jsValue = toJS(exec, value); - - if (attributes && !jsObject->hasProperty(exec, name)) - jsObject->putWithAttributes(exec, name, jsValue, attributes); - else { - PutPropertySlot slot; - jsObject->put(exec, name, jsValue, slot); - } - - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - } -} - -JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - - JSValue jsValue = jsObject->get(exec, propertyIndex); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - } - return toRef(exec, jsValue); -} - - -void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef value, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - JSValue jsValue = toJS(exec, value); - - jsObject->put(exec, propertyIndex, jsValue); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - } -} - -bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - - bool result = jsObject->deleteProperty(exec, propertyName->identifier(&exec->globalData())); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - } - return result; -} - -void* JSObjectGetPrivate(JSObjectRef object) -{ - JSObject* jsObject = toJS(object); - - if (jsObject->inherits(&JSGlobalObject::info)) - return static_cast*>(jsObject)->getPrivate(); - else if (jsObject->inherits(&JSObject::info)) - return static_cast*>(jsObject)->getPrivate(); - - return 0; -} - -bool JSObjectSetPrivate(JSObjectRef object, void* data) -{ - JSObject* jsObject = toJS(object); - - if (jsObject->inherits(&JSGlobalObject::info)) { - static_cast*>(jsObject)->setPrivate(data); - return true; - } else if (jsObject->inherits(&JSObject::info)) { - static_cast*>(jsObject)->setPrivate(data); - return true; - } - - return false; -} - -bool JSObjectIsFunction(JSContextRef, JSObjectRef object) -{ - CallData callData; - return toJS(object)->getCallData(callData) != CallTypeNone; -} - -JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - JSObject* jsThisObject = toJS(thisObject); - - if (!jsThisObject) - jsThisObject = exec->globalThisValue(); - - MarkedArgumentBuffer argList; - for (size_t i = 0; i < argumentCount; i++) - argList.append(toJS(exec, arguments[i])); - - CallData callData; - CallType callType = jsObject->getCallData(callData); - if (callType == CallTypeNone) - return 0; - - JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList)); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - result = 0; - } - return result; -} - -bool JSObjectIsConstructor(JSContextRef, JSObjectRef object) -{ - JSObject* jsObject = toJS(object); - ConstructData constructData; - return jsObject->getConstructData(constructData) != ConstructTypeNone; -} - -JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSObject* jsObject = toJS(object); - - ConstructData constructData; - ConstructType constructType = jsObject->getConstructData(constructData); - if (constructType == ConstructTypeNone) - return 0; - - MarkedArgumentBuffer argList; - for (size_t i = 0; i < argumentCount; i++) - argList.append(toJS(exec, arguments[i])); - JSObjectRef result = toRef(construct(exec, jsObject, constructType, constructData, argList)); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - result = 0; - } - return result; -} - -struct OpaqueJSPropertyNameArray : FastAllocBase { - OpaqueJSPropertyNameArray(JSGlobalData* globalData) - : refCount(0) - , globalData(globalData) - { - } - - unsigned refCount; - JSGlobalData* globalData; - Vector > array; -}; - -JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef ctx, JSObjectRef object) -{ - JSObject* jsObject = toJS(object); - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSGlobalData* globalData = &exec->globalData(); - - JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(globalData); - PropertyNameArray array(globalData); - jsObject->getPropertyNames(exec, array); - - size_t size = array.size(); - propertyNames->array.reserveInitialCapacity(size); - for (size_t i = 0; i < size; ++i) - propertyNames->array.append(JSRetainPtr(Adopt, OpaqueJSString::create(array[i].ustring()).releaseRef())); - - return JSPropertyNameArrayRetain(propertyNames); -} - -JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array) -{ - ++array->refCount; - return array; -} - -void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array) -{ - if (--array->refCount == 0) { - APIEntryShim entryShim(array->globalData); - delete array; - } -} - -size_t JSPropertyNameArrayGetCount(JSPropertyNameArrayRef array) -{ - return array->array.size(); -} - -JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size_t index) -{ - return array->array[static_cast(index)].get(); -} - -void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef array, JSStringRef propertyName) -{ - PropertyNameArray* propertyNames = toJS(array); - APIEntryShim entryShim(propertyNames->globalData()); - propertyNames->add(propertyName->identifier(propertyNames->globalData())); -} diff --git a/src/3rdparty/javascriptcore/API/JSObjectRef.h b/src/3rdparty/javascriptcore/API/JSObjectRef.h deleted file mode 100644 index f95ff8aa9..000000000 --- a/src/3rdparty/javascriptcore/API/JSObjectRef.h +++ /dev/null @@ -1,690 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2008 Kelvin W Sherlock (ksherlock@gmail.com) - * - * 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 JSObjectRef_h -#define JSObjectRef_h - -#include -#include - -#include /* for size_t */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! -@enum JSPropertyAttribute -@constant kJSPropertyAttributeNone Specifies that a property has no special attributes. -@constant kJSPropertyAttributeReadOnly Specifies that a property is read-only. -@constant kJSPropertyAttributeDontEnum Specifies that a property should not be enumerated by JSPropertyEnumerators and JavaScript for...in loops. -@constant kJSPropertyAttributeDontDelete Specifies that the delete operation should fail on a property. -*/ -enum { - kJSPropertyAttributeNone = 0, - kJSPropertyAttributeReadOnly = 1 << 1, - kJSPropertyAttributeDontEnum = 1 << 2, - kJSPropertyAttributeDontDelete = 1 << 3 -}; - -/*! -@typedef JSPropertyAttributes -@abstract A set of JSPropertyAttributes. Combine multiple attributes by logically ORing them together. -*/ -typedef unsigned JSPropertyAttributes; - -/*! -@enum JSClassAttribute -@constant kJSClassAttributeNone Specifies that a class has no special attributes. -@constant kJSClassAttributeNoAutomaticPrototype Specifies that a class should not automatically generate a shared prototype for its instance objects. Use kJSClassAttributeNoAutomaticPrototype in combination with JSObjectSetPrototype to manage prototypes manually. -*/ -enum { - kJSClassAttributeNone = 0, - kJSClassAttributeNoAutomaticPrototype = 1 << 1 -}; - -/*! -@typedef JSClassAttributes -@abstract A set of JSClassAttributes. Combine multiple attributes by logically ORing them together. -*/ -typedef unsigned JSClassAttributes; - -/*! -@typedef JSObjectInitializeCallback -@abstract The callback invoked when an object is first created. -@param ctx The execution context to use. -@param object The JSObject being created. -@discussion If you named your function Initialize, you would declare it like this: - -void Initialize(JSContextRef ctx, JSObjectRef object); - -Unlike the other object callbacks, the initialize callback is called on the least -derived class (the parent class) first, and the most derived class last. -*/ -typedef void -(*JSObjectInitializeCallback) (JSContextRef ctx, JSObjectRef object); - -/*! -@typedef JSObjectFinalizeCallback -@abstract The callback invoked when an object is finalized (prepared for garbage collection). An object may be finalized on any thread. -@param object The JSObject being finalized. -@discussion If you named your function Finalize, you would declare it like this: - -void Finalize(JSObjectRef object); - -The finalize callback is called on the most derived class first, and the least -derived class (the parent class) last. - -You must not call any function that may cause a garbage collection or an allocation -of a garbage collected object from within a JSObjectFinalizeCallback. This includes -all functions that have a JSContextRef parameter. -*/ -typedef void -(*JSObjectFinalizeCallback) (JSObjectRef object); - -/*! -@typedef JSObjectHasPropertyCallback -@abstract The callback invoked when determining whether an object has a property. -@param ctx The execution context to use. -@param object The JSObject to search for the property. -@param propertyName A JSString containing the name of the property look up. -@result true if object has the property, otherwise false. -@discussion If you named your function HasProperty, you would declare it like this: - -bool HasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - -If this function returns false, the hasProperty request forwards to object's statically declared properties, then its parent class chain (which includes the default object class), then its prototype chain. - -This callback enables optimization in cases where only a property's existence needs to be known, not its value, and computing its value would be expensive. - -If this callback is NULL, the getProperty callback will be used to service hasProperty requests. -*/ -typedef bool -(*JSObjectHasPropertyCallback) (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - -/*! -@typedef JSObjectGetPropertyCallback -@abstract The callback invoked when getting a property's value. -@param ctx The execution context to use. -@param object The JSObject to search for the property. -@param propertyName A JSString containing the name of the property to get. -@param exception A pointer to a JSValueRef in which to return an exception, if any. -@result The property's value if object has the property, otherwise NULL. -@discussion If you named your function GetProperty, you would declare it like this: - -JSValueRef GetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - -If this function returns NULL, the get request forwards to object's statically declared properties, then its parent class chain (which includes the default object class), then its prototype chain. -*/ -typedef JSValueRef -(*JSObjectGetPropertyCallback) (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - -/*! -@typedef JSObjectSetPropertyCallback -@abstract The callback invoked when setting a property's value. -@param ctx The execution context to use. -@param object The JSObject on which to set the property's value. -@param propertyName A JSString containing the name of the property to set. -@param value A JSValue to use as the property's value. -@param exception A pointer to a JSValueRef in which to return an exception, if any. -@result true if the property was set, otherwise false. -@discussion If you named your function SetProperty, you would declare it like this: - -bool SetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - -If this function returns false, the set request forwards to object's statically declared properties, then its parent class chain (which includes the default object class). -*/ -typedef bool -(*JSObjectSetPropertyCallback) (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - -/*! -@typedef JSObjectDeletePropertyCallback -@abstract The callback invoked when deleting a property. -@param ctx The execution context to use. -@param object The JSObject in which to delete the property. -@param propertyName A JSString containing the name of the property to delete. -@param exception A pointer to a JSValueRef in which to return an exception, if any. -@result true if propertyName was successfully deleted, otherwise false. -@discussion If you named your function DeleteProperty, you would declare it like this: - -bool DeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - -If this function returns false, the delete request forwards to object's statically declared properties, then its parent class chain (which includes the default object class). -*/ -typedef bool -(*JSObjectDeletePropertyCallback) (JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - -/*! -@typedef JSObjectGetPropertyNamesCallback -@abstract The callback invoked when collecting the names of an object's properties. -@param ctx The execution context to use. -@param object The JSObject whose property names are being collected. -@param accumulator A JavaScript property name accumulator in which to accumulate the names of object's properties. -@discussion If you named your function GetPropertyNames, you would declare it like this: - -void GetPropertyNames(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames); - -Property name accumulators are used by JSObjectCopyPropertyNames and JavaScript for...in loops. - -Use JSPropertyNameAccumulatorAddName to add property names to accumulator. A class's getPropertyNames callback only needs to provide the names of properties that the class vends through a custom getProperty or setProperty callback. Other properties, including statically declared properties, properties vended by other classes, and properties belonging to object's prototype, are added independently. -*/ -typedef void -(*JSObjectGetPropertyNamesCallback) (JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames); - -/*! -@typedef JSObjectCallAsFunctionCallback -@abstract The callback invoked when an object is called as a function. -@param ctx The execution context to use. -@param function A JSObject that is the function being called. -@param thisObject A JSObject that is the 'this' variable in the function's scope. -@param argumentCount An integer count of the number of arguments in arguments. -@param arguments A JSValue array of the arguments passed to the function. -@param exception A pointer to a JSValueRef in which to return an exception, if any. -@result A JSValue that is the function's return value. -@discussion If you named your function CallAsFunction, you would declare it like this: - -JSValueRef CallAsFunction(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -If your callback were invoked by the JavaScript expression 'myObject.myFunction()', function would be set to myFunction, and thisObject would be set to myObject. - -If this callback is NULL, calling your object as a function will throw an exception. -*/ -typedef JSValueRef -(*JSObjectCallAsFunctionCallback) (JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -/*! -@typedef JSObjectCallAsConstructorCallback -@abstract The callback invoked when an object is used as a constructor in a 'new' expression. -@param ctx The execution context to use. -@param constructor A JSObject that is the constructor being called. -@param argumentCount An integer count of the number of arguments in arguments. -@param arguments A JSValue array of the arguments passed to the function. -@param exception A pointer to a JSValueRef in which to return an exception, if any. -@result A JSObject that is the constructor's return value. -@discussion If you named your function CallAsConstructor, you would declare it like this: - -JSObjectRef CallAsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -If your callback were invoked by the JavaScript expression 'new myConstructor()', constructor would be set to myConstructor. - -If this callback is NULL, using your object as a constructor in a 'new' expression will throw an exception. -*/ -typedef JSObjectRef -(*JSObjectCallAsConstructorCallback) (JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -/*! -@typedef JSObjectHasInstanceCallback -@abstract hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression. -@param ctx The execution context to use. -@param constructor The JSObject that is the target of the 'instanceof' expression. -@param possibleInstance The JSValue being tested to determine if it is an instance of constructor. -@param exception A pointer to a JSValueRef in which to return an exception, if any. -@result true if possibleInstance is an instance of constructor, otherwise false. -@discussion If you named your function HasInstance, you would declare it like this: - -bool HasInstance(JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception); - -If your callback were invoked by the JavaScript expression 'someValue instanceof myObject', constructor would be set to myObject and possibleInstance would be set to someValue. - -If this callback is NULL, 'instanceof' expressions that target your object will return false. - -Standard JavaScript practice calls for objects that implement the callAsConstructor callback to implement the hasInstance callback as well. -*/ -typedef bool -(*JSObjectHasInstanceCallback) (JSContextRef ctx, JSObjectRef constructor, JSValueRef possibleInstance, JSValueRef* exception); - -/*! -@typedef JSObjectConvertToTypeCallback -@abstract The callback invoked when converting an object to a particular JavaScript type. -@param ctx The execution context to use. -@param object The JSObject to convert. -@param type A JSType specifying the JavaScript type to convert to. -@param exception A pointer to a JSValueRef in which to return an exception, if any. -@result The objects's converted value, or NULL if the object was not converted. -@discussion If you named your function ConvertToType, you would declare it like this: - -JSValueRef ConvertToType(JSContextRef ctx, JSObjectRef object, JSType type, JSValueRef* exception); - -If this function returns false, the conversion request forwards to object's parent class chain (which includes the default object class). - -This function is only invoked when converting an object to number or string. An object converted to boolean is 'true.' An object converted to object is itself. -*/ -typedef JSValueRef -(*JSObjectConvertToTypeCallback) (JSContextRef ctx, JSObjectRef object, JSC::JSType type, JSValueRef* exception); - -/*! -@struct JSStaticValue -@abstract This structure describes a statically declared value property. -@field name A null-terminated UTF8 string containing the property's name. -@field getProperty A JSObjectGetPropertyCallback to invoke when getting the property's value. -@field setProperty A JSObjectSetPropertyCallback to invoke when setting the property's value. May be NULL if the ReadOnly attribute is set. -@field attributes A logically ORed set of JSPropertyAttributes to give to the property. -*/ -typedef struct { - const char* const name; - JSObjectGetPropertyCallback getProperty; - JSObjectSetPropertyCallback setProperty; - JSPropertyAttributes attributes; -} JSStaticValue; - -/*! -@struct JSStaticFunction -@abstract This structure describes a statically declared function property. -@field name A null-terminated UTF8 string containing the property's name. -@field callAsFunction A JSObjectCallAsFunctionCallback to invoke when the property is called as a function. -@field attributes A logically ORed set of JSPropertyAttributes to give to the property. -*/ -typedef struct { - const char* const name; - JSObjectCallAsFunctionCallback callAsFunction; - JSPropertyAttributes attributes; -} JSStaticFunction; - -/*! -@struct JSClassDefinition -@abstract This structure contains properties and callbacks that define a type of object. All fields other than the version field are optional. Any pointer may be NULL. -@field version The version number of this structure. The current version is 0. -@field attributes A logically ORed set of JSClassAttributes to give to the class. -@field className A null-terminated UTF8 string containing the class's name. -@field parentClass A JSClass to set as the class's parent class. Pass NULL use the default object class. -@field staticValues A JSStaticValue array containing the class's statically declared value properties. Pass NULL to specify no statically declared value properties. The array must be terminated by a JSStaticValue whose name field is NULL. -@field staticFunctions A JSStaticFunction array containing the class's statically declared function properties. Pass NULL to specify no statically declared function properties. The array must be terminated by a JSStaticFunction whose name field is NULL. -@field initialize The callback invoked when an object is first created. Use this callback to initialize the object. -@field finalize The callback invoked when an object is finalized (prepared for garbage collection). Use this callback to release resources allocated for the object, and perform other cleanup. -@field hasProperty The callback invoked when determining whether an object has a property. If this field is NULL, getProperty is called instead. The hasProperty callback enables optimization in cases where only a property's existence needs to be known, not its value, and computing its value is expensive. -@field getProperty The callback invoked when getting a property's value. -@field setProperty The callback invoked when setting a property's value. -@field deleteProperty The callback invoked when deleting a property. -@field getPropertyNames The callback invoked when collecting the names of an object's properties. -@field callAsFunction The callback invoked when an object is called as a function. -@field hasInstance The callback invoked when an object is used as the target of an 'instanceof' expression. -@field callAsConstructor The callback invoked when an object is used as a constructor in a 'new' expression. -@field convertToType The callback invoked when converting an object to a particular JavaScript type. -@discussion The staticValues and staticFunctions arrays are the simplest and most efficient means for vending custom properties. Statically declared properties autmatically service requests like getProperty, setProperty, and getPropertyNames. Property access callbacks are required only to implement unusual properties, like array indexes, whose names are not known at compile-time. - -If you named your getter function "GetX" and your setter function "SetX", you would declare a JSStaticValue array containing "X" like this: - -JSStaticValue StaticValueArray[] = { - { "X", GetX, SetX, kJSPropertyAttributeNone }, - { 0, 0, 0, 0 } -}; - -Standard JavaScript practice calls for storing function objects in prototypes, so they can be shared. The default JSClass created by JSClassCreate follows this idiom, instantiating objects with a shared, automatically generating prototype containing the class's function objects. The kJSClassAttributeNoAutomaticPrototype attribute specifies that a JSClass should not automatically generate such a prototype. The resulting JSClass instantiates objects with the default object prototype, and gives each instance object its own copy of the class's function objects. - -A NULL callback specifies that the default object callback should substitute, except in the case of hasProperty, where it specifies that getProperty should substitute. -*/ -typedef struct { - int version; /* current (and only) version is 0 */ - JSClassAttributes attributes; - - const char* className; - JSClassRef parentClass; - - const JSStaticValue* staticValues; - const JSStaticFunction* staticFunctions; - - JSObjectInitializeCallback initialize; - JSObjectFinalizeCallback finalize; - JSObjectHasPropertyCallback hasProperty; - JSObjectGetPropertyCallback getProperty; - JSObjectSetPropertyCallback setProperty; - JSObjectDeletePropertyCallback deleteProperty; - JSObjectGetPropertyNamesCallback getPropertyNames; - JSObjectCallAsFunctionCallback callAsFunction; - JSObjectCallAsConstructorCallback callAsConstructor; - JSObjectHasInstanceCallback hasInstance; - JSObjectConvertToTypeCallback convertToType; -} JSClassDefinition; - -/*! -@const kJSClassDefinitionEmpty -@abstract A JSClassDefinition structure of the current version, filled with NULL pointers and having no attributes. -@discussion Use this constant as a convenience when creating class definitions. For example, to create a class definition with only a finalize method: - -JSClassDefinition definition = kJSClassDefinitionEmpty; -definition.finalize = Finalize; -*/ -JS_EXPORT extern const JSClassDefinition kJSClassDefinitionEmpty; - -/*! -@function -@abstract Creates a JavaScript class suitable for use with JSObjectMake. -@param definition A JSClassDefinition that defines the class. -@result A JSClass with the given definition. Ownership follows the Create Rule. -*/ -JS_EXPORT JSClassRef JSClassCreate(const JSClassDefinition* definition); - -/*! -@function -@abstract Retains a JavaScript class. -@param jsClass The JSClass to retain. -@result A JSClass that is the same as jsClass. -*/ -JS_EXPORT JSClassRef JSClassRetain(JSClassRef jsClass); - -/*! -@function -@abstract Releases a JavaScript class. -@param jsClass The JSClass to release. -*/ -JS_EXPORT void JSClassRelease(JSClassRef jsClass); - -/*! -@function -@abstract Creates a JavaScript object. -@param ctx The execution context to use. -@param jsClass The JSClass to assign to the object. Pass NULL to use the default object class. -@param data A void* to set as the object's private data. Pass NULL to specify no private data. -@result A JSObject with the given class and private data. -@discussion The default object class does not allocate storage for private data, so you must provide a non-NULL jsClass to JSObjectMake if you want your object to be able to store private data. - -data is set on the created object before the intialize methods in its class chain are called. This enables the initialize methods to retrieve and manipulate data through JSObjectGetPrivate. -*/ -JS_EXPORT JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data); - -/*! -@function -@abstract Convenience method for creating a JavaScript function with a given callback as its implementation. -@param ctx The execution context to use. -@param name A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function. -@param callAsFunction The JSObjectCallAsFunctionCallback to invoke when the function is called. -@result A JSObject that is a function. The object's prototype will be the default function prototype. -*/ -JS_EXPORT JSObjectRef JSObjectMakeFunctionWithCallback(JSContextRef ctx, JSStringRef name, JSObjectCallAsFunctionCallback callAsFunction); - -/*! -@function -@abstract Convenience method for creating a JavaScript constructor. -@param ctx The execution context to use. -@param jsClass A JSClass that is the class your constructor will assign to the objects its constructs. jsClass will be used to set the constructor's .prototype property, and to evaluate 'instanceof' expressions. Pass NULL to use the default object class. -@param callAsConstructor A JSObjectCallAsConstructorCallback to invoke when your constructor is used in a 'new' expression. Pass NULL to use the default object constructor. -@result A JSObject that is a constructor. The object's prototype will be the default object prototype. -@discussion The default object constructor takes no arguments and constructs an object of class jsClass with no private data. -*/ -JS_EXPORT JSObjectRef JSObjectMakeConstructor(JSContextRef ctx, JSClassRef jsClass, JSObjectCallAsConstructorCallback callAsConstructor); - -/*! - @function - @abstract Creates a JavaScript Array object. - @param ctx The execution context to use. - @param argumentCount An integer count of the number of arguments in arguments. - @param arguments A JSValue array of data to populate the Array with. Pass NULL if argumentCount is 0. - @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. - @result A JSObject that is an Array. - @discussion The behavior of this function does not exactly match the behavior of the built-in Array constructor. Specifically, if one argument - is supplied, this function returns an array with one element. - */ -JS_EXPORT JSObjectRef JSObjectMakeArray(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -/*! - @function - @abstract Creates a JavaScript Date object, as if by invoking the built-in Date constructor. - @param ctx The execution context to use. - @param argumentCount An integer count of the number of arguments in arguments. - @param arguments A JSValue array of arguments to pass to the Date Constructor. Pass NULL if argumentCount is 0. - @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. - @result A JSObject that is a Date. - */ -JS_EXPORT JSObjectRef JSObjectMakeDate(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -/*! - @function - @abstract Creates a JavaScript Error object, as if by invoking the built-in Error constructor. - @param ctx The execution context to use. - @param argumentCount An integer count of the number of arguments in arguments. - @param arguments A JSValue array of arguments to pass to the Error Constructor. Pass NULL if argumentCount is 0. - @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. - @result A JSObject that is a Error. - */ -JS_EXPORT JSObjectRef JSObjectMakeError(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -/*! - @function - @abstract Creates a JavaScript RegExp object, as if by invoking the built-in RegExp constructor. - @param ctx The execution context to use. - @param argumentCount An integer count of the number of arguments in arguments. - @param arguments A JSValue array of arguments to pass to the RegExp Constructor. Pass NULL if argumentCount is 0. - @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. - @result A JSObject that is a RegExp. - */ -JS_EXPORT JSObjectRef JSObjectMakeRegExp(JSContextRef ctx, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -/*! -@function -@abstract Creates a function with a given script as its body. -@param ctx The execution context to use. -@param name A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function. -@param parameterCount An integer count of the number of parameter names in parameterNames. -@param parameterNames A JSString array containing the names of the function's parameters. Pass NULL if parameterCount is 0. -@param body A JSString containing the script to use as the function's body. -@param sourceURL A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions. -@param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. -@param exception A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception. -@result A JSObject that is a function, or NULL if either body or parameterNames contains a syntax error. The object's prototype will be the default function prototype. -@discussion Use this method when you want to execute a script repeatedly, to avoid the cost of re-parsing the script before each execution. -*/ -JS_EXPORT JSObjectRef JSObjectMakeFunction(JSContextRef ctx, JSStringRef name, unsigned parameterCount, const JSStringRef parameterNames[], JSStringRef body, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception); - -/*! -@function -@abstract Gets an object's prototype. -@param ctx The execution context to use. -@param object A JSObject whose prototype you want to get. -@result A JSValue that is the object's prototype. -*/ -JS_EXPORT JSValueRef JSObjectGetPrototype(JSContextRef ctx, JSObjectRef object); - -/*! -@function -@abstract Sets an object's prototype. -@param ctx The execution context to use. -@param object The JSObject whose prototype you want to set. -@param value A JSValue to set as the object's prototype. -*/ -JS_EXPORT void JSObjectSetPrototype(JSContextRef ctx, JSObjectRef object, JSValueRef value); - -/*! -@function -@abstract Tests whether an object has a given property. -@param object The JSObject to test. -@param propertyName A JSString containing the property's name. -@result true if the object has a property whose name matches propertyName, otherwise false. -*/ -JS_EXPORT bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - -/*! -@function -@abstract Gets a property from an object. -@param ctx The execution context to use. -@param object The JSObject whose property you want to get. -@param propertyName A JSString containing the property's name. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result The property's value if object has the property, otherwise the undefined value. -*/ -JS_EXPORT JSValueRef JSObjectGetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - -/*! -@function -@abstract Sets a property on an object. -@param ctx The execution context to use. -@param object The JSObject whose property you want to set. -@param propertyName A JSString containing the property's name. -@param value A JSValue to use as the property's value. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@param attributes A logically ORed set of JSPropertyAttributes to give to the property. -*/ -JS_EXPORT void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef* exception); - -/*! -@function -@abstract Deletes a property from an object. -@param ctx The execution context to use. -@param object The JSObject whose property you want to delete. -@param propertyName A JSString containing the property's name. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set). -*/ -JS_EXPORT bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - -/*! -@function -@abstract Gets a property from an object by numeric index. -@param ctx The execution context to use. -@param object The JSObject whose property you want to get. -@param propertyIndex An integer value that is the property's name. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result The property's value if object has the property, otherwise the undefined value. -@discussion Calling JSObjectGetPropertyAtIndex is equivalent to calling JSObjectGetProperty with a string containing propertyIndex, but JSObjectGetPropertyAtIndex provides optimized access to numeric properties. -*/ -JS_EXPORT JSValueRef JSObjectGetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef* exception); - -/*! -@function -@abstract Sets a property on an object by numeric index. -@param ctx The execution context to use. -@param object The JSObject whose property you want to set. -@param propertyIndex The property's name as a number. -@param value A JSValue to use as the property's value. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@discussion Calling JSObjectSetPropertyAtIndex is equivalent to calling JSObjectSetProperty with a string containing propertyIndex, but JSObjectSetPropertyAtIndex provides optimized access to numeric properties. -*/ -JS_EXPORT void JSObjectSetPropertyAtIndex(JSContextRef ctx, JSObjectRef object, unsigned propertyIndex, JSValueRef value, JSValueRef* exception); - -/*! -@function -@abstract Gets an object's private data. -@param object A JSObject whose private data you want to get. -@result A void* that is the object's private data, if the object has private data, otherwise NULL. -*/ -JS_EXPORT void* JSObjectGetPrivate(JSObjectRef object); - -/*! -@function -@abstract Sets a pointer to private data on an object. -@param object The JSObject whose private data you want to set. -@param data A void* to set as the object's private data. -@result true if object can store private data, otherwise false. -@discussion The default object class does not allocate storage for private data. Only objects created with a non-NULL JSClass can store private data. -*/ -JS_EXPORT bool JSObjectSetPrivate(JSObjectRef object, void* data); - -/*! -@function -@abstract Tests whether an object can be called as a function. -@param ctx The execution context to use. -@param object The JSObject to test. -@result true if the object can be called as a function, otherwise false. -*/ -JS_EXPORT bool JSObjectIsFunction(JSContextRef ctx, JSObjectRef object); - -/*! -@function -@abstract Calls an object as a function. -@param ctx The execution context to use. -@param object The JSObject to call as a function. -@param thisObject The object to use as "this," or NULL to use the global object as "this." -@param argumentCount An integer count of the number of arguments in arguments. -@param arguments A JSValue array of arguments to pass to the function. Pass NULL if argumentCount is 0. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result The JSValue that results from calling object as a function, or NULL if an exception is thrown or object is not a function. -*/ -JS_EXPORT JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -/*! -@function -@abstract Tests whether an object can be called as a constructor. -@param ctx The execution context to use. -@param object The JSObject to test. -@result true if the object can be called as a constructor, otherwise false. -*/ -JS_EXPORT bool JSObjectIsConstructor(JSContextRef ctx, JSObjectRef object); - -/*! -@function -@abstract Calls an object as a constructor. -@param ctx The execution context to use. -@param object The JSObject to call as a constructor. -@param argumentCount An integer count of the number of arguments in arguments. -@param arguments A JSValue array of arguments to pass to the constructor. Pass NULL if argumentCount is 0. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result The JSObject that results from calling object as a constructor, or NULL if an exception is thrown or object is not a constructor. -*/ -JS_EXPORT JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - -/*! -@function -@abstract Gets the names of an object's enumerable properties. -@param ctx The execution context to use. -@param object The object whose property names you want to get. -@result A JSPropertyNameArray containing the names object's enumerable properties. Ownership follows the Create Rule. -*/ -JS_EXPORT JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef ctx, JSObjectRef object); - -/*! -@function -@abstract Retains a JavaScript property name array. -@param array The JSPropertyNameArray to retain. -@result A JSPropertyNameArray that is the same as array. -*/ -JS_EXPORT JSPropertyNameArrayRef JSPropertyNameArrayRetain(JSPropertyNameArrayRef array); - -/*! -@function -@abstract Releases a JavaScript property name array. -@param array The JSPropetyNameArray to release. -*/ -JS_EXPORT void JSPropertyNameArrayRelease(JSPropertyNameArrayRef array); - -/*! -@function -@abstract Gets a count of the number of items in a JavaScript property name array. -@param array The array from which to retrieve the count. -@result An integer count of the number of names in array. -*/ -JS_EXPORT size_t JSPropertyNameArrayGetCount(JSPropertyNameArrayRef array); - -/*! -@function -@abstract Gets a property name at a given index in a JavaScript property name array. -@param array The array from which to retrieve the property name. -@param index The index of the property name to retrieve. -@result A JSStringRef containing the property name. -*/ -JS_EXPORT JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size_t index); - -/*! -@function -@abstract Adds a property name to a JavaScript property name accumulator. -@param accumulator The accumulator object to which to add the property name. -@param propertyName The property name to add. -*/ -JS_EXPORT void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef accumulator, JSStringRef propertyName); - -#ifdef __cplusplus -} -#endif - -#endif /* JSObjectRef_h */ diff --git a/src/3rdparty/javascriptcore/API/JSRetainPtr.h b/src/3rdparty/javascriptcore/API/JSRetainPtr.h deleted file mode 100644 index 535f90379..000000000 --- a/src/3rdparty/javascriptcore/API/JSRetainPtr.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 JSRetainPtr_h -#define JSRetainPtr_h - -#include -#include - -inline void JSRetain(JSStringRef string) { JSStringRetain(string); } -inline void JSRelease(JSStringRef string) { JSStringRelease(string); } - -enum AdoptTag { Adopt }; - -template class JSRetainPtr { -public: - JSRetainPtr() : m_ptr(0) {} - JSRetainPtr(T ptr) : m_ptr(ptr) { if (ptr) JSRetain(ptr); } - - JSRetainPtr(AdoptTag, T ptr) : m_ptr(ptr) { } - - JSRetainPtr(const JSRetainPtr& o) : m_ptr(o.m_ptr) { if (T ptr = m_ptr) JSRetain(ptr); } - - ~JSRetainPtr() { if (T ptr = m_ptr) JSRelease(ptr); } - - template JSRetainPtr(const JSRetainPtr& o) : m_ptr(o.get()) { if (T ptr = m_ptr) JSRetain(ptr); } - - T get() const { return m_ptr; } - - T releaseRef() { T tmp = m_ptr; m_ptr = 0; return tmp; } - - T operator->() const { return m_ptr; } - - bool operator!() const { return !m_ptr; } - - // This conversion operator allows implicit conversion to bool but not to other integer types. - typedef T JSRetainPtr::*UnspecifiedBoolType; - operator UnspecifiedBoolType() const { return m_ptr ? &JSRetainPtr::m_ptr : 0; } - - JSRetainPtr& operator=(const JSRetainPtr&); - template JSRetainPtr& operator=(const JSRetainPtr&); - JSRetainPtr& operator=(T); - template JSRetainPtr& operator=(U*); - - void adopt(T); - - void swap(JSRetainPtr&); - -private: - T m_ptr; -}; - -template inline JSRetainPtr& JSRetainPtr::operator=(const JSRetainPtr& o) -{ - T optr = o.get(); - if (optr) - JSRetain(optr); - T ptr = m_ptr; - m_ptr = optr; - if (ptr) - JSRelease(ptr); - return *this; -} - -template template inline JSRetainPtr& JSRetainPtr::operator=(const JSRetainPtr& o) -{ - T optr = o.get(); - if (optr) - JSRetain(optr); - T ptr = m_ptr; - m_ptr = optr; - if (ptr) - JSRelease(ptr); - return *this; -} - -template inline JSRetainPtr& JSRetainPtr::operator=(T optr) -{ - if (optr) - JSRetain(optr); - T ptr = m_ptr; - m_ptr = optr; - if (ptr) - JSRelease(ptr); - return *this; -} - -template inline void JSRetainPtr::adopt(T optr) -{ - T ptr = m_ptr; - m_ptr = optr; - if (ptr) - JSRelease(ptr); -} - -template template inline JSRetainPtr& JSRetainPtr::operator=(U* optr) -{ - if (optr) - JSRetain(optr); - T ptr = m_ptr; - m_ptr = optr; - if (ptr) - JSRelease(ptr); - return *this; -} - -template inline void JSRetainPtr::swap(JSRetainPtr& o) -{ - std::swap(m_ptr, o.m_ptr); -} - -template inline void swap(JSRetainPtr& a, JSRetainPtr& b) -{ - a.swap(b); -} - -template inline bool operator==(const JSRetainPtr& a, const JSRetainPtr& b) -{ - return a.get() == b.get(); -} - -template inline bool operator==(const JSRetainPtr& a, U* b) -{ - return a.get() == b; -} - -template inline bool operator==(T* a, const JSRetainPtr& b) -{ - return a == b.get(); -} - -template inline bool operator!=(const JSRetainPtr& a, const JSRetainPtr& b) -{ - return a.get() != b.get(); -} - -template inline bool operator!=(const JSRetainPtr& a, U* b) -{ - return a.get() != b; -} - -template inline bool operator!=(T* a, const JSRetainPtr& b) -{ - return a != b.get(); -} - - -#endif // JSRetainPtr_h diff --git a/src/3rdparty/javascriptcore/API/JSStringRef.cpp b/src/3rdparty/javascriptcore/API/JSStringRef.cpp deleted file mode 100644 index 366672808..000000000 --- a/src/3rdparty/javascriptcore/API/JSStringRef.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - */ - -#include "Platform.h" -#include "JSStringRef.h" - -#include "InitializeThreading.h" -#include "OpaqueJSString.h" -#include - -using namespace JSC; -using namespace WTF::Unicode; - -JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars) -{ - initializeThreading(); - return OpaqueJSString::create(chars, numChars).releaseRef(); -} - -JSStringRef JSStringRetain(JSStringRef string) -{ - string->ref(); - return string; -} - -void JSStringRelease(JSStringRef string) -{ - string->deref(); -} - -size_t JSStringGetLength(JSStringRef string) -{ - return string->length(); -} - -const JSChar* JSStringGetCharactersPtr(JSStringRef string) -{ - return string->characters(); -} - -size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string) -{ - // Any UTF8 character > 3 bytes encodes as a UTF16 surrogate pair. - return string->length() * 3 + 1; // + 1 for terminating '\0' -} - -bool JSStringIsEqual(JSStringRef a, JSStringRef b) -{ - unsigned len = a->length(); - return len == b->length() && 0 == memcmp(a->characters(), b->characters(), len * sizeof(UChar)); -} diff --git a/src/3rdparty/javascriptcore/API/JSStringRef.h b/src/3rdparty/javascriptcore/API/JSStringRef.h deleted file mode 100644 index 074464d11..000000000 --- a/src/3rdparty/javascriptcore/API/JSStringRef.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2006 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 JSStringRef_h -#define JSStringRef_h - -#include - -#include /* for size_t */ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! -@typedef JSChar -@abstract A Unicode character. -*/ -typedef unsigned short JSChar; - -/*! -@function -@abstract Creates a JavaScript string from a buffer of Unicode characters. -@param chars The buffer of Unicode characters to copy into the new JSString. -@param numChars The number of characters to copy from the buffer pointed to by chars. -@result A JSString containing chars. Ownership follows the Create Rule. -*/ -JS_EXPORT JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars); - -/*! -@function -@abstract Retains a JavaScript string. -@param string The JSString to retain. -@result A JSString that is the same as string. -*/ -JS_EXPORT JSStringRef JSStringRetain(JSStringRef string); - -/*! -@function -@abstract Releases a JavaScript string. -@param string The JSString to release. -*/ -JS_EXPORT void JSStringRelease(JSStringRef string); - -/*! -@function -@abstract Returns the number of Unicode characters in a JavaScript string. -@param string The JSString whose length (in Unicode characters) you want to know. -@result The number of Unicode characters stored in string. -*/ -JS_EXPORT size_t JSStringGetLength(JSStringRef string); - -/*! -@function -@abstract Returns a pointer to the Unicode character buffer that - serves as the backing store for a JavaScript string. -@param string The JSString whose backing store you want to access. -@result A pointer to the Unicode character buffer that serves as string's - backing store, which will be deallocated when string is deallocated. -*/ -JS_EXPORT const JSChar* JSStringGetCharactersPtr(JSStringRef string); - -/*! -@function -@abstract Returns the maximum number of bytes a JavaScript string will - take up if converted into a null-terminated UTF8 string. -@param string The JSString whose maximum converted size (in bytes) you - want to know. -@result The maximum number of bytes that could be required to convert string into a - null-terminated UTF8 string. The number of bytes that the conversion actually ends - up requiring could be less than this, but never more. -*/ -JS_EXPORT size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string); - -/*! -@function -@abstract Tests whether two JavaScript strings match. -@param a The first JSString to test. -@param b The second JSString to test. -@result true if the two strings match, otherwise false. -*/ -JS_EXPORT bool JSStringIsEqual(JSStringRef a, JSStringRef b); - -#ifdef __cplusplus -} -#endif - -#endif /* JSStringRef_h */ diff --git a/src/3rdparty/javascriptcore/API/JSValueRef.cpp b/src/3rdparty/javascriptcore/API/JSValueRef.cpp deleted file mode 100644 index dc7c36fc4..000000000 --- a/src/3rdparty/javascriptcore/API/JSValueRef.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - */ - -#include "Platform.h" -#include "JSValueRef.h" - -#include -#include "APICast.h" -#include "APIShims.h" -#include "JSCallbackObject.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include // for std::min - -using namespace JSC; - -::JSType JSValueGetType(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - - if (jsValue.isUndefined()) - return UndefinedType; - if (jsValue.isNull()) - return NullType; - if (jsValue.isBoolean()) - return BooleanType; - if (jsValue.isNumber()) - return NumberType; - if (jsValue.isString()) - return StringType; - Q_ASSERT(jsValue.isObject()); - return ObjectType; -} - -bool JSValueIsUndefined(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - return jsValue.isUndefined(); -} - -bool JSValueIsNull(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - return jsValue.isNull(); -} - -bool JSValueIsBoolean(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - return jsValue.isBoolean(); -} - -bool JSValueIsNumber(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - return jsValue.isNumber(); -} - -bool JSValueIsString(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - return jsValue.isString(); -} - -bool JSValueIsObject(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - return jsValue.isObject(); -} - -bool JSValueIsObjectOfClass(JSContextRef ctx, JSValueRef value, JSClassRef jsClass) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - - if (JSObject* o = jsValue.getObject()) { - if (o->inherits(&JSCallbackObject::info)) - return static_cast*>(o)->inherits(jsClass); - else if (o->inherits(&JSCallbackObject::info)) - return static_cast*>(o)->inherits(jsClass); - } - return false; -} - -bool JSValueIsEqual(JSContextRef ctx, JSValueRef a, JSValueRef b, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsA = toJS(exec, a); - JSValue jsB = toJS(exec, b); - - bool result = JSValue::equal(exec, jsA, jsB); // false if an exception is thrown - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - } - return result; -} - -bool JSValueIsStrictEqual(JSContextRef ctx, JSValueRef a, JSValueRef b) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsA = toJS(exec, a); - JSValue jsB = toJS(exec, b); - - return JSValue::strictEqual(exec, jsA, jsB); -} - -bool JSValueIsInstanceOfConstructor(JSContextRef ctx, JSValueRef value, JSObjectRef constructor, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - - JSObject* jsConstructor = toJS(constructor); - if (!jsConstructor->structure()->typeInfo().implementsHasInstance()) - return false; - bool result = jsConstructor->hasInstance(exec, jsValue, jsConstructor->get(exec, exec->propertyNames().prototype)); // false if an exception is thrown - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - } - return result; -} - -JSValueRef JSValueMakeUndefined(JSContextRef ctx) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - return toRef(exec, jsUndefined()); -} - -JSValueRef JSValueMakeNull(JSContextRef ctx) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - return toRef(exec, jsNull()); -} - -JSValueRef JSValueMakeBoolean(JSContextRef ctx, bool value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - return toRef(exec, jsBoolean(value)); -} - -JSValueRef JSValueMakeNumber(JSContextRef ctx, double value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - return toRef(exec, jsNumber(exec, value)); -} - -JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - return toRef(exec, jsString(exec, string->ustring())); -} - -bool JSValueToBoolean(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - return jsValue.toBoolean(exec); -} - -double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - - double number = jsValue.toNumber(exec); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - number = NaN; - } - return number; -} - -JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - - RefPtr stringRef(OpaqueJSString::create(jsValue.toString(exec))); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - stringRef.clear(); - } - return stringRef.release().releaseRef(); -} - -JSObjectRef JSValueToObject(JSContextRef ctx, JSValueRef value, JSValueRef* exception) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJS(exec, value); - - JSObjectRef objectRef = toRef(jsValue.toObject(exec)); - if (exec->hadException()) { - if (exception) - *exception = toRef(exec, exec->exception()); - exec->clearException(); - objectRef = 0; - } - return objectRef; -} - -void JSValueProtect(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJSForGC(exec, value); - gcProtect(jsValue); -} - -void JSValueUnprotect(JSContextRef ctx, JSValueRef value) -{ - ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec); - - JSValue jsValue = toJSForGC(exec, value); - gcUnprotect(jsValue); -} diff --git a/src/3rdparty/javascriptcore/API/JSValueRef.h b/src/3rdparty/javascriptcore/API/JSValueRef.h deleted file mode 100644 index 2081c0d71..000000000 --- a/src/3rdparty/javascriptcore/API/JSValueRef.h +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright (C) 2006 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 JSValueRef_h -#define JSValueRef_h - -#include -#include - -/*! -@enum JSType -@abstract A constant identifying the type of a JSValue. -@constant UnspecifiedType -@constant UndefinedType The unique undefined value. -@constant BooleanType A primitive boolean value, one of true or false. -@constant NumberType A primitive number value. -@constant NullType The unique null value. -@constant StringType A primitive string value. -@constant CompoundType -@constant ObjectType An object value (meaning that this JSValueRef is a JSObjectRef). -@constant GetterSetterType -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -/*! -@function -@abstract Returns a JavaScript value's type. -@param ctx The execution context to use. -@param value The JSValue whose type you want to obtain. -@result A value of type JSType that identifies value's type. -*/ -JS_EXPORT JSC::JSType JSValueGetType(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Tests whether a JavaScript value's type is the undefined type. -@param ctx The execution context to use. -@param value The JSValue to test. -@result true if value's type is the undefined type, otherwise false. -*/ -JS_EXPORT bool JSValueIsUndefined(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Tests whether a JavaScript value's type is the null type. -@param ctx The execution context to use. -@param value The JSValue to test. -@result true if value's type is the null type, otherwise false. -*/ -JS_EXPORT bool JSValueIsNull(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Tests whether a JavaScript value's type is the boolean type. -@param ctx The execution context to use. -@param value The JSValue to test. -@result true if value's type is the boolean type, otherwise false. -*/ -JS_EXPORT bool JSValueIsBoolean(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Tests whether a JavaScript value's type is the number type. -@param ctx The execution context to use. -@param value The JSValue to test. -@result true if value's type is the number type, otherwise false. -*/ -JS_EXPORT bool JSValueIsNumber(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Tests whether a JavaScript value's type is the string type. -@param ctx The execution context to use. -@param value The JSValue to test. -@result true if value's type is the string type, otherwise false. -*/ -JS_EXPORT bool JSValueIsString(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Tests whether a JavaScript value's type is the object type. -@param ctx The execution context to use. -@param value The JSValue to test. -@result true if value's type is the object type, otherwise false. -*/ -JS_EXPORT bool JSValueIsObject(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Tests whether a JavaScript value is an object with a given class in its class chain. -@param ctx The execution context to use. -@param value The JSValue to test. -@param jsClass The JSClass to test against. -@result true if value is an object and has jsClass in its class chain, otherwise false. -*/ -JS_EXPORT bool JSValueIsObjectOfClass(JSContextRef ctx, JSValueRef value, JSClassRef jsClass); - -/* Comparing values */ - -/*! -@function -@abstract Tests whether two JavaScript values are equal, as compared by the JS == operator. -@param ctx The execution context to use. -@param a The first value to test. -@param b The second value to test. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result true if the two values are equal, false if they are not equal or an exception is thrown. -*/ -JS_EXPORT bool JSValueIsEqual(JSContextRef ctx, JSValueRef a, JSValueRef b, JSValueRef* exception); - -/*! -@function -@abstract Tests whether two JavaScript values are strict equal, as compared by the JS === operator. -@param ctx The execution context to use. -@param a The first value to test. -@param b The second value to test. -@result true if the two values are strict equal, otherwise false. -*/ -JS_EXPORT bool JSValueIsStrictEqual(JSContextRef ctx, JSValueRef a, JSValueRef b); - -/*! -@function -@abstract Tests whether a JavaScript value is an object constructed by a given constructor, as compared by the JS instanceof operator. -@param ctx The execution context to use. -@param value The JSValue to test. -@param constructor The constructor to test against. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result true if value is an object constructed by constructor, as compared by the JS instanceof operator, otherwise false. -*/ -JS_EXPORT bool JSValueIsInstanceOfConstructor(JSContextRef ctx, JSValueRef value, JSObjectRef constructor, JSValueRef* exception); - -/* Creating values */ - -/*! -@function -@abstract Creates a JavaScript value of the undefined type. -@param ctx The execution context to use. -@result The unique undefined value. -*/ -JS_EXPORT JSValueRef JSValueMakeUndefined(JSContextRef ctx); - -/*! -@function -@abstract Creates a JavaScript value of the null type. -@param ctx The execution context to use. -@result The unique null value. -*/ -JS_EXPORT JSValueRef JSValueMakeNull(JSContextRef ctx); - -/*! -@function -@abstract Creates a JavaScript value of the boolean type. -@param ctx The execution context to use. -@param boolean The bool to assign to the newly created JSValue. -@result A JSValue of the boolean type, representing the value of boolean. -*/ -JS_EXPORT JSValueRef JSValueMakeBoolean(JSContextRef ctx, bool boolean); - -/*! -@function -@abstract Creates a JavaScript value of the number type. -@param ctx The execution context to use. -@param number The double to assign to the newly created JSValue. -@result A JSValue of the number type, representing the value of number. -*/ -JS_EXPORT JSValueRef JSValueMakeNumber(JSContextRef ctx, double number); - -/*! -@function -@abstract Creates a JavaScript value of the string type. -@param ctx The execution context to use. -@param string The JSString to assign to the newly created JSValue. The - newly created JSValue retains string, and releases it upon garbage collection. -@result A JSValue of the string type, representing the value of string. -*/ -JS_EXPORT JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string); - -/* Converting to primitive values */ - -/*! -@function -@abstract Converts a JavaScript value to boolean and returns the resulting boolean. -@param ctx The execution context to use. -@param value The JSValue to convert. -@result The boolean result of conversion. -*/ -JS_EXPORT bool JSValueToBoolean(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Converts a JavaScript value to number and returns the resulting number. -@param ctx The execution context to use. -@param value The JSValue to convert. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result The numeric result of conversion, or NaN if an exception is thrown. -*/ -JS_EXPORT double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception); - -/*! -@function -@abstract Converts a JavaScript value to string and copies the result into a JavaScript string. -@param ctx The execution context to use. -@param value The JSValue to convert. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result A JSString with the result of conversion, or NULL if an exception is thrown. Ownership follows the Create Rule. -*/ -JS_EXPORT JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef* exception); - -/*! -@function -@abstract Converts a JavaScript value to object and returns the resulting object. -@param ctx The execution context to use. -@param value The JSValue to convert. -@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. -@result The JSObject result of conversion, or NULL if an exception is thrown. -*/ -JS_EXPORT JSObjectRef JSValueToObject(JSContextRef ctx, JSValueRef value, JSValueRef* exception); - -/* Garbage collection */ -/*! -@function -@abstract Protects a JavaScript value from garbage collection. -@param ctx The execution context to use. -@param value The JSValue to protect. -@discussion Use this method when you want to store a JSValue in a global or on the heap, where the garbage collector will not be able to discover your reference to it. - -A value may be protected multiple times and must be unprotected an equal number of times before becoming eligible for garbage collection. -*/ -JS_EXPORT void JSValueProtect(JSContextRef ctx, JSValueRef value); - -/*! -@function -@abstract Unprotects a JavaScript value from garbage collection. -@param ctx The execution context to use. -@param value The JSValue to unprotect. -@discussion A value may be protected multiple times and must be unprotected an - equal number of times before becoming eligible for garbage collection. -*/ -JS_EXPORT void JSValueUnprotect(JSContextRef ctx, JSValueRef value); - -#ifdef __cplusplus -} -#endif - -#endif /* JSValueRef_h */ diff --git a/src/3rdparty/javascriptcore/API/JavaScriptCore.h b/src/3rdparty/javascriptcore/API/JavaScriptCore.h deleted file mode 100644 index 0923fcd33..000000000 --- a/src/3rdparty/javascriptcore/API/JavaScriptCore.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2006, 2008 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 JavaScriptCore_h -#define JavaScriptCore_h - -#include -#include -#include -#include -#include -#include - -#endif /* JavaScriptCore_h */ diff --git a/src/3rdparty/javascriptcore/API/OpaqueJSString.cpp b/src/3rdparty/javascriptcore/API/OpaqueJSString.cpp deleted file mode 100644 index a5c3b33e9..000000000 --- a/src/3rdparty/javascriptcore/API/OpaqueJSString.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2008 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. - */ - -#include "Platform.h" -#include "OpaqueJSString.h" - -#include -#include -#include - -using namespace JSC; - -PassRefPtr OpaqueJSString::create(const UString& ustring) -{ - if (!ustring.isNull()) - return adoptRef(new OpaqueJSString(ustring.data(), ustring.size())); - return 0; -} - -UString OpaqueJSString::ustring() const -{ - if (m_characters) - return UString(m_characters, m_length); - return UString::null(); -} - -Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const -{ - if (!m_characters) - return Identifier(globalData, static_cast(0)); - - return Identifier(globalData, m_characters, m_length); -} diff --git a/src/3rdparty/javascriptcore/API/OpaqueJSString.h b/src/3rdparty/javascriptcore/API/OpaqueJSString.h deleted file mode 100644 index 6aa7b99fd..000000000 --- a/src/3rdparty/javascriptcore/API/OpaqueJSString.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2008 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 OpaqueJSString_h -#define OpaqueJSString_h - -#include - -namespace JSC { - class Identifier; - class JSGlobalData; -} - -struct OpaqueJSString : public ThreadSafeShared { - - static PassRefPtr create() // null - { - return adoptRef(new OpaqueJSString); - } - - static PassRefPtr create(const UChar* characters, unsigned length) - { - return adoptRef(new OpaqueJSString(characters, length)); - } - - static PassRefPtr create(const JSC::UString&); - - UChar* characters() { return m_characters; } - unsigned length() { return m_length; } - - JSC::UString ustring() const; - JSC::Identifier identifier(JSC::JSGlobalData*) const; - -private: - friend class WTF::ThreadSafeShared; - - OpaqueJSString() - : m_characters(0) - , m_length(0) - { - } - - OpaqueJSString(const UChar* characters, unsigned length) - : m_length(length) - { - m_characters = new UChar[length]; - memcpy(m_characters, characters, length * sizeof(UChar)); - } - - ~OpaqueJSString() - { - delete[] m_characters; - } - - UChar* m_characters; - unsigned m_length; -}; - -#endif diff --git a/src/3rdparty/javascriptcore/AUTHORS b/src/3rdparty/javascriptcore/AUTHORS deleted file mode 100644 index e50da8c56..000000000 --- a/src/3rdparty/javascriptcore/AUTHORS +++ /dev/null @@ -1,2 +0,0 @@ -Harri Porten (porten@kde.org) -Peter Kelly (pmk@post.com) diff --git a/src/3rdparty/javascriptcore/COPYING.LIB b/src/3rdparty/javascriptcore/COPYING.LIB deleted file mode 100644 index 87c4a33dd..000000000 --- a/src/3rdparty/javascriptcore/COPYING.LIB +++ /dev/null @@ -1,488 +0,0 @@ - - -NOTE! The LGPL below is copyrighted by the Free Software Foundation, but -the instance of code that it refers to (the kde libraries) are copyrighted -by the authors who actually wrote it. - ---------------------------------------------------------------------------- - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor - Boston, MA 02110-1301, USA. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/src/3rdparty/javascriptcore/DerivedSources.make b/src/3rdparty/javascriptcore/DerivedSources.make deleted file mode 100644 index ae2b6ec20..000000000 --- a/src/3rdparty/javascriptcore/DerivedSources.make +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (C) 2006, 2007, 2008, 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. -# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -# its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. - -VPATH = \ - $(JavaScriptCore) \ - $(JavaScriptCore)/parser \ - $(JavaScriptCore)/runtime \ - $(JavaScriptCore)/interpreter -# - -.PHONY : all -all : \ - ArrayPrototype.lut.h \ - DatePrototype.lut.h \ - Grammar.cpp \ - JSONObject.lut.h \ - Lexer.lut.h \ - MathObject.lut.h \ - NumberConstructor.lut.h \ - RegExpConstructor.lut.h \ - RegExpObject.lut.h \ - StringPrototype.lut.h -# - -# lookup tables for classes - -%.lut.h: create_hash_table %.cpp - $^ -i > $@ -Lexer.lut.h: create_hash_table Keywords.table - $^ > $@ - -# JavaScript language grammar - -Grammar.cpp: Grammar.y - bison --no-lines -d -p jscyy $< -o $@ > bison_out.txt 2>&1 - perl -p -e 'END { if ($$conflict) { unlink "Grammar.cpp"; die; } } $$conflict ||= /conflict/' < bison_out.txt - rm -f bison_out.txt diff --git a/src/3rdparty/javascriptcore/NOTE b/src/3rdparty/javascriptcore/NOTE deleted file mode 100644 index 4e83c224b..000000000 --- a/src/3rdparty/javascriptcore/NOTE +++ /dev/null @@ -1,2 +0,0 @@ -This is Git checkout 3ab0f621048fbeb480b687a28ed31d92d8506150 -from git://gitorious.org/qtwebkit/qtwebkit.git that has been modified. diff --git a/src/3rdparty/javascriptcore/THANKS b/src/3rdparty/javascriptcore/THANKS deleted file mode 100644 index b9a964943..000000000 --- a/src/3rdparty/javascriptcore/THANKS +++ /dev/null @@ -1,8 +0,0 @@ - -I would like to thank the following people for their help: - -Richard Moore - for filling the Math object with some life -Daegeun Lee - for pointing out some bugs and providing - much code for the String and Date object. -Marco Pinelli - for his patches -Christian Kirsch - for his contribution to the Date object diff --git a/src/3rdparty/javascriptcore/bytecode/CodeBlock.cpp b/src/3rdparty/javascriptcore/bytecode/CodeBlock.cpp deleted file mode 100644 index 8a1acd0f1..000000000 --- a/src/3rdparty/javascriptcore/bytecode/CodeBlock.cpp +++ /dev/null @@ -1,1427 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. - */ - -#include "Platform.h" -#include "CodeBlock.h" - -#include "JSValue.h" -#include "Interpreter.h" -#include "JSFunction.h" -#include "JSStaticScopeObject.h" -#include "BytecodeGenerator.h" -#include - -#define DUMP_CODE_BLOCK_STATISTICS 0 - -namespace JSC { - -#if !defined(QT_NO_DEBUG) || ENABLE(OPCODE_SAMPLING) - -static UString escapeQuotes(const UString& str) -{ - UString result = str; - int pos = 0; - while ((pos = result.find('\"', pos)) >= 0) { - result = makeString(result.substr(0, pos), "\"\\\"\"", result.substr(pos + 1)); - pos += 4; - } - return result; -} - -static UString valueToSourceString(ExecState* exec, JSValue val) -{ - if (!val) - return "0"; - - if (val.isString()) - return makeString("\"", escapeQuotes(val.toString(exec)), "\""); - - return val.toString(exec); -} - -static const char* constantName(ExecState* exec, int k, JSValue value) -{ - return makeString(valueToSourceString(exec, value), "(@k", UString::from(k - FirstConstantRegisterIndex), ")").UTF8String(); -} - -static const char* idName(int id0, const Identifier& ident) -{ - return makeString(ident.ustring(), "(@id", UString::from(id0), ")").UTF8String(); -} - -const char* CodeBlock::registerName(ExecState* exec, int r) const -{ - 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) -{ - char postfix[5] = { '/', 0, 0, 0, 0 }; - int index = 1; - if (regExp->global()) - postfix[index++] = 'g'; - if (regExp->ignoreCase()) - postfix[index++] = 'i'; - if (regExp->multiline()) - postfix[index] = 'm'; - - return makeString("/", regExp->pattern(), postfix); -} - -static const char* regexpName(int re, RegExp* regexp) -{ - return makeString(regexpToSourceString(regexp), "(@re", UString::from(re), ")").UTF8String(); -} - -static UString pointerToSourceString(void* p) -{ - char buffer[2 + 2 * QT_POINTER_SIZE + 1]; // 0x [two characters per byte] \0 - snprintf(buffer, sizeof(buffer), "%p", p); - return buffer; -} - -NEVER_INLINE static const char* debugHookName(int debugHookID) -{ - switch (static_cast(debugHookID)) { - case DidEnterCallFrame: - return "didEnterCallFrame"; - case WillLeaveCallFrame: - return "willLeaveCallFrame"; - case WillExecuteStatement: - return "willExecuteStatement"; - case WillExecuteProgram: - return "willExecuteProgram"; - case DidExecuteProgram: - return "didExecuteProgram"; - case DidReachBreakpoint: - return "didReachBreakpoint"; - } - - Q_UNREACHABLE(); - return ""; -} - -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(exec, r0), registerName(exec, r1)); -} - -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(exec, r0), registerName(exec, r1), registerName(exec, r2)); -} - -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(exec, r0), offset, location + offset); -} - -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(exec, r0), registerName(exec, r1), idName(id0, m_identifiers[id0])); - it += 4; -} - -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(exec, r0), idName(id0, m_identifiers[id0]), registerName(exec, r1)); - it += 4; -} - -void CodeBlock::printStructure(const char* name, const Instruction* vPC, int operand) const -{ - unsigned instructionOffset = vPC - m_instructions.begin(); - printf(" [%4d] %s: %s\n", instructionOffset, name, pointerToSourceString(vPC[operand].u.structure).UTF8String()); -} - -void CodeBlock::printStructures(const Instruction* vPC) const -{ - unsigned instructionOffset = vPC - m_instructions.begin(); - - if (vPC[0].u.opcode == op_get_by_id) { - printStructure("get_by_id", vPC, 4); - return; - } - if (vPC[0].u.opcode == op_get_by_id_self) { - printStructure("get_by_id_self", vPC, 4); - return; - } - if (vPC[0].u.opcode == op_get_by_id_proto) { - printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(vPC[4].u.structure).UTF8String(), pointerToSourceString(vPC[5].u.structure).UTF8String()); - return; - } - if (vPC[0].u.opcode == op_put_by_id_transition) { - printf(" [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(vPC[4].u.structure).UTF8String(), pointerToSourceString(vPC[5].u.structure).UTF8String(), pointerToSourceString(vPC[6].u.structureChain).UTF8String()); - return; - } - if (vPC[0].u.opcode == op_get_by_id_chain) { - printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(vPC[4].u.structure).UTF8String(), pointerToSourceString(vPC[5].u.structureChain).UTF8String()); - return; - } - if (vPC[0].u.opcode == op_put_by_id) { - printStructure("put_by_id", vPC, 4); - return; - } - if (vPC[0].u.opcode == op_put_by_id_replace) { - printStructure("put_by_id_replace", vPC, 4); - return; - } - if (vPC[0].u.opcode == op_resolve_global) { - printStructure("resolve_global", vPC, 4); - return; - } - - // These m_instructions doesn't ref Structures. - Q_ASSERT(vPC[0].u.opcode == op_get_by_id_generic || vPC[0].u.opcode == op_put_by_id_generic || vPC[0].u.opcode == op_call || vPC[0].u.opcode == op_call_eval || vPC[0].u.opcode == op_construct); -} - -void CodeBlock::dump(ExecState* exec) const -{ - if (m_instructions.isEmpty()) { - printf("No instructions available.\n"); - return; - } - - size_t instructionCount = 0; - - for (size_t i = 0; i < m_instructions.size(); i += opcodeLengths[m_instructions[i].u.opcode]) - ++instructionCount; - - printf("%lu m_instructions; %lu bytes at %p; %d parameter(s); %d callee register(s)\n\n", - static_cast(instructionCount), - static_cast(m_instructions.size() * sizeof(Instruction)), - this, m_numParameters, m_numCalleeRegisters); - - Vector::const_iterator begin = m_instructions.begin(); - Vector::const_iterator end = m_instructions.end(); - for (Vector::const_iterator it = begin; it != end; ++it) - dump(exec, begin, it); - - if (!m_identifiers.isEmpty()) { - printf("\nIdentifiers:\n"); - size_t i = 0; - do { - printf(" id%u = %s\n", static_cast(i), m_identifiers[i].ascii()); - ++i; - } while (i != m_identifiers.size()); - } - - if (!m_constantRegisters.isEmpty()) { - printf("\nConstants:\n"); - unsigned registerIndex = m_numVars; - size_t i = 0; - do { - printf(" k%u = %s\n", registerIndex, valueToSourceString(exec, m_constantRegisters[i].jsValue()).ascii()); - ++i; - ++registerIndex; - } while (i < m_constantRegisters.size()); - } - - if (m_rareData && !m_rareData->m_regexps.isEmpty()) { - printf("\nm_regexps:\n"); - size_t i = 0; - do { - printf(" re%u = %s\n", static_cast(i), regexpToSourceString(m_rareData->m_regexps[i].get()).ascii()); - ++i; - } while (i < m_rareData->m_regexps.size()); - } - - if (!m_globalResolveInstructions.isEmpty() || !m_propertyAccessInstructions.isEmpty()) - printf("\nStructures:\n"); - - if (!m_globalResolveInstructions.isEmpty()) { - size_t i = 0; - do { - printStructures(&m_instructions[m_globalResolveInstructions[i]]); - ++i; - } while (i < m_globalResolveInstructions.size()); - } - if (!m_propertyAccessInstructions.isEmpty()) { - size_t i = 0; - do { - printStructures(&m_instructions[m_propertyAccessInstructions[i]]); - ++i; - } while (i < m_propertyAccessInstructions.size()); - } - - if (m_rareData && !m_rareData->m_exceptionHandlers.isEmpty()) { - printf("\nException Handlers:\n"); - unsigned i = 0; - do { - printf("\t %d: { start: [%4d] end: [%4d] target: [%4d] }\n", i + 1, m_rareData->m_exceptionHandlers[i].start, m_rareData->m_exceptionHandlers[i].end, m_rareData->m_exceptionHandlers[i].target); - ++i; - } while (i < m_rareData->m_exceptionHandlers.size()); - } - - if (m_rareData && !m_rareData->m_immediateSwitchJumpTables.isEmpty()) { - printf("Immediate Switch Jump Tables:\n"); - unsigned i = 0; - do { - printf(" %1d = {\n", i); - int entry = 0; - Vector::const_iterator end = m_rareData->m_immediateSwitchJumpTables[i].branchOffsets.end(); - for (Vector::const_iterator iter = m_rareData->m_immediateSwitchJumpTables[i].branchOffsets.begin(); iter != end; ++iter, ++entry) { - if (!*iter) - continue; - printf("\t\t%4d => %04d\n", entry + m_rareData->m_immediateSwitchJumpTables[i].min, *iter); - } - printf(" }\n"); - ++i; - } while (i < m_rareData->m_immediateSwitchJumpTables.size()); - } - - if (m_rareData && !m_rareData->m_characterSwitchJumpTables.isEmpty()) { - printf("\nCharacter Switch Jump Tables:\n"); - unsigned i = 0; - do { - printf(" %1d = {\n", i); - int entry = 0; - Vector::const_iterator end = m_rareData->m_characterSwitchJumpTables[i].branchOffsets.end(); - for (Vector::const_iterator iter = m_rareData->m_characterSwitchJumpTables[i].branchOffsets.begin(); iter != end; ++iter, ++entry) { - if (!*iter) - continue; - Q_ASSERT(!((i + m_rareData->m_characterSwitchJumpTables[i].min) & ~0xFFFF)); - UChar ch = static_cast(entry + m_rareData->m_characterSwitchJumpTables[i].min); - printf("\t\t\"%s\" => %04d\n", UString(&ch, 1).ascii(), *iter); - } - printf(" }\n"); - ++i; - } while (i < m_rareData->m_characterSwitchJumpTables.size()); - } - - if (m_rareData && !m_rareData->m_stringSwitchJumpTables.isEmpty()) { - printf("\nString Switch Jump Tables:\n"); - unsigned i = 0; - do { - printf(" %1d = {\n", i); - StringJumpTable::StringOffsetTable::const_iterator end = m_rareData->m_stringSwitchJumpTables[i].offsetTable.end(); - for (StringJumpTable::StringOffsetTable::const_iterator iter = m_rareData->m_stringSwitchJumpTables[i].offsetTable.begin(); iter != end; ++iter) - printf("\t\t\"%s\" => %04d\n", UString(iter->first).ascii(), iter->second); - printf(" }\n"); - ++i; - } while (i < m_rareData->m_stringSwitchJumpTables.size()); - } - - printf("\n"); -} - -void CodeBlock::dump(ExecState* exec, const Vector::const_iterator& begin, Vector::const_iterator& it) const -{ - int location = it - begin; - switch (it->u.opcode) { - case op_enter: { - printf("[%4d] enter\n", location); - break; - } - case op_enter_with_activation: { - int r0 = (++it)->u.operand; - printf("[%4d] enter_with_activation %s\n", location, registerName(exec, r0)); - break; - } - case op_create_arguments: { - printf("[%4d] create_arguments\n", location); - break; - } - case op_init_arguments: { - printf("[%4d] init_arguments\n", location); - break; - } - case op_convert_this: { - int r0 = (++it)->u.operand; - printf("[%4d] convert_this %s\n", location, registerName(exec, r0)); - break; - } - case op_new_object: { - int r0 = (++it)->u.operand; - printf("[%4d] new_object\t %s\n", location, registerName(exec, r0)); - 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(exec, dst), registerName(exec, argv), 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(exec, r0), regexpName(re0, regexp(re0))); - break; - } - case op_mov: { - int r0 = (++it)->u.operand; - int r1 = (++it)->u.operand; - printf("[%4d] mov\t\t %s, %s\n", location, registerName(exec, r0), registerName(exec, r1)); - break; - } - case op_not: { - printUnaryOp(exec, location, it, "not"); - break; - } - case op_eq: { - printBinaryOp(exec, location, it, "eq"); - break; - } - case op_eq_null: { - printUnaryOp(exec, location, it, "eq_null"); - break; - } - case op_neq: { - printBinaryOp(exec, location, it, "neq"); - break; - } - case op_neq_null: { - printUnaryOp(exec, location, it, "neq_null"); - break; - } - case op_stricteq: { - printBinaryOp(exec, location, it, "stricteq"); - break; - } - case op_nstricteq: { - printBinaryOp(exec, location, it, "nstricteq"); - break; - } - case op_less: { - printBinaryOp(exec, location, it, "less"); - break; - } - case op_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(exec, r0)); - break; - } - case op_pre_dec: { - int r0 = (++it)->u.operand; - printf("[%4d] pre_dec\t\t %s\n", location, registerName(exec, r0)); - break; - } - case op_post_inc: { - printUnaryOp(exec, location, it, "post_inc"); - break; - } - case op_post_dec: { - printUnaryOp(exec, location, it, "post_dec"); - break; - } - case op_to_jsnumber: { - printUnaryOp(exec, location, it, "to_jsnumber"); - break; - } - case op_negate: { - printUnaryOp(exec, location, it, "negate"); - break; - } - case op_add: { - printBinaryOp(exec, location, it, "add"); - ++it; - break; - } - case op_mul: { - printBinaryOp(exec, location, it, "mul"); - ++it; - break; - } - case op_div: { - printBinaryOp(exec, location, it, "div"); - ++it; - break; - } - case op_mod: { - printBinaryOp(exec, location, it, "mod"); - break; - } - case op_sub: { - printBinaryOp(exec, location, it, "sub"); - ++it; - break; - } - case op_lshift: { - printBinaryOp(exec, location, it, "lshift"); - break; - } - case op_rshift: { - printBinaryOp(exec, location, it, "rshift"); - break; - } - case op_urshift: { - printBinaryOp(exec, location, it, "urshift"); - break; - } - case op_bitand: { - printBinaryOp(exec, location, it, "bitand"); - ++it; - break; - } - case op_bitxor: { - printBinaryOp(exec, location, it, "bitxor"); - ++it; - break; - } - case op_bitor: { - printBinaryOp(exec, location, it, "bitor"); - ++it; - break; - } - case op_bitnot: { - printUnaryOp(exec, location, it, "bitnot"); - break; - } - case op_instanceof: { - int r0 = (++it)->u.operand; - 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(exec, r0), registerName(exec, r1), registerName(exec, r2), registerName(exec, r3)); - break; - } - case op_typeof: { - printUnaryOp(exec, location, it, "typeof"); - break; - } - case op_is_undefined: { - printUnaryOp(exec, location, it, "is_undefined"); - break; - } - case op_is_boolean: { - printUnaryOp(exec, location, it, "is_boolean"); - break; - } - case op_is_number: { - printUnaryOp(exec, location, it, "is_number"); - break; - } - case op_is_string: { - printUnaryOp(exec, location, it, "is_string"); - break; - } - case op_is_object: { - printUnaryOp(exec, location, it, "is_object"); - break; - } - case op_is_function: { - printUnaryOp(exec, location, it, "is_function"); - break; - } - case op_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(exec, r0), idName(id0, m_identifiers[id0])); - 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(exec, r0), idName(id0, m_identifiers[id0]), 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(exec, r0), valueToSourceString(exec, scope).ascii(), idName(id0, m_identifiers[id0])); - it += 2; - break; - } - case op_get_scoped_var: { - 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(exec, r0), 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(exec, r0)); - 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(exec, r0), 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(exec, r0)); - 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(exec, r0), idName(id0, m_identifiers[id0])); - 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(exec, r0), registerName(exec, r1), idName(id0, m_identifiers[id0])); - break; - } - case op_get_by_id: { - printGetByIdOp(exec, location, it, "get_by_id"); - break; - } - case op_get_by_id_self: { - printGetByIdOp(exec, location, it, "get_by_id_self"); - break; - } - case op_get_by_id_proto: { - printGetByIdOp(exec, location, it, "get_by_id_proto"); - break; - } - case op_get_by_id_chain: { - printGetByIdOp(exec, location, it, "get_by_id_chain"); - break; - } - case op_get_by_id_generic: { - printGetByIdOp(exec, location, it, "get_by_id_generic"); - break; - } - case op_get_array_length: { - printGetByIdOp(exec, location, it, "get_array_length"); - break; - } - case op_get_string_length: { - printGetByIdOp(exec, location, it, "get_string_length"); - break; - } - case op_put_by_id: { - printPutByIdOp(exec, location, it, "put_by_id"); - break; - } - case op_put_by_id_replace: { - printPutByIdOp(exec, location, it, "put_by_id_replace"); - break; - } - case op_put_by_id_transition: { - printPutByIdOp(exec, location, it, "put_by_id_transition"); - break; - } - case op_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(exec, r0), idName(id0, m_identifiers[id0]), registerName(exec, r1)); - 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(exec, r0), idName(id0, m_identifiers[id0]), registerName(exec, r1)); - break; - } - case op_method_check: { - 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(exec, r0), registerName(exec, r1), idName(id0, m_identifiers[id0])); - 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(exec, r0), registerName(exec, r1), registerName(exec, r2)); - 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), registerName(exec, r1), registerName(exec, r2), registerName(exec, r3), registerName(exec, r4), registerName(exec, r5)); - 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(exec, r0), registerName(exec, r1), registerName(exec, r2)); - 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(exec, r0), registerName(exec, r1), registerName(exec, r2)); - 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(exec, r0), n0, registerName(exec, r1)); - break; - } - case op_jmp: { - int offset = (++it)->u.operand; - 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, location + offset); - break; - } - case op_jtrue: { - printConditionalJump(exec, begin, it, location, "jtrue"); - break; - } - case op_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(exec, begin, it, location, "jfalse"); - break; - } - case op_jeq_null: { - printConditionalJump(exec, begin, it, location, "jeq_null"); - break; - } - case op_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(exec, r0), registerName(exec, r1), 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(exec, r0), registerName(exec, r1), 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(exec, r0), registerName(exec, r1), 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(exec, r0), registerName(exec, r1), 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), registerName(exec, r1), 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(exec, r0), registerName(exec, r1), 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, location + defaultTarget, registerName(exec, scrutineeRegister)); - 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, location + defaultTarget, registerName(exec, scrutineeRegister)); - 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, location + defaultTarget, registerName(exec, scrutineeRegister)); - 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(exec, r0), 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(exec, r0), f0); - break; - } - case op_call: { - int dst = (++it)->u.operand; - 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(exec, dst), registerName(exec, func), argCount, registerOffset); - break; - } - case op_call_eval: { - int dst = (++it)->u.operand; - 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(exec, dst), registerName(exec, func), argCount, registerOffset); - break; - } - case op_call_varargs: { - int dst = (++it)->u.operand; - 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(exec, dst), registerName(exec, func), registerName(exec, argCount), registerOffset); - break; - } - case op_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(exec, r0)); - break; - } - case op_tear_off_arguments: { - printf("[%4d] tear_off_arguments\n", location); - break; - } - case op_ret: { - int r0 = (++it)->u.operand; - printf("[%4d] ret\t\t %s\n", location, registerName(exec, r0)); - break; - } - case op_construct: { - int dst = (++it)->u.operand; - int func = (++it)->u.operand; - int argCount = (++it)->u.operand; - 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(exec, dst), registerName(exec, func), argCount, registerOffset, registerName(exec, proto), registerName(exec, thisRegister)); - 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(exec, r0), registerName(exec, r1)); - break; - } - case op_strcat: { - int r0 = (++it)->u.operand; - int r1 = (++it)->u.operand; - int count = (++it)->u.operand; - printf("[%4d] strcat\t\t %s, %s, %d\n", location, registerName(exec, r0), registerName(exec, r1), count); - break; - } - case op_to_primitive: { - int r0 = (++it)->u.operand; - int r1 = (++it)->u.operand; - printf("[%4d] to_primitive\t %s, %s\n", location, registerName(exec, r0), registerName(exec, r1)); - break; - } - case op_get_pnames: { - 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), registerName(exec, r1), registerName(exec, r2), registerName(exec, r3), offset, location + offset); - it += OPCODE_LENGTH(op_get_pnames) - 1; - break; - } - case op_next_pname: { - 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), registerName(exec, iter), 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(exec, r0)); - break; - } - case op_pop_scope: { - printf("[%4d] pop_scope\n", location); - break; - } - case op_push_new_scope: { - 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(exec, r0), idName(id0, m_identifiers[id0]), registerName(exec, r1)); - 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, location + offset); - break; - } - case op_catch: { - int r0 = (++it)->u.operand; - printf("[%4d] catch\t\t %s\n", location, registerName(exec, r0)); - break; - } - case op_throw: { - int r0 = (++it)->u.operand; - printf("[%4d] throw\t\t %s\n", location, registerName(exec, r0)); - 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(exec, r0), errorType, constantName(exec, k0, getConstant(k0))); - 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(exec, retAddrDst), offset, location + offset); - break; - } - case op_sret: { - int retAddrSrc = (++it)->u.operand; - printf("[%4d] sret\t\t %s\n", location, registerName(exec, retAddrSrc)); - break; - } - case op_debug: { - int debugHookID = (++it)->u.operand; - int firstLine = (++it)->u.operand; - int lastLine = (++it)->u.operand; - printf("[%4d] debug\t\t %s, %d, %d\n", location, debugHookName(debugHookID), firstLine, lastLine); - break; - } - case op_end: { - int r0 = (++it)->u.operand; - printf("[%4d] end\t\t %s\n", location, registerName(exec, r0)); - break; - } - } -} - -#endif // !defined(QT_NO_DEBUG) || ENABLE(OPCODE_SAMPLING) - -#if DUMP_CODE_BLOCK_STATISTICS -static HashSet liveCodeBlockSet; -#endif - -#define FOR_EACH_MEMBER_VECTOR(macro) \ - macro(instructions) \ - macro(globalResolveInfos) \ - macro(structureStubInfos) \ - macro(callLinkInfos) \ - macro(linkedCallerList) \ - macro(identifiers) \ - macro(functionExpressions) \ - macro(constantRegisters) - -#define FOR_EACH_MEMBER_VECTOR_RARE_DATA(macro) \ - macro(regexps) \ - macro(functions) \ - macro(exceptionHandlers) \ - macro(immediateSwitchJumpTables) \ - macro(characterSwitchJumpTables) \ - macro(stringSwitchJumpTables) \ - macro(functionRegisterInfos) - -#define FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(macro) \ - macro(expressionInfo) \ - macro(lineInfo) \ - macro(getByIdExceptionInfo) \ - macro(pcVector) - -template -static size_t sizeInBytes(const Vector& vector) -{ - return vector.capacity() * sizeof(T); -} - -void CodeBlock::dumpStatistics() -{ -#if DUMP_CODE_BLOCK_STATISTICS - #define DEFINE_VARS(name) size_t name##IsNotEmpty = 0; size_t name##TotalSize = 0; - FOR_EACH_MEMBER_VECTOR(DEFINE_VARS) - FOR_EACH_MEMBER_VECTOR_RARE_DATA(DEFINE_VARS) - FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(DEFINE_VARS) - #undef DEFINE_VARS - - // Non-vector data members - size_t evalCodeCacheIsNotEmpty = 0; - - size_t symbolTableIsNotEmpty = 0; - size_t symbolTableTotalSize = 0; - - size_t hasExceptionInfo = 0; - size_t hasRareData = 0; - - size_t isFunctionCode = 0; - size_t isGlobalCode = 0; - size_t isEvalCode = 0; - - HashSet::const_iterator end = liveCodeBlockSet.end(); - for (HashSet::const_iterator it = liveCodeBlockSet.begin(); it != end; ++it) { - CodeBlock* codeBlock = *it; - - #define GET_STATS(name) if (!codeBlock->m_##name.isEmpty()) { name##IsNotEmpty++; name##TotalSize += sizeInBytes(codeBlock->m_##name); } - FOR_EACH_MEMBER_VECTOR(GET_STATS) - #undef GET_STATS - - if (!codeBlock->m_symbolTable.isEmpty()) { - symbolTableIsNotEmpty++; - symbolTableTotalSize += (codeBlock->m_symbolTable.capacity() * (sizeof(SymbolTable::KeyType) + sizeof(SymbolTable::MappedType))); - } - - if (codeBlock->m_exceptionInfo) { - hasExceptionInfo++; - #define GET_STATS(name) if (!codeBlock->m_exceptionInfo->m_##name.isEmpty()) { name##IsNotEmpty++; name##TotalSize += sizeInBytes(codeBlock->m_exceptionInfo->m_##name); } - FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(GET_STATS) - #undef GET_STATS - } - - if (codeBlock->m_rareData) { - hasRareData++; - #define GET_STATS(name) if (!codeBlock->m_rareData->m_##name.isEmpty()) { name##IsNotEmpty++; name##TotalSize += sizeInBytes(codeBlock->m_rareData->m_##name); } - FOR_EACH_MEMBER_VECTOR_RARE_DATA(GET_STATS) - #undef GET_STATS - - if (!codeBlock->m_rareData->m_evalCodeCache.isEmpty()) - evalCodeCacheIsNotEmpty++; - } - - switch (codeBlock->codeType()) { - case FunctionCode: - ++isFunctionCode; - break; - case GlobalCode: - ++isGlobalCode; - break; - case EvalCode: - ++isEvalCode; - break; - } - } - - size_t totalSize = 0; - - #define GET_TOTAL_SIZE(name) totalSize += name##TotalSize; - FOR_EACH_MEMBER_VECTOR(GET_TOTAL_SIZE) - FOR_EACH_MEMBER_VECTOR_RARE_DATA(GET_TOTAL_SIZE) - FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(GET_TOTAL_SIZE) - #undef GET_TOTAL_SIZE - - totalSize += symbolTableTotalSize; - totalSize += (liveCodeBlockSet.size() * sizeof(CodeBlock)); - - printf("Number of live CodeBlocks: %d\n", liveCodeBlockSet.size()); - printf("Size of a single CodeBlock [sizeof(CodeBlock)]: %zu\n", sizeof(CodeBlock)); - printf("Size of all CodeBlocks: %zu\n", totalSize); - printf("Average size of a CodeBlock: %zu\n", totalSize / liveCodeBlockSet.size()); - - printf("Number of FunctionCode CodeBlocks: %zu (%.3f%%)\n", isFunctionCode, static_cast(isFunctionCode) * 100.0 / liveCodeBlockSet.size()); - printf("Number of GlobalCode CodeBlocks: %zu (%.3f%%)\n", isGlobalCode, static_cast(isGlobalCode) * 100.0 / liveCodeBlockSet.size()); - printf("Number of EvalCode CodeBlocks: %zu (%.3f%%)\n", isEvalCode, static_cast(isEvalCode) * 100.0 / liveCodeBlockSet.size()); - - printf("Number of CodeBlocks with exception info: %zu (%.3f%%)\n", hasExceptionInfo, static_cast(hasExceptionInfo) * 100.0 / liveCodeBlockSet.size()); - printf("Number of CodeBlocks with rare data: %zu (%.3f%%)\n", hasRareData, static_cast(hasRareData) * 100.0 / liveCodeBlockSet.size()); - - #define PRINT_STATS(name) printf("Number of CodeBlocks with " #name ": %zu\n", name##IsNotEmpty); printf("Size of all " #name ": %zu\n", name##TotalSize); - FOR_EACH_MEMBER_VECTOR(PRINT_STATS) - FOR_EACH_MEMBER_VECTOR_RARE_DATA(PRINT_STATS) - FOR_EACH_MEMBER_VECTOR_EXCEPTION_INFO(PRINT_STATS) - #undef PRINT_STATS - - printf("Number of CodeBlocks with evalCodeCache: %zu\n", evalCodeCacheIsNotEmpty); - printf("Number of CodeBlocks with symbolTable: %zu\n", symbolTableIsNotEmpty); - - printf("Size of all symbolTables: %zu\n", symbolTableTotalSize); - -#else - printf("Dumping CodeBlock statistics is not enabled.\n"); -#endif -} - -CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, CodeType codeType, PassRefPtr sourceProvider, unsigned sourceOffset, SymbolTable* symTab) - : m_numCalleeRegisters(0) - , m_numVars(0) - , m_numParameters(0) - , m_ownerExecutable(ownerExecutable) - , m_globalData(0) -#ifndef QT_NO_DEBUG - , m_instructionCount(0) -#endif - , m_needsFullScopeChain(ownerExecutable->needsActivation()) - , m_usesEval(ownerExecutable->usesEval()) - , m_usesArguments(ownerExecutable->usesArguments()) - , m_isNumericCompareFunction(false) - , m_codeType(codeType) - , m_source(sourceProvider) - , m_sourceOffset(sourceOffset) - , m_symbolTable(symTab) - , m_exceptionInfo(new ExceptionInfo) -{ - Q_ASSERT(m_source); - -#if DUMP_CODE_BLOCK_STATISTICS - liveCodeBlockSet.add(this); -#endif -} - -CodeBlock::~CodeBlock() -{ - for (size_t size = m_globalResolveInstructions.size(), i = 0; i < size; ++i) - derefStructures(&m_instructions[m_globalResolveInstructions[i]]); - - for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i) - derefStructures(&m_instructions[m_propertyAccessInstructions[i]]); - -#if DUMP_CODE_BLOCK_STATISTICS - liveCodeBlockSet.remove(this); -#endif -} - -void CodeBlock::derefStructures(Instruction* vPC) const -{ - if (vPC[0].u.opcode == op_get_by_id_self) { - vPC[4].u.structure->deref(); - return; - } - if (vPC[0].u.opcode == op_get_by_id_proto) { - vPC[4].u.structure->deref(); - vPC[5].u.structure->deref(); - return; - } - if (vPC[0].u.opcode == op_get_by_id_chain) { - vPC[4].u.structure->deref(); - vPC[5].u.structureChain->deref(); - return; - } - if (vPC[0].u.opcode == op_put_by_id_transition) { - vPC[4].u.structure->deref(); - vPC[5].u.structure->deref(); - vPC[6].u.structureChain->deref(); - return; - } - if (vPC[0].u.opcode == op_put_by_id_replace) { - vPC[4].u.structure->deref(); - return; - } - if (vPC[0].u.opcode == op_resolve_global) { - if(vPC[4].u.structure) - vPC[4].u.structure->deref(); - return; - } - - // These instructions don't ref their Structures. - Q_ASSERT(vPC[0].u.opcode == op_get_by_id || vPC[0].u.opcode == op_put_by_id || vPC[0].u.opcode == op_get_by_id_generic || vPC[0].u.opcode == op_put_by_id_generic || vPC[0].u.opcode == op_get_array_length || vPC[0].u.opcode == op_get_string_length); -} - -void CodeBlock::refStructures(Instruction* vPC) const -{ - if (vPC[0].u.opcode == op_get_by_id_self) { - vPC[4].u.structure->ref(); - return; - } - if (vPC[0].u.opcode == op_get_by_id_proto) { - vPC[4].u.structure->ref(); - vPC[5].u.structure->ref(); - return; - } - if (vPC[0].u.opcode == op_get_by_id_chain) { - vPC[4].u.structure->ref(); - vPC[5].u.structureChain->ref(); - return; - } - if (vPC[0].u.opcode == op_put_by_id_transition) { - vPC[4].u.structure->ref(); - vPC[5].u.structure->ref(); - vPC[6].u.structureChain->ref(); - return; - } - if (vPC[0].u.opcode == op_put_by_id_replace) { - vPC[4].u.structure->ref(); - return; - } - - // These instructions don't ref their Structures. - Q_ASSERT(vPC[0].u.opcode == op_get_by_id || vPC[0].u.opcode == op_put_by_id || vPC[0].u.opcode == op_get_by_id_generic || vPC[0].u.opcode == op_put_by_id_generic); -} - -void CodeBlock::markAggregate(MarkStack& markStack) -{ - for (size_t i = 0; i < m_constantRegisters.size(); ++i) - markStack.append(m_constantRegisters[i].jsValue()); - for (size_t i = 0; i < m_functionExprs.size(); ++i) - m_functionExprs[i]->markAggregate(markStack); - for (size_t i = 0; i < m_functionDecls.size(); ++i) - m_functionDecls[i]->markAggregate(markStack); -} - -void CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame) -{ - if (m_exceptionInfo) - return; - - ScopeChainNode* scopeChain = callFrame->scopeChain(); - if (m_needsFullScopeChain) { - ScopeChain sc(scopeChain); - int scopeDelta = sc.localDepth(); - if (m_codeType == EvalCode) - scopeDelta -= static_cast(this)->baseScopeDepth(); - else if (m_codeType == FunctionCode) - scopeDelta++; // Compilation of function code assumes activation is not on the scope chain yet. - Q_ASSERT(scopeDelta >= 0); - while (scopeDelta--) - scopeChain = scopeChain->next; - } - - m_exceptionInfo.set(m_ownerExecutable->reparseExceptionInfo(m_globalData, scopeChain, this)); -} - -HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset) -{ - Q_ASSERT(bytecodeOffset < m_instructionCount); - - if (!m_rareData) - return 0; - - Vector& exceptionHandlers = m_rareData->m_exceptionHandlers; - for (size_t i = 0; i < exceptionHandlers.size(); ++i) { - // Handlers are ordered innermost first, so the first handler we encounter - // that contains the source address is the correct handler to use. - if (exceptionHandlers[i].start <= bytecodeOffset && exceptionHandlers[i].end >= bytecodeOffset) - return &exceptionHandlers[i]; - } - - return 0; -} - -int CodeBlock::lineNumberForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset) -{ - Q_ASSERT(bytecodeOffset < m_instructionCount); - - reparseForExceptionInfoIfNecessary(callFrame); - Q_ASSERT(m_exceptionInfo); - - if (!m_exceptionInfo->m_lineInfo.size()) - return m_ownerExecutable->source().firstLine(); // Empty function - - int low = 0; - int high = m_exceptionInfo->m_lineInfo.size(); - while (low < high) { - int mid = low + (high - low) / 2; - if (m_exceptionInfo->m_lineInfo[mid].instructionOffset <= bytecodeOffset) - low = mid + 1; - else - high = mid; - } - - if (!low) - return m_ownerExecutable->source().firstLine(); - return m_exceptionInfo->m_lineInfo[low - 1].lineNumber; -} - -int CodeBlock::expressionRangeForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset) -{ - Q_ASSERT(bytecodeOffset < m_instructionCount); - - reparseForExceptionInfoIfNecessary(callFrame); - Q_ASSERT(m_exceptionInfo); - - if (!m_exceptionInfo->m_expressionInfo.size()) { - // We didn't think anything could throw. Apparently we were wrong. - startOffset = 0; - endOffset = 0; - divot = 0; - return lineNumberForBytecodeOffset(callFrame, bytecodeOffset); - } - - int low = 0; - int high = m_exceptionInfo->m_expressionInfo.size(); - while (low < high) { - int mid = low + (high - low) / 2; - if (m_exceptionInfo->m_expressionInfo[mid].instructionOffset <= bytecodeOffset) - low = mid + 1; - else - high = mid; - } - - Q_ASSERT(low); - if (!low) { - startOffset = 0; - endOffset = 0; - divot = 0; - return lineNumberForBytecodeOffset(callFrame, bytecodeOffset); - } - - startOffset = m_exceptionInfo->m_expressionInfo[low - 1].startOffset; - endOffset = m_exceptionInfo->m_expressionInfo[low - 1].endOffset; - divot = m_exceptionInfo->m_expressionInfo[low - 1].divotPoint + m_sourceOffset; - return lineNumberForBytecodeOffset(callFrame, bytecodeOffset); -} - -bool CodeBlock::getByIdExceptionInfoForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset, OpcodeID& opcodeID) -{ - Q_ASSERT(bytecodeOffset < m_instructionCount); - - reparseForExceptionInfoIfNecessary(callFrame); - Q_ASSERT(m_exceptionInfo); - - if (!m_exceptionInfo->m_getByIdExceptionInfo.size()) - return false; - - int low = 0; - int high = m_exceptionInfo->m_getByIdExceptionInfo.size(); - while (low < high) { - int mid = low + (high - low) / 2; - if (m_exceptionInfo->m_getByIdExceptionInfo[mid].bytecodeOffset <= bytecodeOffset) - low = mid + 1; - else - high = mid; - } - - if (!low || m_exceptionInfo->m_getByIdExceptionInfo[low - 1].bytecodeOffset != bytecodeOffset) - return false; - - opcodeID = m_exceptionInfo->m_getByIdExceptionInfo[low - 1].isOpConstruct ? op_construct : op_instanceof; - return true; -} - -bool CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset) -{ - if (m_globalResolveInstructions.isEmpty()) - return false; - - int low = 0; - int high = m_globalResolveInstructions.size(); - while (low < high) { - int mid = low + (high - low) / 2; - if (m_globalResolveInstructions[mid] <= bytecodeOffset) - low = mid + 1; - else - high = mid; - } - - if (!low || m_globalResolveInstructions[low - 1] != bytecodeOffset) - return false; - return true; -} - -void CodeBlock::shrinkToFit() -{ - m_instructions.shrinkToFit(); - - m_propertyAccessInstructions.shrinkToFit(); - m_globalResolveInstructions.shrinkToFit(); - - m_identifiers.shrinkToFit(); - m_functionDecls.shrinkToFit(); - m_functionExprs.shrinkToFit(); - m_constantRegisters.shrinkToFit(); - - if (m_exceptionInfo) { - m_exceptionInfo->m_expressionInfo.shrinkToFit(); - m_exceptionInfo->m_lineInfo.shrinkToFit(); - m_exceptionInfo->m_getByIdExceptionInfo.shrinkToFit(); - } - - if (m_rareData) { - m_rareData->m_exceptionHandlers.shrinkToFit(); - m_rareData->m_regexps.shrinkToFit(); - m_rareData->m_immediateSwitchJumpTables.shrinkToFit(); - m_rareData->m_characterSwitchJumpTables.shrinkToFit(); - m_rareData->m_stringSwitchJumpTables.shrinkToFit(); - } -} - -} // namespace JSC diff --git a/src/3rdparty/javascriptcore/bytecode/CodeBlock.h b/src/3rdparty/javascriptcore/bytecode/CodeBlock.h deleted file mode 100644 index 298d0c61a..000000000 --- a/src/3rdparty/javascriptcore/bytecode/CodeBlock.h +++ /dev/null @@ -1,398 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 CodeBlock_h -#define CodeBlock_h - -#include "EvalCodeCache.h" -#include "Instruction.h" -#include "JSGlobalObject.h" -#include "JumpTable.h" -#include "Nodes.h" -#include "PtrAndFlags.h" -#include "RegExp.h" -#include "UString.h" -#include -#include -#include - -// Register numbers used in bytecode operations have different meaning accoring to their ranges: -// 0x80000000-0xFFFFFFFF Negative indicies from the CallFrame pointer are entries in the call frame, see RegisterFile.h. -// 0x00000000-0x3FFFFFFF Forwards indices from the CallFrame pointer are local vars and temporaries with the function's callframe. -// 0x40000000-0x7FFFFFFF Positive indices from 0x40000000 specify entries in the constant pool on the CodeBlock. -static const int FirstConstantRegisterIndex = 0x40000000; - -namespace JSC { - - enum HasSeenShouldRepatch { - hasSeenShouldRepatch - }; - - class ExecState; - - enum CodeType { GlobalCode, EvalCode, FunctionCode }; - - static ALWAYS_INLINE int missingThisObjectMarker() { return std::numeric_limits::max(); } - - struct HandlerInfo { - uint32_t start; - uint32_t end; - uint32_t target; - uint32_t scopeDepth; - }; - - struct ExpressionRangeInfo { - enum { - MaxOffset = (1 << 7) - 1, - MaxDivot = (1 << 25) - 1 - }; - uint32_t instructionOffset : 25; - uint32_t divotPoint : 25; - uint32_t startOffset : 7; - uint32_t endOffset : 7; - }; - - struct LineInfo { - uint32_t instructionOffset; - int32_t lineNumber; - }; - - // Both op_construct and op_instanceof require a use of op_get_by_id to get - // the prototype property from an object. The exception messages for exceptions - // thrown by these instances op_get_by_id need to reflect this. - struct GetByIdExceptionInfo { - unsigned bytecodeOffset : 31; - bool isOpConstruct : 1; - }; - - struct ExceptionInfo : FastAllocBase { - Vector m_expressionInfo; - Vector m_lineInfo; - Vector m_getByIdExceptionInfo; - }; - - class CodeBlock : public FastAllocBase { - protected: - CodeBlock(ScriptExecutable* ownerExecutable, CodeType, PassRefPtr, unsigned sourceOffset, SymbolTable* symbolTable); - public: - virtual ~CodeBlock(); - - void markAggregate(MarkStack&); - void refStructures(Instruction* vPC) const; - void derefStructures(Instruction* vPC) const; - - static void dumpStatistics(); - -#if !defined(QT_NO_DEBUG) || ENABLE_OPCODE_SAMPLING - void dump(ExecState*) const; - void printStructures(const Instruction*) const; - void printStructure(const char* name, const Instruction*, int operand) const; -#endif - - inline bool isKnownNotImmediate(int index) - { - if (index == m_thisRegister) - return true; - - if (isConstantRegisterIndex(index)) - return getConstant(index).isCell(); - - return false; - } - - ALWAYS_INLINE bool isTemporaryRegisterIndex(int index) - { - return index >= m_numVars; - } - - HandlerInfo* handlerForBytecodeOffset(unsigned bytecodeOffset); - int lineNumberForBytecodeOffset(CallFrame*, unsigned bytecodeOffset); - int expressionRangeForBytecodeOffset(CallFrame*, unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset); - bool getByIdExceptionInfoForBytecodeOffset(CallFrame*, unsigned bytecodeOffset, OpcodeID&); - - void setIsNumericCompareFunction(bool isNumericCompareFunction) { m_isNumericCompareFunction = isNumericCompareFunction; } - bool isNumericCompareFunction() { return m_isNumericCompareFunction; } - - Vector& instructions() { return m_instructions; } - void discardBytecode() { m_instructions.clear(); } - -#ifndef QT_NO_DEBUG - unsigned instructionCount() { return m_instructionCount; } - void setInstructionCount(unsigned instructionCount) { m_instructionCount = instructionCount; } -#endif - - ScriptExecutable* ownerExecutable() const { return m_ownerExecutable; } - - void setGlobalData(JSGlobalData* globalData) { m_globalData = globalData; } - - void setThisRegister(int thisRegister) { m_thisRegister = thisRegister; } - int thisRegister() const { return m_thisRegister; } - - void setNeedsFullScopeChain(bool needsFullScopeChain) { m_needsFullScopeChain = needsFullScopeChain; } - bool needsFullScopeChain() const { return m_needsFullScopeChain; } - void setUsesEval(bool usesEval) { m_usesEval = usesEval; } - bool usesEval() const { return m_usesEval; } - void setUsesArguments(bool usesArguments) { m_usesArguments = usesArguments; } - bool usesArguments() const { return m_usesArguments; } - - CodeType codeType() const { return m_codeType; } - - SourceProvider* source() const { return m_source.get(); } - unsigned sourceOffset() const { return m_sourceOffset; } - - size_t numberOfJumpTargets() const { return m_jumpTargets.size(); } - void addJumpTarget(unsigned jumpTarget) { m_jumpTargets.append(jumpTarget); } - unsigned jumpTarget(int index) const { return m_jumpTargets[index]; } - unsigned lastJumpTarget() const { return m_jumpTargets.last(); } - - void addPropertyAccessInstruction(unsigned propertyAccessInstruction) { m_propertyAccessInstructions.append(propertyAccessInstruction); } - void addGlobalResolveInstruction(unsigned globalResolveInstruction) { m_globalResolveInstructions.append(globalResolveInstruction); } - bool hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset); - - // Exception handling support - - size_t numberOfExceptionHandlers() const { return m_rareData ? m_rareData->m_exceptionHandlers.size() : 0; } - void addExceptionHandler(const HandlerInfo& hanler) { createRareDataIfNecessary(); return m_rareData->m_exceptionHandlers.append(hanler); } - HandlerInfo& exceptionHandler(int index) { Q_ASSERT(m_rareData); return m_rareData->m_exceptionHandlers[index]; } - - bool hasExceptionInfo() const { return m_exceptionInfo; } - void clearExceptionInfo() { m_exceptionInfo.clear(); } - ExceptionInfo* extractExceptionInfo() { Q_ASSERT(m_exceptionInfo); return m_exceptionInfo.release(); } - - void addExpressionInfo(const ExpressionRangeInfo& expressionInfo) { Q_ASSERT(m_exceptionInfo); m_exceptionInfo->m_expressionInfo.append(expressionInfo); } - void addGetByIdExceptionInfo(const GetByIdExceptionInfo& info) { Q_ASSERT(m_exceptionInfo); m_exceptionInfo->m_getByIdExceptionInfo.append(info); } - - size_t numberOfLineInfos() const { Q_ASSERT(m_exceptionInfo); return m_exceptionInfo->m_lineInfo.size(); } - void addLineInfo(const LineInfo& lineInfo) { Q_ASSERT(m_exceptionInfo); m_exceptionInfo->m_lineInfo.append(lineInfo); } - LineInfo& lastLineInfo() { Q_ASSERT(m_exceptionInfo); return m_exceptionInfo->m_lineInfo.last(); } - - // Constant Pool - - size_t numberOfIdentifiers() const { return m_identifiers.size(); } - void addIdentifier(const Identifier& i) { return m_identifiers.append(i); } - Identifier& identifier(int index) { return m_identifiers[index]; } - - 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) const { return index >= FirstConstantRegisterIndex; } - ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].jsValue(); } - - 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(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; } - RegExp* regexp(int index) const { Q_ASSERT(m_rareData); return m_rareData->m_regexps[index].get(); } - - - // Jump Tables - - size_t numberOfImmediateSwitchJumpTables() const { return m_rareData ? m_rareData->m_immediateSwitchJumpTables.size() : 0; } - SimpleJumpTable& addImmediateSwitchJumpTable() { createRareDataIfNecessary(); m_rareData->m_immediateSwitchJumpTables.append(SimpleJumpTable()); return m_rareData->m_immediateSwitchJumpTables.last(); } - SimpleJumpTable& immediateSwitchJumpTable(int tableIndex) { Q_ASSERT(m_rareData); return m_rareData->m_immediateSwitchJumpTables[tableIndex]; } - - size_t numberOfCharacterSwitchJumpTables() const { return m_rareData ? m_rareData->m_characterSwitchJumpTables.size() : 0; } - SimpleJumpTable& addCharacterSwitchJumpTable() { createRareDataIfNecessary(); m_rareData->m_characterSwitchJumpTables.append(SimpleJumpTable()); return m_rareData->m_characterSwitchJumpTables.last(); } - SimpleJumpTable& characterSwitchJumpTable(int tableIndex) { Q_ASSERT(m_rareData); return m_rareData->m_characterSwitchJumpTables[tableIndex]; } - - size_t numberOfStringSwitchJumpTables() const { return m_rareData ? m_rareData->m_stringSwitchJumpTables.size() : 0; } - StringJumpTable& addStringSwitchJumpTable() { createRareDataIfNecessary(); m_rareData->m_stringSwitchJumpTables.append(StringJumpTable()); return m_rareData->m_stringSwitchJumpTables.last(); } - StringJumpTable& stringSwitchJumpTable(int tableIndex) { Q_ASSERT(m_rareData); return m_rareData->m_stringSwitchJumpTables[tableIndex]; } - - - SymbolTable* symbolTable() { return m_symbolTable; } - SharedSymbolTable* sharedSymbolTable() { Q_ASSERT(m_codeType == FunctionCode); return static_cast(m_symbolTable); } - - EvalCodeCache& evalCodeCache() { createRareDataIfNecessary(); return m_rareData->m_evalCodeCache; } - - void shrinkToFit(); - - // FIXME: Make these remaining members private. - - int m_numCalleeRegisters; - int m_numVars; - int m_numParameters; - - private: -#if !defined(QT_NO_DEBUG) || ENABLE(OPCODE_SAMPLING) - void dump(ExecState*, const Vector::const_iterator& begin, Vector::const_iterator&) const; - - const char* 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*); - - void createRareDataIfNecessary() - { - if (!m_rareData) - m_rareData.set(new RareData); - } - - ScriptExecutable* m_ownerExecutable; - JSGlobalData* m_globalData; - - Vector m_instructions; -#ifndef QT_NO_DEBUG - unsigned m_instructionCount; -#endif - - int m_thisRegister; - - bool m_needsFullScopeChain; - bool m_usesEval; - bool m_usesArguments; - bool m_isNumericCompareFunction; - - CodeType m_codeType; - - RefPtr m_source; - unsigned m_sourceOffset; - - Vector m_propertyAccessInstructions; - Vector m_globalResolveInstructions; - - Vector m_jumpTargets; - - // Constant Pool - Vector m_identifiers; - Vector m_constantRegisters; - Vector > m_functionDecls; - Vector > m_functionExprs; - - SymbolTable* m_symbolTable; - - OwnPtr m_exceptionInfo; - - struct RareData : FastAllocBase { - Vector m_exceptionHandlers; - - // Rare Constants - Vector > m_regexps; - - // Jump Tables - Vector m_immediateSwitchJumpTables; - Vector m_characterSwitchJumpTables; - Vector m_stringSwitchJumpTables; - - EvalCodeCache m_evalCodeCache; - }; - OwnPtr m_rareData; - }; - - // Program code is not marked by any function, so we make the global object - // responsible for marking it. - - class GlobalCodeBlock : public CodeBlock { - public: - GlobalCodeBlock(ScriptExecutable* ownerExecutable, CodeType codeType, PassRefPtr sourceProvider, unsigned sourceOffset, JSGlobalObject* globalObject) - : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset, &m_unsharedSymbolTable) - , m_globalObject(globalObject) - { - m_globalObject->codeBlocks().add(this); - } - - ~GlobalCodeBlock() - { - if (m_globalObject) - m_globalObject->codeBlocks().remove(this); - } - - void clearGlobalObject() { m_globalObject = 0; } - - private: - JSGlobalObject* m_globalObject; // For program and eval nodes, the global object that marks the constant pool. - SymbolTable m_unsharedSymbolTable; - }; - - class ProgramCodeBlock : public GlobalCodeBlock { - public: - ProgramCodeBlock(ProgramExecutable* ownerExecutable, CodeType codeType, JSGlobalObject* globalObject, PassRefPtr sourceProvider) - : GlobalCodeBlock(ownerExecutable, codeType, sourceProvider, 0, globalObject) - { - } - }; - - class EvalCodeBlock : public GlobalCodeBlock { - public: - EvalCodeBlock(EvalExecutable* ownerExecutable, JSGlobalObject* globalObject, PassRefPtr sourceProvider, int baseScopeDepth) - : GlobalCodeBlock(ownerExecutable, EvalCode, sourceProvider, 0, globalObject) - , m_baseScopeDepth(baseScopeDepth) - { - } - - int baseScopeDepth() const { return m_baseScopeDepth; } - - const Identifier& variable(unsigned index) { return m_variables[index]; } - unsigned numVariables() { return m_variables.size(); } - void adoptVariables(Vector& variables) - { - Q_ASSERT(m_variables.isEmpty()); - m_variables.swap(variables); - } - - private: - int m_baseScopeDepth; - Vector m_variables; - }; - - class FunctionCodeBlock : public CodeBlock { - public: - // Rather than using the usual RefCounted::create idiom for SharedSymbolTable we just use new - // as we need to initialise the CodeBlock before we could initialise any RefPtr to hold the shared - // symbol table, so we just pass as a raw pointer with a ref count of 1. We then manually deref - // in the destructor. - FunctionCodeBlock(FunctionExecutable* ownerExecutable, CodeType codeType, PassRefPtr sourceProvider, unsigned sourceOffset) - : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset, new SharedSymbolTable) - { - } - ~FunctionCodeBlock() - { - sharedSymbolTable()->deref(); - } - }; - - inline Register& ExecState::r(int index) - { - CodeBlock* codeBlock = this->codeBlock(); - if (codeBlock->isConstantRegisterIndex(index)) - return codeBlock->constantRegister(index); - return this[index]; - } - -} // namespace JSC - -#endif // CodeBlock_h diff --git a/src/3rdparty/javascriptcore/bytecode/EvalCodeCache.h b/src/3rdparty/javascriptcore/bytecode/EvalCodeCache.h deleted file mode 100644 index 05834fcbf..000000000 --- a/src/3rdparty/javascriptcore/bytecode/EvalCodeCache.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2008, 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 EvalCodeCache_h -#define EvalCodeCache_h - -#include "Executable.h" -#include "JSGlobalObject.h" -#include "Nodes.h" -#include "Parser.h" -#include "SourceCode.h" -#include "UString.h" -#include -#include - -namespace JSC { - - class EvalCodeCache { - public: - PassRefPtr get(ExecState* exec, const UString& evalSource, ScopeChainNode* scopeChain, JSValue& exceptionValue) - { - RefPtr evalExecutable; - - if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject()) - evalExecutable = m_cacheMap.get(evalSource.rep()); - - if (!evalExecutable) { - evalExecutable = EvalExecutable::create(exec, makeSource(evalSource)); - exceptionValue = evalExecutable->compile(exec, scopeChain); - if (exceptionValue) - return 0; - - if (evalSource.size() < maxCacheableSourceLength && (*scopeChain->begin())->isVariableObject() && m_cacheMap.size() < maxCacheEntries) - m_cacheMap.set(evalSource.rep(), evalExecutable); - } - - return evalExecutable.release(); - } - - bool isEmpty() const { return m_cacheMap.isEmpty(); } - - private: - static const int maxCacheableSourceLength = 256; - static const int maxCacheEntries = 64; - - typedef HashMap, RefPtr > EvalCacheMap; - EvalCacheMap m_cacheMap; - }; - -} // namespace JSC - -#endif // EvalCodeCache_h diff --git a/src/3rdparty/javascriptcore/bytecode/Instruction.h b/src/3rdparty/javascriptcore/bytecode/Instruction.h deleted file mode 100644 index 158413a05..000000000 --- a/src/3rdparty/javascriptcore/bytecode/Instruction.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2008 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 Instruction_h -#define Instruction_h - -#include "Opcode.h" -#include "Structure.h" -#include "StructureChain.h" -#include - -#define POLYMORPHIC_LIST_CACHE_SIZE 8 - -namespace JSC { - - class JSCell; - class Structure; - class StructureChain; - - struct Instruction { - Instruction(OpcodeID opcode) - { - // We have to initialize one of the pointer members to ensure that - // the entire struct is initialized, when opcode is not a pointer. - u.jsCell = 0; - u.opcode = opcode; - } - - Instruction(int operand) - { - // We have to initialize one of the pointer members to ensure that - // the entire struct is initialized in 64-bit. - u.jsCell = 0; - u.operand = operand; - } - - Instruction(Structure* structure) { u.structure = structure; } - Instruction(StructureChain* structureChain) { u.structureChain = structureChain; } - Instruction(JSCell* jsCell) { u.jsCell = jsCell; } - - union { - OpcodeID opcode; - int operand; - Structure* structure; - StructureChain* structureChain; - JSCell* jsCell; - } u; - }; - -} // namespace JSC - -namespace WTF { - - template<> struct VectorTraits : VectorTraitsBase { }; - -} // namespace WTF - -#endif // Instruction_h diff --git a/src/3rdparty/javascriptcore/bytecode/JumpTable.cpp b/src/3rdparty/javascriptcore/bytecode/JumpTable.cpp deleted file mode 100644 index 86bea8c9c..000000000 --- a/src/3rdparty/javascriptcore/bytecode/JumpTable.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. - */ - -#include "Platform.h" -#include "JumpTable.h" - -namespace JSC { - -int32_t SimpleJumpTable::offsetForValue(int32_t value, int32_t defaultOffset) -{ - if (value >= min && static_cast(value - min) < branchOffsets.size()) { - int32_t offset = branchOffsets[value - min]; - if (offset) - return offset; - } - return defaultOffset; -} - -} // namespace JSC diff --git a/src/3rdparty/javascriptcore/bytecode/JumpTable.h b/src/3rdparty/javascriptcore/bytecode/JumpTable.h deleted file mode 100644 index cb8baac6f..000000000 --- a/src/3rdparty/javascriptcore/bytecode/JumpTable.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 JumpTable_h -#define JumpTable_h - -#include "UString.h" -#include -#include - -namespace JSC { - - typedef int32_t OffsetLocation; - - struct StringJumpTable { - typedef HashMap, OffsetLocation> StringOffsetTable; - StringOffsetTable offsetTable; - - inline int32_t offsetForValue(UString::Rep* value, int32_t defaultOffset) - { - StringOffsetTable::const_iterator end = offsetTable.end(); - StringOffsetTable::const_iterator loc = offsetTable.find(value); - if (loc == end) - return defaultOffset; - return loc->second; - } - }; - - struct SimpleJumpTable { - // FIXME: The two Vectors can be combind into one Vector - Vector branchOffsets; - int32_t min; - - int32_t offsetForValue(int32_t value, int32_t defaultOffset); - void add(int32_t key, int32_t offset) - { - if (!branchOffsets[key]) - branchOffsets[key] = offset; - } - }; - -} // namespace JSC - -#endif // JumpTable_h diff --git a/src/3rdparty/javascriptcore/bytecode/Opcode.cpp b/src/3rdparty/javascriptcore/bytecode/Opcode.cpp deleted file mode 100644 index 20c3f9e3f..000000000 --- a/src/3rdparty/javascriptcore/bytecode/Opcode.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. - */ - -#include "Platform.h" -#include "Opcode.h" - -using namespace std; - -namespace JSC { - -#if ENABLE(OPCODE_SAMPLING) || ENABLE(CODEBLOCK_SAMPLING) || ENABLE(OPCODE_STATS) - -const char* const opcodeNames[] = { -#define OPCODE_NAME_ENTRY(opcode, size) #opcode, - FOR_EACH_OPCODE_ID(OPCODE_NAME_ENTRY) -#undef OPCODE_NAME_ENTRY -}; - -#endif - -#if ENABLE(OPCODE_STATS) - -long long OpcodeStats::opcodeCounts[numOpcodeIDs]; -long long OpcodeStats::opcodePairCounts[numOpcodeIDs][numOpcodeIDs]; -int OpcodeStats::lastOpcode = -1; - -static OpcodeStats logger; - -OpcodeStats::OpcodeStats() -{ - for (int i = 0; i < numOpcodeIDs; ++i) - opcodeCounts[i] = 0; - - for (int i = 0; i < numOpcodeIDs; ++i) - for (int j = 0; j < numOpcodeIDs; ++j) - opcodePairCounts[i][j] = 0; -} - -static int compareOpcodeIndices(const void* left, const void* right) -{ - long long leftValue = OpcodeStats::opcodeCounts[*(int*) left]; - long long rightValue = OpcodeStats::opcodeCounts[*(int*) right]; - - if (leftValue < rightValue) - return 1; - else if (leftValue > rightValue) - return -1; - else - return 0; -} - -static int compareOpcodePairIndices(const void* left, const void* right) -{ - std::pair leftPair = *(std::pair*) left; - long long leftValue = OpcodeStats::opcodePairCounts[leftPair.first][leftPair.second]; - std::pair rightPair = *(std::pair*) right; - long long rightValue = OpcodeStats::opcodePairCounts[rightPair.first][rightPair.second]; - - if (leftValue < rightValue) - return 1; - else if (leftValue > rightValue) - return -1; - else - return 0; -} - -OpcodeStats::~OpcodeStats() -{ - long long totalInstructions = 0; - for (int i = 0; i < numOpcodeIDs; ++i) - totalInstructions += opcodeCounts[i]; - - long long totalInstructionPairs = 0; - for (int i = 0; i < numOpcodeIDs; ++i) - for (int j = 0; j < numOpcodeIDs; ++j) - totalInstructionPairs += opcodePairCounts[i][j]; - - int sortedIndices[numOpcodeIDs]; - for (int i = 0; i < numOpcodeIDs; ++i) - sortedIndices[i] = i; - qsort(sortedIndices, numOpcodeIDs, sizeof(int), compareOpcodeIndices); - - std::pair sortedPairIndices[numOpcodeIDs * numOpcodeIDs]; - std::pair* currentPairIndex = sortedPairIndices; - for (int i = 0; i < numOpcodeIDs; ++i) - for (int j = 0; j < numOpcodeIDs; ++j) - *(currentPairIndex++) = std::make_pair(i, j); - qsort(sortedPairIndices, numOpcodeIDs * numOpcodeIDs, sizeof(std::pair), compareOpcodePairIndices); - - printf("\nExecuted opcode statistics\n"); - - printf("Total instructions executed: %lld\n\n", totalInstructions); - - printf("All opcodes by frequency:\n\n"); - - for (int i = 0; i < numOpcodeIDs; ++i) { - int index = sortedIndices[i]; - printf("%s:%s %lld - %.2f%%\n", opcodeNames[index], padOpcodeName((OpcodeID)index, 28), opcodeCounts[index], ((double) opcodeCounts[index]) / ((double) totalInstructions) * 100.0); - } - - printf("\n"); - printf("2-opcode sequences by frequency: %lld\n\n", totalInstructions); - - for (int i = 0; i < numOpcodeIDs * numOpcodeIDs; ++i) { - std::pair indexPair = sortedPairIndices[i]; - long long count = opcodePairCounts[indexPair.first][indexPair.second]; - - if (!count) - break; - - printf("%s%s %s:%s %lld %.2f%%\n", opcodeNames[indexPair.first], padOpcodeName((OpcodeID)indexPair.first, 28), opcodeNames[indexPair.second], padOpcodeName((OpcodeID)indexPair.second, 28), count, ((double) count) / ((double) totalInstructionPairs) * 100.0); - } - - printf("\n"); - printf("Most common opcodes and sequences:\n"); - - for (int i = 0; i < numOpcodeIDs; ++i) { - int index = sortedIndices[i]; - long long opcodeCount = opcodeCounts[index]; - double opcodeProportion = ((double) opcodeCount) / ((double) totalInstructions); - if (opcodeProportion < 0.0001) - break; - printf("\n%s:%s %lld - %.2f%%\n", opcodeNames[index], padOpcodeName((OpcodeID)index, 28), opcodeCount, opcodeProportion * 100.0); - - for (int j = 0; j < numOpcodeIDs * numOpcodeIDs; ++j) { - std::pair indexPair = sortedPairIndices[j]; - long long pairCount = opcodePairCounts[indexPair.first][indexPair.second]; - double pairProportion = ((double) pairCount) / ((double) totalInstructionPairs); - - if (!pairCount || pairProportion < 0.0001 || pairProportion < opcodeProportion / 100) - break; - - if (indexPair.first != index && indexPair.second != index) - continue; - - printf(" %s%s %s:%s %lld - %.2f%%\n", opcodeNames[indexPair.first], padOpcodeName((OpcodeID)indexPair.first, 28), opcodeNames[indexPair.second], padOpcodeName((OpcodeID)indexPair.second, 28), pairCount, pairProportion * 100.0); - } - - } - printf("\n"); -} - -void OpcodeStats::recordInstruction(int opcode) -{ - opcodeCounts[opcode]++; - - if (lastOpcode != -1) - opcodePairCounts[lastOpcode][opcode]++; - - lastOpcode = opcode; -} - -void OpcodeStats::resetLastInstruction() -{ - lastOpcode = -1; -} - -#endif - -} // namespace JSC diff --git a/src/3rdparty/javascriptcore/bytecode/Opcode.h b/src/3rdparty/javascriptcore/bytecode/Opcode.h deleted file mode 100644 index 267176cfe..000000000 --- a/src/3rdparty/javascriptcore/bytecode/Opcode.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 Opcode_h -#define Opcode_h - -#include -#include - -#include - -namespace JSC { - - #define FOR_EACH_OPCODE_ID(macro) \ - macro(op_enter, 1) \ - macro(op_enter_with_activation, 2) \ - macro(op_init_arguments, 1) \ - macro(op_create_arguments, 1) \ - macro(op_convert_this, 2) \ - \ - macro(op_new_object, 2) \ - macro(op_new_array, 4) \ - macro(op_new_regexp, 3) \ - macro(op_mov, 3) \ - \ - macro(op_not, 3) \ - macro(op_eq, 4) \ - macro(op_eq_null, 3) \ - macro(op_neq, 4) \ - macro(op_neq_null, 3) \ - macro(op_stricteq, 4) \ - macro(op_nstricteq, 4) \ - macro(op_less, 4) \ - macro(op_lesseq, 4) \ - \ - macro(op_pre_inc, 2) \ - macro(op_pre_dec, 2) \ - macro(op_post_inc, 3) \ - macro(op_post_dec, 3) \ - macro(op_to_jsnumber, 3) \ - macro(op_negate, 3) \ - macro(op_add, 5) \ - macro(op_mul, 5) \ - macro(op_div, 5) \ - macro(op_mod, 4) \ - macro(op_sub, 5) \ - \ - macro(op_lshift, 4) \ - macro(op_rshift, 4) \ - macro(op_urshift, 4) \ - macro(op_bitand, 5) \ - macro(op_bitxor, 5) \ - macro(op_bitor, 5) \ - macro(op_bitnot, 3) \ - \ - macro(op_instanceof, 5) \ - macro(op_typeof, 3) \ - macro(op_is_undefined, 3) \ - macro(op_is_boolean, 3) \ - macro(op_is_number, 3) \ - macro(op_is_string, 3) \ - macro(op_is_object, 3) \ - macro(op_is_function, 3) \ - macro(op_in, 4) \ - \ - macro(op_resolve, 3) \ - macro(op_resolve_skip, 4) \ - macro(op_resolve_global, 6) \ - macro(op_get_scoped_var, 4) \ - macro(op_put_scoped_var, 4) \ - macro(op_get_global_var, 4) \ - macro(op_put_global_var, 4) \ - macro(op_resolve_base, 3) \ - macro(op_resolve_with_base, 4) \ - macro(op_get_by_id, 8) \ - macro(op_get_by_id_self, 8) \ - macro(op_get_by_id_proto, 8) \ - macro(op_get_by_id_chain, 8) \ - macro(op_get_by_id_generic, 8) \ - macro(op_get_array_length, 8) \ - macro(op_get_string_length, 8) \ - macro(op_put_by_id, 8) \ - macro(op_put_by_id_transition, 8) \ - macro(op_put_by_id_replace, 8) \ - 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) \ - macro(op_put_getter, 4) \ - macro(op_put_setter, 4) \ - \ - macro(op_jmp, 2) \ - macro(op_jtrue, 3) \ - macro(op_jfalse, 3) \ - macro(op_jeq_null, 3) \ - macro(op_jneq_null, 3) \ - 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) \ - macro(op_switch_char, 4) \ - macro(op_switch_string, 4) \ - \ - macro(op_new_func, 3) \ - macro(op_new_func_exp, 3) \ - macro(op_call, 5) \ - macro(op_call_eval, 5) \ - macro(op_call_varargs, 5) \ - macro(op_load_varargs, 3) \ - macro(op_tear_off_activation, 2) \ - macro(op_tear_off_arguments, 1) \ - macro(op_ret, 2) \ - macro(op_method_check, 1) \ - \ - macro(op_construct, 7) \ - macro(op_construct_verify, 3) \ - macro(op_strcat, 4) \ - macro(op_to_primitive, 3) \ - \ - macro(op_get_pnames, 6) \ - macro(op_next_pname, 7) \ - \ - macro(op_push_scope, 2) \ - macro(op_pop_scope, 1) \ - macro(op_push_new_scope, 4) \ - \ - macro(op_catch, 2) \ - macro(op_throw, 2) \ - macro(op_new_error, 4) \ - \ - macro(op_jsr, 3) \ - macro(op_sret, 2) \ - \ - macro(op_debug, 4) \ - \ - macro(op_end, 2) // end must be the last opcode in the list - - #define OPCODE_ID_ENUM(opcode, length) opcode, - typedef enum { FOR_EACH_OPCODE_ID(OPCODE_ID_ENUM) } OpcodeID; - #undef OPCODE_ID_ENUM - - const int numOpcodeIDs = op_end + 1; - - #define OPCODE_ID_LENGTHS(id, length) const int id##_length = length; - FOR_EACH_OPCODE_ID(OPCODE_ID_LENGTHS) - #undef OPCODE_ID_LENGTHS - - #define OPCODE_LENGTH(opcode) opcode##_length - - #define OPCODE_ID_LENGTH_MAP(opcode, length) length, - const int opcodeLengths[numOpcodeIDs] = { FOR_EACH_OPCODE_ID(OPCODE_ID_LENGTH_MAP) }; - #undef OPCODE_ID_LENGTH_MAP - - #define VERIFY_OPCODE_ID(id, size) COMPILE_ASSERT(id <= op_end, ASSERT_THAT_JS_OPCODE_IDS_ARE_VALID); - FOR_EACH_OPCODE_ID(VERIFY_OPCODE_ID) - #undef VERIFY_OPCODE_ID - -#if ENABLE(OPCODE_SAMPLING) || ENABLE(CODEBLOCK_SAMPLING) || ENABLE(OPCODE_STATS) - -#define PADDING_STRING " " -#define PADDING_STRING_LENGTH static_cast(strlen(PADDING_STRING)) - - extern const char* const opcodeNames[]; - - inline const char* padOpcodeName(OpcodeID op, unsigned width) - { - unsigned pad = width - strlen(opcodeNames[op]); - pad = std::min(pad, PADDING_STRING_LENGTH); - return PADDING_STRING + PADDING_STRING_LENGTH - pad; - } - -#undef PADDING_STRING_LENGTH -#undef PADDING_STRING - -#endif - -#if ENABLE(OPCODE_STATS) - - struct OpcodeStats { - OpcodeStats(); - ~OpcodeStats(); - static long long opcodeCounts[numOpcodeIDs]; - static long long opcodePairCounts[numOpcodeIDs][numOpcodeIDs]; - static int lastOpcode; - - static void recordInstruction(int opcode); - static void resetLastInstruction(); - }; - -#endif - -} // namespace JSC - -#endif // Opcode_h diff --git a/src/3rdparty/javascriptcore/bytecode/SamplingTool.cpp b/src/3rdparty/javascriptcore/bytecode/SamplingTool.cpp deleted file mode 100644 index 26002ecb8..000000000 --- a/src/3rdparty/javascriptcore/bytecode/SamplingTool.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (C) 2008, 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. - */ - -#include "Platform.h" -#include "SamplingTool.h" - -#include "CodeBlock.h" -#include "Interpreter.h" -#include "Opcode.h" - -#include - -namespace JSC { - -#if ENABLE(SAMPLING_FLAGS) - -void SamplingFlags::sample() -{ - uint32_t mask = 1 << 31; - unsigned index; - - for (index = 0; index < 32; ++index) { - if (mask & s_flags) - break; - mask >>= 1; - } - - s_flagCounts[32 - index]++; -} - -void SamplingFlags::start() -{ - for (unsigned i = 0; i <= 32; ++i) - s_flagCounts[i] = 0; -} -void SamplingFlags::stop() -{ - uint64_t total = 0; - for (unsigned i = 0; i <= 32; ++i) - total += s_flagCounts[i]; - - if (total) { - printf("\nSamplingFlags: sample counts with flags set: (%lld total)\n", total); - for (unsigned i = 0; i <= 32; ++i) { - if (s_flagCounts[i]) - printf(" [ %02d ] : %lld\t\t(%03.2f%%)\n", i, s_flagCounts[i], (100.0 * s_flagCounts[i]) / total); - } - printf("\n"); - } else - printf("\nSamplingFlags: no samples.\n\n"); -} -uint64_t SamplingFlags::s_flagCounts[33]; - -#else -void SamplingFlags::start() {} -void SamplingFlags::stop() {} -#endif - -/* - Start with flag 16 set. - By doing this the monitoring of lower valued flags will be masked out - until flag 16 is explictly cleared. -*/ -uint32_t SamplingFlags::s_flags = 1 << 15; - -SamplingTool* SamplingTool::s_samplingTool = 0; - - -bool SamplingThread::s_running = false; -unsigned SamplingThread::s_hertz = 10000; -ThreadIdentifier SamplingThread::s_samplingThread; - -void* SamplingThread::threadStartFunc(void*) -{ - while (s_running) { - QThread::usleep(1000000 / s_hertz); - -#if ENABLE(SAMPLING_FLAGS) - SamplingFlags::sample(); -#endif -#if ENABLE(OPCODE_SAMPLING) - SamplingTool::sample(); -#endif - } - - return 0; -} - - -void SamplingThread::start(unsigned hertz) -{ - Q_ASSERT(!s_running); - s_running = true; - s_hertz = hertz; - - s_samplingThread = createThread(threadStartFunc, 0, "JavaScriptCore::Sampler"); -} - -void SamplingThread::stop() -{ - Q_ASSERT(s_running); - s_running = false; - waitForThreadCompletion(s_samplingThread); -} - - -void ScriptSampleRecord::sample(CodeBlock* codeBlock, Instruction* vPC) -{ - if (!m_samples) { - m_size = codeBlock->instructions().size(); - m_samples = static_cast(calloc(m_size, sizeof(int))); - m_codeBlock = codeBlock; - } - - ++m_sampleCount; - - unsigned offest = vPC - codeBlock->instructions().begin(); - // Since we don't read and write codeBlock and vPC atomically, this check - // can fail if we sample mid op_call / op_ret. - if (offest < m_size) { - m_samples[offest]++; - m_opcodeSampleCount++; - } -} - -void SamplingTool::doRun() -{ - Sample sample(m_sample, m_codeBlock); - ++m_sampleCount; - - if (sample.isNull()) - return; - - if (!sample.inHostFunction()) { - unsigned opcodeID = sample.vPC()[0].u.opcode; - - ++m_opcodeSampleCount; - ++m_opcodeSamples[opcodeID]; - - if (sample.inCTIFunction()) - m_opcodeSamplesInCTIFunctions[opcodeID]++; - } - -#if ENABLE(CODEBLOCK_SAMPLING) - if (CodeBlock* codeBlock = sample.codeBlock()) { - QMutexLocker locker(m_scriptSampleMapMutex); - ScriptSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerExecutable()); - Q_ASSERT(record); - record->sample(codeBlock, sample.vPC()); - } -#endif -} - -void SamplingTool::sample() -{ - s_samplingTool->doRun(); -} - -void SamplingTool::notifyOfScope(ScriptExecutable* script) -{ -#if ENABLE(CODEBLOCK_SAMPLING) - QMutexLocker locker(m_scriptSampleMapMutex); - m_scopeSampleMap->set(script, new ScriptSampleRecord(script)); -#else - Q_UNUSED(script); -#endif -} - -void SamplingTool::setup() -{ - s_samplingTool = this; -} - -#if ENABLE(OPCODE_SAMPLING) - -struct OpcodeSampleInfo { - OpcodeID opcode; - long long count; - long long countInCTIFunctions; -}; - -struct LineCountInfo { - unsigned line; - unsigned count; -}; - -static int compareOpcodeIndicesSampling(const void* left, const void* right) -{ - const OpcodeSampleInfo* leftSampleInfo = reinterpret_cast(left); - const OpcodeSampleInfo* rightSampleInfo = reinterpret_cast(right); - - return (leftSampleInfo->count < rightSampleInfo->count) ? 1 : (leftSampleInfo->count > rightSampleInfo->count) ? -1 : 0; -} - -#if ENABLE(CODEBLOCK_SAMPLING) -static int compareLineCountInfoSampling(const void* left, const void* right) -{ - const LineCountInfo* leftLineCount = reinterpret_cast(left); - const LineCountInfo* rightLineCount = reinterpret_cast(right); - - return (leftLineCount->line > rightLineCount->line) ? 1 : (leftLineCount->line < rightLineCount->line) ? -1 : 0; -} - -static int compareScriptSampleRecords(const void* left, const void* right) -{ - const ScriptSampleRecord* const leftValue = *static_cast(left); - const ScriptSampleRecord* const rightValue = *static_cast(right); - - return (leftValue->m_sampleCount < rightValue->m_sampleCount) ? 1 : (leftValue->m_sampleCount > rightValue->m_sampleCount) ? -1 : 0; -} -#endif - -void SamplingTool::dump(ExecState* exec) -{ - // Tidies up SunSpider output by removing short scripts - such a small number of samples would likely not be useful anyhow. - if (m_sampleCount < 10) - return; - - // (1) Build and sort 'opcodeSampleInfo' array. - - OpcodeSampleInfo opcodeSampleInfo[numOpcodeIDs]; - for (int i = 0; i < numOpcodeIDs; ++i) { - opcodeSampleInfo[i].opcode = static_cast(i); - opcodeSampleInfo[i].count = m_opcodeSamples[i]; - opcodeSampleInfo[i].countInCTIFunctions = m_opcodeSamplesInCTIFunctions[i]; - } - - qsort(opcodeSampleInfo, numOpcodeIDs, sizeof(OpcodeSampleInfo), compareOpcodeIndicesSampling); - - // (2) Print Opcode sampling results. - - printf("\nBytecode samples [*]\n"); - printf(" sample %% of %% of | cti cti %%\n"); - printf("opcode count VM total | count of self\n"); - printf("------------------------------------------------------- | ----------------\n"); - - for (int i = 0; i < numOpcodeIDs; ++i) { - long long count = opcodeSampleInfo[i].count; - if (!count) - continue; - - OpcodeID opcodeID = opcodeSampleInfo[i].opcode; - - const char* opcodeName = opcodeNames[opcodeID]; - const char* opcodePadding = padOpcodeName(opcodeID, 28); - double percentOfVM = (static_cast(count) * 100) / m_opcodeSampleCount; - double percentOfTotal = (static_cast(count) * 100) / m_sampleCount; - long long countInCTIFunctions = opcodeSampleInfo[i].countInCTIFunctions; - double percentInCTIFunctions = (static_cast(countInCTIFunctions) * 100) / count; - fprintf(stdout, "%s:%s%-6lld %.3f%%\t%.3f%%\t | %-6lld %.3f%%\n", opcodeName, opcodePadding, count, percentOfVM, percentOfTotal, countInCTIFunctions, percentInCTIFunctions); - } - - printf("\n[*] Samples inside host code are not charged to any Bytecode.\n\n"); - printf("\tSamples inside VM:\t\t%lld / %lld (%.3f%%)\n", m_opcodeSampleCount, m_sampleCount, (static_cast(m_opcodeSampleCount) * 100) / m_sampleCount); - printf("\tSamples inside host code:\t%lld / %lld (%.3f%%)\n\n", m_sampleCount - m_opcodeSampleCount, m_sampleCount, (static_cast(m_sampleCount - m_opcodeSampleCount) * 100) / m_sampleCount); - printf("\tsample count:\tsamples inside this opcode\n"); - printf("\t%% of VM:\tsample count / all opcode samples\n"); - printf("\t%% of total:\tsample count / all samples\n"); - printf("\t--------------\n"); - printf("\tcti count:\tsamples inside a CTI function called by this opcode\n"); - printf("\tcti %% of self:\tcti count / sample count\n"); - -#if ENABLE(CODEBLOCK_SAMPLING) - - // (3) Build and sort 'codeBlockSamples' array. - - int scopeCount = m_scopeSampleMap->size(); - Vector codeBlockSamples(scopeCount); - ScriptSampleRecordMap::iterator iter = m_scopeSampleMap->begin(); - for (int i = 0; i < scopeCount; ++i, ++iter) - codeBlockSamples[i] = iter->second; - - qsort(codeBlockSamples.begin(), scopeCount, sizeof(ScriptSampleRecord*), compareScriptSampleRecords); - - // (4) Print data from 'codeBlockSamples' array. - - printf("\nCodeBlock samples\n\n"); - - for (int i = 0; i < scopeCount; ++i) { - ScriptSampleRecord* record = codeBlockSamples[i]; - CodeBlock* codeBlock = record->m_codeBlock; - - double blockPercent = (record->m_sampleCount * 100.0) / m_sampleCount; - - if (blockPercent >= 1) { - //Instruction* code = codeBlock->instructions().begin(); - printf("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().UTF8String().c_str(), codeBlock->lineNumberForBytecodeOffset(exec, 0), record->m_sampleCount, m_sampleCount, blockPercent); - if (i < 10) { - HashMap lineCounts; - codeBlock->dump(exec); - - printf(" Opcode and line number samples [*]\n\n"); - for (unsigned op = 0; op < record->m_size; ++op) { - int count = record->m_samples[op]; - if (count) { - printf(" [% 4d] has sample count: % 4d\n", op, count); - unsigned line = codeBlock->lineNumberForBytecodeOffset(exec, op); - lineCounts.set(line, (lineCounts.contains(line) ? lineCounts.get(line) : 0) + count); - } - } - printf("\n"); - - int linesCount = lineCounts.size(); - Vector lineCountInfo(linesCount); - int lineno = 0; - for (HashMap::iterator iter = lineCounts.begin(); iter != lineCounts.end(); ++iter, ++lineno) { - lineCountInfo[lineno].line = iter->first; - lineCountInfo[lineno].count = iter->second; - } - - qsort(lineCountInfo.begin(), linesCount, sizeof(LineCountInfo), compareLineCountInfoSampling); - - for (lineno = 0; lineno < linesCount; ++lineno) { - printf(" Line #%d has sample count %d.\n", lineCountInfo[lineno].line, lineCountInfo[lineno].count); - } - printf("\n"); - printf(" [*] Samples inside host code are charged to the calling Bytecode.\n"); - printf(" Samples on a call / return boundary are not charged to a specific opcode or line.\n\n"); - printf(" Samples on a call / return boundary: %d / %d (%.3f%%)\n\n", record->m_sampleCount - record->m_opcodeSampleCount, record->m_sampleCount, (static_cast(record->m_sampleCount - record->m_opcodeSampleCount) * 100) / record->m_sampleCount); - } - } - } -#else - Q_UNUSED(exec); -#endif // ENABLE(CODEBLOCK_SAMPLING) -} -#endif // ENABLE(OPCODE_SAMPLING) - -void AbstractSamplingCounter::dump() -{ -#if ENABLE(SAMPLING_COUNTERS) - if (s_abstractSamplingCounterChain != &s_abstractSamplingCounterChainEnd) { - printf("\nSampling Counter Values:\n"); - for (AbstractSamplingCounter* currCounter = s_abstractSamplingCounterChain; (currCounter != &s_abstractSamplingCounterChainEnd); currCounter = currCounter->m_next) - printf("\t%s\t: %lld\n", currCounter->m_name, currCounter->m_counter); - printf("\n\n"); - } - s_completed = true; -#endif -} - -AbstractSamplingCounter AbstractSamplingCounter::s_abstractSamplingCounterChainEnd; -AbstractSamplingCounter* AbstractSamplingCounter::s_abstractSamplingCounterChain = &s_abstractSamplingCounterChainEnd; -bool AbstractSamplingCounter::s_completed = false; - -} // namespace JSC diff --git a/src/3rdparty/javascriptcore/bytecode/SamplingTool.h b/src/3rdparty/javascriptcore/bytecode/SamplingTool.h deleted file mode 100644 index 1ebf63c2a..000000000 --- a/src/3rdparty/javascriptcore/bytecode/SamplingTool.h +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (C) 2008 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 SamplingTool_h -#define SamplingTool_h - -#include -#include -#include - -#include "Nodes.h" -#include "Opcode.h" - -namespace JSC { - - class ScriptExecutable; - - class SamplingFlags { - public: - static void start(); - static void stop(); - -#if ENABLE(SAMPLING_FLAGS) - static void setFlag(unsigned flag) - { - Q_ASSERT(flag >= 1); - Q_ASSERT(flag <= 32); - s_flags |= 1u << (flag - 1); - } - - static void clearFlag(unsigned flag) - { - Q_ASSERT(flag >= 1); - Q_ASSERT(flag <= 32); - s_flags &= ~(1u << (flag - 1)); - } - - static void sample(); - - class ScopedFlag { - public: - ScopedFlag(int flag) - : m_flag(flag) - { - setFlag(flag); - } - - ~ScopedFlag() - { - clearFlag(m_flag); - } - - private: - int m_flag; - }; - -#endif - private: - static uint32_t s_flags; -#if ENABLE(SAMPLING_FLAGS) - static uint64_t s_flagCounts[33]; -#endif - }; - - class CodeBlock; - class ExecState; - class Interpreter; - class ScopeNode; - struct Instruction; - - struct ScriptSampleRecord { - ScriptSampleRecord(ScriptExecutable* executable) - : m_executable(executable) - , m_codeBlock(0) - , m_sampleCount(0) - , m_opcodeSampleCount(0) - , m_samples(0) - , m_size(0) - { - } - - ~ScriptSampleRecord() - { - if (m_samples) - free(m_samples); - } - - void sample(CodeBlock*, Instruction*); - - RefPtr m_executable; - CodeBlock* m_codeBlock; - int m_sampleCount; - int m_opcodeSampleCount; - int* m_samples; - unsigned m_size; - }; - - typedef WTF::HashMap ScriptSampleRecordMap; - - class SamplingThread { - public: - // Sampling thread state. - static bool s_running; - static unsigned s_hertz; - static ThreadIdentifier s_samplingThread; - - static void start(unsigned hertz=10000); - static void stop(); - - static void* threadStartFunc(void*); - }; - - class SamplingTool { - public: - friend struct CallRecord; - friend class HostCallRecord; - -#if ENABLE(OPCODE_SAMPLING) - class CallRecord : public Noncopyable { - public: - CallRecord(SamplingTool* samplingTool) - : m_samplingTool(samplingTool) - , m_savedSample(samplingTool->m_sample) - , m_savedCodeBlock(samplingTool->m_codeBlock) - { - } - - ~CallRecord() - { - m_samplingTool->m_sample = m_savedSample; - m_samplingTool->m_codeBlock = m_savedCodeBlock; - } - - private: - SamplingTool* m_samplingTool; - intptr_t m_savedSample; - CodeBlock* m_savedCodeBlock; - }; - - class HostCallRecord : public CallRecord { - public: - HostCallRecord(SamplingTool* samplingTool) - : CallRecord(samplingTool) - { - samplingTool->m_sample |= 0x1; - } - }; -#else - class CallRecord : public Noncopyable { - public: - CallRecord(SamplingTool*) - { - } - }; - - class HostCallRecord : public CallRecord { - public: - HostCallRecord(SamplingTool* samplingTool) - : CallRecord(samplingTool) - { - } - }; -#endif - - SamplingTool(Interpreter* interpreter) - : m_interpreter(interpreter) - , m_codeBlock(0) - , m_sample(0) - , m_sampleCount(0) - , m_opcodeSampleCount(0) -#if ENABLE(CODEBLOCK_SAMPLING) - , m_scopeSampleMap(new ScriptSampleRecordMap()) -#endif - { - memset(m_opcodeSamples, 0, sizeof(m_opcodeSamples)); - memset(m_opcodeSamplesInCTIFunctions, 0, sizeof(m_opcodeSamplesInCTIFunctions)); - } - - ~SamplingTool() - { -#if ENABLE(CODEBLOCK_SAMPLING) - deleteAllValues(*m_scopeSampleMap); -#endif - } - - void setup(); -#if ENABLE(OPCODE_SAMPLING) - void dump(ExecState*); -#endif - - void notifyOfScope(ScriptExecutable* scope); - - void sample(CodeBlock* codeBlock, Instruction* vPC) - { - Q_ASSERT(!(reinterpret_cast(vPC) & 0x3)); - m_codeBlock = codeBlock; - m_sample = reinterpret_cast(vPC); - } - - CodeBlock** codeBlockSlot() { return &m_codeBlock; } - intptr_t* sampleSlot() { return &m_sample; } - - void* encodeSample(Instruction* vPC, bool inCTIFunction = false, bool inHostFunction = false) - { - Q_ASSERT(!(reinterpret_cast(vPC) & 0x3)); - return reinterpret_cast(reinterpret_cast(vPC) | (static_cast(inCTIFunction) << 1) | static_cast(inHostFunction)); - } - - static void sample(); - - private: - class Sample { - public: - Sample(volatile intptr_t sample, CodeBlock* volatile codeBlock) - : m_sample(sample) - , m_codeBlock(codeBlock) - { - } - - bool isNull() { return !m_sample; } - CodeBlock* codeBlock() { return m_codeBlock; } - Instruction* vPC() { return reinterpret_cast(m_sample & ~0x3); } - bool inHostFunction() { return m_sample & 0x1; } - bool inCTIFunction() { return m_sample & 0x2; } - - private: - intptr_t m_sample; - CodeBlock* m_codeBlock; - }; - - void doRun(); - static SamplingTool* s_samplingTool; - - Interpreter* m_interpreter; - - // State tracked by the main thread, used by the sampling thread. - CodeBlock* m_codeBlock; - intptr_t m_sample; - - // Gathered sample data. - long long m_sampleCount; - long long m_opcodeSampleCount; - unsigned m_opcodeSamples[numOpcodeIDs]; - unsigned m_opcodeSamplesInCTIFunctions[numOpcodeIDs]; - -#if ENABLE(CODEBLOCK_SAMPLING) - QMutex m_scriptSampleMapMutex; - OwnPtr m_scopeSampleMap; -#endif - }; - - // AbstractSamplingCounter: - // - // Implements a named set of counters, printed on exit if ENABLE(SAMPLING_COUNTERS). - // See subclasses below, SamplingCounter, GlobalSamplingCounter and DeletableSamplingCounter. - class AbstractSamplingCounter { - friend class DeletableSamplingCounter; - public: - void count(uint32_t count = 1) - { - m_counter += count; - } - - static void dump(); - - protected: - // Effectively the contructor, however called lazily in the case of GlobalSamplingCounter. - void init(const char* name) - { - m_counter = 0; - m_name = name; - - // Set m_next to point to the head of the chain, and inform whatever is - // currently at the head that this node will now hold the pointer to it. - m_next = s_abstractSamplingCounterChain; - s_abstractSamplingCounterChain->m_referer = &m_next; - // Add this node to the head of the list. - s_abstractSamplingCounterChain = this; - m_referer = &s_abstractSamplingCounterChain; - } - - int64_t m_counter; - const char* m_name; - AbstractSamplingCounter* m_next; - // This is a pointer to the pointer to this node in the chain; used to - // allow fast linked list deletion. - AbstractSamplingCounter** m_referer; - // Null object used to detect end of static chain. - static AbstractSamplingCounter s_abstractSamplingCounterChainEnd; - static AbstractSamplingCounter* s_abstractSamplingCounterChain; - static bool s_completed; - }; - -#if ENABLE(SAMPLING_COUNTERS) - // SamplingCounter: - // - // This class is suitable and (hopefully!) convenient for cases where a counter is - // required within the scope of a single function. It can be instantiated as a - // static variable since it contains a constructor but not a destructor (static - // variables in WebKit cannot have destructors). - // - // For example: - // - // void someFunction() - // { - // static SamplingCounter countMe("This is my counter. There are many like it, but this one is mine."); - // countMe.count(); - // // ... - // } - // - class SamplingCounter : public AbstractSamplingCounter { - public: - SamplingCounter(const char* name) { init(name); } - }; - - // GlobalSamplingCounter: - // - // This class is suitable for use where a counter is to be declared globally, - // since it contains neither a constructor nor destructor. Instead, ensure - // that 'name()' is called to provide the counter with a name (and also to - // allow it to be printed out on exit). - // - // GlobalSamplingCounter globalCounter; - // - // void firstFunction() - // { - // // Put this within a function that is definitely called! - // // (Or alternatively alongside all calls to 'count()'). - // globalCounter.name("I Name You Destroyer."); - // globalCounter.count(); - // // ... - // } - // - // void secondFunction() - // { - // globalCounter.count(); - // // ... - // } - // - class GlobalSamplingCounter : public AbstractSamplingCounter { - public: - void name(const char* name) - { - // Global objects should be mapped in zero filled memory, so this should - // be a safe (albeit not necessarily threadsafe) check for 'first call'. - if (!m_next) - init(name); - } - }; - - // DeletableSamplingCounter: - // - // The above classes (SamplingCounter, GlobalSamplingCounter), are intended for - // use within a global or static scope, and as such cannot have a destructor. - // This means there is no convenient way for them to remove themselves from the - // static list of counters, and should an instance of either class be freed - // before 'dump()' has walked over the list it will potentially walk over an - // invalid pointer. - // - // This class is intended for use where the counter may possibly be deleted before - // the program exits. Should this occur, the counter will print it's value to - // stderr, and remove itself from the static list. Example: - // - // DeletableSamplingCounter* counter = new DeletableSamplingCounter("The Counter With No Name"); - // counter->count(); - // delete counter; - // - class DeletableSamplingCounter : public AbstractSamplingCounter { - public: - DeletableSamplingCounter(const char* name) { init(name); } - - ~DeletableSamplingCounter() - { - if (!s_completed) - fprintf(stderr, "DeletableSamplingCounter \"%s\" deleted early (with count %lld)\n", m_name, m_counter); - // Our m_referer pointer should know where the pointer to this node is, - // and m_next should know that this node is the previous node in the list. - Q_ASSERT(*m_referer == this); - Q_ASSERT(m_next->m_referer == &m_next); - // Remove this node from the list, and inform m_next that we have done so. - m_next->m_referer = m_referer; - *m_referer = m_next; - } - }; -#endif - -} // namespace JSC - -#endif // SamplingTool_h diff --git a/src/3rdparty/javascriptcore/bytecompiler/BytecodeGenerator.cpp b/src/3rdparty/javascriptcore/bytecompiler/BytecodeGenerator.cpp deleted file mode 100644 index 02467f2a3..000000000 --- a/src/3rdparty/javascriptcore/bytecompiler/BytecodeGenerator.cpp +++ /dev/null @@ -1,1915 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2008 Cameron Zwarich - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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. - */ - -#include "Platform.h" -#include "BytecodeGenerator.h" - -#include "BatchedTransitionOptimizer.h" -#include "PrototypeFunction.h" -#include "JSFunction.h" -#include "Interpreter.h" -#include "UString.h" - -using namespace std; - -namespace JSC { - -/* - The layout of a register frame looks like this: - - For - - function f(x, y) { - var v1; - function g() { } - var v2; - return (x) * (y); - } - - assuming (x) and (y) generated temporaries t1 and t2, you would have - - ------------------------------------ - | x | y | g | v2 | v1 | t1 | t2 | <-- value held - ------------------------------------ - | -5 | -4 | -3 | -2 | -1 | +0 | +1 | <-- register index - ------------------------------------ - | params->|<-locals | temps-> - - Because temporary registers are allocated in a stack-like fashion, we - can reclaim them with a simple popping algorithm. The same goes for labels. - (We never reclaim parameter or local registers, because parameters and - locals are DontDelete.) - - The register layout before a function call looks like this: - - For - - function f(x, y) - { - } - - f(1); - - > <------------------------------ - < > reserved: call frame | 1 | <-- value held - > >snip< <------------------------------ - < > +0 | +1 | +2 | +3 | +4 | +5 | <-- register index - > <------------------------------ - | params->|<-locals | temps-> - - The call instruction fills in the "call frame" registers. It also pads - missing arguments at the end of the call: - - > <----------------------------------- - < > reserved: call frame | 1 | ? | <-- value held ("?" stands for "undefined") - > >snip< <----------------------------------- - < > +0 | +1 | +2 | +3 | +4 | +5 | +6 | <-- register index - > <----------------------------------- - | params->|<-locals | temps-> - - After filling in missing arguments, the call instruction sets up the new - stack frame to overlap the end of the old stack frame: - - |----------------------------------> < - | reserved: call frame | 1 | ? < > <-- value held ("?" stands for "undefined") - |----------------------------------> >snip< < - | -7 | -6 | -5 | -4 | -3 | -2 | -1 < > <-- register index - |----------------------------------> < - | | params->|<-locals | temps-> - - That way, arguments are "copied" into the callee's stack frame for free. - - If the caller supplies too many arguments, this trick doesn't work. The - extra arguments protrude into space reserved for locals and temporaries. - In that case, the call instruction makes a real copy of the call frame header, - along with just the arguments expected by the callee, leaving the original - call frame header and arguments behind. (The call instruction can't just discard - extra arguments, because the "arguments" object may access them later.) - This copying strategy ensures that all named values will be at the indices - expected by the callee. -*/ - -#ifndef QT_NO_DEBUG -static bool s_dumpsGeneratedCode = false; -#endif - -void BytecodeGenerator::setDumpsGeneratedCode(bool dumpsGeneratedCode) -{ -#ifndef QT_NO_DEBUG - s_dumpsGeneratedCode = dumpsGeneratedCode; -#else - Q_UNUSED(dumpsGeneratedCode); -#endif -} - -bool BytecodeGenerator::dumpsGeneratedCode() -{ -#ifndef QT_NO_DEBUG - return s_dumpsGeneratedCode; -#else - return false; -#endif -} - -void BytecodeGenerator::generate() -{ - m_codeBlock->setThisRegister(m_thisRegister.index()); - - m_scopeNode->emitBytecode(*this); - -#ifndef QT_NO_DEBUG - m_codeBlock->setInstructionCount(m_codeBlock->instructions().size()); - - if (s_dumpsGeneratedCode) - m_codeBlock->dump(m_scopeChain->globalObject()->globalExec()); -#endif - - if ((m_codeType == FunctionCode && !m_codeBlock->needsFullScopeChain() && !m_codeBlock->usesArguments()) || m_codeType == EvalCode) - symbolTable().clear(); - - m_codeBlock->setIsNumericCompareFunction(instructions() == m_globalData->numericCompareFunction(m_scopeChain->globalObject()->globalExec())); - -#if !ENABLE(OPCODE_SAMPLING) - if (!m_regeneratingForExceptionInfo && (m_codeType == FunctionCode || m_codeType == EvalCode)) - m_codeBlock->clearExceptionInfo(); -#endif - - m_codeBlock->shrinkToFit(); -} - -bool BytecodeGenerator::addVar(const Identifier& ident, bool isConstant, RegisterID*& r0) -{ - int index = m_calleeRegisters.size(); - SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0); - std::pair result = symbolTable().add(ident.ustring().rep(), newEntry); - - if (!result.second) { - r0 = ®isterFor(result.first->second.getIndex()); - return false; - } - - ++m_codeBlock->m_numVars; - r0 = newRegister(); - return true; -} - -bool BytecodeGenerator::addGlobalVar(const Identifier& ident, bool isConstant, RegisterID*& r0) -{ - int index = m_nextGlobalIndex; - SymbolTableEntry newEntry(index, isConstant ? ReadOnly : 0); - std::pair result = symbolTable().add(ident.ustring().rep(), newEntry); - - if (!result.second) - index = result.first->second.getIndex(); - else { - --m_nextGlobalIndex; - m_globals.append(index + m_globalVarStorageOffset); - } - - r0 = ®isterFor(index); - return result.second; -} - -void BytecodeGenerator::preserveLastVar() -{ - if ((m_firstConstantIndex = m_calleeRegisters.size()) != 0) - m_lastVar = &m_calleeRegisters.last(); -} - -BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const Debugger* debugger, const ScopeChain& scopeChain, SymbolTable* symbolTable, ProgramCodeBlock* codeBlock) - : m_shouldEmitDebugHooks(!!debugger) - , m_scopeChain(&scopeChain) - , m_symbolTable(symbolTable) - , m_scopeNode(programNode) - , m_codeBlock(codeBlock) - , m_thisRegister(RegisterFile::ProgramCodeThisRegister) - , m_finallyDepth(0) - , m_dynamicScopeDepth(0) - , m_baseScopeDepth(0) - , m_codeType(GlobalCode) - , m_nextGlobalIndex(-1) - , m_nextConstantOffset(0) - , m_globalData(&scopeChain.globalObject()->globalExec()->globalData()) - , m_lastOpcodeID(op_end) - , m_emitNodeDepth(0) - , m_regeneratingForExceptionInfo(false) - , m_codeBlockBeingRegeneratedFrom(0) -{ - if (m_shouldEmitDebugHooks) - m_codeBlock->setNeedsFullScopeChain(true); - - emitOpcode(op_enter); - codeBlock->setGlobalData(m_globalData); - - // FIXME: Move code that modifies the global object to Interpreter::execute. - - m_codeBlock->m_numParameters = 1; // Allocate space for "this" - - JSGlobalObject* globalObject = scopeChain.globalObject(); - ExecState* exec = globalObject->globalExec(); - RegisterFile* registerFile = &exec->globalData().interpreter->registerFile(); - - // Shift register indexes in generated code to elide registers allocated by intermediate stack frames. - m_globalVarStorageOffset = -RegisterFile::CallFrameHeaderSize - m_codeBlock->m_numParameters - registerFile->size(); - - // Add previously defined symbols to bookkeeping. - m_globals.grow(symbolTable->size()); - SymbolTable::iterator end = symbolTable->end(); - for (SymbolTable::iterator it = symbolTable->begin(); it != end; ++it) - registerFor(it->second.getIndex()).setIndex(it->second.getIndex() + m_globalVarStorageOffset); - - BatchedTransitionOptimizer optimizer(globalObject); - - const VarStack& varStack = programNode->varStack(); - const FunctionStack& functionStack = programNode->functionStack(); - bool canOptimizeNewGlobals = symbolTable->size() + functionStack.size() + varStack.size() < registerFile->maxGlobals(); - if (canOptimizeNewGlobals) { - // Shift new symbols so they get stored prior to existing symbols. - m_nextGlobalIndex -= symbolTable->size(); - - for (size_t i = 0; i < functionStack.size(); ++i) { - FunctionBodyNode* function = functionStack[i]; - globalObject->removeDirect(function->ident()); // Make sure our new function is not shadowed by an old property. - emitNewFunction(addGlobalVar(function->ident(), false), function); - } - - Vector newVars; - for (size_t i = 0; i < varStack.size(); ++i) - if (!globalObject->hasProperty(exec, *varStack[i].first)) - newVars.append(addGlobalVar(*varStack[i].first, varStack[i].second & DeclarationStacks::IsConstant)); - - preserveLastVar(); - - for (size_t i = 0; i < newVars.size(); ++i) - emitLoad(newVars[i], jsUndefined()); - } else { - for (size_t i = 0; i < functionStack.size(); ++i) { - FunctionBodyNode* function = functionStack[i]; - globalObject->putWithAttributes(exec, function->ident(), new (exec) JSFunction(exec, makeFunction(exec, function), scopeChain.node()), DontDelete); - } - for (size_t i = 0; i < varStack.size(); ++i) { - if (globalObject->hasProperty(exec, *varStack[i].first)) - continue; - int attributes = DontDelete; - if (varStack[i].second & DeclarationStacks::IsConstant) - attributes |= ReadOnly; - globalObject->putWithAttributes(exec, *varStack[i].first, jsUndefined(), attributes); - } - - preserveLastVar(); - } -} - -BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debugger* debugger, const ScopeChain& scopeChain, SymbolTable* symbolTable, CodeBlock* codeBlock) - : m_shouldEmitDebugHooks(!!debugger) - , m_scopeChain(&scopeChain) - , m_symbolTable(symbolTable) - , m_scopeNode(functionBody) - , m_codeBlock(codeBlock) - , m_finallyDepth(0) - , m_dynamicScopeDepth(0) - , m_baseScopeDepth(0) - , m_codeType(FunctionCode) - , m_nextConstantOffset(0) - , m_globalData(&scopeChain.globalObject()->globalExec()->globalData()) - , m_lastOpcodeID(op_end) - , m_emitNodeDepth(0) - , m_regeneratingForExceptionInfo(false) - , m_codeBlockBeingRegeneratedFrom(0) -{ - if (m_shouldEmitDebugHooks) - m_codeBlock->setNeedsFullScopeChain(true); - - codeBlock->setGlobalData(m_globalData); - - bool usesArguments = functionBody->usesArguments(); - codeBlock->setUsesArguments(usesArguments); - if (usesArguments) { - m_argumentsRegister.setIndex(RegisterFile::OptionalCalleeArguments); - addVar(propertyNames().arguments, false); - } - - if (m_codeBlock->needsFullScopeChain()) { - ++m_codeBlock->m_numVars; - m_activationRegisterIndex = newRegister()->index(); - emitOpcode(op_enter_with_activation); - instructions().append(m_activationRegisterIndex); - } else - emitOpcode(op_enter); - - if (usesArguments) { - emitOpcode(op_init_arguments); - - // The debugger currently retrieves the arguments object from an activation rather than pulling - // it from a call frame. In the long-term it should stop doing that (), - // but for now we force eager creation of the arguments object when debugging. - if (m_shouldEmitDebugHooks) - emitOpcode(op_create_arguments); - } - - const DeclarationStacks::FunctionStack& functionStack = functionBody->functionStack(); - for (size_t i = 0; i < functionStack.size(); ++i) { - FunctionBodyNode* function = functionStack[i]; - const Identifier& ident = function->ident(); - m_functions.add(ident.ustring().rep()); - emitNewFunction(addVar(ident, false), function); - } - - const DeclarationStacks::VarStack& varStack = functionBody->varStack(); - for (size_t i = 0; i < varStack.size(); ++i) - addVar(*varStack[i].first, varStack[i].second & DeclarationStacks::IsConstant); - - FunctionParameters& parameters = *functionBody->parameters(); - size_t parameterCount = parameters.size(); - m_nextParameterIndex = -RegisterFile::CallFrameHeaderSize - parameterCount - 1; - m_parameters.grow(1 + parameterCount); // reserve space for "this" - - // Add "this" as a parameter - m_thisRegister.setIndex(m_nextParameterIndex); - ++m_nextParameterIndex; - ++m_codeBlock->m_numParameters; - - if (functionBody->usesThis() || m_shouldEmitDebugHooks) { - emitOpcode(op_convert_this); - instructions().append(m_thisRegister.index()); - } - - for (size_t i = 0; i < parameterCount; ++i) - addParameter(parameters[i]); - - preserveLastVar(); -} - -BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugger, const ScopeChain& scopeChain, SymbolTable* symbolTable, EvalCodeBlock* codeBlock) - : m_shouldEmitDebugHooks(!!debugger) - , m_scopeChain(&scopeChain) - , m_symbolTable(symbolTable) - , m_scopeNode(evalNode) - , m_codeBlock(codeBlock) - , m_thisRegister(RegisterFile::ProgramCodeThisRegister) - , m_finallyDepth(0) - , m_dynamicScopeDepth(0) - , m_baseScopeDepth(codeBlock->baseScopeDepth()) - , m_codeType(EvalCode) - , m_nextConstantOffset(0) - , m_globalData(&scopeChain.globalObject()->globalExec()->globalData()) - , m_lastOpcodeID(op_end) - , m_emitNodeDepth(0) - , m_regeneratingForExceptionInfo(false) - , m_codeBlockBeingRegeneratedFrom(0) -{ - if (m_shouldEmitDebugHooks || m_baseScopeDepth) - m_codeBlock->setNeedsFullScopeChain(true); - - emitOpcode(op_enter); - codeBlock->setGlobalData(m_globalData); - m_codeBlock->m_numParameters = 1; // Allocate space for "this" - - const DeclarationStacks::FunctionStack& functionStack = evalNode->functionStack(); - for (size_t i = 0; i < functionStack.size(); ++i) - m_codeBlock->addFunctionDecl(makeFunction(m_globalData, functionStack[i])); - - const DeclarationStacks::VarStack& varStack = evalNode->varStack(); - unsigned numVariables = varStack.size(); - Vector variables; - variables.reserveCapacity(numVariables); - for (size_t i = 0; i < numVariables; ++i) - variables.append(*varStack[i].first); - codeBlock->adoptVariables(variables); - - preserveLastVar(); -} - -RegisterID* BytecodeGenerator::addParameter(const Identifier& ident) -{ - // Parameters overwrite var declarations, but not function declarations. - RegisterID* result = 0; - UString::Rep* rep = ident.ustring().rep(); - if (!m_functions.contains(rep)) { - symbolTable().set(rep, m_nextParameterIndex); - RegisterID& parameter = registerFor(m_nextParameterIndex); - parameter.setIndex(m_nextParameterIndex); - result = ¶meter; - } - - // To maintain the calling convention, we have to allocate unique space for - // each parameter, even if the parameter doesn't make it into the symbol table. - ++m_nextParameterIndex; - ++m_codeBlock->m_numParameters; - return result; -} - -RegisterID* BytecodeGenerator::registerFor(const Identifier& ident) -{ - if (ident == propertyNames().thisIdentifier) - return &m_thisRegister; - - if (!shouldOptimizeLocals()) - return 0; - - SymbolTableEntry entry = symbolTable().get(ident.ustring().rep()); - if (entry.isNull()) - return 0; - - if (ident == propertyNames().arguments) - createArgumentsIfNecessary(); - - return ®isterFor(entry.getIndex()); -} - -bool BytecodeGenerator::willResolveToArguments(const Identifier& ident) -{ - if (ident != propertyNames().arguments) - return false; - - if (!shouldOptimizeLocals()) - return false; - - SymbolTableEntry entry = symbolTable().get(ident.ustring().rep()); - if (entry.isNull()) - return false; - - if (m_codeBlock->usesArguments() && m_codeType == FunctionCode) - return true; - - return false; -} - -RegisterID* BytecodeGenerator::uncheckedRegisterForArguments() -{ - Q_ASSERT(willResolveToArguments(propertyNames().arguments)); - - SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.ustring().rep()); - Q_ASSERT(!entry.isNull()); - return ®isterFor(entry.getIndex()); -} - -RegisterID* BytecodeGenerator::constRegisterFor(const Identifier& ident) -{ - if (m_codeType == EvalCode) - return 0; - - SymbolTableEntry entry = symbolTable().get(ident.ustring().rep()); - if (entry.isNull()) - return 0; - - return ®isterFor(entry.getIndex()); -} - -bool BytecodeGenerator::isLocal(const Identifier& ident) -{ - if (ident == propertyNames().thisIdentifier) - return true; - - return shouldOptimizeLocals() && symbolTable().contains(ident.ustring().rep()); -} - -bool BytecodeGenerator::isLocalConstant(const Identifier& ident) -{ - return symbolTable().get(ident.ustring().rep()).isReadOnly(); -} - -RegisterID* BytecodeGenerator::newRegister() -{ - m_calleeRegisters.append(m_calleeRegisters.size()); - m_codeBlock->m_numCalleeRegisters = std::max(m_codeBlock->m_numCalleeRegisters, m_calleeRegisters.size()); - return &m_calleeRegisters.last(); -} - -RegisterID* BytecodeGenerator::newTemporary() -{ - // Reclaim free register IDs. - while (m_calleeRegisters.size() && !m_calleeRegisters.last().refCount()) - m_calleeRegisters.removeLast(); - - RegisterID* result = newRegister(); - result->setTemporary(); - return result; -} - -RegisterID* BytecodeGenerator::highestUsedRegister() -{ - size_t count = m_codeBlock->m_numCalleeRegisters; - while (m_calleeRegisters.size() < count) - newRegister(); - return &m_calleeRegisters.last(); -} - -PassRefPtr BytecodeGenerator::newLabelScope(LabelScope::Type type, const Identifier* name) -{ - // Reclaim free label scopes. - while (m_labelScopes.size() && !m_labelScopes.last().refCount()) - m_labelScopes.removeLast(); - - // Allocate new label scope. - LabelScope scope(type, name, scopeDepth(), newLabel(), type == LabelScope::Loop ? newLabel() : PassRefPtr