Bug 891215 (part 17) - Move SizeOfRegExpStaticsData() into the RegExpStaticsObject class. r=terrence.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 10 Jul 2013 16:23:28 -0700
changeset 138081 42d3202f0e030a9a2af9661c727ee903f3c2aba3
parent 138080 763c1a2daaee63f011c327790fb2ff066284831b
child 138082 c56ec9d1022203826c597349af2f3fa8c9688db7
push id24941
push useremorley@mozilla.com
push dateThu, 11 Jul 2013 09:11:18 +0000
treeherdermozilla-central@c89e5b9fe935 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs891215
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 891215 (part 17) - Move SizeOfRegExpStaticsData() into the RegExpStaticsObject class. r=terrence.
js/src/jsobj.cpp
js/src/vm/RegExpStatics-inl.h
js/src/vm/RegExpStatics.h
js/src/vm/RegExpStaticsObject.h
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -5584,17 +5584,17 @@ JSObject::sizeOfExcludingThis(mozilla::M
         }
     }
 
     // Other things may be measured in the future if DMD indicates it is worthwhile.
     // Note that sizes->private_ is measured elsewhere.
     if (is<ArgumentsObject>()) {
         sizes->argumentsData = as<ArgumentsObject>().sizeOfMisc(mallocSizeOf);
     } else if (is<RegExpStaticsObject>()) {
-        sizes->regExpStatics = js::SizeOfRegExpStaticsData(this, mallocSizeOf);
+        sizes->regExpStatics = as<RegExpStaticsObject>().sizeOfData(mallocSizeOf);
     } else if (is<PropertyIteratorObject>()) {
         sizes->propertyIteratorData = as<PropertyIteratorObject>().sizeOfMisc(mallocSizeOf);
 #ifdef JS_HAS_CTYPES
     } else {
         // This must be the last case.
         sizes->ctypesData = js::SizeOfDataIfCDataObject(mallocSizeOf, const_cast<JSObject *>(this));
 #endif
     }
--- a/js/src/vm/RegExpStatics-inl.h
+++ b/js/src/vm/RegExpStatics-inl.h
@@ -207,22 +207,16 @@ class PreserveRegExpStatics
 
 inline js::RegExpStatics *
 js::GlobalObject::getRegExpStatics() const
 {
     JSObject &resObj = getSlot(REGEXP_STATICS).toObject();
     return static_cast<RegExpStatics *>(resObj.getPrivate());
 }
 
-inline size_t
-SizeOfRegExpStaticsData(const JSObject *obj, mozilla::MallocSizeOf mallocSizeOf)
-{
-    return mallocSizeOf(obj->getPrivate());
-}
-
 inline bool
 RegExpStatics::createDependent(JSContext *cx, size_t start, size_t end, MutableHandleValue out)
 {
     /* Private function: caller must perform lazy evaluation. */
     JS_ASSERT(!pendingLazyEvaluation);
 
     JS_ASSERT(start <= end);
     JS_ASSERT(end <= matchesInput->length());
--- a/js/src/vm/RegExpStatics.h
+++ b/js/src/vm/RegExpStatics.h
@@ -15,13 +15,11 @@
 
 #include "js/Utility.h"
 
 namespace js {
 
 class PreserveRegExpStatics;
 class RegExpStatics;
 
-size_t SizeOfRegExpStaticsData(const JSObject *obj, mozilla::MallocSizeOf mallocSizeOf);
-
 } /* namespace js */
 
 #endif /* vm_RegExpStatics_h */
--- a/js/src/vm/RegExpStaticsObject.h
+++ b/js/src/vm/RegExpStaticsObject.h
@@ -10,13 +10,17 @@
 #include "jsobj.h"
 
 namespace js {
 
 class RegExpStaticsObject : public JSObject
 {
   public:
     static Class class_;
+
+    size_t sizeOfData(mozilla::MallocSizeOf mallocSizeOf) {
+        return mallocSizeOf(getPrivate());
+    }
 };
 
 } // namespace js
 
 #endif /* vm_RegExpStaticsObject_h */