зеркало из https://github.com/mozilla/pjs.git
Bug 748119 - Read barrier for js::types::Type (r=bhackett)
This commit is contained in:
Родитель
9a18b49704
Коммит
b7849cd8a0
|
@ -107,10 +107,7 @@ class Type
|
|||
return data > JSVAL_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
TypeObjectKey *objectKey() const {
|
||||
JS_ASSERT(isObject());
|
||||
return (TypeObjectKey *) data;
|
||||
}
|
||||
inline TypeObjectKey *objectKey() const;
|
||||
|
||||
/* Accessors for JSObject types */
|
||||
|
||||
|
@ -118,10 +115,7 @@ class Type
|
|||
return isObject() && !!(data & 1);
|
||||
}
|
||||
|
||||
JSObject *singleObject() const {
|
||||
JS_ASSERT(isSingleObject());
|
||||
return (JSObject *) (data ^ 1);
|
||||
}
|
||||
inline JSObject *singleObject() const;
|
||||
|
||||
/* Accessors for TypeObject types */
|
||||
|
||||
|
@ -129,10 +123,7 @@ class Type
|
|||
return isObject() && !(data & 1);
|
||||
}
|
||||
|
||||
TypeObject *typeObject() const {
|
||||
JS_ASSERT(isTypeObject());
|
||||
return (TypeObject *) data;
|
||||
}
|
||||
inline TypeObject *typeObject() const;
|
||||
|
||||
bool operator == (Type o) const { return data == o.data; }
|
||||
bool operator != (Type o) const { return data != o.data; }
|
||||
|
|
|
@ -1014,6 +1014,33 @@ HashSetLookup(U **values, unsigned count, T key)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
inline TypeObjectKey *
|
||||
Type::objectKey() const
|
||||
{
|
||||
JS_ASSERT(isObject());
|
||||
if (isTypeObject())
|
||||
TypeObject::readBarrier((TypeObject *) data);
|
||||
else
|
||||
JSObject::readBarrier((JSObject *) (data ^ 1));
|
||||
return (TypeObjectKey *) data;
|
||||
}
|
||||
|
||||
inline JSObject *
|
||||
Type::singleObject() const
|
||||
{
|
||||
JS_ASSERT(isSingleObject());
|
||||
JSObject::readBarrier((JSObject *) (data ^ 1));
|
||||
return (JSObject *) (data ^ 1);
|
||||
}
|
||||
|
||||
inline TypeObject *
|
||||
Type::typeObject() const
|
||||
{
|
||||
JS_ASSERT(isTypeObject());
|
||||
TypeObject::readBarrier((TypeObject *) data);
|
||||
return (TypeObject *) data;
|
||||
}
|
||||
|
||||
inline bool
|
||||
TypeSet::hasType(Type type)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче