Bug 1485347 - Part 2: Remove CheckScriptDataIntegrity. r=jandem

This diagnostic did not provide value and should be removed to allow
further cleanup.

MozReview-Commit-ID: 49XJM0G7NAP
This commit is contained in:
Ted Campbell 2018-08-23 16:59:21 -04:00
parent d02091f27c
commit d5ae417328

View File

@ -75,21 +75,6 @@ using mozilla::Maybe;
using mozilla::PodCopy;
// Check that JSScript::data hasn't experienced obvious memory corruption.
// This is a diagnositic for Bug 1367896.
static void
CheckScriptDataIntegrity(JSScript* script)
{
ScopeArray* sa = script->scopes();
uint8_t* ptr = reinterpret_cast<uint8_t*>(sa->vector);
// Check that scope data - who's pointer is stored in data region - also
// points within the data region.
MOZ_RELEASE_ASSERT(ptr >= script->data &&
ptr + sa->length <= script->data + script->dataSize(),
"Corrupt JSScript::data");
}
template<XDRMode mode>
XDRResult
js::XDRScriptConst(XDRState<mode>* xdr, MutableHandleValue vp)
@ -370,8 +355,6 @@ js::XDRScript(XDRState<mode>* xdr, HandleScope scriptEnclosingScope,
script = scriptp.get();
MOZ_ASSERT(script->functionNonDelazifying() == fun);
CheckScriptDataIntegrity(script);
if (!fun && script->treatAsRunOnce() && script->hasRunOnce()) {
// This is a toplevel or eval script that's runOnce. We want to
// make sure that we're not XDR-saving an object we emitted for
@ -890,8 +873,6 @@ js::XDRScript(XDRState<mode>* xdr, HandleScope scriptEnclosingScope,
}
if (mode == XDR_DECODE) {
CheckScriptDataIntegrity(script);
scriptp.set(script);
/* see BytecodeEmitter::tellDebuggerAboutCompiledScript */
@ -3458,8 +3439,6 @@ js::detail::CopyScript(JSContext* cx, HandleScript src, HandleScript dst,
/* NB: Keep this in sync with XDRScript. */
CheckScriptDataIntegrity(src);
/* Some embeddings are not careful to use ExposeObjectToActiveJS as needed. */
MOZ_ASSERT(!src->sourceObject()->isMarkedGray());