summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/PropertySlot.h
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-27 16:23:55 +0100
committerSteve Block <steveblock@google.com>2010-04-27 17:07:03 +0100
commit692e5dbf12901edacf14812a6fae25462920af42 (patch)
treed62802373a429e0a9dc093b6046c166b2c514285 /JavaScriptCore/runtime/PropertySlot.h
parente24bea4efef1c414137d36a9778aa4e142e10c7d (diff)
downloadexternal_webkit-692e5dbf12901edacf14812a6fae25462920af42.zip
external_webkit-692e5dbf12901edacf14812a6fae25462920af42.tar.gz
external_webkit-692e5dbf12901edacf14812a6fae25462920af42.tar.bz2
Merge webkit.org at r55033 : Initial merge by git
Change-Id: I98a4af828067cc243ec3dc5e5826154dd88074b5
Diffstat (limited to 'JavaScriptCore/runtime/PropertySlot.h')
-rw-r--r--JavaScriptCore/runtime/PropertySlot.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/JavaScriptCore/runtime/PropertySlot.h b/JavaScriptCore/runtime/PropertySlot.h
index 15d9034..a364e42 100644
--- a/JavaScriptCore/runtime/PropertySlot.h
+++ b/JavaScriptCore/runtime/PropertySlot.h
@@ -71,7 +71,9 @@ namespace JSC {
return m_getValue(exec, Identifier::from(exec, propertyName), *this);
}
- bool isCacheable() const { return m_offset != WTF::notFound; }
+ bool isGetter() const { return m_isGetter; }
+ bool isCacheable() const { return m_isCacheable; }
+ bool isCacheableValue() const { return m_isCacheable && !m_isGetter; }
size_t cachedOffset() const
{
ASSERT(isCacheable());
@@ -102,6 +104,8 @@ namespace JSC {
m_slotBase = slotBase;
m_data.valueSlot = valueSlot;
m_offset = offset;
+ m_isCacheable = true;
+ m_isGetter = false;
}
void setValue(JSValue value)
@@ -139,14 +143,28 @@ namespace JSC {
m_slotBase = slotBase;
m_data.index = index;
}
-
+
void setGetterSlot(JSObject* getterFunc)
{
ASSERT(getterFunc);
+ m_thisValue = m_slotBase;
m_getValue = functionGetter;
m_data.getterFunc = getterFunc;
+ m_isGetter = true;
}
-
+
+ void setCacheableGetterSlot(JSValue slotBase, JSObject* getterFunc, unsigned offset)
+ {
+ ASSERT(getterFunc);
+ m_getValue = functionGetter;
+ m_thisValue = m_slotBase;
+ m_slotBase = slotBase;
+ m_data.getterFunc = getterFunc;
+ m_offset = offset;
+ m_isCacheable = true;
+ m_isGetter = true;
+ }
+
void setUndefined()
{
setValue(jsUndefined());
@@ -182,11 +200,14 @@ namespace JSC {
{
// Clear offset even in release builds, in case this PropertySlot has been used before.
// (For other data members, we don't need to clear anything because reuse would meaningfully overwrite them.)
- m_offset = WTF::notFound;
+ m_offset = 0;
+ m_isCacheable = false;
+ m_isGetter = false;
}
unsigned index() const { return m_data.index; }
+ JSValue thisValue() const { return m_thisValue; }
private:
static JSValue functionGetter(ExecState*, const Identifier&, const PropertySlot&);
@@ -201,8 +222,11 @@ namespace JSC {
} m_data;
JSValue m_value;
+ JSValue m_thisValue;
size_t m_offset;
+ bool m_isCacheable : 1;
+ bool m_isGetter : 1;
};
} // namespace JSC