namespace JSC {
class JSObject;
+ class JSFunction;
class PutPropertySlot {
public:
- enum Type { Invalid, ExistingProperty, NewProperty };
+ enum Type { Uncachable, ExistingProperty, NewProperty };
- PutPropertySlot()
- : m_type(Invalid)
+ PutPropertySlot(bool isStrictMode = false)
+ : m_type(Uncachable)
, m_base(0)
- , m_wasTransition(false)
+ , m_isStrictMode(isStrictMode)
{
}
- void setExistingProperty(JSObject* base, size_t offset)
+ void setExistingProperty(JSObject* base, PropertyOffset offset)
{
m_type = ExistingProperty;
m_base = base;
m_offset = offset;
}
- void setNewProperty(JSObject* base, size_t offset)
+ void setNewProperty(JSObject* base, PropertyOffset offset)
{
m_type = NewProperty;
m_base = base;
Type type() const { return m_type; }
JSObject* base() const { return m_base; }
- bool isCacheable() const { return m_type != Invalid; }
- size_t cachedOffset() const {
+ bool isStrictMode() const { return m_isStrictMode; }
+ bool isCacheable() const { return m_type != Uncachable; }
+ PropertyOffset cachedOffset() const
+ {
ASSERT(isCacheable());
return m_offset;
}
-
- bool wasTransition() const { return m_wasTransition; }
- void setWasTransition(bool wasTransition) { m_wasTransition = wasTransition; }
+
private:
Type m_type;
JSObject* m_base;
- bool m_wasTransition;
- size_t m_offset;
+ PropertyOffset m_offset;
+ bool m_isStrictMode;
};
} // namespace JSC