From 09ad38721d8f22499890c9ed9caa338a78c01443 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Mon, 23 Jun 2014 14:14:27 -0700 Subject: [PATCH] Bug 1029132 - Use IsInRange for FAKE_JIT_TOP_FOR_BAILOUT range assertions to silence a compiler warning. r=nbp --HG-- extra : rebase_source : 187e3b4c4266e6e80f9a499973084ad0327ea696 --- js/src/jit/Bailouts.cpp | 6 ++++-- js/src/jit/ParallelFunctions.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/src/jit/Bailouts.cpp b/js/src/jit/Bailouts.cpp index 61b1829e266..7d8ca6a21c4 100644 --- a/js/src/jit/Bailouts.cpp +++ b/js/src/jit/Bailouts.cpp @@ -22,6 +22,8 @@ using namespace js; using namespace js::jit; +using mozilla::IsInRange; + // These constructor are exactly the same except for the type of the iterator // which is given to the SnapshotIterator constructor. Doing so avoid the // creation of virtual functions for the IonIterator but may introduce some @@ -76,8 +78,8 @@ jit::Bailout(BailoutStack *sp, BaselineBailoutInfo **bailoutInfo) JS_ASSERT(bailoutInfo); // We don't have an exit frame. - MOZ_ASSERT(size_t(FAKE_JIT_TOP_FOR_BAILOUT + sizeof(IonCommonFrameLayout)) < 0x1000 && - size_t(FAKE_JIT_TOP_FOR_BAILOUT) >= 0, + MOZ_ASSERT(IsInRange(FAKE_JIT_TOP_FOR_BAILOUT, 0, 0x1000) && + IsInRange(FAKE_JIT_TOP_FOR_BAILOUT + sizeof(IonCommonFrameLayout), 0, 0x1000), "Fake jitTop pointer should be within the first page."); cx->mainThread().jitTop = FAKE_JIT_TOP_FOR_BAILOUT; gc::AutoSuppressGC suppress(cx); diff --git a/js/src/jit/ParallelFunctions.cpp b/js/src/jit/ParallelFunctions.cpp index e6fa9172c37..4fbae4fccb6 100644 --- a/js/src/jit/ParallelFunctions.cpp +++ b/js/src/jit/ParallelFunctions.cpp @@ -18,6 +18,8 @@ using namespace js; using namespace jit; +using mozilla::IsInRange; + using JS::AutoCheckCannotGC; using parallel::Spew; @@ -524,8 +526,8 @@ jit::BailoutPar(BailoutStack *sp, uint8_t **entryFramePointer) ForkJoinContext *cx = ForkJoinContext::current(); // We don't have an exit frame. - MOZ_ASSERT(size_t(FAKE_JIT_TOP_FOR_BAILOUT + sizeof(IonCommonFrameLayout)) < 0x1000 && - size_t(FAKE_JIT_TOP_FOR_BAILOUT) >= 0, + MOZ_ASSERT(IsInRange(FAKE_JIT_TOP_FOR_BAILOUT, 0, 0x1000) && + IsInRange(FAKE_JIT_TOP_FOR_BAILOUT + sizeof(IonCommonFrameLayout), 0, 0x1000), "Fake jitTop pointer should be within the first page."); cx->perThreadData->jitTop = FAKE_JIT_TOP_FOR_BAILOUT;