Fix for bug 560462 (Use fast unwrapping for more quickstubs), part 3a. r=jst.

This commit is contained in:
Peter Van der Beken 2010-04-19 17:41:39 +02:00
Родитель 722a3b681e
Коммит a41f86cd3d
7 изменённых файлов: 37 добавлений и 19 удалений

Просмотреть файл

@ -193,6 +193,8 @@ static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID);
// FOR CSP (autogenerated by xpidl)
#include "nsIContentSecurityPolicy.h"
#include "nsHTMLStyleSheet.h"
#include "nsHTMLCSSStyleSheet.h"
#include "mozilla/dom/Link.h"
using namespace mozilla::dom;

Просмотреть файл

@ -95,13 +95,7 @@
#include "nsGkAtoms.h"
#include "nsIApplicationCache.h"
#include "nsIApplicationCacheContainer.h"
// Put these here so all document impls get them automatically
#include "nsHTMLStyleSheet.h"
#include "nsHTMLCSSStyleSheet.h"
#include "nsStyleSet.h"
#include "nsXMLEventsManager.h"
#include "pldhash.h"
#include "nsAttrAndChildArray.h"
#include "nsDOMAttributeMap.h"
@ -135,6 +129,9 @@ struct nsRadioGroupStruct;
class nsOnloadBlocker;
class nsUnblockOnloadEvent;
class nsChildContentList;
class nsXMLEventsManager;
class nsHTMLStyleSheet;
class nsHTMLCSSStyleSheet;
/**
* Right now our identifier map entries contain information for 'name'

Просмотреть файл

@ -74,16 +74,20 @@ enum nsDOMClassInfoID {
* to that interface from the *canonical* nsISupports!
*/
#define DOMCI_CASTABLE_INTERFACES(_extra) \
DOMCI_CASTABLE_INTERFACE(nsINode, 0, _extra) \
DOMCI_CASTABLE_INTERFACE(nsIContent, 1, _extra) \
DOMCI_CASTABLE_INTERFACE(nsIDocument, 2, _extra) \
DOMCI_CASTABLE_INTERFACE(nsINodeList, 3, _extra) \
DOMCI_CASTABLE_INTERFACE(nsICSSDeclaration, 4, _extra) \
DOMCI_CASTABLE_INTERFACE(nsGenericTextNode, 5, _extra)
DOMCI_CASTABLE_INTERFACE(nsINode, nsINode, 0, _extra) \
DOMCI_CASTABLE_INTERFACE(nsIContent, nsIContent, 1, _extra) \
DOMCI_CASTABLE_INTERFACE(nsIDocument, nsIDocument, 2, _extra) \
DOMCI_CASTABLE_INTERFACE(nsINodeList, nsINodeList, 3, _extra) \
DOMCI_CASTABLE_INTERFACE(nsICSSDeclaration, nsICSSDeclaration, 4, _extra) \
DOMCI_CASTABLE_INTERFACE(nsGenericTextNode, nsGenericTextNode, 5, _extra) \
DOMCI_CASTABLE_INTERFACE(nsDocument, nsIDocument, 6, _extra) \
DOMCI_CASTABLE_INTERFACE(nsGenericHTMLElement, nsGenericHTMLElement, 7, \
_extra) \
DOMCI_CASTABLE_INTERFACE(nsHTMLDocument, nsIDocument, 8, _extra)
// Make sure all classes mentioned in DOMCI_CASTABLE_INTERFACES
// have been declared.
#define DOMCI_CASTABLE_INTERFACE(_interface, _u1, _u2) class _interface;
#define DOMCI_CASTABLE_INTERFACE(_interface, _u1, _u2, _u3) class _interface;
DOMCI_CASTABLE_INTERFACES(unused)
#undef DOMCI_CASTABLE_INTERFACE
@ -135,7 +139,7 @@ template <typename Interface> struct DOMCI_CastableTo {
/**
* Here we calculate the bitmap for a given class.
*/
#define DOMCI_CASTABLE_INTERFACE(_interface, _bit, _class) \
#define DOMCI_CASTABLE_INTERFACE(_interface, _base, _bit, _class) \
(DOMCI_CASTABLE_TO(_interface, _class) ? 1 << _bit : 0) +
#define DOMCI_DATA(_dom_class, _class) \

Просмотреть файл

@ -121,6 +121,9 @@ LOCAL_INCLUDES = \
-I$(topsrcdir)/js/src/nanojit \
-I$(topsrcdir)/caps/include \
-I$(topsrcdir)/content/base/src \
-I$(topsrcdir)/content/html/content/src \
-I$(topsrcdir)/content/html/document/src \
-I$(topsrcdir)/layout/style \
$(NULL)
EXTRA_DSO_LDOPTS += \

Просмотреть файл

@ -501,8 +501,11 @@ customIncludes = [
'nsIDocument.h',
'nsINodeList.h',
'nsCSSPropertiesQS.h',
'nsDocument.h',
'nsGenericDOMDataNode.h',
'nsGenericElement.h',
'nsGenericHTMLElement.h',
'nsHTMLDocument.h',
'nsDOMQS.h',
]

Просмотреть файл

@ -39,7 +39,7 @@
#include "nsDOMClassInfoID.h"
#define DEFINE_UNWRAP_CAST(_interface, _bit) \
#define DEFINE_UNWRAP_CAST(_interface, _base, _bit) \
NS_SPECIALIZE_TEMPLATE \
inline JSBool \
xpc_qsUnwrapThis<_interface>(JSContext *cx, \
@ -56,7 +56,7 @@ xpc_qsUnwrapThis<_interface>(JSContext *cx, \
&rv); \
if(!native) \
return xpc_qsThrow(cx, rv); \
*ppThis = static_cast<_interface*>(native); \
*ppThis = static_cast<_interface*>(static_cast<_base*>(native)); \
return JS_TRUE; \
} \
\
@ -72,12 +72,12 @@ xpc_qsUnwrapArg<_interface>(JSContext *cx, \
nsISupports *native = castNativeArgFromWrapper(cx, v, _bit, ppArgRef, vp, \
&rv); \
if(NS_SUCCEEDED(rv)) \
*ppArg = static_cast<_interface*>(native); \
*ppArg = static_cast<_interface*>(static_cast<_base*>(native)); \
return rv; \
}
#define DOMCI_CASTABLE_INTERFACE(_interface, _bit, _extra) \
DEFINE_UNWRAP_CAST(_interface, _bit)
#define DOMCI_CASTABLE_INTERFACE(_interface, _base, _bit, _extra) \
DEFINE_UNWRAP_CAST(_interface, _base, _bit)
DOMCI_CASTABLE_INTERFACES(unused)
@ -139,4 +139,10 @@ xpc_qsUnwrapArg<nsGenericElement>(JSContext *cx,
return rv;
}
inline nsISupports*
ToSupports(nsContentList *p)
{
return static_cast<nsINodeList*>(p);
}
#endif /* nsDOMQS_h__ */

Просмотреть файл

@ -389,6 +389,7 @@ class nsStyleSet
};
#ifdef _IMPL_NS_LAYOUT
inline
void nsRuleNode::AddRef()
{
@ -405,3 +406,5 @@ void nsRuleNode::Release()
}
}
#endif
#endif