merge mozilla-central to autoland. r=merge a=merge

This commit is contained in:
Sebastian Hengst 2017-09-15 21:34:39 +02:00
Родитель 6b2dbc2b82 6d3d62f7fb
Коммит 79fa2520bf
39 изменённых файлов: 85 добавлений и 327 удалений

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

@ -3629,16 +3629,27 @@ already_AddRefed<nsIEventTarget>
ContentChild::GetSpecificMessageEventTarget(const Message& aMsg)
{
switch(aMsg.type()) {
// Javascript
case PJavaScript::Msg_DropTemporaryStrongReferences__ID:
case PJavaScript::Msg_DropObject__ID:
// Navigation
case PContent::Msg_NotifyVisited__ID:
// Storage API
case PContent::Msg_DataStoragePut__ID:
case PContent::Msg_DataStorageRemove__ID:
case PContent::Msg_DataStorageClear__ID:
case PContent::Msg_PIPCBlobInputStreamConstructor__ID:
// Blob and BlobURL
case PContent::Msg_BlobURLRegistration__ID:
case PContent::Msg_BlobURLUnregistration__ID:
case PContent::Msg_InitBlobURLs__ID:
case PContent::Msg_PIPCBlobInputStreamConstructor__ID:
case PContent::Msg_StoreAndBroadcastBlobURLRegistration__ID:
return do_AddRef(SystemGroup::EventTargetFor(TaskCategory::Other));
default:
return nullptr;
}

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

@ -1573,7 +1573,7 @@ js::RegExpPrototypeOptimizable(JSContext* cx, unsigned argc, Value* vp)
bool
js::RegExpPrototypeOptimizableRaw(JSContext* cx, JSObject* proto)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
AutoAssertNoPendingException aanpe(cx);
if (!proto->isNative())
return false;
@ -1666,7 +1666,7 @@ js::RegExpInstanceOptimizable(JSContext* cx, unsigned argc, Value* vp)
bool
js::RegExpInstanceOptimizableRaw(JSContext* cx, JSObject* obj, JSObject* proto)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
AutoAssertNoPendingException aanpe(cx);
RegExpObject* rx = &obj->as<RegExpObject>();

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

@ -40,8 +40,6 @@ int
irregexp::CaseInsensitiveCompareStrings(const CharT* substring1, const CharT* substring2,
size_t byteLength)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(byteLength % sizeof(CharT) == 0);
size_t length = byteLength / sizeof(CharT);
@ -72,8 +70,6 @@ int
irregexp::CaseInsensitiveCompareUCStrings(const CharT* substring1, const CharT* substring2,
size_t byteLength)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(byteLength % sizeof(CharT) == 0);
size_t length = byteLength / sizeof(CharT);

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

@ -47,7 +47,6 @@ RegExpStackScope::~RegExpStackScope()
int
irregexp::GrowBacktrackStack(JSRuntime* rt)
{
AutoUnsafeCallWithABI unsafe;
return TlsContext.get()->regexpStack.ref().grow();
}

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

@ -153,11 +153,6 @@ testComparison32('gt_u', 40, 40, 0);
testComparison32('ge_s', 40, 40, 1);
testComparison32('ge_u', 40, 40, 1);
// On 32-bit debug builds, with --ion-eager, this test can run into our
// per-process JIT code limits and OOM. Trigger a GC to discard code.
if (getJitCompilerOptions()["ion.warmup.trigger"] === 0)
gc();
// Test MTest's GVN branch inversion.
var testTrunc = wasmEvalText(`(module (func (param f32) (result i32) (if i32 (i32.eqz (i32.trunc_s/f32 (get_local 0))) (i32.const 0) (i32.const 1))) (export "" 0))`).exports[""];
assertEq(testTrunc(0), 0);

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

@ -29,8 +29,6 @@ using mozilla::IsInRange;
uint32_t
jit::Bailout(BailoutStack* sp, BaselineBailoutInfo** bailoutInfo)
{
AutoUnsafeCallWithABI unsafe;
JSContext* cx = TlsContext.get();
MOZ_ASSERT(bailoutInfo);
@ -106,8 +104,6 @@ uint32_t
jit::InvalidationBailout(InvalidationBailoutStack* sp, size_t* frameSizeOut,
BaselineBailoutInfo** bailoutInfo)
{
AutoUnsafeCallWithABI unsafe;
sp->checkInvariants();
JSContext* cx = TlsContext.get();

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

@ -988,7 +988,6 @@ EmitBranchIsReturningFromCallVM(MacroAssembler& masm, Register entry, Label* lab
static void
SyncBaselineDebugModeOSRInfo(BaselineFrame* frame, Value* vp, bool rv)
{
AutoUnsafeCallWithABI unsafe;
BaselineDebugModeOSRInfo* info = frame->debugModeOSRInfo();
MOZ_ASSERT(info);
MOZ_ASSERT(frame->script()->baselineScript()->containsCodeAddress(info->resumeAddr));
@ -1023,7 +1022,6 @@ SyncBaselineDebugModeOSRInfo(BaselineFrame* frame, Value* vp, bool rv)
static void
FinishBaselineDebugModeOSR(BaselineFrame* frame)
{
AutoUnsafeCallWithABI unsafe;
frame->deleteDebugModeOSRInfo();
// We will return to JIT code now so we have to clear the override pc.

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

@ -1591,14 +1591,12 @@ CreateDependentString::generate(MacroAssembler& masm, const JSAtomState& names,
static void*
AllocateString(JSContext* cx)
{
AutoUnsafeCallWithABI unsafe;
return js::Allocate<JSString, NoGC>(cx);
}
static void*
AllocateFatInlineString(JSContext* cx)
{
AutoUnsafeCallWithABI unsafe;
return js::Allocate<JSFatInlineString, NoGC>(cx);
}
@ -1631,7 +1629,6 @@ CreateDependentString::generateFallback(MacroAssembler& masm, LiveRegisterSet re
static void*
CreateMatchResultFallbackFunc(JSContext* cx, gc::AllocKind kind, size_t nDynamicSlots)
{
AutoUnsafeCallWithABI unsafe;
return js::Allocate<JSObject, NoGC>(cx, kind, nDynamicSlots, gc::DefaultHeap,
&ArrayObject::class_);
}
@ -4003,8 +4000,7 @@ CodeGenerator::visitCallNative(LCallNative* call)
if (jitInfo && jitInfo->type() == JSJitInfo::IgnoresReturnValueNative)
native = jitInfo->ignoresReturnValueMethod;
}
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, native), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, native));
emitTracelogStopEvent(TraceLogger_Call);
@ -4127,8 +4123,7 @@ CodeGenerator::visitCallDOMNative(LCallDOMNative* call)
masm.passABIArg(argObj);
masm.passABIArg(argPrivate);
masm.passABIArg(argArgs);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->jitInfo()->method), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->jitInfo()->method));
if (target->jitInfo()->isInfallible) {
masm.loadValue(Address(masm.getStackPointer(), IonDOMMethodExitFrameLayout::offsetOfResult()),
@ -7062,24 +7057,15 @@ CodeGenerator::visitMathFunctionF(LMathFunctionF* ins)
masm.passABIArg(input, MoveOp::FLOAT32);
void* funptr = nullptr;
CheckUnsafeCallWithABI check = CheckUnsafeCallWithABI::Check;
switch (ins->mir()->function()) {
case MMathFunction::Floor:
funptr = JS_FUNC_TO_DATA_PTR(void*, floorf);
check = CheckUnsafeCallWithABI::DontCheckOther;
break;
case MMathFunction::Round:
funptr = JS_FUNC_TO_DATA_PTR(void*, math_roundf_impl);
break;
case MMathFunction::Ceil:
funptr = JS_FUNC_TO_DATA_PTR(void*, ceilf);
check = CheckUnsafeCallWithABI::DontCheckOther;
break;
case MMathFunction::Floor: funptr = JS_FUNC_TO_DATA_PTR(void*, floorf); break;
case MMathFunction::Round: funptr = JS_FUNC_TO_DATA_PTR(void*, math_roundf_impl); break;
case MMathFunction::Ceil: funptr = JS_FUNC_TO_DATA_PTR(void*, ceilf); break;
default:
MOZ_CRASH("Unknown or unsupported float32 math function");
}
masm.callWithABI(funptr, MoveOp::FLOAT32, check);
masm.callWithABI(funptr, MoveOp::FLOAT32);
}
void
@ -7972,8 +7958,7 @@ JitRuntime::generateFreeStub(JSContext* cx)
masm.setupUnalignedABICall(regTemp);
masm.passABIArg(regSlots);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, js_free), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, js_free));
masm.PopRegsInMask(save);
@ -8011,8 +7996,7 @@ JitRuntime::generateLazyLinkStub(JSContext* cx)
masm.setupUnalignedABICall(temp0);
masm.passABIArg(temp0);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, LazyLinkTopActivation), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, LazyLinkTopActivation));
masm.leaveExitFrame(/* stub code */ sizeof(JitCode*));
@ -11813,8 +11797,7 @@ CodeGenerator::visitGetDOMProperty(LGetDOMProperty* ins)
masm.passABIArg(ObjectReg);
masm.passABIArg(PrivateReg);
masm.passABIArg(ValueReg);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()));
if (ins->mir()->isInfallible()) {
masm.loadValue(Address(masm.getStackPointer(), IonDOMExitFrameLayout::offsetOfResult()),
@ -11912,8 +11895,7 @@ CodeGenerator::visitSetDOMProperty(LSetDOMProperty* ins)
masm.passABIArg(ObjectReg);
masm.passABIArg(PrivateReg);
masm.passABIArg(ValueReg);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()));
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());

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

@ -1078,8 +1078,7 @@ IonCacheIRCompiler::emitCallNativeGetterResult()
masm.passABIArg(argJSContext);
masm.passABIArg(argUintN);
masm.passABIArg(argVp);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()));
// Test for failure.
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
@ -1137,8 +1136,7 @@ IonCacheIRCompiler::emitCallProxyGetResult()
masm.passABIArg(argProxy);
masm.passABIArg(argId);
masm.passABIArg(argVp);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ProxyGetProperty), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ProxyGetProperty));
// Test for failure.
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
@ -1326,7 +1324,6 @@ IonCacheIRCompiler::emitCallStringSplitResult()
static bool
GroupHasPropertyTypes(ObjectGroup* group, jsid* id, Value* v)
{
AutoUnsafeCallWithABI unsafe;
if (group->unknownProperties())
return true;
HeapTypeSet* propTypes = group->maybeGetProperty(*id);
@ -1994,8 +1991,7 @@ IonCacheIRCompiler::emitCallNativeSetter()
masm.passABIArg(argJSContext);
masm.passABIArg(argUintN);
masm.passABIArg(argVp);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()));
// Test for failure.
masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());

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

@ -126,22 +126,8 @@ MacroAssembler::passABIArg(FloatRegister reg, MoveOp::Type type)
passABIArg(MoveOperand(reg), type);
}
void
MacroAssembler::callWithABI(void* fun, MoveOp::Type result, CheckUnsafeCallWithABI check)
{
AutoProfilerCallInstrumentation profiler(*this);
callWithABINoProfiler(fun, result, check);
}
void
MacroAssembler::callWithABI(Register fun, MoveOp::Type result)
{
AutoProfilerCallInstrumentation profiler(*this);
callWithABINoProfiler(fun, result);
}
void
MacroAssembler::callWithABI(const Address& fun, MoveOp::Type result)
template <typename T> void
MacroAssembler::callWithABI(const T& fun, MoveOp::Type result)
{
AutoProfilerCallInstrumentation profiler(*this);
callWithABINoProfiler(fun, result);

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

@ -1043,7 +1043,7 @@ FindStartOfUninitializedAndUndefinedSlots(NativeObject* templateObj, uint32_t ns
static void
AllocateObjectBufferWithInit(JSContext* cx, TypedArrayObject* obj, int32_t count)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc(cx);
obj->initPrivate(nullptr);
@ -1550,8 +1550,7 @@ MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
loadJSContext(ReturnReg);
setupUnalignedABICall(scratch);
passABIArg(ReturnReg);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, BailoutReportOverRecursed), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckHasExitFrame);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, BailoutReportOverRecursed));
jump(exceptionLabel());
}
@ -1616,8 +1615,7 @@ MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
// Call a stub to free allocated memory and create arguments objects.
setupUnalignedABICall(temp);
passABIArg(bailoutInfo);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline));
branchTest32(Zero, ReturnReg, ReturnReg, exceptionLabel());
// Restore values where they need to be and resume execution.
@ -1655,8 +1653,7 @@ MacroAssembler::generateBailoutTail(Register scratch, Register bailoutInfo)
// Call a stub to free allocated memory and create arguments objects.
setupUnalignedABICall(temp);
passABIArg(bailoutInfo);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline));
branchTest32(Zero, ReturnReg, ReturnReg, exceptionLabel());
// Restore values where they need to be and resume execution.
@ -1732,9 +1729,7 @@ MacroAssembler::assumeUnreachable(const char* output)
setupUnalignedABICall(temp);
movePtr(ImmPtr(output), temp);
passABIArg(temp);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, AssumeUnreachable_),
MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, AssumeUnreachable_));
PopRegsInMask(save);
}
@ -1758,10 +1753,7 @@ MacroAssembler::assertTestInt32(Condition cond, const T& value, const char* outp
template void MacroAssembler::assertTestInt32(Condition, const Address&, const char*);
static void
Printf0_(const char* output)
{
AutoUnsafeCallWithABI unsafe;
Printf0_(const char* output) {
// Use stderr instead of stdout because this is only used for debug
// output. stderr is less likely to interfere with the program's normal
// output, and it's always unbuffered.
@ -1786,9 +1778,7 @@ MacroAssembler::printf(const char* output)
}
static void
Printf1_(const char* output, uintptr_t value)
{
AutoUnsafeCallWithABI unsafe;
Printf1_(const char* output, uintptr_t value) {
AutoEnterOOMUnsafeRegion oomUnsafe;
js::UniqueChars line = JS_sprintf_append(nullptr, output, value);
if (!line)
@ -1834,8 +1824,7 @@ MacroAssembler::tracelogStartId(Register logger, uint32_t textId, bool force)
passABIArg(logger);
move32(Imm32(textId), temp);
passABIArg(temp);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStartEventPrivate), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStartEventPrivate));
PopRegsInMask(save);
}
@ -1854,8 +1843,7 @@ MacroAssembler::tracelogStartId(Register logger, Register textId)
setupUnalignedABICall(temp);
passABIArg(logger);
passABIArg(textId);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStartEventPrivate), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStartEventPrivate));
PopRegsInMask(save);
}
@ -1876,8 +1864,7 @@ MacroAssembler::tracelogStartEvent(Register logger, Register event)
setupUnalignedABICall(temp);
passABIArg(logger);
passABIArg(event);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogFunc), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogFunc));
PopRegsInMask(save);
}
@ -1900,8 +1887,7 @@ MacroAssembler::tracelogStopId(Register logger, uint32_t textId, bool force)
move32(Imm32(textId), temp);
passABIArg(temp);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStopEventPrivate), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStopEventPrivate));
PopRegsInMask(save);
}
@ -1920,8 +1906,7 @@ MacroAssembler::tracelogStopId(Register logger, Register textId)
setupUnalignedABICall(temp);
passABIArg(logger);
passABIArg(textId);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStopEventPrivate), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, TraceLogStopEventPrivate));
PopRegsInMask(save);
}
@ -2122,8 +2107,7 @@ MacroAssembler::outOfLineTruncateSlow(FloatRegister src, Register dest, bool wid
} else {
setupUnalignedABICall(dest);
passABIArg(src, MoveOp::DOUBLE);
callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
}
storeCallWordResult(dest);
@ -2817,7 +2801,7 @@ MacroAssembler::passABIArg(const MoveOperand& from, MoveOp::Type type)
}
void
MacroAssembler::callWithABINoProfiler(void* fun, MoveOp::Type result, CheckUnsafeCallWithABI check)
MacroAssembler::callWithABINoProfiler(void* fun, MoveOp::Type result)
{
appendSignatureType(result);
#ifdef JS_SIMULATOR
@ -2826,33 +2810,8 @@ MacroAssembler::callWithABINoProfiler(void* fun, MoveOp::Type result, CheckUnsaf
uint32_t stackAdjust;
callWithABIPre(&stackAdjust);
#ifdef DEBUG
if (check == CheckUnsafeCallWithABI::Check) {
push(ReturnReg);
loadJSContext(ReturnReg);
Address flagAddr(ReturnReg, JSContext::offsetOfInUnsafeCallWithABI());
store32(Imm32(1), flagAddr);
pop(ReturnReg);
}
#endif
call(ImmPtr(fun));
callWithABIPost(stackAdjust, result);
#ifdef DEBUG
if (check == CheckUnsafeCallWithABI::Check) {
Label ok;
push(ReturnReg);
loadJSContext(ReturnReg);
Address flagAddr(ReturnReg, JSContext::offsetOfInUnsafeCallWithABI());
branch32(Assembler::Equal, flagAddr, Imm32(0), &ok);
assumeUnreachable("callWithABI: callee did not use AutoInUnsafeCallWithABI");
bind(&ok);
pop(ReturnReg);
}
#endif
}
void

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

@ -193,20 +193,6 @@ enum class ExitFrameToken : uint8_t;
class AutoSaveLiveRegisters;
enum class CheckUnsafeCallWithABI {
// Require the callee to use AutoUnsafeCallWithABI.
Check,
// We pushed an exit frame so this callWithABI can safely GC and walk the
// stack.
DontCheckHasExitFrame,
// Don't check this callWithABI uses AutoUnsafeCallWithABI, for instance
// because we're calling a simple helper function (like malloc or js_free)
// that we can't change and/or that we know won't GC.
DontCheckOther,
};
// The public entrypoint for emitting assembly. Note that a MacroAssembler can
// use cx->lifoAlloc, so take care not to interleave masm use with other
// lifoAlloc use if one will be destroyed before the other.
@ -579,10 +565,8 @@ class MacroAssembler : public MacroAssemblerSpecific
inline void passABIArg(Register reg);
inline void passABIArg(FloatRegister reg, MoveOp::Type type);
inline void callWithABI(void* fun, MoveOp::Type result = MoveOp::GENERAL,
CheckUnsafeCallWithABI check = CheckUnsafeCallWithABI::Check);
inline void callWithABI(Register fun, MoveOp::Type result = MoveOp::GENERAL);
inline void callWithABI(const Address& fun, MoveOp::Type result = MoveOp::GENERAL);
template <typename T>
inline void callWithABI(const T& fun, MoveOp::Type result = MoveOp::GENERAL);
void callWithABI(wasm::BytecodeOffset offset, wasm::SymbolicAddress fun,
MoveOp::Type result = MoveOp::GENERAL);
@ -596,7 +580,7 @@ class MacroAssembler : public MacroAssemblerSpecific
void callWithABIPre(uint32_t* stackAdjust, bool callFromWasm = false) PER_ARCH;
// Emits a call to a C/C++ function, resolving all argument moves.
void callWithABINoProfiler(void* fun, MoveOp::Type result, CheckUnsafeCallWithABI check);
void callWithABINoProfiler(void* fun, MoveOp::Type result);
void callWithABINoProfiler(Register fun, MoveOp::Type result) PER_ARCH;
void callWithABINoProfiler(const Address& fun, MoveOp::Type result) PER_ARCH;

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

@ -1205,8 +1205,7 @@ ICBinaryArith_DoubleWithInt32::Compiler::generateStubCode(MacroAssembler& masm)
masm.push(intReg);
masm.setupUnalignedABICall(scratchReg);
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
masm.callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
masm.callWithABI(mozilla::BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
masm.storeCallWordResult(scratchReg);
masm.pop(intReg);
@ -1359,8 +1358,7 @@ ICUnaryArith_Double::Compiler::generateStubCode(MacroAssembler& masm)
masm.bind(&truncateABICall);
masm.setupUnalignedABICall(scratchReg);
masm.passABIArg(FloatReg0, MoveOp::DOUBLE);
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32),
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
masm.storeCallWordResult(scratchReg);
masm.bind(&doneTruncate);

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

@ -544,7 +544,6 @@ InterruptCheck(JSContext* cx)
void*
MallocWrapper(JSRuntime* rt, size_t nbytes)
{
AutoUnsafeCallWithABI unsafe;
return rt->pod_malloc<uint8_t>(nbytes);
}
@ -650,8 +649,6 @@ GetDynamicName(JSContext* cx, JSObject* envChain, JSString* str, Value* vp)
// undefined through rval. This function is infallible, and cannot GC or
// invalidate.
AutoUnsafeCallWithABI unsafe;
JSAtom* atom;
if (str->isAtom()) {
atom = &str->asAtom();
@ -682,7 +679,7 @@ GetDynamicName(JSContext* cx, JSObject* envChain, JSString* str, Value* vp)
void
PostWriteBarrier(JSRuntime* rt, JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
MOZ_ASSERT(!IsInsideNursery(obj));
rt->gc.storeBuffer().putWholeCell(obj);
}
@ -693,7 +690,7 @@ template <IndexInBounds InBounds>
void
PostWriteElementBarrier(JSRuntime* rt, JSObject* obj, int32_t index)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
MOZ_ASSERT(!IsInsideNursery(obj));
@ -747,7 +744,7 @@ int32_t
GetIndexFromString(JSString* str)
{
// We shouldn't GC here as this is called directly from IC code.
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
if (!str->isFlat())
return -1;
@ -763,7 +760,7 @@ JSObject*
WrapObjectPure(JSContext* cx, JSObject* obj)
{
// IC code calls this directly so we shouldn't GC.
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
MOZ_ASSERT(obj);
MOZ_ASSERT(cx->compartment() != obj->compartment());
@ -867,7 +864,6 @@ DebugEpilogue(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool ok)
void
FrameIsDebuggeeCheck(BaselineFrame* frame)
{
AutoUnsafeCallWithABI unsafe;
if (frame->script()->isDebuggee())
frame->setIsDebuggee();
}
@ -1144,7 +1140,6 @@ OnDebuggerStatement(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool* m
bool
GlobalHasLiveOnDebuggerStatement(JSContext* cx)
{
AutoUnsafeCallWithABI unsafe;
return cx->compartment()->isDebuggee() &&
Debugger::hasLiveHook(cx->global(), Debugger::OnDebuggerStatement);
}
@ -1237,7 +1232,6 @@ bool
InitBaselineFrameForOsr(BaselineFrame* frame, InterpreterFrame* interpFrame,
uint32_t numStackValues)
{
AutoUnsafeCallWithABI unsafe;
return frame->initForOsr(interpFrame, numStackValues);
}
@ -1324,7 +1318,6 @@ AutoDetectInvalidation::setReturnOverride()
void
AssertValidObjectPtr(JSContext* cx, JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
#ifdef DEBUG
// Check what we can, so that we'll hopefully assert/crash if we get a
// bogus object (pointer).
@ -1346,7 +1339,6 @@ AssertValidObjectPtr(JSContext* cx, JSObject* obj)
void
AssertValidObjectOrNullPtr(JSContext* cx, JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
if (obj)
AssertValidObjectPtr(cx, obj);
}
@ -1354,7 +1346,6 @@ AssertValidObjectOrNullPtr(JSContext* cx, JSObject* obj)
void
AssertValidStringPtr(JSContext* cx, JSString* str)
{
AutoUnsafeCallWithABI unsafe;
#ifdef DEBUG
// We can't closely inspect strings from another runtime.
if (str->runtimeFromAnyThread() != cx->runtime()) {
@ -1391,8 +1382,6 @@ AssertValidStringPtr(JSContext* cx, JSString* str)
void
AssertValidSymbolPtr(JSContext* cx, JS::Symbol* sym)
{
AutoUnsafeCallWithABI unsafe;
// We can't closely inspect symbols from another runtime.
if (sym->runtimeFromAnyThread() != cx->runtime()) {
MOZ_ASSERT(sym->isWellKnownSymbol());
@ -1412,7 +1401,6 @@ AssertValidSymbolPtr(JSContext* cx, JS::Symbol* sym)
void
AssertValidValue(JSContext* cx, Value* v)
{
AutoUnsafeCallWithABI unsafe;
if (v->isObject())
AssertValidObjectPtr(cx, &v->toObject());
else if (v->isString())
@ -1424,28 +1412,24 @@ AssertValidValue(JSContext* cx, Value* v)
bool
ObjectIsCallable(JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
return obj->isCallable();
}
bool
ObjectIsConstructor(JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
return obj->isConstructor();
}
void
MarkValueFromIon(JSRuntime* rt, Value* vp)
{
AutoUnsafeCallWithABI unsafe;
TraceManuallyBarrieredEdge(&rt->gc.marker, vp, "write barrier");
}
void
MarkStringFromIon(JSRuntime* rt, JSString** stringp)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(*stringp);
TraceManuallyBarrieredEdge(&rt->gc.marker, stringp, "write barrier");
}
@ -1453,7 +1437,6 @@ MarkStringFromIon(JSRuntime* rt, JSString** stringp)
void
MarkObjectFromIon(JSRuntime* rt, JSObject** objp)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT(*objp);
TraceManuallyBarrieredEdge(&rt->gc.marker, objp, "write barrier");
}
@ -1461,14 +1444,12 @@ MarkObjectFromIon(JSRuntime* rt, JSObject** objp)
void
MarkShapeFromIon(JSRuntime* rt, Shape** shapep)
{
AutoUnsafeCallWithABI unsafe;
TraceManuallyBarrieredEdge(&rt->gc.marker, shapep, "write barrier");
}
void
MarkObjectGroupFromIon(JSRuntime* rt, ObjectGroup** groupp)
{
AutoUnsafeCallWithABI unsafe;
TraceManuallyBarrieredEdge(&rt->gc.marker, groupp, "write barrier");
}
@ -1570,7 +1551,7 @@ bool
EqualStringsHelper(JSString* str1, JSString* str2)
{
// IC code calls this directly so we shouldn't GC.
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
MOZ_ASSERT(str1->isAtom());
MOZ_ASSERT(!str2->isAtom());
@ -1600,7 +1581,7 @@ GetNativeDataProperty(JSContext* cx, NativeObject* obj, jsid id, Value* vp)
// lookup paths, this is optimized to be as fast as possible for simple
// data property lookups.
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
MOZ_ASSERT(JSID_IS_ATOM(id) || JSID_IS_SYMBOL(id));
@ -1652,7 +1633,7 @@ GetNativeDataProperty<false>(JSContext* cx, JSObject* obj, PropertyName* name, V
static MOZ_ALWAYS_INLINE bool
ValueToAtomOrSymbol(JSContext* cx, Value& idVal, jsid* id)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
if (MOZ_LIKELY(idVal.isString())) {
JSString* s = idVal.toString();
@ -1685,7 +1666,7 @@ template <bool HandleMissing>
bool
GetNativeDataPropertyByValue(JSContext* cx, JSObject* obj, Value* vp)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
// Condition checked by caller.
MOZ_ASSERT(obj->isNative());
@ -1710,7 +1691,7 @@ template <bool NeedsTypeBarrier>
bool
SetNativeDataProperty(JSContext* cx, JSObject* obj, PropertyName* name, Value* val)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
if (MOZ_UNLIKELY(!obj->isNative()))
return false;
@ -1742,7 +1723,7 @@ SetNativeDataProperty<false>(JSContext* cx, JSObject* obj, PropertyName* name, V
bool
ObjectHasGetterSetter(JSContext* cx, JSObject* objArg, Shape* propShape)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
MOZ_ASSERT(propShape->hasGetterObject() || propShape->hasSetterObject());
@ -1785,7 +1766,7 @@ ObjectHasGetterSetter(JSContext* cx, JSObject* objArg, Shape* propShape)
bool
HasOwnNativeDataProperty(JSContext* cx, JSObject* obj, Value* vp)
{
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
// vp[0] contains the id, result will be stored in vp[1].
Value idVal = vp[0];
@ -1822,7 +1803,6 @@ HasOwnNativeDataProperty(JSContext* cx, JSObject* obj, Value* vp)
JSString*
TypeOfObject(JSObject* obj, JSRuntime* rt)
{
AutoUnsafeCallWithABI unsafe;
JSType type = js::TypeOfObject(obj);
return TypeName(type, *rt->commonNames);
}

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

@ -630,8 +630,7 @@ CodeGeneratorARM::visitSoftDivI(LSoftDivI* ins)
masm.setupAlignedABICall();
masm.passABIArg(lhs);
masm.passABIArg(rhs);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod));
}
// idivmod returns the quotient in r0, and the remainder in r1.
@ -820,8 +819,7 @@ CodeGeneratorARM::visitSoftModI(LSoftModI* ins)
masm.setupAlignedABICall();
masm.passABIArg(lhs);
masm.passABIArg(rhs);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod));
}
MOZ_ASSERT(r1 != output);
@ -2843,8 +2841,7 @@ CodeGeneratorARM::visitSoftUDivOrMod(LSoftUDivOrMod* ins)
masm.setupAlignedABICall();
masm.passABIArg(lhs);
masm.passABIArg(rhs);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_uidivmod), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_uidivmod));
}
if (mod) {

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

@ -3598,7 +3598,7 @@ MacroAssemblerARMCompat::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(r1);
asMasm().passABIArg(r0);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
asMasm().callWithABI(handler);
Label entryFrame;
Label catch_;

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

@ -94,8 +94,7 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm)
masm.setupAlignedABICall();
masm.passABIArg(R0.payloadReg());
masm.passABIArg(R1.payloadReg());
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, __aeabi_idivmod));
// idivmod returns the quotient in r0, and the remainder in r1.
if (op_ == JSOP_DIV) {

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

@ -882,7 +882,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (outReg != InvalidReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(f.wrapped);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -145,7 +145,7 @@ MacroAssemblerCompat::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(r1);
asMasm().passABIArg(r0);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
asMasm().callWithABI(handler);
Label entryFrame;
Label catch_;

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

@ -677,7 +677,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (outReg != InvalidReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(f.wrapped);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -1848,7 +1848,7 @@ MacroAssemblerMIPSCompat::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(a1);
asMasm().passABIArg(a0);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
asMasm().callWithABI(handler);
Label entryFrame;
Label catch_;

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

@ -847,7 +847,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
MoveOp::GENERAL);
}
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(f.wrapped);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -2030,7 +2030,7 @@ MacroAssemblerMIPS64Compat::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(a1);
asMasm().passABIArg(a0);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
asMasm().callWithABI(handler);
Label entryFrame;
Label catch_;

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

@ -793,7 +793,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (InvalidReg != outReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(f.wrapped);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -307,7 +307,7 @@ MacroAssemblerX64::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(rcx);
asMasm().passABIArg(rax);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
asMasm().callWithABI(handler);
Label entryFrame;
Label catch_;

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

@ -765,7 +765,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (outReg != InvalidReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(f.wrapped);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -744,8 +744,7 @@ CodeGeneratorX86::visitOutOfLineTruncate(OutOfLineTruncate* ool)
} else {
masm.setupUnalignedABICall(output);
masm.passABIArg(input, MoveOp::DOUBLE);
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
}
masm.storeCallWordResult(output);
@ -832,12 +831,10 @@ CodeGeneratorX86::visitOutOfLineTruncateFloat32(OutOfLineTruncateFloat32* ool)
masm.vcvtss2sd(input, input, input);
masm.passABIArg(input.asDouble(), MoveOp::DOUBLE);
if (gen->compilingWasm()) {
if (gen->compilingWasm())
masm.callWithABI(ins->mir()->bytecodeOffset(), wasm::SymbolicAddress::ToInt32);
} else {
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32), MoveOp::GENERAL,
CheckUnsafeCallWithABI::DontCheckOther);
}
else
masm.callWithABI(BitwiseCast<void*, int32_t(*)(double)>(JS::ToInt32));
masm.storeCallWordResult(output);
masm.Pop(input);

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

@ -206,7 +206,7 @@ MacroAssemblerX86::handleFailureWithHandlerTail(void* handler)
// Call the handler.
asMasm().setupUnalignedABICall(ecx);
asMasm().passABIArg(eax);
asMasm().callWithABI(handler, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
asMasm().callWithABI(handler);
Label entryFrame;
Label catch_;

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

@ -795,7 +795,7 @@ JitRuntime::generateVMWrapper(JSContext* cx, const VMFunction& f)
if (outReg != InvalidReg)
masm.passABIArg(outReg);
masm.callWithABI(f.wrapped, MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
masm.callWithABI(f.wrapped);
if (!generateTLExitVM(cx, masm, f))
return nullptr;

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

@ -2424,7 +2424,6 @@ DefineBoxedOrUnboxedFunctor1(ShiftMoveBoxedOrUnboxedDenseElements, JSObject*);
void
js::ArrayShiftMoveElements(JSObject* obj)
{
AutoUnsafeCallWithABI unsafe;
MOZ_ASSERT_IF(obj->is<ArrayObject>(), obj->as<ArrayObject>().lengthIsWritable());
ShiftMoveBoxedOrUnboxedDenseElementsFunctor functor(obj);

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

@ -9,8 +9,6 @@
#include "jsbool.h"
#include "jscntxt.h"
#include "vm/BooleanObject.h"
#include "vm/WrapperObject.h"
@ -21,7 +19,6 @@ EmulatesUndefined(JSObject* obj)
{
// This may be called off the main thread. It's OK not to expose the object
// here as it doesn't escape.
AutoUnsafeCallWithABI unsafe;
JSObject* actual = MOZ_LIKELY(!obj->is<WrapperObject>()) ? obj : UncheckedUnwrapWithoutExpose(obj);
return actual->getClass()->emulatesUndefined();
}

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

@ -1293,8 +1293,6 @@ JSContext::JSContext(JSRuntime* runtime, const JS::ContextOptions& options)
requestDepth(0),
#ifdef DEBUG
checkRequestDepth(0),
inUnsafeCallWithABI(false),
hasAutoUnsafeCallWithABI(false),
#endif
#ifdef JS_SIMULATOR
simulator_(nullptr),
@ -1670,21 +1668,3 @@ AutoEnterOOMUnsafeRegion::crash(size_t size, const char* reason)
}
crash(reason);
}
#ifdef DEBUG
AutoUnsafeCallWithABI::AutoUnsafeCallWithABI()
: cx_(TlsContext.get()),
nested_(cx_->hasAutoUnsafeCallWithABI)
{
cx_->hasAutoUnsafeCallWithABI = true;
}
AutoUnsafeCallWithABI::~AutoUnsafeCallWithABI()
{
MOZ_ASSERT(cx_->hasAutoUnsafeCallWithABI);
if (!nested_) {
cx_->hasAutoUnsafeCallWithABI = false;
cx_->inUnsafeCallWithABI = false;
}
}
#endif

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

@ -379,12 +379,6 @@ struct JSContext : public JS::RootingContext,
return offsetof(JSContext, profilingActivation_);
}
#ifdef DEBUG
static size_t offsetOfInUnsafeCallWithABI() {
return offsetof(JSContext, inUnsafeCallWithABI);
}
#endif
private:
/* Space for interpreter frames. */
js::ThreadLocalData<js::InterpreterStack> interpreterStack_;
@ -425,8 +419,6 @@ struct JSContext : public JS::RootingContext,
#ifdef DEBUG
js::ThreadLocalData<unsigned> checkRequestDepth;
js::ThreadLocalData<uint32_t> inUnsafeCallWithABI;
js::ThreadLocalData<bool> hasAutoUnsafeCallWithABI;
#endif
#ifdef JS_SIMULATOR
@ -1294,23 +1286,6 @@ class MOZ_RAII AutoEnterIonCompilation
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
// Should be used in functions called directly from JIT code (with
// masm.callWithABI) to assert invariants in debug builds.
class MOZ_RAII AutoUnsafeCallWithABI
{
JS::AutoCheckCannotGC nogc;
#ifdef DEBUG
JSContext* cx_;
bool nested_;
#endif
public:
#ifdef DEBUG
AutoUnsafeCallWithABI();
~AutoUnsafeCallWithABI();
#endif
};
namespace gc {
// In debug builds, set/unset the performing GC flag for the current thread.

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

@ -11,7 +11,6 @@
#include <math.h>
#include "jscntxt.h"
#include "jsnum.h"
/*
@ -49,7 +48,6 @@ namespace js {
inline double
NumberDiv(double a, double b)
{
AutoUnsafeCallWithABI unsafe;
if (b == 0) {
if (a == 0 || mozilla::IsNaN(a)
#ifdef XP_WIN
@ -67,9 +65,7 @@ NumberDiv(double a, double b)
}
inline double
NumberMod(double a, double b)
{
AutoUnsafeCallWithABI unsafe;
NumberMod(double a, double b) {
if (b == 0)
return JS::GenericNaN();
return js_fmod(a, b);

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

@ -183,14 +183,12 @@ js::math_abs(JSContext* cx, unsigned argc, Value* vp)
double
js::math_acos_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::acos, x, MathCache::Acos);
}
double
js::math_acos_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::acos(x);
}
@ -220,14 +218,12 @@ js::math_acos(JSContext* cx, unsigned argc, Value* vp)
double
js::math_asin_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::asin, x, MathCache::Asin);
}
double
js::math_asin_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::asin(x);
}
@ -257,14 +253,12 @@ js::math_asin(JSContext* cx, unsigned argc, Value* vp)
double
js::math_atan_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::atan, x, MathCache::Atan);
}
double
js::math_atan_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::atan(x);
}
@ -294,7 +288,6 @@ js::math_atan(JSContext* cx, unsigned argc, Value* vp)
double
js::ecmaAtan2(double y, double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::atan2(y, x);
}
@ -325,7 +318,6 @@ js::math_atan2(JSContext* cx, unsigned argc, Value* vp)
double
js::math_ceil_impl(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::ceil(x);
}
@ -380,14 +372,12 @@ js::math_clz32(JSContext* cx, unsigned argc, Value* vp)
double
js::math_cos_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(cos, x, MathCache::Cos);
}
double
js::math_cos_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return cos(x);
}
@ -417,14 +407,12 @@ js::math_cos(JSContext* cx, unsigned argc, Value* vp)
double
js::math_exp_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::exp, x, MathCache::Exp);
}
double
js::math_exp_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::exp(x);
}
@ -454,7 +442,6 @@ js::math_exp(JSContext* cx, unsigned argc, Value* vp)
double
js::math_floor_impl(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::floor(x);
}
@ -545,14 +532,12 @@ js::math_fround(JSContext* cx, unsigned argc, Value* vp)
double
js::math_log_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(math_log_uncached, x, MathCache::Log);
}
double
js::math_log_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::log(x);
}
@ -588,8 +573,6 @@ js::math_log(JSContext* cx, unsigned argc, Value* vp)
double
js::math_max_impl(double x, double y)
{
AutoUnsafeCallWithABI unsafe;
// Math.max(num, NaN) => NaN, Math.max(-0, +0) => +0
if (x > y || IsNaN(x) || (x == y && IsNegative(y)))
return x;
@ -615,8 +598,6 @@ js::math_max(JSContext* cx, unsigned argc, Value* vp)
double
js::math_min_impl(double x, double y)
{
AutoUnsafeCallWithABI unsafe;
// Math.min(num, NaN) => NaN, Math.min(-0, +0) => -0
if (x < y || IsNaN(x) || (x == y && IsNegativeZero(x)))
return x;
@ -660,7 +641,6 @@ js::minmax_impl(JSContext* cx, bool max, HandleValue a, HandleValue b, MutableHa
double
js::powi(double x, int y)
{
AutoUnsafeCallWithABI unsafe;
unsigned n = (y < 0) ? -y : y;
double m = x;
double p = 1;
@ -689,8 +669,6 @@ js::powi(double x, int y)
double
js::ecmaPow(double x, double y)
{
AutoUnsafeCallWithABI unsafe;
/*
* Use powi if the exponent is an integer-valued double. We don't have to
* check for NaN since a comparison with NaN is always false.
@ -847,8 +825,6 @@ template float js::GetBiggestNumberLessThan<>(float x);
double
js::math_round_impl(double x)
{
AutoUnsafeCallWithABI unsafe;
int32_t ignored;
if (NumberIsInt32(x, &ignored))
return x;
@ -864,8 +840,6 @@ js::math_round_impl(double x)
float
js::math_roundf_impl(float x)
{
AutoUnsafeCallWithABI unsafe;
int32_t ignored;
if (NumberIsInt32(x, &ignored))
return x;
@ -894,14 +868,12 @@ js::math_round(JSContext* cx, unsigned argc, Value* vp)
double
js::math_sin_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(math_sin_uncached, x, MathCache::Sin);
}
double
js::math_sin_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
#ifdef _WIN64
// Workaround MSVC bug where sin(-0) is +0 instead of -0 on x64 on
// CPUs without FMA3 (pre-Haswell). See bug 1076670.
@ -943,7 +915,6 @@ js::math_sin(JSContext* cx, unsigned argc, Value* vp)
void
js::math_sincos_uncached(double x, double *sin, double *cos)
{
AutoUnsafeCallWithABI unsafe;
#if defined(HAVE_SINCOS)
sincos(x, sin, cos);
#elif defined(HAVE___SINCOS)
@ -957,7 +928,6 @@ js::math_sincos_uncached(double x, double *sin, double *cos)
void
js::math_sincos_impl(MathCache* mathCache, double x, double *sin, double *cos)
{
AutoUnsafeCallWithABI unsafe;
unsigned indexSin;
unsigned indexCos;
bool hasSin = mathCache->isCached(x, MathCache::Sin, sin, &indexSin);
@ -1008,14 +978,12 @@ js::math_sqrt(JSContext* cx, unsigned argc, Value* vp)
double
js::math_tan_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(tan, x, MathCache::Tan);
}
double
js::math_tan_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return tan(x);
}
@ -1069,14 +1037,12 @@ static bool math_function(JSContext* cx, unsigned argc, Value* vp)
double
js::math_log10_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::log10, x, MathCache::Log10);
}
double
js::math_log10_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::log10(x);
}
@ -1089,14 +1055,12 @@ js::math_log10(JSContext* cx, unsigned argc, Value* vp)
double
js::math_log2_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::log2, x, MathCache::Log2);
}
double
js::math_log2_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::log2(x);
}
@ -1109,14 +1073,12 @@ js::math_log2(JSContext* cx, unsigned argc, Value* vp)
double
js::math_log1p_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::log1p, x, MathCache::Log1p);
}
double
js::math_log1p_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::log1p(x);
}
@ -1129,14 +1091,12 @@ js::math_log1p(JSContext* cx, unsigned argc, Value* vp)
double
js::math_expm1_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::expm1, x, MathCache::Expm1);
}
double
js::math_expm1_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::expm1(x);
}
@ -1149,14 +1109,12 @@ js::math_expm1(JSContext* cx, unsigned argc, Value* vp)
double
js::math_cosh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::cosh, x, MathCache::Cosh);
}
double
js::math_cosh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::cosh(x);
}
@ -1169,14 +1127,12 @@ js::math_cosh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_sinh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::sinh, x, MathCache::Sinh);
}
double
js::math_sinh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::sinh(x);
}
@ -1189,14 +1145,12 @@ js::math_sinh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_tanh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::tanh, x, MathCache::Tanh);
}
double
js::math_tanh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::tanh(x);
}
@ -1209,14 +1163,12 @@ js::math_tanh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_acosh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::acosh, x, MathCache::Acosh);
}
double
js::math_acosh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::acosh(x);
}
@ -1229,14 +1181,12 @@ js::math_acosh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_asinh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::asinh, x, MathCache::Asinh);
}
double
js::math_asinh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::asinh(x);
}
@ -1249,14 +1199,12 @@ js::math_asinh(JSContext* cx, unsigned argc, Value* vp)
double
js::math_atanh_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::atanh, x, MathCache::Atanh);
}
double
js::math_atanh_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::atanh(x);
}
@ -1270,7 +1218,6 @@ js::math_atanh(JSContext* cx, unsigned argc, Value* vp)
double
js::ecmaHypot(double x, double y)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::hypot(x, y);
}
@ -1290,8 +1237,6 @@ hypot_step(double& scale, double& sumsq, double x)
double
js::hypot4(double x, double y, double z, double w)
{
AutoUnsafeCallWithABI unsafe;
/* Check for infinity or NaNs so that we can return immediatelly.
* Does not need to be WIN_XP specific as ecmaHypot
*/
@ -1317,7 +1262,6 @@ js::hypot4(double x, double y, double z, double w)
double
js::hypot3(double x, double y, double z)
{
AutoUnsafeCallWithABI unsafe;
return hypot4(x, y, z, 0.0);
}
@ -1374,14 +1318,12 @@ js::math_hypot_handle(JSContext* cx, HandleValueArray args, MutableHandleValue r
double
js::math_trunc_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::trunc, x, MathCache::Trunc);
}
double
js::math_trunc_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::trunc(x);
}
@ -1402,14 +1344,12 @@ static double sign(double x)
double
js::math_sign_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(sign, x, MathCache::Sign);
}
double
js::math_sign_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return sign(x);
}
@ -1422,14 +1362,12 @@ js::math_sign(JSContext* cx, unsigned argc, Value* vp)
double
js::math_cbrt_impl(MathCache* cache, double x)
{
AutoUnsafeCallWithABI unsafe;
return cache->lookup(fdlibm::cbrt, x, MathCache::Cbrt);
}
double
js::math_cbrt_uncached(double x)
{
AutoUnsafeCallWithABI unsafe;
return fdlibm::cbrt(x);
}

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

@ -371,7 +371,7 @@ ArgumentsObject::finishForIon(JSContext* cx, jit::JitFrameLayout* frame,
{
// JIT code calls this directly (no callVM), because it's faster, so we're
// not allowed to GC in here.
AutoUnsafeCallWithABI unsafe;
JS::AutoCheckCannotGC nogc;
JSFunction* callee = jit::CalleeTokenToFunction(frame->calleeToken());
RootedObject callObj(cx, scopeChain->is<CallObject>() ? scopeChain : nullptr);

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

@ -406,7 +406,7 @@ NativeObject::growSlots(JSContext* cx, uint32_t oldCount, uint32_t newCount)
NativeObject::growSlotsDontReportOOM(JSContext* cx, NativeObject* obj, uint32_t newCount)
{
// IC code calls this directly.
AutoUnsafeCallWithABI unsafe;
AutoCheckCannotGC nogc;
if (!obj->growSlots(cx, obj->numDynamicSlots(), newCount)) {
cx->recoverFromOutOfMemory();
@ -419,7 +419,7 @@ NativeObject::growSlotsDontReportOOM(JSContext* cx, NativeObject* obj, uint32_t
NativeObject::addDenseElementDontReportOOM(JSContext* cx, NativeObject* obj)
{
// IC code calls this directly.
AutoUnsafeCallWithABI unsafe;
AutoCheckCannotGC nogc;
MOZ_ASSERT(obj->getDenseInitializedLength() == obj->getDenseCapacity());
MOZ_ASSERT(!obj->denseElementsAreCopyOnWrite());

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

@ -1276,7 +1276,7 @@ public class GeckoView extends LayerView {
public final String issuerOrganization;
/**
* Indicates the security level of the site; possible values are SECURITY_MODE_UNKNOWN,
* SECURITY_MODE_IDENTIFIED, and SECURITY_MODE_VERIFIED. SECURITY_MODE_IDENTIFIED
* SECURITY_MODE_IDENTIFIED, and SECURITY_MODE_VERIFIED. SECURITY_MODE_IDENTIFIED
* indicates domain validation only, while SECURITY_MODE_VERIFIED indicates extended validation.
*/
public final int securityMode;

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

@ -1822,7 +1822,7 @@ pref("network.http.enforce-framing.soft", true);
pref("network.http.max_response_header_size", 393216);
// If we should attempt to race the cache and network
pref("network.http.rcwn.enabled", true);
pref("network.http.rcwn.enabled", false);
pref("network.http.rcwn.cache_queue_normal_threshold", 8);
pref("network.http.rcwn.cache_queue_priority_threshold", 2);
// We might attempt to race the cache with the network only if a resource