Bug 1036781 - Part 4: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit for Baseline code. r=jandem

This commit is contained in:
Chris Peterson 2014-08-23 13:14:14 -07:00
parent f9989ac25a
commit b5b8b210b7
8 changed files with 32 additions and 37 deletions

View File

@ -1726,7 +1726,7 @@ jit::FinishBailoutToBaseline(BaselineBailoutInfo *bailoutInfo)
// baseline frame.
return false;
default:
MOZ_ASSUME_UNREACHABLE("Unknown bailout kind!");
MOZ_CRASH("Unknown bailout kind!");
}
if (!CheckFrequentBailouts(cx, outerScript))

View File

@ -1394,7 +1394,7 @@ BaselineCompiler::storeValue(const StackValue *source, const Address &dest,
masm.storeValue(scratch, dest);
break;
default:
MOZ_ASSUME_UNREACHABLE("Invalid kind");
MOZ_CRASH("Invalid kind");
}
}

View File

@ -253,7 +253,7 @@ ICEntryKindToString(ICEntry::Kind kind)
case ICEntry::Kind_DebugEpilogue:
return "debug epilogue";
default:
MOZ_ASSUME_UNREACHABLE("bad ICEntry kind");
MOZ_CRASH("bad ICEntry kind");
}
}
@ -612,7 +612,7 @@ CloneOldBaselineStub(JSContext *cx, DebugModeOSREntryVector &entries, size_t ent
#undef CASE_KIND
default:
MOZ_ASSUME_UNREACHABLE("Bad stub kind");
MOZ_CRASH("Bad stub kind");
}
if (!entry.newStub)
@ -714,7 +714,7 @@ BaselineDebugModeOSRInfo::popValueInto(PCMappingSlotInfo::SlotLocation loc, Valu
case PCMappingSlotInfo::SlotIgnore:
break;
default:
MOZ_ASSUME_UNREACHABLE("Bad slot location");
MOZ_CRASH("Bad slot location");
}
stackAdjust++;

View File

@ -46,7 +46,7 @@ FrameInfo::sync(StackValue *val)
masm.pushValue(val->constant());
break;
default:
MOZ_ASSUME_UNREACHABLE("Invalid kind");
MOZ_CRASH("Invalid kind");
}
val->setStack();
@ -102,7 +102,7 @@ FrameInfo::popValue(ValueOperand dest)
masm.moveValue(val->reg(), dest);
break;
default:
MOZ_ASSUME_UNREACHABLE("Invalid kind");
MOZ_CRASH("Invalid kind");
}
// masm.popValue already adjusted the stack pointer, don't do it twice.
@ -138,7 +138,7 @@ FrameInfo::popRegsAndSync(uint32_t uses)
break;
}
default:
MOZ_ASSUME_UNREACHABLE("Invalid uses");
MOZ_CRASH("Invalid uses");
}
}
@ -175,7 +175,7 @@ FrameInfo::assertValidState(const BytecodeInfo &info)
JS_ASSERT(!usedR1);
usedR1 = true;
} else {
MOZ_ASSUME_UNREACHABLE("Invalid register");
MOZ_CRASH("Invalid register");
}
}
}

View File

@ -253,7 +253,7 @@ ICStub::trace(JSTracer *trc)
case 2: setElemStub->toImpl<2>()->traceShapes(trc); break;
case 3: setElemStub->toImpl<3>()->traceShapes(trc); break;
case 4: setElemStub->toImpl<4>()->traceShapes(trc); break;
default: MOZ_ASSUME_UNREACHABLE("Invalid proto stub.");
default: MOZ_CRASH("Invalid proto stub.");
}
break;
}
@ -348,7 +348,7 @@ ICStub::trace(JSTracer *trc)
case 6: propStub->toImpl<6>()->traceShapes(trc); break;
case 7: propStub->toImpl<7>()->traceShapes(trc); break;
case 8: propStub->toImpl<8>()->traceShapes(trc); break;
default: MOZ_ASSUME_UNREACHABLE("Invalid proto stub.");
default: MOZ_CRASH("Invalid proto stub.");
}
break;
}
@ -415,7 +415,7 @@ ICStub::trace(JSTracer *trc)
case 2: propStub->toImpl<2>()->traceShapes(trc); break;
case 3: propStub->toImpl<3>()->traceShapes(trc); break;
case 4: propStub->toImpl<4>()->traceShapes(trc); break;
default: MOZ_ASSUME_UNREACHABLE("Invalid proto stub.");
default: MOZ_CRASH("Invalid proto stub.");
}
break;
}
@ -827,7 +827,7 @@ EnsureCanEnterIon(JSContext *cx, ICUseCount_Fallback *stub, BaselineFrame *frame
else if (stat == Method_Compiled)
IonSpew(IonSpew_BaselineOSR, " Compiled with Ion!");
else
MOZ_ASSUME_UNREACHABLE("Invalid MethodStatus!");
MOZ_CRASH("Invalid MethodStatus!");
// Failed to compile. Reset use count and return.
if (stat != Method_Compiled) {
@ -1544,7 +1544,7 @@ DoTypeUpdateFallback(JSContext *cx, BaselineFrame *frame, ICUpdatedStub *stub, H
break;
}
default:
MOZ_ASSUME_UNREACHABLE("Invalid stub");
MOZ_CRASH("Invalid stub");
}
return stub->addUpdateStubForValue(cx, script, obj, id, value);
@ -2590,7 +2590,7 @@ DoBinaryArithFallback(JSContext *cx, BaselineFrame *frame, ICBinaryArith_Fallbac
break;
}
default:
MOZ_ASSUME_UNREACHABLE("Unhandled baseline arith op");
MOZ_CRASH("Unhandled baseline arith op");
}
// Check if debug mode toggling made the stub invalid.
@ -2914,7 +2914,7 @@ ICBinaryArith_Double::Compiler::generateStubCode(MacroAssembler &masm)
JS_ASSERT(ReturnDoubleReg == FloatReg0);
break;
default:
MOZ_ASSUME_UNREACHABLE("Unexpected op");
MOZ_CRASH("Unexpected op");
}
masm.boxDouble(FloatReg0, R0);
@ -2992,7 +2992,7 @@ ICBinaryArith_BooleanWithInt32::Compiler::generateStubCode(MacroAssembler &masm)
break;
}
default:
MOZ_ASSUME_UNREACHABLE("Unhandled op for BinaryArith_BooleanWithInt32.");
MOZ_CRASH("Unhandled op for BinaryArith_BooleanWithInt32.");
}
// Failure case - jump to next stub
@ -3054,7 +3054,7 @@ ICBinaryArith_DoubleWithInt32::Compiler::generateStubCode(MacroAssembler &masm)
masm.andPtr(intReg, intReg2);
break;
default:
MOZ_ASSUME_UNREACHABLE("Unhandled op for BinaryArith_DoubleWithInt32.");
MOZ_CRASH("Unhandled op for BinaryArith_DoubleWithInt32.");
}
masm.tagValue(JSVAL_TYPE_INT32, intReg2, R0);
EmitReturnFromIC(masm);
@ -3098,7 +3098,7 @@ DoUnaryArithFallback(JSContext *cx, BaselineFrame *frame, ICUnaryArith_Fallback
return false;
break;
default:
MOZ_ASSUME_UNREACHABLE("Unexpected op");
MOZ_CRASH("Unexpected op");
}
// Check if debug mode toggling made the stub invalid.
@ -3738,7 +3738,7 @@ RemoveExistingGetElemNativeStubs(JSContext *cx, ICGetElem_Fallback *stub, Handle
// Should never get here, because this means a matching stub exists, and if
// a matching stub exists, this procedure should never have been called.
MOZ_ASSUME_UNREACHABLE("Procedure should never have been called.");
MOZ_CRASH("Procedure should never have been called.");
}
}
@ -5354,7 +5354,7 @@ ICSetElemDenseAddCompiler::getStub(ICStubSpace *space)
case 2: stub = getStubSpecific<2>(space, &shapes); break;
case 3: stub = getStubSpecific<3>(space, &shapes); break;
case 4: stub = getStubSpecific<4>(space, &shapes); break;
default: MOZ_ASSUME_UNREACHABLE("ProtoChainDepth too high.");
default: MOZ_CRASH("ProtoChainDepth too high.");
}
if (!stub || !stub->initUpdatingChain(cx, space))
return nullptr;
@ -6714,7 +6714,7 @@ ICGetProp_Primitive::Compiler::generateStubCode(MacroAssembler &masm)
masm.branchTestBoolean(Assembler::NotEqual, R0, &failure);
break;
default:
MOZ_ASSUME_UNREACHABLE("unexpected type");
MOZ_CRASH("unexpected type");
}
GeneralRegisterSet regs(availableGeneralRegs(1));
@ -6869,7 +6869,7 @@ ICGetPropNativeDoesNotExistCompiler::getStub(ICStubSpace *space)
case 6: stub = getStubSpecific<6>(space, &shapes); break;
case 7: stub = getStubSpecific<7>(space, &shapes); break;
case 8: stub = getStubSpecific<8>(space, &shapes); break;
default: MOZ_ASSUME_UNREACHABLE("ProtoChainDepth too high.");
default: MOZ_CRASH("ProtoChainDepth too high.");
}
if (!stub)
return nullptr;
@ -7748,7 +7748,7 @@ ICSetPropNativeAddCompiler::getStub(ICStubSpace *space)
case 2: stub = getStubSpecific<2>(space, &shapes); break;
case 3: stub = getStubSpecific<3>(space, &shapes); break;
case 4: stub = getStubSpecific<4>(space, &shapes); break;
default: MOZ_ASSUME_UNREACHABLE("ProtoChainDepth too high.");
default: MOZ_CRASH("ProtoChainDepth too high.");
}
if (!stub || !stub->initUpdatingChain(cx, space))
return nullptr;
@ -10051,7 +10051,7 @@ ICTypeOf_Typed::Compiler::generateStubCode(MacroAssembler &masm)
break;
default:
MOZ_ASSUME_UNREACHABLE("Unexpected type");
MOZ_CRASH("Unexpected type");
}
masm.movePtr(ImmGCPtr(typeString_), R0.scratchReg());

View File

@ -595,7 +595,7 @@ class ICStub
IC_STUB_KIND_LIST(DEF_KIND_STR)
#undef DEF_KIND_STR
default:
MOZ_ASSUME_UNREACHABLE("Invalid kind.");
MOZ_CRASH("Invalid kind.");
}
}
@ -1130,7 +1130,7 @@ class ICStubCompiler
regs.take(R1);
break;
default:
MOZ_ASSUME_UNREACHABLE("Invalid numInputs");
MOZ_CRASH("Invalid numInputs");
}
return regs;
@ -3306,8 +3306,7 @@ class ICGetElemNativeCompiler : public ICStubCompiler
getter_, pcOffset_, holder_, holderShape);
}
MOZ_ASSUME_UNREACHABLE("Invalid kind.");
return nullptr;
MOZ_CRASH("Invalid kind.");
}
};

View File

@ -530,7 +530,7 @@ BaselineScript::icEntryFromPCOffset(uint32_t pcOffset)
if (icEntry(i).isForOp())
return icEntry(i);
}
MOZ_ASSUME_UNREACHABLE("Invalid PC offset for IC entry.");
MOZ_CRASH("Invalid PC offset for IC entry.");
}
ICEntry &
@ -672,8 +672,6 @@ BaselineScript::nativeCodeForPC(JSScript *script, jsbytecode *pc, PCMappingSlotI
curPC += GetBytecodeLength(curPC);
}
MOZ_ASSUME_UNREACHABLE("Invalid pc");
}
jsbytecode *
@ -748,8 +746,6 @@ BaselineScript::pcForNativeOffset(JSScript *script, uint32_t nativeOffset, bool
curPC += GetBytecodeLength(curPC);
}
MOZ_ASSUME_UNREACHABLE("Bad baseline jitcode address");
}
jsbytecode *

View File

@ -813,7 +813,7 @@ DebugPrologue(JSContext *cx, BaselineFrame *frame, jsbytecode *pc, bool *mustRet
return false;
default:
MOZ_ASSUME_UNREACHABLE("Invalid trap status");
MOZ_CRASH("Invalid trap status");
}
}
@ -965,7 +965,7 @@ HandleDebugTrap(JSContext *cx, BaselineFrame *frame, uint8_t *retAddr, bool *mus
return false;
default:
MOZ_ASSUME_UNREACHABLE("Invalid trap status");
MOZ_CRASH("Invalid trap status");
}
return true;
@ -996,7 +996,7 @@ OnDebuggerStatement(JSContext *cx, BaselineFrame *frame, jsbytecode *pc, bool *m
return false;
default:
MOZ_ASSUME_UNREACHABLE("Invalid trap status");
MOZ_CRASH("Invalid trap status");
}
}