#include "JSGlobalObject.h"
#include "JSValue.h"
#include <wtf/Platform.h>
-#include <wtf/UnusedParam.h>
namespace JSC {
class ExecState;
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<JSC::JSCell*>(const_cast<OpaqueJSValue*>(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<JSC::JSCell*>(const_cast<OpaqueJSValue*>(v));
return reinterpret_cast<JSValueRef>(JSC::jsAPIValueWrapper(exec, v).asCell());
return reinterpret_cast<JSValueRef>(v.asCell());
#else
- UNUSED_PARAM(exec);
+ Q_UNUSED(exec);
return reinterpret_cast<JSValueRef>(JSC::JSValue::encode(v));
#endif
}
// 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;
}
#include <MacroAssemblerCodeRef.h>
#include <CodeLocation.h>
#include <wtf/Noncopyable.h>
-#include <wtf/UnusedParam.h>
#if ENABLE(ASSEMBLER)
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();
}
// (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();
}
#include "ExecutableAllocator.h"
#include "PassRefPtr.h"
#include "RefPtr.h"
-#include "UnusedParam.h"
#if ENABLE(ASSEMBLER)
{
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;
}
{
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);
}
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);
}
QMutexLocker locker(m_scriptSampleMapMutex);
m_scopeSampleMap->set(script, new ScriptSampleRecord(script));
#else
- UNUSED_PARAM(script);
+ Q_UNUSED(script);
#endif
}
// 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];
continue;
OpcodeID opcodeID = opcodeSampleInfo[i].opcode;
-
+
const char* opcodeName = opcodeNames[opcodeID];
const char* opcodePadding = padOpcodeName(opcodeID, 28);
double percentOfVM = (static_cast<double>(count) * 100) / m_opcodeSampleCount;
}
}
#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()
{
}
void setup();
+#if ENABLE(OPCODE_SAMPLING)
void dump(ExecState*);
+#endif
void notifyOfScope(ScriptExecutable* scope);
#ifndef NDEBUG
s_dumpsGeneratedCode = dumpsGeneratedCode;
#else
- UNUSED_PARAM(dumpsGeneratedCode);
+ Q_UNUSED(dumpsGeneratedCode);
#endif
}
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<NumberNode*>(node)->value();
int32_t key = static_cast<int32_t>(value);
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<StringNode*>(node)->value().ustring().rep();
Q_ASSERT(clause->size() == 1);
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;
#if ENABLE(JIT)
return codeBlock->getBytecodeIndex(callFrame, ReturnAddressPtr(pc));
#else
- UNUSED_PARAM(callFrame);
+ Q_UNUSED(callFrame);
return static_cast<Instruction*>(pc) - codeBlock->instructions().begin();
#endif
}
if (m_sampler)
m_sampler->dump(exec);
#else
- UNUSED_PARAM(exec);
+ Q_UNUSED(exec);
#endif
}
void Interpreter::startSampling()
#include <wtf/Assertions.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
-#include <wtf/UnusedParam.h>
#include <wtf/Vector.h>
#if OS(IPHONE_OS)
void ExecutablePool::systemRelease(const ExecutablePool::Allocation& alloc)
{
int result = munmap(alloc.pages, alloc.size);
- ASSERT_UNUSED(result, !result);
+ Q_UNUSED(result)
+ Q_ASSERT(!result);
}
}
unsigned op2 = currentInstruction[3].u.operand;
#if USE(JSVALUE64)
- UNUSED_PARAM(op1);
- UNUSED_PARAM(op2);
+ Q_UNUSED(op1);
+ Q_UNUSED(op2);
linkSlowCase(iter);
linkSlowCase(iter);
#else
ALWAYS_INLINE void JIT::emitFastArithImmToInt(RegisterID reg)
{
#if USE(JSVALUE64)
- UNUSED_PARAM(reg);
+ Q_UNUSED(reg);
#else
rshift32(Imm32(JSImmediate::IntegerPayloadShift), reg);
#endif
#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
}
#if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
*ctiStringLengthTrampoline = trampolineAt(finalCode, stringLengthBegin);
#else
- UNUSED_PARAM(ctiStringLengthTrampoline);
+ Q_UNUSED(ctiStringLengthTrampoline);
#endif
}
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);
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);
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<SlowCaseEntry>::iterator& iter)
#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;
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)
#include <stdlib.h>
#include <wtf/FastMalloc.h>
#include <wtf/HashCountedSet.h>
-#include <wtf/UnusedParam.h>
#include <wtf/VMTags.h>
#if OS(DARWIN)
{
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);
#include <wtf/DateMath.h>
#include <wtf/MathExtras.h>
#include <wtf/StringExtras.h>
-#include <wtf/UnusedParam.h>
#if HAVE(SYS_PARAM_H)
#include <sys/param.h>
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;
if (SamplingTool* sampler = globalData->interpreter->sampler())
sampler->notifyOfScope(this);
#else
- UNUSED_PARAM(globalData);
+ Q_UNUSED(globalData);
#endif
}
if (SamplingTool* sampler = exec->globalData().interpreter->sampler())
sampler->notifyOfScope(this);
#else
- UNUSED_PARAM(exec);
+ Q_UNUSED(exec);
#endif
}
{
if (!m_evalCodeBlock) {
JSObject* error = compile(exec, scopeChainNode);
- ASSERT_UNUSED(!error, error);
+ Q_UNUSED(error);
+ Q_ASSERT(!error);
}
return *m_evalCodeBlock;
}
{
if (!m_programCodeBlock) {
JSObject* error = compile(exec, scopeChainNode);
- ASSERT_UNUSED(!error, error);
+ Q_UNUSED(error);
+ Q_ASSERT(!error);
}
return *m_programCodeBlock;
}
r = globalData->smallStrings.singleCharacterStringRep(c);
if (r->isIdentifier()) {
#ifndef NDEBUG
- checkSameIdentifierTable(globalData, r);
+ checkSameIdentifierTable(globalData);
#endif
return 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<ThreadIdentifierTableData>* g_identifierTableSpecific = 0;
{
if (r->isIdentifier()) {
#ifndef NDEBUG
- checkSameIdentifierTable(exec, r);
+ checkSameIdentifierTable(exec);
#endif
return r;
}
{
if (r->isIdentifier()) {
#ifndef NDEBUG
- checkSameIdentifierTable(globalData, r);
+ checkSameIdentifierTable(globalData);
#endif
return r;
}
static PassRefPtr<UString::Rep> addSlowCase(ExecState*, UString::Rep* r);
static PassRefPtr<UString::Rep> 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)
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;
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
}
#include "config.h"
#include "JSNotAnObject.h"
-#include <wtf/UnusedParam.h>
-
namespace JSC {
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;
}
// 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
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;
#include "JSObject.h"
#include "Register.h"
#include "SymbolTable.h"
-#include "UnusedParam.h"
#include <wtf/OwnArrayPtr.h>
-#include <wtf/UnusedParam.h>
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;
{
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
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;
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();
{
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())
#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
}
void RegExp::compile(JSGlobalData* globalData)
{
m_regExp = 0;
- UNUSED_PARAM(globalData);
+ Q_UNUSED(globalData);
JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase;
JSRegExpMultilineOption multilineOption = multiline() ? JSRegExpMultiline : JSRegExpSingleLine;
transition->despecifyAllFunctions();
else {
bool removed = transition->despecifyFunction(replaceFunction);
- ASSERT_UNUSED(removed, removed);
+ Q_UNUSED(removed);
+ Q_ASSERT(removed);
}
return transition.release();
} 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 <qglobal.h>
#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
#include <time.h>
#include <wtf/CurrentTime.h>
#include <wtf/Noncopyable.h>
-#include <wtf/UnusedParam.h>
namespace WTF {
using WTF::HashMap;
-#include "RefPtrHashMap.h"
-
#endif /* WTF_HashMap_h */
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
template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
void removeIterator(HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>* it)
{
- typedef HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> HashTableType;
- typedef HashTableConstIterator<Key, Value, Extractor, HashFunctions, Traits, KeyTraits> const_iterator;
-
// Delete iterator from doubly-linked list of iterators.
if (!it->m_table) {
Q_ASSERT(!it->m_next);
+++ /dev/null
-/*
- * 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<typename RawKeyType, typename ValueType, typename ValueTraits, typename HashFunctions>
- 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<typename T, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg>
- class RefPtrHashMap : public FastAllocBase {
- private:
- typedef KeyTraitsArg KeyTraits;
- typedef MappedTraitsArg MappedTraits;
- typedef PairHashTraits<KeyTraits, MappedTraits> 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<KeyType, ValueType, PairFirstExtractor<ValueType>,
- HashFunctions, ValueTraits, KeyTraits> HashTableType;
-
- typedef RefPtrHashMapRawKeyTranslator<RawKeyType, ValueType, ValueTraits, HashFunctions>
- RawKeyTranslator;
-
- public:
- typedef HashTableIteratorAdapter<HashTableType, ValueType> iterator;
- typedef HashTableConstIteratorAdapter<HashTableType, ValueType> 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<iterator, bool> set(const KeyType&, const MappedType&);
- pair<iterator, bool> 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<iterator, bool> add(const KeyType&, const MappedType&);
- pair<iterator, bool> 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<iterator, bool> inlineAdd(const KeyType&, const MappedType&);
- pair<iterator, bool> inlineAdd(RawKeyType, const MappedType&);
-
- HashTableType m_impl;
- };
- template<typename T, typename MappedArg, typename HashArg, typename KeyTraitsArg, typename MappedTraitsArg>
- class HashMap<RefPtr<T>, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> :
- public RefPtrHashMap<T, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg>
- {
- };
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline void RefPtrHashMap<T, U, V, W, X>::swap(RefPtrHashMap& other)
- {
- m_impl.swap(other.m_impl);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline int RefPtrHashMap<T, U, V, W, X>::size() const
- {
- return m_impl.size();
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline int RefPtrHashMap<T, U, V, W, X>::capacity() const
- {
- return m_impl.capacity();
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline bool RefPtrHashMap<T, U, V, W, X>::isEmpty() const
- {
- return m_impl.isEmpty();
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline typename RefPtrHashMap<T, U, V, W, X>::iterator RefPtrHashMap<T, U, V, W, X>::begin()
- {
- return m_impl.begin();
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline typename RefPtrHashMap<T, U, V, W, X>::iterator RefPtrHashMap<T, U, V, W, X>::end()
- {
- return m_impl.end();
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline typename RefPtrHashMap<T, U, V, W, X>::const_iterator RefPtrHashMap<T, U, V, W, X>::begin() const
- {
- return m_impl.begin();
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline typename RefPtrHashMap<T, U, V, W, X>::const_iterator RefPtrHashMap<T, U, V, W, X>::end() const
- {
- return m_impl.end();
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline typename RefPtrHashMap<T, U, V, W, X>::iterator RefPtrHashMap<T, U, V, W, X>::find(const KeyType& key)
- {
- return m_impl.find(key);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline typename RefPtrHashMap<T, U, V, W, X>::iterator RefPtrHashMap<T, U, V, W, X>::find(RawKeyType key)
- {
- return m_impl.template find<RawKeyType, RawKeyTranslator>(key);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline typename RefPtrHashMap<T, U, V, W, X>::const_iterator RefPtrHashMap<T, U, V, W, X>::find(const KeyType& key) const
- {
- return m_impl.find(key);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline typename RefPtrHashMap<T, U, V, W, X>::const_iterator RefPtrHashMap<T, U, V, W, X>::find(RawKeyType key) const
- {
- return m_impl.template find<RawKeyType, RawKeyTranslator>(key);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline bool RefPtrHashMap<T, U, V, W, X>::contains(const KeyType& key) const
- {
- return m_impl.contains(key);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline bool RefPtrHashMap<T, U, V, W, X>::contains(RawKeyType key) const
- {
- return m_impl.template contains<RawKeyType, RawKeyTranslator>(key);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
- RefPtrHashMap<T, U, V, W, X>::inlineAdd(const KeyType& key, const MappedType& mapped)
- {
- typedef HashMapTranslator<ValueType, ValueTraits, HashFunctions> TranslatorType;
- pair<typename HashTableType::iterator, bool> p = m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
-// typename RefPtrHashMap<T, U, V, W, X>::iterator temp = p.first;
- return std::pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>(
- typename RefPtrHashMap<T, U, V, W, X>::iterator(p.first), p.second);
-
-// return m_impl.template add<KeyType, MappedType, TranslatorType>(key, mapped);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
- RefPtrHashMap<T, U, V, W, X>::inlineAdd(RawKeyType key, const MappedType& mapped)
- {
- pair<typename HashTableType::iterator, bool> p = m_impl.template add<RawKeyType, MappedType, RawKeyTranslator>(key, mapped);
- return std::pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>(
- typename RefPtrHashMap<T, U, V, W, X>::iterator(p.first), p.second);
-
- // return m_impl.template add<RawKeyType, MappedType, RawKeyTranslator>(key, mapped);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
- RefPtrHashMap<T, U, V, W, X>::set(const KeyType& key, const MappedType& mapped)
- {
- pair<iterator, bool> 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<typename T, typename U, typename V, typename W, typename X>
- pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
- RefPtrHashMap<T, U, V, W, X>::set(RawKeyType key, const MappedType& mapped)
- {
- pair<iterator, bool> 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<typename T, typename U, typename V, typename W, typename X>
- pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
- RefPtrHashMap<T, U, V, W, X>::add(const KeyType& key, const MappedType& mapped)
- {
- return inlineAdd(key, mapped);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- pair<typename RefPtrHashMap<T, U, V, W, X>::iterator, bool>
- RefPtrHashMap<T, U, V, W, X>::add(RawKeyType key, const MappedType& mapped)
- {
- return inlineAdd(key, mapped);
- }
-
- template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
- RefPtrHashMap<T, U, V, W, MappedTraits>::get(const KeyType& key) const
- {
- ValueType* entry = const_cast<HashTableType&>(m_impl).lookup(key);
- if (!entry)
- return MappedTraits::emptyValue();
- return entry->second;
- }
-
- template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
- inline RefPtrHashMap<T, U, V, W, MappedTraits>::inlineGet(RawKeyType key) const
- {
- ValueType* entry = const_cast<HashTableType&>(m_impl).template lookup<RawKeyType, RawKeyTranslator>(key);
- if (!entry)
- return MappedTraits::emptyValue();
- return entry->second;
- }
-
- template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
- RefPtrHashMap<T, U, V, W, MappedTraits>::get(RawKeyType key) const
- {
- return inlineGet(key);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline void RefPtrHashMap<T, U, V, W, X>::remove(iterator it)
- {
- if (it.m_impl == m_impl.end())
- return;
- m_impl.checkTableConsistency();
- m_impl.removeWithoutEntryConsistencyCheck(it.m_impl);
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline void RefPtrHashMap<T, U, V, W, X>::remove(const KeyType& key)
- {
- remove(find(key));
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline void RefPtrHashMap<T, U, V, W, X>::remove(RawKeyType key)
- {
- remove(find(key));
- }
-
- template<typename T, typename U, typename V, typename W, typename X>
- inline void RefPtrHashMap<T, U, V, W, X>::clear()
- {
- m_impl.clear();
- }
-
- template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
- RefPtrHashMap<T, U, V, W, MappedTraits>::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<T, U, V, W, MappedTraits>::MappedType result = it->second;
- remove(it);
- return result;
- }
-
- template<typename T, typename U, typename V, typename W, typename MappedTraits>
- typename RefPtrHashMap<T, U, V, W, MappedTraits>::MappedType
- RefPtrHashMap<T, U, V, W, MappedTraits>::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<T, U, V, W, MappedTraits>::MappedType result = it->second;
- remove(it);
- return result;
- }
-
-} // namespace WTF
+++ /dev/null
-/*
- * 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 */