Backed out 2 changesets (bug 1686586) for Valgrind failure. CLOSED TREE

Backed out changeset b7113f34ed0b (bug 1686586)
Backed out changeset 4464c774d0cd (bug 1686586)
This commit is contained in:
Dorel Luca 2021-01-19 21:29:03 +02:00
Родитель a0bfc3b622
Коммит 4d6741fd61
3 изменённых файлов: 19 добавлений и 27 удалений

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

@ -144,11 +144,6 @@ EnterJitStatus js::jit::MaybeEnterJit(JSContext* cx, RunState& state) {
JSScript* script = state.script();
uint8_t* code = script->jitCodeRaw();
#ifdef JS_CACHEIR_SPEW
cx->spewer().enableSpewing();
#endif
do {
// Make sure we can enter Baseline Interpreter code. Note that the prologue
// has warm-up checks to tier up if needed.
@ -199,9 +194,5 @@ EnterJitStatus js::jit::MaybeEnterJit(JSContext* cx, RunState& state) {
return EnterJitStatus::NotEntered;
} while (false);
#ifdef JS_CACHEIR_SPEW
cx->spewer().disableSpewing();
#endif
return EnterJit(cx, state, code);
}

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

@ -96,7 +96,7 @@ static bool MatchJSScript(JSScript* script, const char* pattern) {
}
bool StructuredSpewer::enabled(JSScript* script) {
if (spewingEnabled_ == 0) {
if (!spewingEnabled_) {
return false;
}

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

@ -123,6 +123,7 @@ class StructuredSpewer {
public:
StructuredSpewer()
: outputInitializationAttempted_(false),
spewingEnabled_(false),
json_(mozilla::Nothing()),
selectedChannel_() {
if (getenv("SPEW")) {
@ -130,21 +131,11 @@ class StructuredSpewer {
}
}
~StructuredSpewer() {
if (json_.isSome()) {
json_->endList();
output_.flush();
output_.finish();
json_.reset();
}
}
~StructuredSpewer() { finishSpew(); }
void enableSpewing() { spewingEnabled_++; }
void enableSpewing() { spewingEnabled_ = true; }
void disableSpewing() {
MOZ_ASSERT(spewingEnabled_ > 0);
spewingEnabled_--;
}
void disableSpewing() { spewingEnabled_ = false; }
// Check if the spewer is enabled for a particular script, used to power
// script level filtering.
@ -176,9 +167,7 @@ class StructuredSpewer {
// attemped in the right place.
bool outputInitializationAttempted_;
// Indicates the number of times spewing has been enabled. If
// spewingEnabled_ is greater than zero, then spewing is enabled.
size_t spewingEnabled_;
bool spewingEnabled_;
Fprinter output_;
mozilla::Maybe<JSONPrinter> json_;
@ -208,12 +197,24 @@ class StructuredSpewer {
// Returns true iff the channels is enabled
bool enabled(SpewChannel channel) {
return (spewingEnabled_ > 0 && selectedChannel_.enabled(channel));
return (spewingEnabled_ && selectedChannel_.enabled(channel));
}
// Start a record
void startObject(JSContext* cx, const JSScript* script, SpewChannel channel);
void finishSpew() {
if (json_.isSome()) {
json_->endList();
output_.flush();
output_.finish();
json_.reset();
}
spewingEnabled_ = false;
outputInitializationAttempted_ = false;
}
friend class AutoSpewChannel;
friend class AutoStructuredSpewer;
};