|
@@ -1,554 +0,0 @@
|
|
|
-# HG changeset patch
|
|
|
-# User Ted Campbell <tcampbell@mozilla.com>
|
|
|
-# Date 1534169521 14400
|
|
|
-# Mon Aug 13 10:12:01 2018 -0400
|
|
|
-# Node ID 490b0d605859e612832f6b655d4168e39a30ceb1
|
|
|
-# Parent 0dcc490db922fc504a1b92339be000260448d75b
|
|
|
-Bug 1482931 - Cleanup const-ness of statics in js/src. r=waldo
|
|
|
-
|
|
|
-Mark read-only global data as const. Replacing |const char* x[]| with
|
|
|
-|const char* const x[]|. Replacing |static const char* x = "..."| with
|
|
|
-|static const char x[] = "..."|.
|
|
|
-
|
|
|
-MozReview-Commit-ID: Ftv7ziIAWGh
|
|
|
-
|
|
|
-diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp
|
|
|
---- a/js/src/gc/GC.cpp
|
|
|
-+++ b/js/src/gc/GC.cpp
|
|
|
-@@ -1033,17 +1033,17 @@ GCRuntime::GCRuntime(JSRuntime* rt) :
|
|
|
- void
|
|
|
- GCRuntime::getZealBits(uint32_t* zealBits, uint32_t* frequency, uint32_t* scheduled)
|
|
|
- {
|
|
|
- *zealBits = zealModeBits;
|
|
|
- *frequency = zealFrequency;
|
|
|
- *scheduled = nextScheduled;
|
|
|
- }
|
|
|
-
|
|
|
--const char* gc::ZealModeHelpText =
|
|
|
-+const char gc::ZealModeHelpText[] =
|
|
|
- " Specifies how zealous the garbage collector should be. Some of these modes can\n"
|
|
|
- " be set simultaneously, by passing multiple level options, e.g. \"2;4\" will activate\n"
|
|
|
- " both modes 2 and 4. Modes can be specified by name or number.\n"
|
|
|
- " \n"
|
|
|
- " Values:\n"
|
|
|
- " 0: (None) Normal amount of collection (resets all modes)\n"
|
|
|
- " 1: (RootsChange) Collect when roots are added or removed\n"
|
|
|
- " 2: (Alloc) Collect when every N allocations (default: 100)\n"
|
|
|
-@@ -1239,17 +1239,17 @@ GCRuntime::parseAndSetZeal(const char* s
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- static const char*
|
|
|
- AllocKindName(AllocKind kind)
|
|
|
- {
|
|
|
-- static const char* names[] = {
|
|
|
-+ static const char* const names[] = {
|
|
|
- #define EXPAND_THING_NAME(allocKind, _1, _2, _3, _4, _5, _6) \
|
|
|
- #allocKind,
|
|
|
- FOR_EACH_ALLOCKIND(EXPAND_THING_NAME)
|
|
|
- #undef EXPAND_THING_NAME
|
|
|
- };
|
|
|
- static_assert(ArrayLength(names) == size_t(AllocKind::LIMIT),
|
|
|
- "names array should have an entry for every AllocKind");
|
|
|
-
|
|
|
-diff --git a/js/src/gc/GC.h b/js/src/gc/GC.h
|
|
|
---- a/js/src/gc/GC.h
|
|
|
-+++ b/js/src/gc/GC.h
|
|
|
-@@ -140,17 +140,17 @@ void
|
|
|
- MergeRealms(JS::Realm* source, JS::Realm* target);
|
|
|
-
|
|
|
- enum VerifierType {
|
|
|
- PreBarrierVerifier
|
|
|
- };
|
|
|
-
|
|
|
- #ifdef JS_GC_ZEAL
|
|
|
-
|
|
|
--extern const char* ZealModeHelpText;
|
|
|
-+extern const char ZealModeHelpText[];
|
|
|
-
|
|
|
- /* Check that write barriers have been used correctly. See gc/Verifier.cpp. */
|
|
|
- void
|
|
|
- VerifyBarriers(JSRuntime* rt, VerifierType type);
|
|
|
-
|
|
|
- void
|
|
|
- MaybeVerifyBarriers(JSContext* cx, bool always = false);
|
|
|
-
|
|
|
-diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
|
|
|
---- a/js/src/gc/Nursery.cpp
|
|
|
-+++ b/js/src/gc/Nursery.cpp
|
|
|
-@@ -621,17 +621,17 @@ js::Nursery::renderProfileJSON(JSONPrint
|
|
|
- // in non-nightly builds.
|
|
|
- json.property("cells_allocated_nursery", runtime()->gc.stats().allocsSinceMinorGCNursery());
|
|
|
- json.property("cells_allocated_tenured", runtime()->gc.stats().allocsSinceMinorGCTenured());
|
|
|
- #endif
|
|
|
-
|
|
|
- json.beginObjectProperty("phase_times");
|
|
|
-
|
|
|
- #define EXTRACT_NAME(name, text) #name,
|
|
|
-- static const char* names[] = {
|
|
|
-+ static const char* const names[] = {
|
|
|
- FOR_EACH_NURSERY_PROFILE_TIME(EXTRACT_NAME)
|
|
|
- #undef EXTRACT_NAME
|
|
|
- "" };
|
|
|
-
|
|
|
- size_t i = 0;
|
|
|
- for (auto time : profileDurations_)
|
|
|
- json.property(names[i++], time, json.MICROSECONDS);
|
|
|
-
|
|
|
-diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp
|
|
|
---- a/js/src/jit/CacheIR.cpp
|
|
|
-+++ b/js/src/jit/CacheIR.cpp
|
|
|
-@@ -21,17 +21,17 @@
|
|
|
- #include "vm/UnboxedObject-inl.h"
|
|
|
-
|
|
|
- using namespace js;
|
|
|
- using namespace js::jit;
|
|
|
-
|
|
|
- using mozilla::DebugOnly;
|
|
|
- using mozilla::Maybe;
|
|
|
-
|
|
|
--const char* js::jit::CacheKindNames[] = {
|
|
|
-+const char* const js::jit::CacheKindNames[] = {
|
|
|
- #define DEFINE_KIND(kind) #kind,
|
|
|
- CACHE_IR_KINDS(DEFINE_KIND)
|
|
|
- #undef DEFINE_KIND
|
|
|
- };
|
|
|
-
|
|
|
- void
|
|
|
- CacheIRWriter::assertSameCompartment(JSObject* obj) {
|
|
|
- assertSameCompartmentDebugOnly(cx_, obj);
|
|
|
-diff --git a/js/src/jit/CacheIR.h b/js/src/jit/CacheIR.h
|
|
|
---- a/js/src/jit/CacheIR.h
|
|
|
-+++ b/js/src/jit/CacheIR.h
|
|
|
-@@ -171,17 +171,17 @@ class TypedOperandId : public OperandId
|
|
|
-
|
|
|
- enum class CacheKind : uint8_t
|
|
|
- {
|
|
|
- #define DEFINE_KIND(kind) kind,
|
|
|
- CACHE_IR_KINDS(DEFINE_KIND)
|
|
|
- #undef DEFINE_KIND
|
|
|
- };
|
|
|
-
|
|
|
--extern const char* CacheKindNames[];
|
|
|
-+extern const char* const CacheKindNames[];
|
|
|
-
|
|
|
- #define CACHE_IR_OPS(_) \
|
|
|
- _(GuardIsObject) \
|
|
|
- _(GuardIsObjectOrNull) \
|
|
|
- _(GuardIsNullOrUndefined) \
|
|
|
- _(GuardIsNotNullOrUndefined) \
|
|
|
- _(GuardIsNull) \
|
|
|
- _(GuardIsUndefined) \
|
|
|
-diff --git a/js/src/jit/IonOptimizationLevels.cpp b/js/src/jit/IonOptimizationLevels.cpp
|
|
|
---- a/js/src/jit/IonOptimizationLevels.cpp
|
|
|
-+++ b/js/src/jit/IonOptimizationLevels.cpp
|
|
|
-@@ -10,17 +10,17 @@
|
|
|
- #include "vm/JSScript.h"
|
|
|
-
|
|
|
- using namespace js;
|
|
|
- using namespace js::jit;
|
|
|
-
|
|
|
- namespace js {
|
|
|
- namespace jit {
|
|
|
-
|
|
|
--OptimizationLevelInfo IonOptimizations;
|
|
|
-+const OptimizationLevelInfo IonOptimizations;
|
|
|
-
|
|
|
- const uint32_t OptimizationInfo::CompilerWarmupThreshold = 1000;
|
|
|
- const uint32_t OptimizationInfo::CompilerSmallFunctionWarmupThreshold = CompilerWarmupThreshold;
|
|
|
-
|
|
|
- void
|
|
|
- OptimizationInfo::initNormalOptimizationInfo()
|
|
|
- {
|
|
|
- level_ = OptimizationLevel::Normal;
|
|
|
-diff --git a/js/src/jit/IonOptimizationLevels.h b/js/src/jit/IonOptimizationLevels.h
|
|
|
---- a/js/src/jit/IonOptimizationLevels.h
|
|
|
-+++ b/js/src/jit/IonOptimizationLevels.h
|
|
|
-@@ -303,14 +303,14 @@ class OptimizationLevelInfo
|
|
|
- }
|
|
|
-
|
|
|
- OptimizationLevel nextLevel(OptimizationLevel level) const;
|
|
|
- OptimizationLevel firstLevel() const;
|
|
|
- bool isLastLevel(OptimizationLevel level) const;
|
|
|
- OptimizationLevel levelForScript(JSScript* script, jsbytecode* pc = nullptr) const;
|
|
|
- };
|
|
|
-
|
|
|
--extern OptimizationLevelInfo IonOptimizations;
|
|
|
-+extern const OptimizationLevelInfo IonOptimizations;
|
|
|
-
|
|
|
- } // namespace jit
|
|
|
- } // namespace js
|
|
|
-
|
|
|
- #endif /* jit_IonOptimizationLevels_h */
|
|
|
-diff --git a/js/src/jit/JitSpewer.cpp b/js/src/jit/JitSpewer.cpp
|
|
|
---- a/js/src/jit/JitSpewer.cpp
|
|
|
-+++ b/js/src/jit/JitSpewer.cpp
|
|
|
-@@ -98,17 +98,17 @@ static size_t ChannelIndentLevel[] =
|
|
|
- #define JITSPEW_CHANNEL(name) 0,
|
|
|
- JITSPEW_CHANNEL_LIST(JITSPEW_CHANNEL)
|
|
|
- #undef JITSPEW_CHANNEL
|
|
|
- };
|
|
|
-
|
|
|
- static bool
|
|
|
- FilterContainsLocation(JSScript* function)
|
|
|
- {
|
|
|
-- static const char* filter = getenv("IONFILTER");
|
|
|
-+ static const char* const filter = getenv("IONFILTER");
|
|
|
-
|
|
|
- // If there is no filter we accept all outputs.
|
|
|
- if (!filter || !filter[0])
|
|
|
- return true;
|
|
|
-
|
|
|
- // Disable wasm output when filter is set.
|
|
|
- if (!function)
|
|
|
- return false;
|
|
|
-diff --git a/js/src/jit/ScalarReplacement.cpp b/js/src/jit/ScalarReplacement.cpp
|
|
|
---- a/js/src/jit/ScalarReplacement.cpp
|
|
|
-+++ b/js/src/jit/ScalarReplacement.cpp
|
|
|
-@@ -307,17 +307,17 @@ IsObjectEscaped(MInstruction* ins, JSObj
|
|
|
- JitSpew(JitSpew_Escape, "Object is not escaped");
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- class ObjectMemoryView : public MDefinitionVisitorDefaultNoop
|
|
|
- {
|
|
|
- public:
|
|
|
- typedef MObjectState BlockState;
|
|
|
-- static const char* phaseName;
|
|
|
-+ static const char phaseName[];
|
|
|
-
|
|
|
- private:
|
|
|
- TempAllocator& alloc_;
|
|
|
- MConstant* undefinedVal_;
|
|
|
- MInstruction* obj_;
|
|
|
- MBasicBlock* startBlock_;
|
|
|
- BlockState* state_;
|
|
|
-
|
|
|
-@@ -365,17 +365,18 @@ class ObjectMemoryView : public MDefinit
|
|
|
- void visitLoadUnboxedString(MLoadUnboxedString* ins);
|
|
|
-
|
|
|
- private:
|
|
|
- void storeOffset(MInstruction* ins, size_t offset, MDefinition* value);
|
|
|
- void loadOffset(MInstruction* ins, size_t offset);
|
|
|
- void visitObjectGuard(MInstruction* ins, MDefinition* operand);
|
|
|
- };
|
|
|
-
|
|
|
--const char* ObjectMemoryView::phaseName = "Scalar Replacement of Object";
|
|
|
-+/* static */ const char
|
|
|
-+ObjectMemoryView::phaseName[] = "Scalar Replacement of Object";
|
|
|
-
|
|
|
- ObjectMemoryView::ObjectMemoryView(TempAllocator& alloc, MInstruction* obj)
|
|
|
- : alloc_(alloc),
|
|
|
- undefinedVal_(nullptr),
|
|
|
- obj_(obj),
|
|
|
- startBlock_(obj->block()),
|
|
|
- state_(nullptr),
|
|
|
- lastResumePoint_(nullptr),
|
|
|
-diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp
|
|
|
---- a/js/src/jsnum.cpp
|
|
|
-+++ b/js/src/jsnum.cpp
|
|
|
-@@ -1240,17 +1240,17 @@ js::InitNumberClass(JSContext* cx, Handl
|
|
|
-
|
|
|
- if (!LinkConstructorAndPrototype(cx, ctor, numberProto))
|
|
|
- return nullptr;
|
|
|
-
|
|
|
- /*
|
|
|
- * Our NaN must be one particular canonical value, because we rely on NaN
|
|
|
- * encoding for our value representation. See Value.h.
|
|
|
- */
|
|
|
-- static JSConstDoubleSpec number_constants[] = {
|
|
|
-+ static const JSConstDoubleSpec number_constants[] = {
|
|
|
- {"NaN", GenericNaN() },
|
|
|
- {"POSITIVE_INFINITY", mozilla::PositiveInfinity<double>() },
|
|
|
- {"NEGATIVE_INFINITY", mozilla::NegativeInfinity<double>() },
|
|
|
- {"MAX_VALUE", 1.7976931348623157E+308 },
|
|
|
- {"MIN_VALUE", MinNumberValue<double>() },
|
|
|
- /* ES6 (April 2014 draft) 20.1.2.6 */
|
|
|
- {"MAX_SAFE_INTEGER", 9007199254740991 },
|
|
|
- /* ES6 (April 2014 draft) 20.1.2.10 */
|
|
|
-diff --git a/js/src/proxy/ScriptedProxyHandler.cpp b/js/src/proxy/ScriptedProxyHandler.cpp
|
|
|
---- a/js/src/proxy/ScriptedProxyHandler.cpp
|
|
|
-+++ b/js/src/proxy/ScriptedProxyHandler.cpp
|
|
|
-@@ -30,17 +30,17 @@ IsCompatiblePropertyDescriptor(JSContext
|
|
|
- {
|
|
|
- // precondition: we won't set details if checks pass, so it must be null here.
|
|
|
- MOZ_ASSERT(*errorDetails == nullptr);
|
|
|
-
|
|
|
- // Step 2.
|
|
|
- if (!current.object()) {
|
|
|
- // Step 2a-b,e. As |O| is always undefined, steps 2c-d fall away.
|
|
|
- if (!extensible) {
|
|
|
-- static const char* DETAILS_NOT_EXTENSIBLE =
|
|
|
-+ static const char DETAILS_NOT_EXTENSIBLE[] =
|
|
|
- "proxy can't report an extensible object as non-extensible";
|
|
|
- *errorDetails = DETAILS_NOT_EXTENSIBLE;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // Step 3.
|
|
|
- if (!desc.hasValue() && !desc.hasWritable() &&
|
|
|
-@@ -68,63 +68,63 @@ IsCompatiblePropertyDescriptor(JSContext
|
|
|
- if (same)
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // Step 5.
|
|
|
- if (!current.configurable()) {
|
|
|
- // Step 5a.
|
|
|
- if (desc.hasConfigurable() && desc.configurable()) {
|
|
|
-- static const char* DETAILS_CANT_REPORT_NC_AS_C =
|
|
|
-+ static const char DETAILS_CANT_REPORT_NC_AS_C[] =
|
|
|
- "proxy can't report an existing non-configurable property as configurable";
|
|
|
- *errorDetails = DETAILS_CANT_REPORT_NC_AS_C;
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // Step 5b.
|
|
|
- if (desc.hasEnumerable() && desc.enumerable() != current.enumerable()) {
|
|
|
-- static const char* DETAILS_ENUM_DIFFERENT =
|
|
|
-+ static const char DETAILS_ENUM_DIFFERENT[] =
|
|
|
- "proxy can't report a different 'enumerable' from target when target is not configurable";
|
|
|
- *errorDetails = DETAILS_ENUM_DIFFERENT;
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // Step 6.
|
|
|
- if (desc.isGenericDescriptor())
|
|
|
- return true;
|
|
|
-
|
|
|
- // Step 7.
|
|
|
- if (current.isDataDescriptor() != desc.isDataDescriptor()) {
|
|
|
- // Steps 7a, 11. As |O| is always undefined, steps 2b-c fall away.
|
|
|
- if (!current.configurable()) {
|
|
|
-- static const char* DETAILS_CURRENT_NC_DIFF_TYPE =
|
|
|
-+ static const char DETAILS_CURRENT_NC_DIFF_TYPE[] =
|
|
|
- "proxy can't report a different descriptor type when target is not configurable";
|
|
|
- *errorDetails = DETAILS_CURRENT_NC_DIFF_TYPE;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // Step 8.
|
|
|
- if (current.isDataDescriptor()) {
|
|
|
- MOZ_ASSERT(desc.isDataDescriptor()); // by step 7
|
|
|
- if (!current.configurable() && !current.writable()) {
|
|
|
- if (desc.hasWritable() && desc.writable()) {
|
|
|
-- static const char* DETAILS_CANT_REPORT_NW_AS_W =
|
|
|
-+ static const char DETAILS_CANT_REPORT_NW_AS_W[] =
|
|
|
- "proxy can't report a non-configurable, non-writable property as writable";
|
|
|
- *errorDetails = DETAILS_CANT_REPORT_NW_AS_W;
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- if (desc.hasValue()) {
|
|
|
- bool same;
|
|
|
- if (!SameValue(cx, desc.value(), current.value(), &same))
|
|
|
- return false;
|
|
|
- if (!same) {
|
|
|
-- static const char* DETAILS_DIFFERENT_VALUE =
|
|
|
-+ static const char DETAILS_DIFFERENT_VALUE[] =
|
|
|
- "proxy must report the same value for the non-writable, non-configurable property";
|
|
|
- *errorDetails = DETAILS_DIFFERENT_VALUE;
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
-@@ -132,22 +132,22 @@ IsCompatiblePropertyDescriptor(JSContext
|
|
|
-
|
|
|
- // Step 9.
|
|
|
- MOZ_ASSERT(current.isAccessorDescriptor()); // by step 8
|
|
|
- MOZ_ASSERT(desc.isAccessorDescriptor()); // by step 7
|
|
|
-
|
|
|
- if (current.configurable())
|
|
|
- return true;
|
|
|
- if (desc.hasSetterObject() && (desc.setter() != current.setter())) {
|
|
|
-- static const char* DETAILS_SETTERS_DIFFERENT =
|
|
|
-+ static const char DETAILS_SETTERS_DIFFERENT[] =
|
|
|
- "proxy can't report different setters for a currently non-configurable property";
|
|
|
- *errorDetails = DETAILS_SETTERS_DIFFERENT;
|
|
|
- }
|
|
|
- else if (desc.hasGetterObject() && (desc.getter() != current.getter())) {
|
|
|
-- static const char* DETAILS_GETTERS_DIFFERENT =
|
|
|
-+ static const char DETAILS_GETTERS_DIFFERENT[] =
|
|
|
- "proxy can't report different getters for a currently non-configurable property";
|
|
|
- *errorDetails = DETAILS_GETTERS_DIFFERENT;
|
|
|
- }
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // Get the [[ProxyHandler]] of a scripted proxy.
|
|
|
- /* static */ JSObject*
|
|
|
-@@ -651,17 +651,17 @@ ScriptedProxyHandler::defineProperty(JSC
|
|
|
- &errorDetails))
|
|
|
- return false;
|
|
|
-
|
|
|
- if (errorDetails)
|
|
|
- return js::Throw(cx, id, JSMSG_CANT_DEFINE_INVALID, errorDetails);
|
|
|
-
|
|
|
- // Step 16b.
|
|
|
- if (settingConfigFalse && targetDesc.configurable()) {
|
|
|
-- static const char* DETAILS_CANT_REPORT_C_AS_NC =
|
|
|
-+ static const char DETAILS_CANT_REPORT_C_AS_NC[] =
|
|
|
- "proxy can't define an existing configurable property as non-configurable";
|
|
|
- return js::Throw(cx, id, JSMSG_CANT_DEFINE_INVALID, DETAILS_CANT_REPORT_C_AS_NC);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // Step 17.
|
|
|
- return result.succeed();
|
|
|
- }
|
|
|
-diff --git a/js/src/vm/ArrayBufferObject.cpp b/js/src/vm/ArrayBufferObject.cpp
|
|
|
---- a/js/src/vm/ArrayBufferObject.cpp
|
|
|
-+++ b/js/src/vm/ArrayBufferObject.cpp
|
|
|
-@@ -1487,17 +1487,17 @@ ArrayBufferObject::addView(JSContext* cx
|
|
|
- }
|
|
|
- return ObjectRealm::get(this).innerViews.get().addView(cx, this, view);
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * InnerViewTable
|
|
|
- */
|
|
|
-
|
|
|
--static size_t VIEW_LIST_MAX_LENGTH = 500;
|
|
|
-+constexpr size_t VIEW_LIST_MAX_LENGTH = 500;
|
|
|
-
|
|
|
- bool
|
|
|
- InnerViewTable::addView(JSContext* cx, ArrayBufferObject* buffer, ArrayBufferViewObject* view)
|
|
|
- {
|
|
|
- // ArrayBufferObject entries are only added when there are multiple views.
|
|
|
- MOZ_ASSERT(buffer->firstView());
|
|
|
-
|
|
|
- Map::AddPtr p = map.lookupForAdd(buffer);
|
|
|
-diff --git a/js/src/vm/BytecodeUtil.cpp b/js/src/vm/BytecodeUtil.cpp
|
|
|
---- a/js/src/vm/BytecodeUtil.cpp
|
|
|
-+++ b/js/src/vm/BytecodeUtil.cpp
|
|
|
-@@ -68,27 +68,27 @@ const JSCodeSpec js::CodeSpec[] = {
|
|
|
- FOR_EACH_OPCODE(MAKE_CODESPEC)
|
|
|
- #undef MAKE_CODESPEC
|
|
|
- };
|
|
|
-
|
|
|
- /*
|
|
|
- * Each element of the array is either a source literal associated with JS
|
|
|
- * bytecode or null.
|
|
|
- */
|
|
|
--static const char * const CodeToken[] = {
|
|
|
-+static const char* const CodeToken[] = {
|
|
|
- #define TOKEN(op, val, name, token, ...) token,
|
|
|
- FOR_EACH_OPCODE(TOKEN)
|
|
|
- #undef TOKEN
|
|
|
- };
|
|
|
-
|
|
|
- /*
|
|
|
- * Array of JS bytecode names used by PC count JSON, DEBUG-only Disassemble
|
|
|
- * and JIT debug spew.
|
|
|
- */
|
|
|
--const char * const js::CodeName[] = {
|
|
|
-+const char* const js::CodeName[] = {
|
|
|
- #define OPNAME(op, val, name, ...) name,
|
|
|
- FOR_EACH_OPCODE(OPNAME)
|
|
|
- #undef OPNAME
|
|
|
- };
|
|
|
-
|
|
|
- /************************************************************************/
|
|
|
-
|
|
|
- static bool
|
|
|
-@@ -109,17 +109,18 @@ js::GetVariableBytecodeLength(jsbytecode
|
|
|
- unsigned ncases = unsigned(high - low + 1);
|
|
|
- return 1 + 3 * JUMP_OFFSET_LEN + ncases * JUMP_OFFSET_LEN;
|
|
|
- }
|
|
|
- default:
|
|
|
- MOZ_CRASH("Unexpected op");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
--const char * PCCounts::numExecName = "interp";
|
|
|
-+/* static */ const char
|
|
|
-+PCCounts::numExecName[] = "interp";
|
|
|
-
|
|
|
- static MOZ_MUST_USE bool
|
|
|
- DumpIonScriptCounts(Sprinter* sp, HandleScript script, jit::IonScriptCounts* ionCounts)
|
|
|
- {
|
|
|
- if (!sp->jsprintf("IonScript [%zu blocks]:\n", ionCounts->numBlocks()))
|
|
|
- return false;
|
|
|
-
|
|
|
- for (size_t i = 0; i < ionCounts->numBlocks(); i++) {
|
|
|
-diff --git a/js/src/vm/BytecodeUtil.h b/js/src/vm/BytecodeUtil.h
|
|
|
---- a/js/src/vm/BytecodeUtil.h
|
|
|
-+++ b/js/src/vm/BytecodeUtil.h
|
|
|
-@@ -807,17 +807,17 @@ class PCCounts
|
|
|
-
|
|
|
- uint64_t& numExec() {
|
|
|
- return numExec_;
|
|
|
- }
|
|
|
- uint64_t numExec() const {
|
|
|
- return numExec_;
|
|
|
- }
|
|
|
-
|
|
|
-- static const char* numExecName;
|
|
|
-+ static const char numExecName[];
|
|
|
- };
|
|
|
-
|
|
|
- static inline jsbytecode*
|
|
|
- GetNextPc(jsbytecode* pc)
|
|
|
- {
|
|
|
- return pc + GetBytecodeLength(pc);
|
|
|
- }
|
|
|
-
|
|
|
-diff --git a/js/src/vm/TraceLoggingGraph.cpp b/js/src/vm/TraceLoggingGraph.cpp
|
|
|
---- a/js/src/vm/TraceLoggingGraph.cpp
|
|
|
-+++ b/js/src/vm/TraceLoggingGraph.cpp
|
|
|
-@@ -51,17 +51,17 @@ TraceLoggerGraphState* traceLoggerGraphS
|
|
|
- // Return a filename relative to the output directory. %u and %d substitutions
|
|
|
- // are allowed, with %u standing for a full 32-bit number and %d standing for
|
|
|
- // an up to 3-digit number.
|
|
|
- static js::UniqueChars
|
|
|
- MOZ_FORMAT_PRINTF(1, 2)
|
|
|
- AllocTraceLogFilename(const char* pattern, ...) {
|
|
|
- va_list ap;
|
|
|
-
|
|
|
-- static const char* outdir = getenv("TLDIR") ? getenv("TLDIR") : DEFAULT_TRACE_LOG_DIR;
|
|
|
-+ static const char* const outdir = getenv("TLDIR") ? getenv("TLDIR") : DEFAULT_TRACE_LOG_DIR;
|
|
|
- size_t len = strlen(outdir) + 1; // "+ 1" is for the '/'
|
|
|
-
|
|
|
- for (const char* p = pattern; *p; p++) {
|
|
|
- if (*p == '%') {
|
|
|
- p++;
|
|
|
- if (*p == 'u')
|
|
|
- len += sizeof("4294967295") - 1;
|
|
|
- else if (*p == 'd')
|
|
|
-diff --git a/js/src/wasm/WasmFrameIter.cpp b/js/src/wasm/WasmFrameIter.cpp
|
|
|
---- a/js/src/wasm/WasmFrameIter.cpp
|
|
|
-+++ b/js/src/wasm/WasmFrameIter.cpp
|
|
|
-@@ -1280,21 +1280,21 @@ ThunkedNativeToDescription(SymbolicAddre
|
|
|
- const char*
|
|
|
- ProfilingFrameIterator::label() const
|
|
|
- {
|
|
|
- MOZ_ASSERT(!done());
|
|
|
-
|
|
|
- // Use the same string for both time inside and under so that the two
|
|
|
- // entries will be coalesced by the profiler.
|
|
|
- // Must be kept in sync with /tools/profiler/tests/test_asm.js
|
|
|
-- static const char* importJitDescription = "fast exit trampoline (in wasm)";
|
|
|
-- static const char* importInterpDescription = "slow exit trampoline (in wasm)";
|
|
|
-- static const char* builtinNativeDescription = "fast exit trampoline to native (in wasm)";
|
|
|
-- static const char* trapDescription = "trap handling (in wasm)";
|
|
|
-- static const char* debugTrapDescription = "debug trap handling (in wasm)";
|
|
|
-+ static const char importJitDescription[] = "fast exit trampoline (in wasm)";
|
|
|
-+ static const char importInterpDescription[] = "slow exit trampoline (in wasm)";
|
|
|
-+ static const char builtinNativeDescription[] = "fast exit trampoline to native (in wasm)";
|
|
|
-+ static const char trapDescription[] = "trap handling (in wasm)";
|
|
|
-+ static const char debugTrapDescription[] = "debug trap handling (in wasm)";
|
|
|
-
|
|
|
- if (!exitReason_.isFixed())
|
|
|
- return ThunkedNativeToDescription(exitReason_.symbolic());
|
|
|
-
|
|
|
- switch (exitReason_.fixed()) {
|
|
|
- case ExitReason::Fixed::None:
|
|
|
- break;
|
|
|
- case ExitReason::Fixed::ImportJit:
|