summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/basilisk/base/content/tabbrowser.xml13
-rw-r--r--application/basilisk/components/sessionstore/SessionStore.jsm3
-rw-r--r--application/basilisk/components/sessionstore/TabAttributes.jsm5
-rw-r--r--application/palemoon/base/content/browser.js17
-rw-r--r--application/palemoon/base/content/tabbrowser.xml13
-rw-r--r--application/palemoon/components/sessionstore/SessionStore.jsm7
-rw-r--r--application/palemoon/config/version.txt2
-rw-r--r--docs/CODE_OF_CONDUCT.md61
-rw-r--r--js/public/MemoryMetrics.h23
-rw-r--r--js/public/Utility.h2
-rw-r--r--js/src/gc/GCInternals.h5
-rw-r--r--js/src/gc/Statistics.h18
-rw-r--r--js/src/jit/BacktrackingAllocator.cpp11
-rw-r--r--js/src/jit/BacktrackingAllocator.h15
-rw-r--r--js/src/jit/IonCode.h11
-rw-r--r--js/src/jit/shared/Assembler-shared.h10
-rw-r--r--js/src/vm/Caches.h16
-rw-r--r--js/src/vm/Runtime.h15
-rw-r--r--js/src/vm/String.h11
-rw-r--r--js/src/vm/TypeInference.h20
-rw-r--r--js/src/wasm/AsmJS.cpp18
21 files changed, 158 insertions, 138 deletions
diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml
index 76ea5d167..043838020 100644
--- a/application/basilisk/base/content/tabbrowser.xml
+++ b/application/basilisk/base/content/tabbrowser.xml
@@ -2101,6 +2101,7 @@
var aRelatedBrowser;
var aOriginPrincipal;
var aOpener;
+ var aSkipBackgroundNotify;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@@ -2123,6 +2124,7 @@
aRelatedBrowser = params.relatedBrowser;
aOriginPrincipal = params.originPrincipal;
aOpener = params.opener;
+ aSkipBackgroundNotify = params.skipBackgroundNotify;
}
// if we're adding tabs, we're past interrupt mode, ditch the owner
@@ -2151,6 +2153,11 @@
t.setAttribute("crop", "end");
t.setAttribute("onerror", "this.removeAttribute('image');");
+
+ if (aSkipBackgroundNotify) {
+ t.setAttribute("skipbackgroundnotify", true);
+ }
+
t.className = "tabbrowser-tab";
this.tabContainer._unlockTabSizing();
@@ -5932,7 +5939,11 @@
this._fillTrailingGap();
this._handleTabSelect();
} else {
- this._notifyBackgroundTab(tab);
+ if (tab.hasAttribute("skipbackgroundnotify")) {
+ tab.removeAttribute("skipbackgroundnotify");
+ } else {
+ this._notifyBackgroundTab(tab);
+ }
}
// XXXmano: this is a temporary workaround for bug 345399
diff --git a/application/basilisk/components/sessionstore/SessionStore.jsm b/application/basilisk/components/sessionstore/SessionStore.jsm
index e23b205fc..b599bc162 100644
--- a/application/basilisk/components/sessionstore/SessionStore.jsm
+++ b/application/basilisk/components/sessionstore/SessionStore.jsm
@@ -3113,7 +3113,8 @@ var SessionStoreInternal = {
tabbrowser.addTab("about:blank",
{skipAnimation: true,
forceNotRemote,
- userContextId});
+ userContextId,
+ skipBackgroundNotify: true});
// If we inserted a new tab because the userContextId didn't match with the
// open tab, even though `t < openTabCount`, we need to remove that open tab
diff --git a/application/basilisk/components/sessionstore/TabAttributes.jsm b/application/basilisk/components/sessionstore/TabAttributes.jsm
index 8a29680f4..c8e6d9744 100644
--- a/application/basilisk/components/sessionstore/TabAttributes.jsm
+++ b/application/basilisk/components/sessionstore/TabAttributes.jsm
@@ -14,7 +14,10 @@ this.EXPORTED_SYMBOLS = ["TabAttributes"];
// 'pending' is used internal by sessionstore and managed accordingly.
// 'iconLoadingPrincipal' is same as 'image' that it should be handled by
// using the gBrowser.getIcon()/setIcon() methods.
-const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconLoadingPrincipal"]);
+// 'skipbackgroundnotify' is used internal by tabbrowser.xml.
+const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending",
+ "iconLoadingPrincipal",
+ "skipbackgroundnotify"]);
// A set of tab attributes to persist. We will read a given list of tab
// attributes when collecting tab data and will re-set those attributes when
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index 5cf43850a..4167f186c 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -2421,11 +2421,18 @@ function BrowserOnAboutPageLoad(doc) {
/* === about:home === */
if (doc.documentURI.toLowerCase() == "about:home") {
- let ss = Components.classes["@mozilla.org/browser/sessionstore;1"].
- getService(Components.interfaces.nsISessionStore);
- if (ss.canRestoreLastSession &&
- !PrivateBrowsingUtils.isWindowPrivate(window))
- doc.getElementById("launcher").setAttribute("session", "true");
+ if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
+ let wrapper = {};
+ Cu.import("resource:///modules/sessionstore/SessionStore.jsm", wrapper);
+ let ss = wrapper.SessionStore;
+ ss.promiseInitialized.then(function() {
+ if (ss.canRestoreLastSession) {
+ doc.getElementById("launcher").setAttribute("session", "true");
+ }
+ }).then(null, function onError(x) {
+ Cu.reportError("Error in SessionStore init while processing 'about:home': " + x);
+ });
+ }
// Inject search engine and snippets URL.
let docElt = doc.documentElement;
diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml
index 3de1c6be2..93818e290 100644
--- a/application/palemoon/base/content/tabbrowser.xml
+++ b/application/palemoon/base/content/tabbrowser.xml
@@ -1429,6 +1429,7 @@
var aRelatedToCurrent;
var aSkipAnimation;
var aOriginPrincipal;
+ var aSkipBackgroundNotify;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@@ -1444,6 +1445,7 @@
aRelatedToCurrent = params.relatedToCurrent;
aSkipAnimation = params.skipAnimation;
aOriginPrincipal = params.originPrincipal;
+ aSkipBackgroundNotify = params.skipBackgroundNotify;
}
// if we're adding tabs, we're past interrupt mode, ditch the owner
@@ -1467,6 +1469,11 @@
t.setAttribute("crop", "end");
t.setAttribute("validate", "never"); //PMed
t.setAttribute("onerror", "this.removeAttribute('image');");
+
+ if (aSkipBackgroundNotify) {
+ t.setAttribute("skipbackgroundnotify", true);
+ }
+
t.className = "tabbrowser-tab";
this.tabContainer._unlockTabSizing();
@@ -4143,7 +4150,11 @@
this._fillTrailingGap();
this._handleTabSelect();
} else {
- this._notifyBackgroundTab(tab);
+ if (tab.hasAttribute("skipbackgroundnotify")) {
+ tab.removeAttribute("skipbackgroundnotify");
+ } else {
+ this._notifyBackgroundTab(tab);
+ }
}
// XXXmano: this is a temporary workaround for bug 345399
diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm
index c5e55321c..e19a578f4 100644
--- a/application/palemoon/components/sessionstore/SessionStore.jsm
+++ b/application/palemoon/components/sessionstore/SessionStore.jsm
@@ -2739,7 +2739,9 @@ var SessionStoreInternal = {
for (var t = 0; t < newTabCount; t++) {
tabs.push(t < openTabCount ?
tabbrowser.tabs[t] :
- tabbrowser.addTab("about:blank", {skipAnimation: true}));
+ tabbrowser.addTab("about:blank",
+ {skipAnimation: true,
+ skipBackgroundNotify: true}));
// when resuming at startup: add additionally requested pages to the end
if (!aOverwriteTabs && root._firstTabs) {
tabbrowser.moveTabTo(tabs[t], t);
@@ -4684,7 +4686,8 @@ var TabAttributes = {
// 'image' should not be accessed directly but handled by using the
// gBrowser.getIcon()/setIcon() methods.
// 'pending' is used internal by sessionstore and managed accordingly.
- _skipAttrs: new Set(["image", "pending"]),
+ // 'skipbackgroundnotify' is used internal by tabbrowser.xml.
+ _skipAttrs: new Set(["image", "pending", "skipbackgroundnotify"]),
persist: function (name) {
if (this._attrs.has(name) || this._skipAttrs.has(name)) {
diff --git a/application/palemoon/config/version.txt b/application/palemoon/config/version.txt
index 466c71dc8..f35c734b3 100644
--- a/application/palemoon/config/version.txt
+++ b/application/palemoon/config/version.txt
@@ -1 +1 @@
-28.1.0a1 \ No newline at end of file
+28.2.0a1 \ No newline at end of file
diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md
index bcd8b8f77..68d1dcc60 100644
--- a/docs/CODE_OF_CONDUCT.md
+++ b/docs/CODE_OF_CONDUCT.md
@@ -1,48 +1,53 @@
# Contributor Code of Conduct
-## Our Pledge
+This code of conduct is intended to lay down the basis on which we, as a community of developers and maintainers, work with each other and with others outside of the community. As always when dealing with groups of people from many different backgrounds, there are no hard and fast rules here, and the intention is not to lay down any sort of restrictive frame to work in, but rather to clarify how we (prefer to) approach each other when working together as volunteers/professionals to improve our respective projects, products and life.
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, physical attributes, disability, ethnicity, level of experience, nationality, personal appearance, race, religion, or sexual orientation.
+## Our Goal with this Code of Conduct
-## Our Standards
+We, as contributors and maintainers, aim to create a _focused but welcoming_ environment for others; collaboration, acceptance and respect are the cornerstones upon which we must build our community, otherwise there is no future for it. As such, we want to keep participation in our project and community free of harassment. We therefore ask of everyone, new contributors and long-standing members alike, to be accepting of others regardless of their age, ethnicity, level of experience, nationality, personal appearance, race, religion, or sexual orientation. None of these (and alike) attributes should influence how we work together in this project, and should not be grounds to judge or dismiss work done.
-Examples of behavior that contributes to creating a positive environment include:
+## Examples of acceptable and unacceptable behavior
-* Using welcoming and inclusive language
-* Being courteous (use "please" when you ask something of someone)
-* Being respectful of differing viewpoints and experiences
+Please note that these lists are examples and not exhaustive. If you have any doubts whether behavior is considered unacceptable, always err on the side of caution.
+
+Examples of behavior that helps create a positive working environment:
+
+* Using friendly, neutral and welcoming language.
+* Being clear in your descriptions and not assuming the reader has any sort of prior knowledge of what you are talking about.
+* Being courteous (use "please" when you ask something of someone).
+* Being respectful of differing viewpoints and experiences.
* Gracefully accepting constructive criticism, even if you disagree with such criticism.
* Similarly, accepting that someone may not act on criticism given.
-* Focusing on what is best for the community and its projects
-* Showing understanding and a reasonable level of empathy towards other community members
-
-Examples of unacceptable behavior by participants include:
+* Focusing on what is best for the community and its projects instead of individuals.
+* Showing understanding and a reasonable level of empathy towards other community members.
-* Unwelcome sexual attention or advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a professional setting
+Examples of unacceptable behavior:
-## Our Responsibilities
+* Unwelcome personal attention or advances (sexual or otherwise). If someone asks you to stop approaching them, please respect that.
+* Displaying disproportionate levels of moral outrage and offense, especially when in response to someone's opinion.
+* Bullying, trolling, insulting/derogatory comments, and personal or political attacks.
+* Public or private harassment of other community members/contributors.
+* Publishing others' personal/private information, such as a physical or electronic address, without explicit permission.
+* Other conduct which could reasonably be considered inappropriate in a professional/workplace setting.
-Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+## Responsibilities of the project's staff/leadership
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct or community's or projects' best interests, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and above all fair corrective action in response to instances of unacceptable behavior.
-## Scope
+Corrective action: Project staff has the right and responsibility to evaluate, and if necessary to remove, edit, or reject any comments, repository commits, code changes, wiki edits, issues or issue comments, and other contributions that are not aligned with this Code of Conduct or the community's or projects' best interests, or to ban (temporarily or permanently) any contributor, community member or maintainer for other behaviors that they deem inappropriate, threatening, offensive, or harmful. In cases where there is no clear and definitive breach of rules or common sense, it is expected that staff members consult with project leadership before bans are issued to discuss the severity and intended action.
-This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, acting on behalf of the project on IRC or other chat networks, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+## Applicability
-## Enforcement
+This Code of Conduct applies within project spaces (forum, website, IRC, repositories and other project-controlled resources with user interaction) as well as in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, acting on behalf of the project on IRC or other chat networks, or acting as an appointed or voluntary (spontaneous) representative at an online or offline event. Representation of a project in general should be courteous, respectful, and at all times keeping in mind that any representation reflects directly on the project's public image. Do not claim to officially represent the project if you have any doubts about your ability to maintain a professional composure that does not harm the project.
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project owner at moonchild@palemoon.org. The project owner will review and investigate all complaints, and will respond in a way that they deem appropriate for the circumstances. The project team is generally obligated to maintain confidentiality with regard to the reporter of an incident, although in exceptional cases where intervention of authorities is required, the reporter may be individually identified to aid in the investigation or resolution of a conflict situation. Further details of specific enforcement policies may be posted separately.
+## Enforcing this Code of Conduct
-Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+We expect our community to apply a good measure of self-regulation when it comes to the conduct displayed by its members. We believe that any community of adults is capable of applying the concepts of common sense, common decency and common courtesy to interactions between its members.
+That said, there are always exception situations possible where things need to be escalated, which is where this section comes into play.
+Incidents involving abusive, harassing, or otherwise unacceptable behavior that need to be escalated for resolution may be reported by contacting the project owner at moonchild@palemoon.org. The project owner will then review and investigate all complaints and related communication of the case, and will respond in a way that they deem appropriate for the circumstances.
-## Attribution
+## Confidentiality
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version [1.4][version].
+The project team is generally obligated to maintain confidentiality with regard to the reporter of an incident, although in exceptional cases where intervention of authorities is required, the reporter may be individually identified to aid in the investigation or resolution of a conflict situation.
-[homepage]: http://contributor-covenant.org
-[version]: http://contributor-covenant.org/version/1/4/
+Project staff members who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's staff. Being a member of staff does not excuse you from adhering to acceptable behavior outlined in this Code of Conduct.
diff --git a/js/public/MemoryMetrics.h b/js/public/MemoryMetrics.h
index b0b26631c..dcc886217 100644
--- a/js/public/MemoryMetrics.h
+++ b/js/public/MemoryMetrics.h
@@ -11,7 +11,6 @@
// at your own risk.
#include "mozilla/MemoryReporting.h"
-#include "mozilla/PodOperations.h"
#include "mozilla/TypeTraits.h"
#include <string.h>
@@ -74,15 +73,7 @@ struct ServoSizes
Ignore
};
- ServoSizes()
- : gcHeapUsed(0)
- , gcHeapUnused(0)
- , gcHeapAdmin(0)
- , gcHeapDecommitted(0)
- , mallocHeap(0)
- , nonHeap(0)
- {
- }
+ ServoSizes() = default;
void add(Kind kind, size_t n) {
switch (kind) {
@@ -97,12 +88,12 @@ struct ServoSizes
}
}
- size_t gcHeapUsed;
- size_t gcHeapUnused;
- size_t gcHeapAdmin;
- size_t gcHeapDecommitted;
- size_t mallocHeap;
- size_t nonHeap;
+ size_t gcHeapUsed = 0;
+ size_t gcHeapUnused = 0;
+ size_t gcHeapAdmin = 0;
+ size_t gcHeapDecommitted = 0;
+ size_t mallocHeap = 0;
+ size_t nonHeap = 0;
};
} // namespace JS
diff --git a/js/public/Utility.h b/js/public/Utility.h
index 68de3004a..99712faa8 100644
--- a/js/public/Utility.h
+++ b/js/public/Utility.h
@@ -391,7 +391,7 @@ js_delete_poison(const T* p)
{
if (p) {
p->~T();
- memset(const_cast<T*>(p), 0x3B, sizeof(T));
+ memset(static_cast<void*>(const_cast<T*>(p)), 0x3B, sizeof(T));
js_free(const_cast<T*>(p));
}
}
diff --git a/js/src/gc/GCInternals.h b/js/src/gc/GCInternals.h
index 4919b87a5..e8df0bb70 100644
--- a/js/src/gc/GCInternals.h
+++ b/js/src/gc/GCInternals.h
@@ -9,7 +9,6 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/Maybe.h"
-#include "mozilla/PodOperations.h"
#include "jscntxt.h"
@@ -102,9 +101,9 @@ struct TenureCountCache
static const size_t EntryShift = 4;
static const size_t EntryCount = 1 << EntryShift;
- TenureCount entries[EntryCount];
+ TenureCount entries[EntryCount] = {}; // zeroes
- TenureCountCache() { mozilla::PodZero(this); }
+ TenureCountCache() = default;
HashNumber hash(ObjectGroup* group) {
#if JS_BITS_PER_WORD == 32
diff --git a/js/src/gc/Statistics.h b/js/src/gc/Statistics.h
index ca1969b2c..08a2810cf 100644
--- a/js/src/gc/Statistics.h
+++ b/js/src/gc/Statistics.h
@@ -10,7 +10,6 @@
#include "mozilla/EnumeratedArray.h"
#include "mozilla/IntegerRange.h"
#include "mozilla/Maybe.h"
-#include "mozilla/PodOperations.h"
#include "jsalloc.h"
#include "jsgc.h"
@@ -112,29 +111,26 @@ enum Stat {
struct ZoneGCStats
{
/* Number of zones collected in this GC. */
- int collectedZoneCount;
+ int collectedZoneCount = 0;
/* Total number of zones in the Runtime at the start of this GC. */
- int zoneCount;
+ int zoneCount = 0;
/* Number of zones swept in this GC. */
- int sweptZoneCount;
+ int sweptZoneCount = 0;
/* Total number of compartments in all zones collected. */
- int collectedCompartmentCount;
+ int collectedCompartmentCount = 0;
/* Total number of compartments in the Runtime at the start of this GC. */
- int compartmentCount;
+ int compartmentCount = 0;
/* Total number of compartments swept by this GC. */
- int sweptCompartmentCount;
+ int sweptCompartmentCount = 0;
bool isCollectingAllZones() const { return collectedZoneCount == zoneCount; }
- ZoneGCStats()
- : collectedZoneCount(0), zoneCount(0), sweptZoneCount(0),
- collectedCompartmentCount(0), compartmentCount(0), sweptCompartmentCount(0)
- {}
+ ZoneGCStats() = default;
};
#define FOR_EACH_GC_PROFILE_TIME(_) \
diff --git a/js/src/jit/BacktrackingAllocator.cpp b/js/src/jit/BacktrackingAllocator.cpp
index 94ef25785..73aceeccb 100644
--- a/js/src/jit/BacktrackingAllocator.cpp
+++ b/js/src/jit/BacktrackingAllocator.cpp
@@ -378,7 +378,6 @@ BacktrackingAllocator::init()
size_t numVregs = graph.numVirtualRegisters();
if (!vregs.init(mir->alloc(), numVregs))
return false;
- memset(&vregs[0], 0, sizeof(VirtualRegister) * numVregs);
for (uint32_t i = 0; i < numVregs; i++)
new(&vregs[i]) VirtualRegister();
@@ -1101,9 +1100,9 @@ BacktrackingAllocator::mergeAndQueueRegisters()
if (iter->isParameter()) {
for (size_t i = 0; i < iter->numDefs(); i++) {
DebugOnly<bool> found = false;
- VirtualRegister &paramVreg = vreg(iter->getDef(i));
+ VirtualRegister& paramVreg = vreg(iter->getDef(i));
for (; original < paramVreg.vreg(); original++) {
- VirtualRegister &originalVreg = vregs[original];
+ VirtualRegister& originalVreg = vregs[original];
if (*originalVreg.def()->output() == *iter->getDef(i)->output()) {
MOZ_ASSERT(originalVreg.ins()->isParameter());
if (!tryMergeBundles(originalVreg.firstBundle(), paramVreg.firstBundle()))
@@ -1136,7 +1135,7 @@ BacktrackingAllocator::mergeAndQueueRegisters()
LBlock* block = graph.getBlock(i);
for (size_t j = 0; j < block->numPhis(); j++) {
LPhi* phi = block->getPhi(j);
- VirtualRegister &outputVreg = vreg(phi->getDef(0));
+ VirtualRegister& outputVreg = vreg(phi->getDef(0));
for (size_t k = 0, kend = phi->numOperands(); k < kend; k++) {
VirtualRegister& inputVreg = vreg(phi->getOperand(k)->toUse());
if (!tryMergeBundles(inputVreg.firstBundle(), outputVreg.firstBundle()))
@@ -1334,7 +1333,7 @@ BacktrackingAllocator::computeRequirement(LiveBundle* bundle,
for (LiveRange::BundleLinkIterator iter = bundle->rangesBegin(); iter; iter++) {
LiveRange* range = LiveRange::get(*iter);
- VirtualRegister &reg = vregs[range->vreg()];
+ VirtualRegister& reg = vregs[range->vreg()];
if (range->hasDefinition()) {
// Deal with any definition constraints/hints.
@@ -1396,7 +1395,7 @@ BacktrackingAllocator::tryAllocateRegister(PhysicalRegister& r, LiveBundle* bund
for (LiveRange::BundleLinkIterator iter = bundle->rangesBegin(); iter; iter++) {
LiveRange* range = LiveRange::get(*iter);
- VirtualRegister &reg = vregs[range->vreg()];
+ VirtualRegister& reg = vregs[range->vreg()];
if (!reg.isCompatible(r.reg))
return true;
diff --git a/js/src/jit/BacktrackingAllocator.h b/js/src/jit/BacktrackingAllocator.h
index 6d14ffacd..9910498fb 100644
--- a/js/src/jit/BacktrackingAllocator.h
+++ b/js/src/jit/BacktrackingAllocator.h
@@ -478,34 +478,31 @@ class LiveBundle : public TempObject
class VirtualRegister
{
// Instruction which defines this register.
- LNode* ins_;
+ LNode* ins_ = nullptr;
// Definition in the instruction for this register.
- LDefinition* def_;
+ LDefinition* def_ = nullptr;
// All live ranges for this register. These may overlap each other, and are
// ordered by their start position.
InlineForwardList<LiveRange::RegisterLink> ranges_;
// Whether def_ is a temp or an output.
- bool isTemp_;
+ bool isTemp_ = false;
// Whether this vreg is an input for some phi. This use is not reflected in
// any range on the vreg.
- bool usedByPhi_;
+ bool usedByPhi_ = false;
// If this register's definition is MUST_REUSE_INPUT, whether a copy must
// be introduced before the definition that relaxes the policy.
- bool mustCopyInput_;
+ bool mustCopyInput_ = false;
void operator=(const VirtualRegister&) = delete;
VirtualRegister(const VirtualRegister&) = delete;
public:
- explicit VirtualRegister()
- {
- // Note: This class is zeroed before it is constructed.
- }
+ VirtualRegister() = default;
void init(LNode* ins, LDefinition* def, bool isTemp) {
MOZ_ASSERT(!ins_);
diff --git a/js/src/jit/IonCode.h b/js/src/jit/IonCode.h
index c581aa62e..55c3d4dad 100644
--- a/js/src/jit/IonCode.h
+++ b/js/src/jit/IonCode.h
@@ -9,7 +9,6 @@
#include "mozilla/Atomics.h"
#include "mozilla/MemoryReporting.h"
-#include "mozilla/PodOperations.h"
#include "jstypes.h"
@@ -692,17 +691,15 @@ struct IonScriptCounts
{
private:
// Any previous invalidated compilation(s) for the script.
- IonScriptCounts* previous_;
+ IonScriptCounts* previous_ = nullptr;
// Information about basic blocks in this script.
- size_t numBlocks_;
- IonBlockCounts* blocks_;
+ size_t numBlocks_ = 0;
+ IonBlockCounts* blocks_ = nullptr;
public:
- IonScriptCounts() {
- mozilla::PodZero(this);
- }
+ IonScriptCounts() = default;
~IonScriptCounts() {
for (size_t i = 0; i < numBlocks_; i++)
diff --git a/js/src/jit/shared/Assembler-shared.h b/js/src/jit/shared/Assembler-shared.h
index aac9687b8..8044e75cb 100644
--- a/js/src/jit/shared/Assembler-shared.h
+++ b/js/src/jit/shared/Assembler-shared.h
@@ -7,8 +7,6 @@
#ifndef jit_shared_Assembler_shared_h
#define jit_shared_Assembler_shared_h
-#include "mozilla/PodOperations.h"
-
#include <limits.h>
#include "jit/AtomicOp.h"
@@ -491,10 +489,10 @@ class CodeLabel
class CodeOffsetJump
{
- size_t offset_;
+ size_t offset_ = 0;
#ifdef JS_SMALL_BRANCH
- size_t jumpTableIndex_;
+ size_t jumpTableIndex_ = 0;
#endif
public:
@@ -510,9 +508,7 @@ class CodeOffsetJump
explicit CodeOffsetJump(size_t offset) : offset_(offset) {}
#endif
- CodeOffsetJump() {
- mozilla::PodZero(this);
- }
+ CodeOffsetJump() = default;
size_t offset() const {
return offset_;
diff --git a/js/src/vm/Caches.h b/js/src/vm/Caches.h
index 91a78bdc8..b11dd9dcb 100644
--- a/js/src/vm/Caches.h
+++ b/js/src/vm/Caches.h
@@ -7,6 +7,8 @@
#ifndef vm_Caches_h
#define vm_Caches_h
+#include <new>
+
#include "jsatom.h"
#include "jsbytecode.h"
#include "jsobj.h"
@@ -191,14 +193,20 @@ class NewObjectCache
char templateObject[MAX_OBJ_SIZE];
};
- Entry entries[41]; // TODO: reconsider size
+ using EntryArray = Entry[41]; // TODO: reconsider size;
+ EntryArray entries;
public:
- typedef int EntryIndex;
+ using EntryIndex = int;
+
+ NewObjectCache()
+ : entries{} // zeroes out the array
+ {}
- NewObjectCache() { mozilla::PodZero(this); }
- void purge() { mozilla::PodZero(this); }
+ void purge() {
+ new (&entries) EntryArray{}; // zeroes out the array
+ }
/* Remove any cached items keyed on moved objects. */
void clearNurseryObjects(JSRuntime* rt);
diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h
index 735adadf2..f354d2069 100644
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -11,11 +11,11 @@
#include "mozilla/Attributes.h"
#include "mozilla/LinkedList.h"
#include "mozilla/MemoryReporting.h"
-#include "mozilla/PodOperations.h"
#include "mozilla/Scoped.h"
#include "mozilla/ThreadLocal.h"
#include "mozilla/Vector.h"
+#include <algorithm>
#include <setjmp.h>
#include "jsatom.h"
@@ -1504,20 +1504,21 @@ PerThreadData::exclusiveThreadsPresent()
static MOZ_ALWAYS_INLINE void
MakeRangeGCSafe(Value* vec, size_t len)
{
- mozilla::PodZero(vec, len);
+ // Don't PodZero here because JS::Value is non-trivial.
+ for (size_t i = 0; i < len; i++)
+ vec[i].setDouble(+0.0);
}
static MOZ_ALWAYS_INLINE void
MakeRangeGCSafe(Value* beg, Value* end)
{
- mozilla::PodZero(beg, end - beg);
+ MakeRangeGCSafe(beg, end - beg);
}
static MOZ_ALWAYS_INLINE void
MakeRangeGCSafe(jsid* beg, jsid* end)
{
- for (jsid* id = beg; id != end; ++id)
- *id = INT_TO_JSID(0);
+ std::fill(beg, end, INT_TO_JSID(0));
}
static MOZ_ALWAYS_INLINE void
@@ -1529,13 +1530,13 @@ MakeRangeGCSafe(jsid* vec, size_t len)
static MOZ_ALWAYS_INLINE void
MakeRangeGCSafe(Shape** beg, Shape** end)
{
- mozilla::PodZero(beg, end - beg);
+ std::fill(beg, end, nullptr);
}
static MOZ_ALWAYS_INLINE void
MakeRangeGCSafe(Shape** vec, size_t len)
{
- mozilla::PodZero(vec, len);
+ MakeRangeGCSafe(vec, vec + len);
}
static MOZ_ALWAYS_INLINE void
diff --git a/js/src/vm/String.h b/js/src/vm/String.h
index 1a0c58575..514e2c205 100644
--- a/js/src/vm/String.h
+++ b/js/src/vm/String.h
@@ -8,7 +8,6 @@
#define vm_String_h
#include "mozilla/MemoryReporting.h"
-#include "mozilla/PodOperations.h"
#include "mozilla/Range.h"
#include "jsapi.h"
@@ -1087,19 +1086,17 @@ class StaticStrings
static const size_t SMALL_CHAR_LIMIT = 128U;
static const size_t NUM_SMALL_CHARS = 64U;
- JSAtom* length2StaticTable[NUM_SMALL_CHARS * NUM_SMALL_CHARS];
+ JSAtom* length2StaticTable[NUM_SMALL_CHARS * NUM_SMALL_CHARS] = {}; // zeroes
public:
/* We keep these public for the JITs. */
static const size_t UNIT_STATIC_LIMIT = 256U;
- JSAtom* unitStaticTable[UNIT_STATIC_LIMIT];
+ JSAtom* unitStaticTable[UNIT_STATIC_LIMIT] = {}; // zeroes
static const size_t INT_STATIC_LIMIT = 256U;
- JSAtom* intStaticTable[INT_STATIC_LIMIT];
+ JSAtom* intStaticTable[INT_STATIC_LIMIT] = {}; // zeroes
- StaticStrings() {
- mozilla::PodZero(this);
- }
+ StaticStrings() = default;
bool init(JSContext* cx);
void trace(JSTracer* trc);
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);
diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp
index 7fade24fb..2237d1d7f 100644
--- a/js/src/wasm/AsmJS.cpp
+++ b/js/src/wasm/AsmJS.cpp
@@ -249,14 +249,14 @@ typedef Vector<AsmJSImport, 0, SystemAllocPolicy> AsmJSImportVector;
// case the function is toString()ed.
class AsmJSExport
{
- uint32_t funcIndex_;
+ uint32_t funcIndex_ = 0;
// All fields are treated as cacheable POD:
- uint32_t startOffsetInModule_; // Store module-start-relative offsets
- uint32_t endOffsetInModule_; // so preserved by serialization.
+ uint32_t startOffsetInModule_ = 0; // Store module-start-relative offsets
+ uint32_t endOffsetInModule_ = 0; // so preserved by serialization.
public:
- AsmJSExport() { PodZero(this); }
+ AsmJSExport() = default;
AsmJSExport(uint32_t funcIndex, uint32_t startOffsetInModule, uint32_t endOffsetInModule)
: funcIndex_(funcIndex),
startOffsetInModule_(startOffsetInModule),
@@ -288,12 +288,12 @@ enum class CacheResult
struct AsmJSMetadataCacheablePod
{
- uint32_t numFFIs;
- uint32_t srcLength;
- uint32_t srcLengthWithRightBrace;
- bool usesSimd;
+ uint32_t numFFIs = 0;
+ uint32_t srcLength = 0;
+ uint32_t srcLengthWithRightBrace = 0;
+ bool usesSimd = false;
- AsmJSMetadataCacheablePod() { PodZero(this); }
+ AsmJSMetadataCacheablePod() = default;
};
struct js::AsmJSMetadata : Metadata, AsmJSMetadataCacheablePod