summaryrefslogtreecommitdiffstats
path: root/js/src/vm/TypeInference.h
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-09-12 05:41:41 -0500
committertrav90 <travawine@palemoon.org>2018-09-12 05:41:41 -0500
commit847f12e88faf1b9a34d0b6fa9b262dfed209aedb (patch)
treecfec69fc3613d921f0f466574f8c67695f246a96 /js/src/vm/TypeInference.h
parent2f64d5eeecdeb995504748e3da37964d22cc27f0 (diff)
downloadUXP-847f12e88faf1b9a34d0b6fa9b262dfed209aedb.tar
UXP-847f12e88faf1b9a34d0b6fa9b262dfed209aedb.tar.gz
UXP-847f12e88faf1b9a34d0b6fa9b262dfed209aedb.tar.lz
UXP-847f12e88faf1b9a34d0b6fa9b262dfed209aedb.tar.xz
UXP-847f12e88faf1b9a34d0b6fa9b262dfed209aedb.zip
Stop using PodZero in several places to initialize values of non-trivial type
Diffstat (limited to 'js/src/vm/TypeInference.h')
-rw-r--r--js/src/vm/TypeInference.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/js/src/vm/TypeInference.h b/js/src/vm/TypeInference.h
index 9ba1c3cc8..0e737bad7 100644
--- a/js/src/vm/TypeInference.h
+++ b/js/src/vm/TypeInference.h
@@ -807,12 +807,10 @@ class PreliminaryObjectArray
private:
// All objects with the type which have been allocated. The pointers in
// this array are weak.
- JSObject* objects[COUNT];
+ JSObject* objects[COUNT] = {}; // zeroes
public:
- PreliminaryObjectArray() {
- mozilla::PodZero(this);
- }
+ PreliminaryObjectArray() = default;
void registerNewObject(JSObject* res);
void unregisterObject(JSObject* obj);
@@ -906,11 +904,11 @@ class TypeNewScript
private:
// Scripted function which this information was computed for.
- HeapPtr<JSFunction*> function_;
+ HeapPtr<JSFunction*> function_ = {};
// Any preliminary objects with the type. The analyses are not performed
// until this array is cleared.
- PreliminaryObjectArray* preliminaryObjects;
+ PreliminaryObjectArray* preliminaryObjects = nullptr;
// After the new script properties analyses have been performed, a template
// object to use for newly constructed objects. The shape of this object
@@ -918,7 +916,7 @@ class TypeNewScript
// allocation kind to use. This is null if the new objects have an unboxed
// layout, in which case the UnboxedLayout provides the initial structure
// of the object.
- HeapPtr<PlainObject*> templateObject_;
+ HeapPtr<PlainObject*> templateObject_ = {};
// Order in which definite properties become initialized. We need this in
// case the definite properties are invalidated (such as by adding a setter
@@ -928,21 +926,21 @@ class TypeNewScript
// shape. Property assignments in inner frames are preceded by a series of
// SETPROP_FRAME entries specifying the stack down to the frame containing
// the write.
- Initializer* initializerList;
+ Initializer* initializerList = nullptr;
// If there are additional properties found by the acquired properties
// analysis which were not found by the definite properties analysis, this
// shape contains all such additional properties (plus the definite
// properties). When an object of this group acquires this shape, it is
// fully initialized and its group can be changed to initializedGroup.
- HeapPtr<Shape*> initializedShape_;
+ HeapPtr<Shape*> initializedShape_ = {};
// Group with definite properties set for all properties found by
// both the definite and acquired properties analyses.
- HeapPtr<ObjectGroup*> initializedGroup_;
+ HeapPtr<ObjectGroup*> initializedGroup_ = {};
public:
- TypeNewScript() { mozilla::PodZero(this); }
+ TypeNewScript() = default;
~TypeNewScript() {
js_delete(preliminaryObjects);
js_free(initializerList);