From 8e85c5eba9bf438d3d34aea0b94f67b000fe3693 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 8 Aug 2016 02:07:27 +0000 Subject: [PATCH] get rid of some JavaScriptCore macros and RefPtrHashMap Signed-off-by: Ivailo Monev --- .../javascriptcore/JavaScriptCore/API/APICast.h | 7 +- .../JavaScriptCore/assembler/ARMv7Assembler.h | 3 +- .../assembler/AbstractMacroAssembler.h | 1 - .../JavaScriptCore/assembler/MacroAssemblerARM.h | 10 +- .../assembler/MacroAssemblerCodeRef.h | 1 - .../assembler/MacroAssemblerX86_64.h | 9 +- .../JavaScriptCore/bytecode/SamplingTool.cpp | 19 +- .../JavaScriptCore/bytecode/SamplingTool.h | 2 + .../bytecompiler/BytecodeGenerator.cpp | 6 +- .../JavaScriptCore/debugger/Debugger.h | 30 +- .../JavaScriptCore/interpreter/Interpreter.cpp | 4 +- .../JavaScriptCore/jit/ExecutableAllocator.h | 1 - .../jit/ExecutableAllocatorPosix.cpp | 3 +- .../JavaScriptCore/jit/JITArithmetic.cpp | 4 +- .../JavaScriptCore/jit/JITInlineMethods.h | 2 +- .../JavaScriptCore/jit/JITOpcodes.cpp | 6 +- .../JavaScriptCore/jit/JITPropertyAccess.cpp | 24 +- .../JavaScriptCore/jit/JITStubCall.h | 8 +- .../JavaScriptCore/runtime/Collector.cpp | 6 +- .../JavaScriptCore/runtime/DatePrototype.cpp | 5 +- .../JavaScriptCore/runtime/Executable.h | 10 +- .../JavaScriptCore/runtime/Identifier.cpp | 24 +- .../JavaScriptCore/runtime/Identifier.h | 10 +- .../JavaScriptCore/runtime/JSArray.cpp | 3 +- .../JavaScriptCore/runtime/JSFunction.cpp | 4 +- .../JavaScriptCore/runtime/JSNotAnObject.cpp | 44 ++- .../JavaScriptCore/runtime/JSVariableObject.cpp | 2 +- .../JavaScriptCore/runtime/JSVariableObject.h | 12 +- .../JavaScriptCore/runtime/RegExp.cpp | 4 +- .../JavaScriptCore/runtime/Structure.cpp | 3 +- .../javascriptcore/JavaScriptCore/wtf/Assertions.h | 8 +- .../javascriptcore/JavaScriptCore/wtf/DateMath.h | 1 - .../javascriptcore/JavaScriptCore/wtf/HashMap.h | 2 - .../javascriptcore/JavaScriptCore/wtf/HashTable.h | 6 +- .../JavaScriptCore/wtf/RefPtrHashMap.h | 350 --------------------- .../JavaScriptCore/wtf/UnusedParam.h | 29 -- 36 files changed, 144 insertions(+), 519 deletions(-) delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtrHashMap.h delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/wtf/UnusedParam.h diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h b/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h index a7d71d571..d1e768df2 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/API/APICast.h @@ -30,7 +30,6 @@ #include "JSGlobalObject.h" #include "JSValue.h" #include -#include namespace JSC { class ExecState; @@ -63,7 +62,7 @@ inline JSC::ExecState* toJS(JSGlobalContextRef c) inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v) { - ASSERT_UNUSED(exec, exec); + Q_UNUSED(exec); Q_ASSERT(v); #if USE(JSVALUE32_64) JSC::JSCell* jsCell = reinterpret_cast(const_cast(v)); @@ -79,7 +78,7 @@ inline JSC::JSValue toJS(JSC::ExecState* exec, JSValueRef v) inline JSC::JSValue toJSForGC(JSC::ExecState* exec, JSValueRef v) { - ASSERT_UNUSED(exec, exec); + Q_UNUSED(exec); Q_ASSERT(v); #if USE(JSVALUE32_64) JSC::JSCell* jsCell = reinterpret_cast(const_cast(v)); @@ -115,7 +114,7 @@ inline JSValueRef toRef(JSC::ExecState* exec, JSC::JSValue v) return reinterpret_cast(JSC::jsAPIValueWrapper(exec, v).asCell()); return reinterpret_cast(v.asCell()); #else - UNUSED_PARAM(exec); + Q_UNUSED(exec); return reinterpret_cast(JSC::JSValue::encode(v)); #endif } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMv7Assembler.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMv7Assembler.h index 05397b68f..5d1c2ef6a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMv7Assembler.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/ARMv7Assembler.h @@ -239,7 +239,8 @@ class ARMThumbImmediate { // Make sure this constructor is only reached with type TypeUInt16; // this extra parameter makes the code a little clearer by making it // explicit at call sites which type is being constructed - ASSERT_UNUSED(type, type == TypeUInt16); + Q_UNUSED(type); + Q_ASSERT(type == TypeUInt16); m_value.asInt = value; } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/AbstractMacroAssembler.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/AbstractMacroAssembler.h index c5f6f3027..b3b8850b0 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/AbstractMacroAssembler.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/AbstractMacroAssembler.h @@ -31,7 +31,6 @@ #include #include #include -#include #if ENABLE(ASSEMBLER) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h index d00966673..97a82fb8f 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.h @@ -407,9 +407,9 @@ public: Jump branch16(Condition cond, BaseIndex left, RegisterID right) { - UNUSED_PARAM(cond); - UNUSED_PARAM(left); - UNUSED_PARAM(right); + Q_UNUSED(cond); + Q_UNUSED(left); + Q_UNUSED(right); ASSERT_NOT_REACHED(); return jump(); } @@ -824,8 +824,8 @@ public: // (specifically, in this case, INT_MIN). Jump branchTruncateDoubleToInt32(FPRegisterID src, RegisterID dest) { - UNUSED_PARAM(src); - UNUSED_PARAM(dest); + Q_UNUSED(src); + Q_UNUSED(dest); ASSERT_NOT_REACHED(); return jump(); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerCodeRef.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerCodeRef.h index 8d47bab7d..0574fc11a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerCodeRef.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerCodeRef.h @@ -31,7 +31,6 @@ #include "ExecutableAllocator.h" #include "PassRefPtr.h" #include "RefPtr.h" -#include "UnusedParam.h" #if ENABLE(ASSEMBLER) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86_64.h b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86_64.h index 2b5147c92..a26eaeb38 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86_64.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerX86_64.h @@ -112,7 +112,8 @@ public: { DataLabelPtr label = moveWithPatch(ImmPtr(0), scratchRegister); Call result = Call(m_assembler.call(scratchRegister), Call::Linkable); - ASSERT_UNUSED(label, differenceBetween(label, result) == REPTACH_OFFSET_CALL_R11); + Q_UNUSED(label); + Q_ASSERT(differenceBetween(label, result) == REPTACH_OFFSET_CALL_R11); return result; } @@ -120,7 +121,8 @@ public: { DataLabelPtr label = moveWithPatch(ImmPtr(0), scratchRegister); Jump newJump = Jump(m_assembler.jmp_r(scratchRegister)); - ASSERT_UNUSED(label, differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11); + Q_UNUSED(label); + Q_ASSERT(differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11); return Call::fromTailJump(newJump); } @@ -129,7 +131,8 @@ public: oldJump.link(this); DataLabelPtr label = moveWithPatch(ImmPtr(0), scratchRegister); Jump newJump = Jump(m_assembler.jmp_r(scratchRegister)); - ASSERT_UNUSED(label, differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11); + Q_UNUSED(label); + Q_ASSERT(differenceBetween(label, newJump) == REPTACH_OFFSET_CALL_R11); return Call::fromTailJump(newJump); } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp index 1fc92b8bb..ca7ad0460 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.cpp @@ -197,7 +197,7 @@ void SamplingTool::notifyOfScope(ScriptExecutable* script) QMutexLocker locker(m_scriptSampleMapMutex); m_scopeSampleMap->set(script, new ScriptSampleRecord(script)); #else - UNUSED_PARAM(script); + Q_UNUSED(script); #endif } @@ -250,7 +250,7 @@ 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]; @@ -275,7 +275,7 @@ void SamplingTool::dump(ExecState* exec) 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; @@ -356,17 +356,10 @@ void SamplingTool::dump(ExecState* exec) } } #else - UNUSED_PARAM(exec); -#endif + Q_UNUSED(exec); +#endif // ENABLE(CODEBLOCK_SAMPLING) } - -#else - -void SamplingTool::dump(ExecState*) -{ -} - -#endif +#endif // ENABLE(OPCODE_SAMPLING) void AbstractSamplingCounter::dump() { diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h index 1c8ce950e..1dcfdb293 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/SamplingTool.h @@ -214,7 +214,9 @@ namespace JSC { } void setup(); +#if ENABLE(OPCODE_SAMPLING) void dump(ExecState*); +#endif void notifyOfScope(ScriptExecutable* scope); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 2dec0e2c9..8c940e374 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -124,7 +124,7 @@ void BytecodeGenerator::setDumpsGeneratedCode(bool dumpsGeneratedCode) #ifndef NDEBUG s_dumpsGeneratedCode = dumpsGeneratedCode; #else - UNUSED_PARAM(dumpsGeneratedCode); + Q_UNUSED(dumpsGeneratedCode); #endif } @@ -1846,7 +1846,7 @@ void BytecodeGenerator::beginSwitch(RegisterID* scrutineeRegister, SwitchInfo::S static int32_t keyForImmediateSwitch(ExpressionNode* node, int32_t min, int32_t max) { - UNUSED_PARAM(max); + Q_UNUSED(max); Q_ASSERT(node->isNumber()); double value = static_cast(node)->value(); int32_t key = static_cast(value); @@ -1871,7 +1871,7 @@ static void prepareJumpTableForImmediateSwitch(SimpleJumpTable& jumpTable, int32 static int32_t keyForCharacterSwitch(ExpressionNode* node, int32_t min, int32_t max) { - UNUSED_PARAM(max); + Q_UNUSED(max); Q_ASSERT(node->isString()); UString::Rep* clause = static_cast(node)->value().ustring().rep(); Q_ASSERT(clause->size() == 1); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h index 9b86a7ffc..2db3d75d7 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h @@ -43,45 +43,45 @@ namespace JSC { virtual void scriptUnload(QT_PREPEND_NAMESPACE(qint64) id) { - UNUSED_PARAM(id); + Q_UNUSED(id); }; virtual void scriptLoad(QT_PREPEND_NAMESPACE(qint64) id, const UString &program, const UString &fileName, int baseLineNumber) { - UNUSED_PARAM(id); - UNUSED_PARAM(program); - UNUSED_PARAM(fileName); - UNUSED_PARAM(baseLineNumber); + Q_UNUSED(id); + Q_UNUSED(program); + Q_UNUSED(fileName); + Q_UNUSED(baseLineNumber); }; virtual void contextPush() {}; virtual void contextPop() {}; virtual void evaluateStart(intptr_t sourceID) { - UNUSED_PARAM(sourceID); + Q_UNUSED(sourceID); } virtual void evaluateStop(const JSC::JSValue& returnValue, intptr_t sourceID) { - UNUSED_PARAM(sourceID); - UNUSED_PARAM(returnValue); + Q_UNUSED(sourceID); + Q_UNUSED(returnValue); } virtual void exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler) { - UNUSED_PARAM(frame); - UNUSED_PARAM(sourceID); - UNUSED_PARAM(hasHandler); + Q_UNUSED(frame); + Q_UNUSED(sourceID); + Q_UNUSED(hasHandler); }; virtual void exceptionCatch(const JSC::DebuggerCallFrame& frame, intptr_t sourceID) { - UNUSED_PARAM(frame); - UNUSED_PARAM(sourceID); + Q_UNUSED(frame); + Q_UNUSED(sourceID); }; virtual void functionExit(const JSC::JSValue& returnValue, intptr_t sourceID) { - UNUSED_PARAM(returnValue); - UNUSED_PARAM(sourceID); + Q_UNUSED(returnValue); + Q_UNUSED(sourceID); }; virtual void sourceParsed(ExecState*, const SourceCode&, int errorLineNumber, const UString& errorMessage) = 0; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp index 9067fa3e9..d9791933a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp @@ -76,7 +76,7 @@ static ALWAYS_INLINE unsigned bytecodeOffsetForPC(CallFrame* callFrame, CodeBloc #if ENABLE(JIT) return codeBlock->getBytecodeIndex(callFrame, ReturnAddressPtr(pc)); #else - UNUSED_PARAM(callFrame); + Q_UNUSED(callFrame); return static_cast(pc) - codeBlock->instructions().begin(); #endif } @@ -3900,7 +3900,7 @@ void Interpreter::dumpSampleData(ExecState* exec) if (m_sampler) m_sampler->dump(exec); #else - UNUSED_PARAM(exec); + Q_UNUSED(exec); #endif } void Interpreter::startSampling() diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h index ece88a06d..2b139609c 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #if OS(IPHONE_OS) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp index 4888ef291..6913cf296 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp @@ -52,7 +52,8 @@ ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t n) void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc) { int result = munmap(alloc.pages, alloc.size); - ASSERT_UNUSED(result, !result); + Q_UNUSED(result) + Q_ASSERT(!result); } } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp index 1946791c8..3fda624ee 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITArithmetic.cpp @@ -1230,8 +1230,8 @@ void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector* executable #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) *ctiStringLengthTrampoline = trampolineAt(finalCode, stringLengthBegin); #else - UNUSED_PARAM(ctiStringLengthTrampoline); + Q_UNUSED(ctiStringLengthTrampoline); #endif #if ENABLE(JIT_OPTIMIZE_CALL) *ctiVirtualCallLink = trampolineAt(finalCode, virtualCallLinkBegin); #else - UNUSED_PARAM(ctiVirtualCallLink); + Q_UNUSED(ctiVirtualCallLink); #endif } @@ -1814,7 +1814,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr* executable #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) *ctiStringLengthTrampoline = trampolineAt(finalCode, stringLengthBegin); #else - UNUSED_PARAM(ctiStringLengthTrampoline); + Q_UNUSED(ctiStringLengthTrampoline); #endif } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp index 3b8b85577..75618cdb7 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITPropertyAccess.cpp @@ -226,9 +226,11 @@ void JIT::emit_op_method_check(Instruction* currentInstruction) move(Imm32(JSValue::CellTag), regT1); Jump match = jump(); - ASSERT_UNUSED(protoObj, differenceBetween(info.structureToCompare, protoObj) == patchOffsetMethodCheckProtoObj); + Q_UNUSED(protoObj); + Q_ASSERT(differenceBetween(info.structureToCompare, protoObj) == patchOffsetMethodCheckProtoObj); Q_ASSERT(differenceBetween(info.structureToCompare, protoStructureToCompare) == patchOffsetMethodCheckProtoStruct); - ASSERT_UNUSED(putFunction, differenceBetween(info.structureToCompare, putFunction) == patchOffsetMethodCheckPutFunction); + Q_UNUSED(putFunction); + Q_ASSERT(differenceBetween(info.structureToCompare, putFunction) == patchOffsetMethodCheckPutFunction); // Link the failure cases here. structureCheck.link(this); @@ -395,12 +397,15 @@ void JIT::compileGetByIdHotPath() Label externalLoad = loadPtrWithPatchToLEA(Address(regT0, OBJECT_OFFSETOF(JSObject, m_externalStorage)), regT2); Label externalLoadComplete(this); Q_ASSERT(differenceBetween(hotPathBegin, externalLoad) == patchOffsetGetByIdExternalLoad); - ASSERT_UNUSED(externalLoad, differenceBetween(externalLoad, externalLoadComplete) == patchLengthGetByIdExternalLoad); + Q_UNUSED(externalLoad); + Q_ASSERT(differenceBetween(externalLoad, externalLoadComplete) == patchLengthGetByIdExternalLoad); DataLabel32 displacementLabel1 = loadPtrWithAddressOffsetPatch(Address(regT2, patchGetByIdDefaultOffset), regT0); // payload - ASSERT_UNUSED(displacementLabel1, differenceBetween(hotPathBegin, displacementLabel1) == patchOffsetGetByIdPropertyMapOffset1); + Q_UNUSED(displacementLabel1); + Q_ASSERT(differenceBetween(hotPathBegin, displacementLabel1) == patchOffsetGetByIdPropertyMapOffset1); DataLabel32 displacementLabel2 = loadPtrWithAddressOffsetPatch(Address(regT2, patchGetByIdDefaultOffset), regT1); // tag - ASSERT_UNUSED(displacementLabel2, differenceBetween(hotPathBegin, displacementLabel2) == patchOffsetGetByIdPropertyMapOffset2); + Q_UNUSED(displacementLabel2); + Q_ASSERT(differenceBetween(hotPathBegin, displacementLabel2) == patchOffsetGetByIdPropertyMapOffset2); Label putResult(this); Q_ASSERT(differenceBetween(hotPathBegin, putResult) == patchOffsetGetByIdPutResult); @@ -474,15 +479,18 @@ void JIT::emit_op_put_by_id(Instruction* currentInstruction) Label externalLoad = loadPtrWithPatchToLEA(Address(regT0, OBJECT_OFFSETOF(JSObject, m_externalStorage)), regT0); Label externalLoadComplete(this); Q_ASSERT(differenceBetween(hotPathBegin, externalLoad) == patchOffsetPutByIdExternalLoad); - ASSERT_UNUSED(externalLoad, differenceBetween(externalLoad, externalLoadComplete) == patchLengthPutByIdExternalLoad); + Q_UNUSED(externalLoad); + Q_ASSERT(differenceBetween(externalLoad, externalLoadComplete) == patchLengthPutByIdExternalLoad); DataLabel32 displacementLabel1 = storePtrWithAddressOffsetPatch(regT2, Address(regT0, patchGetByIdDefaultOffset)); // payload DataLabel32 displacementLabel2 = storePtrWithAddressOffsetPatch(regT3, Address(regT0, patchGetByIdDefaultOffset)); // tag END_UNINTERRUPTED_SEQUENCE(sequencePutById); - ASSERT_UNUSED(displacementLabel1, differenceBetween(hotPathBegin, displacementLabel1) == patchOffsetPutByIdPropertyMapOffset1); - ASSERT_UNUSED(displacementLabel2, differenceBetween(hotPathBegin, displacementLabel2) == patchOffsetPutByIdPropertyMapOffset2); + Q_UNUSED(displacementLabel1); + Q_ASSERT(differenceBetween(hotPathBegin, displacementLabel1) == patchOffsetPutByIdPropertyMapOffset1); + Q_UNUSED(displacementLabel2); + Q_ASSERT(differenceBetween(hotPathBegin, displacementLabel2) == patchOffsetPutByIdPropertyMapOffset2); } void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector::iterator& iter) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubCall.h b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubCall.h index 0360de0cc..433fe2523 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubCall.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubCall.h @@ -200,7 +200,8 @@ namespace JSC { #else JIT::Call call(unsigned dst) // dst is a virtual register. { - ASSERT_UNUSED(m_returnType, m_returnType == VoidPtr || m_returnType == Cell); + Q_UNUSED(m_returnType); + Q_ASSERT(m_returnType == VoidPtr || m_returnType == Cell); JIT::Call call = this->call(); m_jit->emitPutVirtualRegister(dst); return call; @@ -209,10 +210,11 @@ namespace JSC { JIT::Call call(JIT::RegisterID dst) // dst is a machine register. { + Q_UNUSED(m_returnType); #if USE(JSVALUE32_64) - ASSERT_UNUSED(m_returnType, m_returnType == Value || m_returnType == VoidPtr || m_returnType == Int || m_returnType == Cell); + Q_ASSERT(m_returnType == Value || m_returnType == VoidPtr || m_returnType == Int || m_returnType == Cell); #else - ASSERT_UNUSED(m_returnType, m_returnType == VoidPtr || m_returnType == Int || m_returnType == Cell); + Q_ASSERT(m_returnType == VoidPtr || m_returnType == Int || m_returnType == Cell); #endif JIT::Call call = this->call(); if (dst != JIT::returnValueRegister) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp index 99f5cdb81..3194ef64e 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #if OS(DARWIN) @@ -301,8 +300,9 @@ void* Heap::allocate(size_t s) { typedef HeapConstants::Block Block; typedef HeapConstants::Cell Cell; - - ASSERT_UNUSED(s, s <= HeapConstants::cellSize); + + Q_UNUSED(s); + Q_ASSERT(s <= HeapConstants::cellSize); Q_ASSERT(m_heap.operationInProgress == NoOperation); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DatePrototype.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DatePrototype.cpp index 8a1966b30..915346587 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DatePrototype.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DatePrototype.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #if HAVE(SYS_PARAM_H) #include @@ -770,13 +769,13 @@ static JSValue setNewValueFromDateArgs(ExecState* exec, JSValue thisValue, const return jsNaN(exec); gregorianDateTime.copyFrom(*other); } - + if (!fillStructuresUsingDateArgs(exec, args, numArgsToUse, &ms, &gregorianDateTime)) { JSValue result = jsNaN(exec); thisDateObj->setInternalValue(result); return result; } - + JSValue result = jsNumber(exec, gregorianDateTimeToMS(exec, gregorianDateTime, ms, inputIsUTC)); thisDateObj->setInternalValue(result); return result; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h index 011a66c91..205470081 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h @@ -113,7 +113,7 @@ namespace JSC { if (SamplingTool* sampler = globalData->interpreter->sampler()) sampler->notifyOfScope(this); #else - UNUSED_PARAM(globalData); + Q_UNUSED(globalData); #endif } @@ -126,7 +126,7 @@ namespace JSC { if (SamplingTool* sampler = exec->globalData().interpreter->sampler()) sampler->notifyOfScope(this); #else - UNUSED_PARAM(exec); + Q_UNUSED(exec); #endif } @@ -165,7 +165,8 @@ namespace JSC { { if (!m_evalCodeBlock) { JSObject* error = compile(exec, scopeChainNode); - ASSERT_UNUSED(!error, error); + Q_UNUSED(error); + Q_ASSERT(!error); } return *m_evalCodeBlock; } @@ -212,7 +213,8 @@ namespace JSC { { if (!m_programCodeBlock) { JSObject* error = compile(exec, scopeChainNode); - ASSERT_UNUSED(!error, error); + Q_UNUSED(error); + Q_ASSERT(!error); } return *m_programCodeBlock; } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp index 6c576d9d5..b8ac2727a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp @@ -217,7 +217,7 @@ PassRefPtr Identifier::addSlowCase(JSGlobalData* globalData, UStri r = globalData->smallStrings.singleCharacterStringRep(c); if (r->isIdentifier()) { #ifndef NDEBUG - checkSameIdentifierTable(globalData, r); + checkSameIdentifierTable(globalData); #endif return r; } @@ -240,27 +240,17 @@ void Identifier::remove(UString::Rep* r) } #ifndef NDEBUG - -void Identifier::checkSameIdentifierTable(ExecState* exec, UString::Rep*) +void Identifier::checkSameIdentifierTable(ExecState* exec) { - ASSERT_UNUSED(exec, exec->globalData().identifierTable == currentIdentifierTable()); + Q_UNUSED(exec); + Q_ASSERT(exec->globalData().identifierTable == currentIdentifierTable()); } -void Identifier::checkSameIdentifierTable(JSGlobalData* globalData, UString::Rep*) -{ - ASSERT_UNUSED(globalData, globalData->identifierTable == currentIdentifierTable()); -} - -#else - -void Identifier::checkSameIdentifierTable(ExecState*, UString::Rep*) +void Identifier::checkSameIdentifierTable(JSGlobalData* globalData) { + Q_UNUSED(globalData); + Q_ASSERT(globalData->identifierTable == currentIdentifierTable()); } - -void Identifier::checkSameIdentifierTable(JSGlobalData*, UString::Rep*) -{ -} - #endif ThreadSpecific* g_identifierTableSpecific = 0; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.h index 1d1bd186f..542664bef 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.h @@ -95,7 +95,7 @@ namespace JSC { { if (r->isIdentifier()) { #ifndef NDEBUG - checkSameIdentifierTable(exec, r); + checkSameIdentifierTable(exec); #endif return r; } @@ -105,7 +105,7 @@ namespace JSC { { if (r->isIdentifier()) { #ifndef NDEBUG - checkSameIdentifierTable(globalData, r); + checkSameIdentifierTable(globalData); #endif return r; } @@ -115,8 +115,10 @@ namespace JSC { static PassRefPtr addSlowCase(ExecState*, UString::Rep* r); static PassRefPtr addSlowCase(JSGlobalData*, UString::Rep* r); - static void checkSameIdentifierTable(ExecState*, UString::Rep*); - static void checkSameIdentifierTable(JSGlobalData*, UString::Rep*); +#ifndef NDEBUG + static void checkSameIdentifierTable(ExecState*); + static void checkSameIdentifierTable(JSGlobalData*); +#endif }; inline bool operator==(const Identifier& a, const Identifier& b) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp index 04ff77ded..d4419134c 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSArray.cpp @@ -950,7 +950,8 @@ void JSArray::fillArgList(ExecState* exec, MarkedArgumentBuffer& args) void JSArray::copyToRegisters(ExecState* exec, Register* buffer, uint32_t maxSize) { - ASSERT_UNUSED(maxSize, m_storage->m_length == maxSize); + Q_UNUSED(maxSize); + Q_ASSERT(m_storage->m_length == maxSize); JSValue* vector = m_storage->m_vector; unsigned vectorEnd = min(m_storage->m_length, m_vectorLength); unsigned i = 0; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.cpp index 61d369b46..40203d8c5 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSFunction.cpp @@ -66,8 +66,8 @@ JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr structure, setNativeFunction(func); putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum); #else - UNUSED_PARAM(length); - UNUSED_PARAM(func); + Q_UNUSED(length); + Q_UNUSED(func); ASSERT_NOT_REACHED(); #endif } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSNotAnObject.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSNotAnObject.cpp index f4764e270..d568f1b9a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSNotAnObject.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSNotAnObject.cpp @@ -30,8 +30,6 @@ #include "config.h" #include "JSNotAnObject.h" -#include - namespace JSC { ASSERT_CLASS_FITS_IN_CELL(JSNotAnObject); @@ -39,37 +37,43 @@ ASSERT_CLASS_FITS_IN_CELL(JSNotAnObject); // JSValue methods JSValue JSNotAnObject::toPrimitive(ExecState* exec, PreferredPrimitiveType) const { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return m_exception; } bool JSNotAnObject::getPrimitiveNumber(ExecState* exec, double&, JSValue&) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return false; } bool JSNotAnObject::toBoolean(ExecState* exec) const { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return false; } double JSNotAnObject::toNumber(ExecState* exec) const { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return NaN; } UString JSNotAnObject::toString(ExecState* exec) const { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return ""; } JSObject* JSNotAnObject::toObject(ExecState* exec) const { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return m_exception; } @@ -83,47 +87,55 @@ void JSNotAnObject::markChildren(MarkStack& markStack) // JSObject methods bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, const Identifier&, PropertySlot&) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return false; } bool JSNotAnObject::getOwnPropertySlot(ExecState* exec, unsigned, PropertySlot&) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return false; } bool JSNotAnObject::getOwnPropertyDescriptor(ExecState* exec, const Identifier&, PropertyDescriptor&) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return false; } void JSNotAnObject::put(ExecState* exec, const Identifier& , JSValue, PutPropertySlot&) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); } void JSNotAnObject::put(ExecState* exec, unsigned, JSValue) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); } bool JSNotAnObject::deleteProperty(ExecState* exec, const Identifier&) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return false; } bool JSNotAnObject::deleteProperty(ExecState* exec, unsigned) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); return false; } void JSNotAnObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray&, EnumerationMode) { - ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); + Q_UNUSED(exec); + Q_ASSERT(exec->hadException() && exec->exception() == m_exception); } } // namespace JSC diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSVariableObject.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSVariableObject.cpp index 73650016a..15e7b02ff 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSVariableObject.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSVariableObject.cpp @@ -60,7 +60,7 @@ bool JSVariableObject::isVariableObject() const bool JSVariableObject::symbolTableGet(const Identifier& propertyName, PropertyDescriptor& descriptor) { - SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep()); + SymbolTableEntry entry = symbolTable().get(propertyName.ustring().rep()); if (!entry.isNull()) { descriptor.setDescriptor(registerAt(entry.getIndex()).jsValue(), entry.getAttributes() | DontDelete); return true; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSVariableObject.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSVariableObject.h index dfa9006d0..b96efe601 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSVariableObject.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSVariableObject.h @@ -32,9 +32,7 @@ #include "JSObject.h" #include "Register.h" #include "SymbolTable.h" -#include "UnusedParam.h" #include -#include namespace JSC { @@ -50,7 +48,7 @@ namespace JSC { virtual bool deleteProperty(ExecState*, const Identifier&); virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); - + virtual bool isVariableObject() const; virtual bool isDynamicScope() const = 0; @@ -60,7 +58,7 @@ namespace JSC { { return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); } - + protected: static const unsigned StructureFlags = OverridesGetPropertyNames | JSObject::StructureFlags; // Subclasses of JSVariableObject can subclass this struct to add data @@ -103,7 +101,7 @@ namespace JSC { inline bool JSVariableObject::symbolTableGet(const Identifier& propertyName, PropertySlot& slot) { - SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep()); + SymbolTableEntry entry = symbolTable().get(propertyName.ustring().rep()); if (!entry.isNull()) { slot.setRegisterSlot(®isterAt(entry.getIndex())); return true; @@ -113,7 +111,7 @@ namespace JSC { inline bool JSVariableObject::symbolTableGet(const Identifier& propertyName, PropertySlot& slot, bool& slotIsWriteable) { - SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep()); + SymbolTableEntry entry = symbolTable().get(propertyName.ustring().rep()); if (!entry.isNull()) { slot.setRegisterSlot(®isterAt(entry.getIndex())); slotIsWriteable = !entry.isReadOnly(); @@ -126,7 +124,7 @@ namespace JSC { { Q_ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this)); - SymbolTableEntry entry = symbolTable().inlineGet(propertyName.ustring().rep()); + SymbolTableEntry entry = symbolTable().get(propertyName.ustring().rep()); if (entry.isNull()) return false; if (entry.isReadOnly()) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/RegExp.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/RegExp.cpp index bf37bb3fa..82d4040f4 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/RegExp.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/RegExp.cpp @@ -111,7 +111,7 @@ void RegExp::compile(JSGlobalData* globalData) #if ENABLE(YARR_JIT) Yarr::jitCompileRegex(globalData, m_regExpJITCode, m_pattern, m_numSubpatterns, m_constructionError, ignoreCase(), multiline()); #else - UNUSED_PARAM(globalData); + Q_UNUSED(globalData); m_regExpBytecode.set(Yarr::byteCompileRegex(m_pattern, m_numSubpatterns, m_constructionError, ignoreCase(), multiline())); #endif } @@ -173,7 +173,7 @@ int RegExp::match(const UString& s, int startOffset, Vector* ovector) void RegExp::compile(JSGlobalData* globalData) { m_regExp = 0; - UNUSED_PARAM(globalData); + Q_UNUSED(globalData); JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase; JSRegExpMultilineOption multilineOption = multiline() ? JSRegExpMultiline : JSRegExpSingleLine; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp index 307368922..2eb11c036 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp @@ -446,7 +446,8 @@ PassRefPtr Structure::despecifyFunctionTransition(Structure* structur transition->despecifyAllFunctions(); else { bool removed = transition->despecifyFunction(replaceFunction); - ASSERT_UNUSED(removed, removed); + Q_UNUSED(removed); + Q_ASSERT(removed); } return transition.release(); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h index 0e2bb66a4..cacb12a7d 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h @@ -59,20 +59,18 @@ } while(false) #endif -// TODO: get rid of those assert macros? -/* ASSERT_NOT_REACHED, ASSERT_UNUSED */ +// TODO: get rid of that assert macro? +/* ASSERT_NOT_REACHED */ #include #ifdef QT_NO_DEBUG #define ASSERT_NOT_REACHED() ((void)0) -#define ASSERT_UNUSED(variable, assertion) ((void)variable) #else -#define ASSERT_NOT_REACHED() Q_ASSERT_X(false, 0, "SHOULD NEVER BE REACHED\n") -#define ASSERT_UNUSED(variable, assertion) Q_ASSERT(assertion); Q_UNUSED(variable) +#define ASSERT_NOT_REACHED() Q_ASSERT_X(false, 0, "SHOULD NEVER BE REACHED") #endif diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/DateMath.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/DateMath.h index 0c0e4dac6..985d61229 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/DateMath.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/DateMath.h @@ -47,7 +47,6 @@ #include #include #include -#include namespace WTF { diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashMap.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashMap.h index a93b07e47..19a95e848 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashMap.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashMap.h @@ -398,6 +398,4 @@ namespace WTF { using WTF::HashMap; -#include "RefPtrHashMap.h" - #endif /* WTF_HashMap_h */ diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h index f22560cd2..ef5eff93a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashTable.h @@ -197,7 +197,8 @@ namespace WTF { void checkValidity(const const_iterator& other) const { Q_ASSERT(m_table); - ASSERT_UNUSED(other, other.m_table); + Q_UNUSED(other); + Q_ASSERT(other.m_table); Q_ASSERT(m_table == other.m_table); } #else @@ -1066,9 +1067,6 @@ namespace WTF { template void removeIterator(HashTableConstIterator* it) { - typedef HashTable HashTableType; - typedef HashTableConstIterator const_iterator; - // Delete iterator from doubly-linked list of iterators. if (!it->m_table) { Q_ASSERT(!it->m_next); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtrHashMap.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtrHashMap.h deleted file mode 100644 index 38a17d8fd..000000000 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtrHashMap.h +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -namespace WTF { - - // This specialization is a direct copy of HashMap, with overloaded functions - // to allow for lookup by pointer instead of RefPtr, avoiding ref-count churn. - - // FIXME: Find a better way that doesn't require an entire copy of the HashMap template. - - template - struct RefPtrHashMapRawKeyTranslator { - typedef typename ValueType::first_type KeyType; - typedef typename ValueType::second_type MappedType; - typedef typename ValueTraits::FirstTraits KeyTraits; - typedef typename ValueTraits::SecondTraits MappedTraits; - - static unsigned hash(RawKeyType key) { return HashFunctions::hash(key); } - static bool equal(const KeyType& a, RawKeyType b) { return HashFunctions::equal(a, b); } - static void translate(ValueType& location, RawKeyType key, const MappedType& mapped) - { - location.first = key; - location.second = mapped; - } - }; - - template - class RefPtrHashMap : public FastAllocBase { - private: - typedef KeyTraitsArg KeyTraits; - typedef MappedTraitsArg MappedTraits; - typedef PairHashTraits ValueTraits; - - public: - typedef typename KeyTraits::TraitType KeyType; - typedef T* RawKeyType; - typedef typename MappedTraits::TraitType MappedType; - typedef typename ValueTraits::TraitType ValueType; - - private: - typedef HashArg HashFunctions; - - typedef HashTable, - HashFunctions, ValueTraits, KeyTraits> HashTableType; - - typedef RefPtrHashMapRawKeyTranslator - RawKeyTranslator; - - public: - typedef HashTableIteratorAdapter iterator; - typedef HashTableConstIteratorAdapter const_iterator; - - void swap(RefPtrHashMap&); - - int size() const; - int capacity() const; - bool isEmpty() const; - - // iterators iterate over pairs of keys and values - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - - iterator find(const KeyType&); - iterator find(RawKeyType); - const_iterator find(const KeyType&) const; - const_iterator find(RawKeyType) const; - bool contains(const KeyType&) const; - bool contains(RawKeyType) const; - MappedType get(const KeyType&) const; - MappedType get(RawKeyType) const; - MappedType inlineGet(RawKeyType) const; - - // replaces value but not key if key is already present - // return value is a pair of the iterator to the key location, - // and a boolean that's true if a new value was actually added - pair set(const KeyType&, const MappedType&); - pair set(RawKeyType, const MappedType&); - - // does nothing if key is already present - // return value is a pair of the iterator to the key location, - // and a boolean that's true if a new value was actually added - pair add(const KeyType&, const MappedType&); - pair add(RawKeyType, const MappedType&); - - void remove(const KeyType&); - void remove(RawKeyType); - void remove(iterator); - void clear(); - - MappedType take(const KeyType&); // efficient combination of get with remove - MappedType take(RawKeyType); // efficient combination of get with remove - - private: - pair inlineAdd(const KeyType&, const MappedType&); - pair inlineAdd(RawKeyType, const MappedType&); - - HashTableType m_impl; - }; - template - class HashMap, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> : - public RefPtrHashMap - { - }; - - template - inline void RefPtrHashMap::swap(RefPtrHashMap& other) - { - m_impl.swap(other.m_impl); - } - - template - inline int RefPtrHashMap::size() const - { - return m_impl.size(); - } - - template - inline int RefPtrHashMap::capacity() const - { - return m_impl.capacity(); - } - - template - inline bool RefPtrHashMap::isEmpty() const - { - return m_impl.isEmpty(); - } - - template - inline typename RefPtrHashMap::iterator RefPtrHashMap::begin() - { - return m_impl.begin(); - } - - template - inline typename RefPtrHashMap::iterator RefPtrHashMap::end() - { - return m_impl.end(); - } - - template - inline typename RefPtrHashMap::const_iterator RefPtrHashMap::begin() const - { - return m_impl.begin(); - } - - template - inline typename RefPtrHashMap::const_iterator RefPtrHashMap::end() const - { - return m_impl.end(); - } - - template - inline typename RefPtrHashMap::iterator RefPtrHashMap::find(const KeyType& key) - { - return m_impl.find(key); - } - - template - inline typename RefPtrHashMap::iterator RefPtrHashMap::find(RawKeyType key) - { - return m_impl.template find(key); - } - - template - inline typename RefPtrHashMap::const_iterator RefPtrHashMap::find(const KeyType& key) const - { - return m_impl.find(key); - } - - template - inline typename RefPtrHashMap::const_iterator RefPtrHashMap::find(RawKeyType key) const - { - return m_impl.template find(key); - } - - template - inline bool RefPtrHashMap::contains(const KeyType& key) const - { - return m_impl.contains(key); - } - - template - inline bool RefPtrHashMap::contains(RawKeyType key) const - { - return m_impl.template contains(key); - } - - template - inline pair::iterator, bool> - RefPtrHashMap::inlineAdd(const KeyType& key, const MappedType& mapped) - { - typedef HashMapTranslator TranslatorType; - pair p = m_impl.template add(key, mapped); -// typename RefPtrHashMap::iterator temp = p.first; - return std::pair::iterator, bool>( - typename RefPtrHashMap::iterator(p.first), p.second); - -// return m_impl.template add(key, mapped); - } - - template - inline pair::iterator, bool> - RefPtrHashMap::inlineAdd(RawKeyType key, const MappedType& mapped) - { - pair p = m_impl.template add(key, mapped); - return std::pair::iterator, bool>( - typename RefPtrHashMap::iterator(p.first), p.second); - - // return m_impl.template add(key, mapped); - } - - template - pair::iterator, bool> - RefPtrHashMap::set(const KeyType& key, const MappedType& mapped) - { - pair result = inlineAdd(key, mapped); - if (!result.second) { - // add call above didn't change anything, so set the mapped value - result.first->second = mapped; - } - return result; - } - - template - pair::iterator, bool> - RefPtrHashMap::set(RawKeyType key, const MappedType& mapped) - { - pair result = inlineAdd(key, mapped); - if (!result.second) { - // add call above didn't change anything, so set the mapped value - result.first->second = mapped; - } - return result; - } - - template - pair::iterator, bool> - RefPtrHashMap::add(const KeyType& key, const MappedType& mapped) - { - return inlineAdd(key, mapped); - } - - template - pair::iterator, bool> - RefPtrHashMap::add(RawKeyType key, const MappedType& mapped) - { - return inlineAdd(key, mapped); - } - - template - typename RefPtrHashMap::MappedType - RefPtrHashMap::get(const KeyType& key) const - { - ValueType* entry = const_cast(m_impl).lookup(key); - if (!entry) - return MappedTraits::emptyValue(); - return entry->second; - } - - template - typename RefPtrHashMap::MappedType - inline RefPtrHashMap::inlineGet(RawKeyType key) const - { - ValueType* entry = const_cast(m_impl).template lookup(key); - if (!entry) - return MappedTraits::emptyValue(); - return entry->second; - } - - template - typename RefPtrHashMap::MappedType - RefPtrHashMap::get(RawKeyType key) const - { - return inlineGet(key); - } - - template - inline void RefPtrHashMap::remove(iterator it) - { - if (it.m_impl == m_impl.end()) - return; - m_impl.checkTableConsistency(); - m_impl.removeWithoutEntryConsistencyCheck(it.m_impl); - } - - template - inline void RefPtrHashMap::remove(const KeyType& key) - { - remove(find(key)); - } - - template - inline void RefPtrHashMap::remove(RawKeyType key) - { - remove(find(key)); - } - - template - inline void RefPtrHashMap::clear() - { - m_impl.clear(); - } - - template - typename RefPtrHashMap::MappedType - RefPtrHashMap::take(const KeyType& key) - { - // This can probably be made more efficient to avoid ref/deref churn. - iterator it = find(key); - if (it == end()) - return MappedTraits::emptyValue(); - typename RefPtrHashMap::MappedType result = it->second; - remove(it); - return result; - } - - template - typename RefPtrHashMap::MappedType - RefPtrHashMap::take(RawKeyType key) - { - // This can probably be made more efficient to avoid ref/deref churn. - iterator it = find(key); - if (it == end()) - return MappedTraits::emptyValue(); - typename RefPtrHashMap::MappedType result = it->second; - remove(it); - return result; - } - -} // namespace WTF diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/UnusedParam.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/UnusedParam.h deleted file mode 100644 index 996f5c856..000000000 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/UnusedParam.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef WTF_UnusedParam_h -#define WTF_UnusedParam_h - -/* don't use this for C++, it should only be used in plain C files or - ObjC methods, where leaving off the parameter name is not allowed. */ - -#define UNUSED_PARAM(x) (void)x - -#endif /* WTF_UnusedParam_h */ -- 2.11.0