diff --git a/js/src/jit/ABIFunctionList-inl.h b/js/src/jit/ABIFunctionList-inl.h index 6b77221ddeb5..919f395858cf 100644 --- a/js/src/jit/ABIFunctionList-inl.h +++ b/js/src/jit/ABIFunctionList-inl.h @@ -112,6 +112,7 @@ namespace jit { _(js::jit::CreateMatchResultFallbackFunc) \ _(js::jit::EqualStringsHelperPure) \ _(js::jit::FinishBailoutToBaseline) \ + _(js::jit::FrameIsDebuggeeCheck) \ _(js::jit::GetDynamicNamePure) \ _(js::jit::GetIndexFromString) \ _(js::jit::GetInt32FromStringPure) \ @@ -119,6 +120,8 @@ namespace jit { _(js::jit::GetNativeDataPropertyByValuePure) \ _(js::jit::GetNativeDataPropertyPure) \ _(js::jit::GetNativeDataPropertyPure) \ + _(js::jit::GlobalHasLiveOnDebuggerStatement) \ + _(js::jit::GroupHasPropertyTypes) \ _(js::jit::HandleCodeCoverageAtPC) \ _(js::jit::HandleCodeCoverageAtPrologue) \ _(js::jit::HandleException) \ @@ -129,6 +132,9 @@ namespace jit { _(js::jit::InvalidationBailout) \ _(js::jit::InvokeFromInterpreterStub) \ _(js::jit::LazyLinkTopActivation) \ + _(js::jit::ObjectHasGetterSetterPure) \ + _(js::jit::ObjectIsCallable) \ + _(js::jit::ObjectIsConstructor) \ _(js::jit::PostGlobalWriteBarrier) \ _(js::jit::PostWriteBarrier) \ _(js::jit::PostWriteElementBarrier) \ @@ -138,6 +144,7 @@ namespace jit { _(js::jit::SetNativeDataPropertyPure) \ _(js::jit::SetNativeDataPropertyPure) \ _(js::jit::StringFromCharCodeNoGC) \ + _(js::jit::TypeOfObject) \ _(js::jit::WrapObjectPure) \ _(js::MapIteratorObject::next) \ _(js::NativeObject::addDenseElementPure) \ diff --git a/js/src/jit/BaselineCodeGen.cpp b/js/src/jit/BaselineCodeGen.cpp index dbbd26a7d45a..f797ab0ebf70 100644 --- a/js/src/jit/BaselineCodeGen.cpp +++ b/js/src/jit/BaselineCodeGen.cpp @@ -759,10 +759,11 @@ bool BaselineCodeGen::emitStackCheck() { } static void EmitCallFrameIsDebuggeeCheck(MacroAssembler& masm) { + using Fn = void (*)(BaselineFrame * frame); masm.setupUnalignedABICall(R0.scratchReg()); masm.loadBaselineFramePtr(BaselineFrameReg, R0.scratchReg()); masm.passABIArg(R0.scratchReg()); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, jit::FrameIsDebuggeeCheck)); + masm.callWithABI(); } template <> diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index 34bfbe27173d..d33079a51c52 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -3930,9 +3930,10 @@ bool CacheIRCompiler::emitIsCallableResult(ValOperandId inputId) { liveVolatileFloatRegs()); masm.PushRegsInMask(volatileRegs); + using Fn = bool (*)(JSObject * obj); masm.setupUnalignedABICall(scratch2); masm.passABIArg(scratch1); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ObjectIsCallable)); + masm.callWithABI(); masm.storeCallBoolResult(scratch2); LiveRegisterSet ignore; @@ -3963,9 +3964,10 @@ bool CacheIRCompiler::emitIsConstructorResult(ObjOperandId objId) { liveVolatileFloatRegs()); masm.PushRegsInMask(volatileRegs); + using Fn = bool (*)(JSObject * obj); masm.setupUnalignedABICall(scratch); masm.passABIArg(obj); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ObjectIsConstructor)); + masm.callWithABI(); masm.storeCallBoolResult(scratch); LiveRegisterSet ignore; @@ -5714,11 +5716,12 @@ bool CacheIRCompiler::emitLoadTypeOfObjectResult(ObjOperandId objId) { liveVolatileFloatRegs()); masm.PushRegsInMask(save); + using Fn = JSString* (*)(JSObject * obj, JSRuntime * rt); masm.setupUnalignedABICall(scratch); masm.passABIArg(obj); masm.movePtr(ImmPtr(cx_->runtime()), scratch); masm.passABIArg(scratch); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, TypeOfObject)); + masm.callWithABI(); masm.mov(ReturnReg, scratch); LiveRegisterSet ignore; @@ -7208,13 +7211,14 @@ bool CacheIRCompiler::emitGuardHasGetterSetter(ObjOperandId objId, volatileRegs.takeUnchecked(scratch2); masm.PushRegsInMask(volatileRegs); + using Fn = bool (*)(JSContext* cx, JSObject* obj, Shape* propShape); masm.setupUnalignedABICall(scratch1); masm.loadJSContext(scratch1); masm.passABIArg(scratch1); masm.passABIArg(obj); emitLoadStubField(shape, scratch2); masm.passABIArg(scratch2); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ObjectHasGetterSetterPure)); + masm.callWithABI(); masm.mov(ReturnReg, scratch1); masm.PopRegsInMask(volatileRegs); diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 9279bf0007f1..970f8ca1a2da 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -12623,11 +12623,12 @@ void CodeGenerator::visitOutOfLineTypeOfV(OutOfLineTypeOfV* ool) { masm.bind(&slowCheck); saveVolatile(output); + using Fn = JSString* (*)(JSObject * obj, JSRuntime * rt); masm.setupUnalignedABICall(output); masm.passABIArg(obj); masm.movePtr(ImmPtr(gen->runtime), output); masm.passABIArg(output); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, jit::TypeOfObject)); + masm.callWithABI(); masm.storeCallPointerResult(output); restoreVolatile(output); @@ -14022,9 +14023,10 @@ void CodeGenerator::visitOutOfLineIsCallable(OutOfLineIsCallable* ool) { Register output = ool->output(); saveVolatile(output); + using Fn = bool (*)(JSObject * obj); masm.setupUnalignedABICall(output); masm.passABIArg(object); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ObjectIsCallable)); + masm.callWithABI(); masm.storeCallBoolResult(output); restoreVolatile(output); masm.jump(ool->rejoin()); @@ -14060,9 +14062,10 @@ void CodeGenerator::visitOutOfLineIsConstructor(OutOfLineIsConstructor* ool) { Register output = ToRegister(ins->output()); saveVolatile(output); + using Fn = bool (*)(JSObject * obj); masm.setupUnalignedABICall(output); masm.passABIArg(object); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ObjectIsConstructor)); + masm.callWithABI(); masm.storeCallBoolResult(output); restoreVolatile(output); masm.jump(ool->rejoin()); @@ -14668,10 +14671,10 @@ void CodeGenerator::visitDebugger(LDebugger* ins) { Register temp = ToRegister(ins->getTemp(1)); masm.loadJSContext(cx); + using Fn = bool (*)(JSContext * cx); masm.setupUnalignedABICall(temp); masm.passABIArg(cx); - masm.callWithABI( - JS_FUNC_TO_DATA_PTR(void*, GlobalHasLiveOnDebuggerStatement)); + masm.callWithABI(); Label bail; masm.branchIfTrueBool(ReturnReg, &bail); @@ -15200,12 +15203,13 @@ void CodeGenerator::visitGuardHasGetterSetter(LGuardHasGetterSetter* lir) { masm.movePtr(ImmGCPtr(lir->mir()->shape()), temp2); + using Fn = bool (*)(JSContext* cx, JSObject* obj, Shape* propShape); masm.setupUnalignedABICall(temp1); masm.loadJSContext(temp1); masm.passABIArg(temp1); masm.passABIArg(object); masm.passABIArg(temp2); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ObjectHasGetterSetterPure)); + masm.callWithABI(); bailoutIfFalseBool(ReturnReg, lir->snapshot()); } diff --git a/js/src/jit/IonCacheIRCompiler.cpp b/js/src/jit/IonCacheIRCompiler.cpp index 68b3d1dce28f..9dc3a6f49fd5 100644 --- a/js/src/jit/IonCacheIRCompiler.cpp +++ b/js/src/jit/IonCacheIRCompiler.cpp @@ -1276,21 +1276,6 @@ bool IonCacheIRCompiler::emitCompareStringResult(JSOp op, StringOperandId lhsId, return true; } -static bool GroupHasPropertyTypes(ObjectGroup* group, jsid* id, Value* v) { - AutoUnsafeCallWithABI unsafe; - if (group->unknownPropertiesDontCheckGeneration()) { - return true; - } - HeapTypeSet* propTypes = group->maybeGetPropertyDontCheckGeneration(*id); - if (!propTypes) { - return true; - } - if (!propTypes->nonConstantProperty()) { - return false; - } - return propTypes->hasType(TypeSet::GetValueType(*v)); -} - static void EmitCheckPropertyTypes(MacroAssembler& masm, const PropertyTypeCheckInfo* typeCheckInfo, Register obj, const ConstantOrRegister& val, @@ -1404,12 +1389,13 @@ static void EmitCheckPropertyTypes(MacroAssembler& masm, masm.Push(id, scratch3); masm.moveStackPtrTo(scratch3); + using Fn = bool (*)(ObjectGroup * group, jsid * id, Value * v); masm.setupUnalignedABICall(scratch1); masm.movePtr(ImmGCPtr(group), scratch1); masm.passABIArg(scratch1); masm.passABIArg(scratch3); masm.passABIArg(scratch2); - masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, GroupHasPropertyTypes)); + masm.callWithABI(); masm.mov(ReturnReg, scratch1); masm.adjustStack(sizeof(Value) + sizeof(jsid)); diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp index 39e40754574f..267549c33abb 100644 --- a/js/src/jit/VMFunctions.cpp +++ b/js/src/jit/VMFunctions.cpp @@ -2469,6 +2469,21 @@ AtomicsReadWriteModifyFn AtomicsXor(Scalar::Type elementType) { } } +bool GroupHasPropertyTypes(ObjectGroup* group, jsid* id, Value* v) { + AutoUnsafeCallWithABI unsafe; + if (group->unknownPropertiesDontCheckGeneration()) { + return true; + } + HeapTypeSet* propTypes = group->maybeGetPropertyDontCheckGeneration(*id); + if (!propTypes) { + return true; + } + if (!propTypes->nonConstantProperty()) { + return false; + } + return propTypes->hasType(TypeSet::GetValueType(*v)); +} + void AssumeUnreachable(const char* output) { MOZ_ReportAssertionFailure(output, __FILE__, __LINE__); } diff --git a/js/src/jit/VMFunctions.h b/js/src/jit/VMFunctions.h index 07d2a8a12c98..08fd437f1283 100644 --- a/js/src/jit/VMFunctions.h +++ b/js/src/jit/VMFunctions.h @@ -1173,6 +1173,8 @@ AtomicsReadWriteModifyFn AtomicsAnd(Scalar::Type elementType); AtomicsReadWriteModifyFn AtomicsOr(Scalar::Type elementType); AtomicsReadWriteModifyFn AtomicsXor(Scalar::Type elementType); +bool GroupHasPropertyTypes(ObjectGroup* group, jsid* id, Value* v); + // Functions used when JS_MASM_VERBOSE is enabled. void AssumeUnreachable(const char* output); void Printf0(const char* output);