GenericArguments.h [plain text]
#pragma once
#include "CagedBarrierPtr.h"
#include "JSObject.h"
namespace JSC {
template<typename Type>
class GenericArguments : public JSNonFinalObject {
public:
typedef JSNonFinalObject Base;
static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetOwnPropertyNames | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero;
protected:
GenericArguments(VM& vm, Structure* structure)
: Base(vm, structure)
{
}
static void visitChildren(JSCell*, SlotVisitor&);
static bool getOwnPropertySlot(JSObject*, JSGlobalObject*, PropertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSObject*, JSGlobalObject*, unsigned propertyName, PropertySlot&);
static void getOwnPropertyNames(JSObject*, JSGlobalObject*, PropertyNameArray&, DontEnumPropertiesMode);
static bool put(JSCell*, JSGlobalObject*, PropertyName, JSValue, PutPropertySlot&);
static bool putByIndex(JSCell*, JSGlobalObject*, unsigned propertyName, JSValue, bool shouldThrow);
static bool deleteProperty(JSCell*, JSGlobalObject*, PropertyName, DeletePropertySlot&);
static bool deletePropertyByIndex(JSCell*, JSGlobalObject*, unsigned propertyName);
static bool defineOwnProperty(JSObject*, JSGlobalObject*, PropertyName, const PropertyDescriptor&, bool shouldThrow);
void initModifiedArgumentsDescriptor(JSGlobalObject*, unsigned length);
void initModifiedArgumentsDescriptorIfNecessary(JSGlobalObject*, unsigned length);
void setModifiedArgumentDescriptor(JSGlobalObject*, unsigned index, unsigned length);
bool isModifiedArgumentDescriptor(unsigned index, unsigned length);
void copyToArguments(JSGlobalObject*, JSValue* firstElementDest, unsigned offset, unsigned length);
using ModifiedArgumentsPtr = CagedBarrierPtr<Gigacage::Primitive, bool>;
ModifiedArgumentsPtr m_modifiedArgumentsDescriptor;
};
}