Reduce the size of tokens. b=113657, r=heikki, sr=jst

This commit is contained in:
harishd%netscape.com 2002-01-11 19:39:57 +00:00
Родитель 6f2a5a0699
Коммит 8cd8ea8a25
8 изменённых файлов: 72 добавлений и 98 удалений

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

@ -126,8 +126,6 @@ class CStartToken: public CHTMLToken {
virtual const char* GetClassName(void);
virtual PRInt32 GetTokenType(void);
PRBool IsAttributed(void);
void SetAttributed(PRBool aValue);
PRBool IsEmpty(void);
void SetEmpty(PRBool aValue);
#ifdef DEBUG
@ -154,13 +152,13 @@ class CStartToken: public CHTMLToken {
nsString mTextValue;
nsString mTrailingContent;
PRInt32 mOrigin;
protected:
PRBool mAttributed;
PRBool mEmpty;
protected:
eContainerInfo mContainerInfo;
nsCOMPtr<nsIAtom> mIDAttributeAtom;
PRPackedBool mEmpty;
#ifdef DEBUG
PRPackedBool mAttributed;
#endif
};
@ -379,12 +377,14 @@ class CAttributeToken: public CHTMLToken {
#ifdef DEBUG
virtual void DebugDumpSource(nsOutputStream& out);
#endif
PRBool mLastAttribute;
PRBool mHasEqualWithoutValue;
PRPackedBool mHasEqualWithoutValue;
protected:
nsAutoString mTextValue;
nsSlidingSubstring mTextKey;
nsAutoString mTextValue;
nsSlidingSubstring mTextKey;
#ifdef DEBUG
PRPackedBool mLastAttribute;
#endif
};

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

@ -278,7 +278,6 @@ class CToken {
static int GetTokenCount();
eTokenOrigin mOrigin;
PRInt32 mNewlineCount;
protected:
@ -287,9 +286,9 @@ protected:
*/
virtual size_t SizeOf() const = 0;
PRInt32 mTypeID;
PRInt16 mAttrCount;
PRInt32 mUseCount;
PRInt32 mTypeID;
PRInt32 mUseCount;
PRInt16 mAttrCount;
};

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

@ -90,26 +90,29 @@ CHTMLToken::~CHTMLToken() {
* @return
*/
CStartToken::CStartToken(eHTMLTags aTag) : CHTMLToken(aTag) {
mAttributed=PR_FALSE;
mEmpty=PR_FALSE;
mOrigin=-1;
mContainerInfo=eFormUnknown;
#ifdef DEBUG
mAttributed = PR_FALSE;
#endif
}
CStartToken::CStartToken(const nsAReadableString& aName) : CHTMLToken(eHTMLTag_unknown) {
mAttributed=PR_FALSE;
mEmpty=PR_FALSE;
mOrigin=-1;
mContainerInfo=eFormUnknown;
mTextValue.Assign(aName);
#ifdef DEBUG
mAttributed = PR_FALSE;
#endif
}
CStartToken::CStartToken(const nsAReadableString& aName,eHTMLTags aTag) : CHTMLToken(aTag) {
mAttributed=PR_FALSE;
mEmpty=PR_FALSE;
mOrigin=-1;
mContainerInfo=eFormUnknown;
mTextValue.Assign(aName);
#ifdef DEBUG
mAttributed = PR_FALSE;
#endif
}
nsresult CStartToken::GetIDAttributeAtom(nsIAtom** aResult)
@ -167,28 +170,6 @@ PRInt32 CStartToken::GetTokenType(void) {
return eToken_start;
}
/*
*
*
* @update gess 3/25/98
* @param
* @return
*/
void CStartToken::SetAttributed(PRBool aValue) {
mAttributed=aValue;
}
/*
*
*
* @update gess 3/25/98
* @param
* @return
*/
PRBool CStartToken::IsAttributed(void) {
return mAttributed;
}
/*
*
*
@ -1350,8 +1331,10 @@ nsresult CNewlineToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aFl
* @return
*/
CAttributeToken::CAttributeToken() : CHTMLToken(eHTMLTag_unknown) {
mLastAttribute=PR_FALSE;
mHasEqualWithoutValue=PR_FALSE;
#ifdef DEBUG
mLastAttribute = PR_FALSE;
#endif
}
/*
@ -1363,8 +1346,10 @@ CAttributeToken::CAttributeToken() : CHTMLToken(eHTMLTag_unknown) {
*/
CAttributeToken::CAttributeToken(const nsAReadableString& aName) : CHTMLToken(eHTMLTag_unknown) {
mTextValue.Assign(aName);
mLastAttribute=PR_FALSE;
mHasEqualWithoutValue=PR_FALSE;
#ifdef DEBUG
mLastAttribute = PR_FALSE;
#endif
}
/*
@ -1378,8 +1363,10 @@ CAttributeToken::CAttributeToken(const nsAReadableString& aName) : CHTMLToken(eH
CAttributeToken::CAttributeToken(const nsAReadableString& aKey, const nsAReadableString& aName) : CHTMLToken(eHTMLTag_unknown) {
mTextValue.Assign(aName);
mTextKey.Rebind(aKey);
mLastAttribute=PR_FALSE;
mHasEqualWithoutValue=PR_FALSE;
#ifdef DEBUG
mLastAttribute = PR_FALSE;
#endif
}
/*
@ -1771,7 +1758,9 @@ nsresult CAttributeToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 a
if (NS_OK==result) {
result=aScanner.Peek(aChar);
mLastAttribute= PRBool((kGreaterThan==aChar) || (kEOF==result));
#ifdef DEBUG
mLastAttribute = (kGreaterThan == aChar || kEOF == result);
#endif
}
}//if
return result;

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

@ -68,7 +68,6 @@ CToken::CToken(PRInt32 aTag) {
mAttrCount=0;
mNewlineCount=0;
mTypeID=aTag;
mOrigin=eSource;
// Note that the use count starts with 1 instead of 0. This
// is because of the assumption that any token created is in
// use and therefore does not require an explicit addref, or

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

@ -126,8 +126,6 @@ class CStartToken: public CHTMLToken {
virtual const char* GetClassName(void);
virtual PRInt32 GetTokenType(void);
PRBool IsAttributed(void);
void SetAttributed(PRBool aValue);
PRBool IsEmpty(void);
void SetEmpty(PRBool aValue);
#ifdef DEBUG
@ -154,13 +152,13 @@ class CStartToken: public CHTMLToken {
nsString mTextValue;
nsString mTrailingContent;
PRInt32 mOrigin;
protected:
PRBool mAttributed;
PRBool mEmpty;
protected:
eContainerInfo mContainerInfo;
nsCOMPtr<nsIAtom> mIDAttributeAtom;
PRPackedBool mEmpty;
#ifdef DEBUG
PRPackedBool mAttributed;
#endif
};
@ -379,12 +377,14 @@ class CAttributeToken: public CHTMLToken {
#ifdef DEBUG
virtual void DebugDumpSource(nsOutputStream& out);
#endif
PRBool mLastAttribute;
PRBool mHasEqualWithoutValue;
PRPackedBool mHasEqualWithoutValue;
protected:
nsAutoString mTextValue;
nsSlidingSubstring mTextKey;
nsAutoString mTextValue;
nsSlidingSubstring mTextKey;
#ifdef DEBUG
PRPackedBool mLastAttribute;
#endif
};

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

@ -278,7 +278,6 @@ class CToken {
static int GetTokenCount();
eTokenOrigin mOrigin;
PRInt32 mNewlineCount;
protected:
@ -287,9 +286,9 @@ protected:
*/
virtual size_t SizeOf() const = 0;
PRInt32 mTypeID;
PRInt16 mAttrCount;
PRInt32 mUseCount;
PRInt32 mTypeID;
PRInt32 mUseCount;
PRInt16 mAttrCount;
};

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

@ -90,26 +90,29 @@ CHTMLToken::~CHTMLToken() {
* @return
*/
CStartToken::CStartToken(eHTMLTags aTag) : CHTMLToken(aTag) {
mAttributed=PR_FALSE;
mEmpty=PR_FALSE;
mOrigin=-1;
mContainerInfo=eFormUnknown;
#ifdef DEBUG
mAttributed = PR_FALSE;
#endif
}
CStartToken::CStartToken(const nsAReadableString& aName) : CHTMLToken(eHTMLTag_unknown) {
mAttributed=PR_FALSE;
mEmpty=PR_FALSE;
mOrigin=-1;
mContainerInfo=eFormUnknown;
mTextValue.Assign(aName);
#ifdef DEBUG
mAttributed = PR_FALSE;
#endif
}
CStartToken::CStartToken(const nsAReadableString& aName,eHTMLTags aTag) : CHTMLToken(aTag) {
mAttributed=PR_FALSE;
mEmpty=PR_FALSE;
mOrigin=-1;
mContainerInfo=eFormUnknown;
mTextValue.Assign(aName);
#ifdef DEBUG
mAttributed = PR_FALSE;
#endif
}
nsresult CStartToken::GetIDAttributeAtom(nsIAtom** aResult)
@ -167,28 +170,6 @@ PRInt32 CStartToken::GetTokenType(void) {
return eToken_start;
}
/*
*
*
* @update gess 3/25/98
* @param
* @return
*/
void CStartToken::SetAttributed(PRBool aValue) {
mAttributed=aValue;
}
/*
*
*
* @update gess 3/25/98
* @param
* @return
*/
PRBool CStartToken::IsAttributed(void) {
return mAttributed;
}
/*
*
*
@ -1350,8 +1331,10 @@ nsresult CNewlineToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aFl
* @return
*/
CAttributeToken::CAttributeToken() : CHTMLToken(eHTMLTag_unknown) {
mLastAttribute=PR_FALSE;
mHasEqualWithoutValue=PR_FALSE;
#ifdef DEBUG
mLastAttribute = PR_FALSE;
#endif
}
/*
@ -1363,8 +1346,10 @@ CAttributeToken::CAttributeToken() : CHTMLToken(eHTMLTag_unknown) {
*/
CAttributeToken::CAttributeToken(const nsAReadableString& aName) : CHTMLToken(eHTMLTag_unknown) {
mTextValue.Assign(aName);
mLastAttribute=PR_FALSE;
mHasEqualWithoutValue=PR_FALSE;
#ifdef DEBUG
mLastAttribute = PR_FALSE;
#endif
}
/*
@ -1378,8 +1363,10 @@ CAttributeToken::CAttributeToken(const nsAReadableString& aName) : CHTMLToken(eH
CAttributeToken::CAttributeToken(const nsAReadableString& aKey, const nsAReadableString& aName) : CHTMLToken(eHTMLTag_unknown) {
mTextValue.Assign(aName);
mTextKey.Rebind(aKey);
mLastAttribute=PR_FALSE;
mHasEqualWithoutValue=PR_FALSE;
#ifdef DEBUG
mLastAttribute = PR_FALSE;
#endif
}
/*
@ -1771,7 +1758,9 @@ nsresult CAttributeToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 a
if (NS_OK==result) {
result=aScanner.Peek(aChar);
mLastAttribute= PRBool((kGreaterThan==aChar) || (kEOF==result));
#ifdef DEBUG
mLastAttribute = (kGreaterThan == aChar || kEOF == result);
#endif
}
}//if
return result;

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

@ -68,7 +68,6 @@ CToken::CToken(PRInt32 aTag) {
mAttrCount=0;
mNewlineCount=0;
mTypeID=aTag;
mOrigin=eSource;
// Note that the use count starts with 1 instead of 0. This
// is because of the assumption that any token created is in
// use and therefore does not require an explicit addref, or