зеркало из https://github.com/mozilla/gecko-dev.git
Bug 836301 - Add tracking for whether we have a non-trivial enter() trap. r=mrbkap
This will allow us to skip the virtual function call for non-security-wrapper proxies, which are the cases where we care most about performance.
This commit is contained in:
Родитель
f27050fcfb
Коммит
0418ad061b
|
@ -51,7 +51,8 @@ GetFunctionProxyConstruct(UnrootedObject proxy)
|
|||
|
||||
BaseProxyHandler::BaseProxyHandler(void *family)
|
||||
: mFamily(family),
|
||||
mHasPrototype(false)
|
||||
mHasPrototype(false),
|
||||
mHasPolicy(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -51,9 +51,11 @@ class JS_FRIEND_API(Wrapper);
|
|||
class JS_FRIEND_API(BaseProxyHandler) {
|
||||
void *mFamily;
|
||||
bool mHasPrototype;
|
||||
bool mHasPolicy;
|
||||
protected:
|
||||
// Subclasses may set this in their constructor.
|
||||
void setHasPrototype(bool aHasPrototype) { mHasPrototype = aHasPrototype; }
|
||||
void setHasPolicy(bool aHasPolicy) { mHasPolicy = aHasPolicy; }
|
||||
|
||||
public:
|
||||
explicit BaseProxyHandler(void *family);
|
||||
|
@ -63,6 +65,10 @@ class JS_FRIEND_API(BaseProxyHandler) {
|
|||
return mHasPrototype;
|
||||
}
|
||||
|
||||
bool hasPolicy() {
|
||||
return mHasPolicy;
|
||||
}
|
||||
|
||||
inline void *family() {
|
||||
return mFamily;
|
||||
}
|
||||
|
|
|
@ -838,6 +838,7 @@ SecurityWrapper<Base>::SecurityWrapper(unsigned flags)
|
|||
: Base(flags)
|
||||
{
|
||||
Base::setSafeToUnwrap(false);
|
||||
BaseProxyHandler::setHasPolicy(true);
|
||||
}
|
||||
|
||||
template <class Base>
|
||||
|
|
Загрузка…
Ссылка в новой задаче