Bug 1378983 - Improve the packing of HTMLFormElement; r=mystor

This brings the size of this node to 512 bytes on 64-bit debug builds.
This commit is contained in:
Ehsan Akhgari 2017-07-06 16:57:24 -04:00
Родитель 6684dd79a5
Коммит 23e03fa69b
2 изменённых файлов: 25 добавлений и 24 удалений

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

@ -100,14 +100,6 @@ HTMLFormElement::HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNode
mSelectedRadioButtons(2),
mRequiredRadioButtonCounts(2),
mValueMissingRadioGroups(2),
mGeneratingSubmit(false),
mGeneratingReset(false),
mIsSubmitting(false),
mDeferSubmission(false),
mNotifiedObservers(false),
mNotifiedObserversResult(false),
mSubmitPopupState(openAbused),
mSubmitInitiatedFromUserInput(false),
mPendingSubmission(nullptr),
mSubmittingRequest(nullptr),
mDefaultSubmitElement(nullptr),
@ -115,7 +107,15 @@ HTMLFormElement::HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNode
mFirstSubmitNotInElements(nullptr),
mImageNameLookupTable(FORM_CONTROL_LIST_HASHTABLE_LENGTH),
mPastNameLookupTable(FORM_CONTROL_LIST_HASHTABLE_LENGTH),
mSubmitPopupState(openAbused),
mInvalidElementsCount(0),
mGeneratingSubmit(false),
mGeneratingReset(false),
mIsSubmitting(false),
mDeferSubmission(false),
mNotifiedObservers(false),
mNotifiedObserversResult(false),
mSubmitInitiatedFromUserInput(false),
mEverTriedInvalidSubmit(false)
{
// We start out valid.

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

@ -560,22 +560,6 @@ protected:
nsDataHashtable<nsStringCaseInsensitiveHashKey,uint32_t> mRequiredRadioButtonCounts;
/** The value missing state of each group */
nsDataHashtable<nsStringCaseInsensitiveHashKey,bool> mValueMissingRadioGroups;
/** Whether we are currently processing a submit event or not */
bool mGeneratingSubmit;
/** Whether we are currently processing a reset event or not */
bool mGeneratingReset;
/** Whether we are submitting currently */
bool mIsSubmitting;
/** Whether the submission is to be deferred in case a script triggers it */
bool mDeferSubmission;
/** Whether we notified NS_FORMSUBMIT_SUBJECT listeners already */
bool mNotifiedObservers;
/** If we notified the listeners early, what was the result? */
bool mNotifiedObserversResult;
/** Keep track of what the popup state was when the submit was initiated */
PopupControlState mSubmitPopupState;
/** Keep track of whether a submission was user-initiated or not */
bool mSubmitInitiatedFromUserInput;
/** The pending submission object */
nsAutoPtr<HTMLFormSubmission> mPendingSubmission;
@ -612,6 +596,9 @@ protected:
nsInterfaceHashtable<nsStringHashKey,nsISupports> mPastNameLookupTable;
/** Keep track of what the popup state was when the submit was initiated */
PopupControlState mSubmitPopupState;
/**
* Number of invalid and candidate for constraint validation elements in the
* form the last time UpdateValidity has been called.
@ -619,6 +606,20 @@ protected:
*/
int32_t mInvalidElementsCount;
/** Whether we are currently processing a submit event or not */
bool mGeneratingSubmit;
/** Whether we are currently processing a reset event or not */
bool mGeneratingReset;
/** Whether we are submitting currently */
bool mIsSubmitting;
/** Whether the submission is to be deferred in case a script triggers it */
bool mDeferSubmission;
/** Whether we notified NS_FORMSUBMIT_SUBJECT listeners already */
bool mNotifiedObservers;
/** If we notified the listeners early, what was the result? */
bool mNotifiedObserversResult;
/** Keep track of whether a submission was user-initiated or not */
bool mSubmitInitiatedFromUserInput;
/**
* Whether the submission of this form has been ever prevented because of
* being invalid.