diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index 64ac80c4cdd6..120aff9bf5ea 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -21,6 +21,7 @@ #include "jit/SharedICRegisters.h" #include "proxy/Proxy.h" #include "vm/ArrayBufferObject.h" +#include "vm/BigIntType.h" #include "vm/GeneratorObject.h" #include "builtin/Boolean-inl.h" @@ -2750,67 +2751,67 @@ bool CacheIRCompiler::emitBigIntBinaryOperationShared() { bool CacheIRCompiler::emitBigIntAddResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntSubResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntMulResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntDivResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntModResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntPowResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntBitAndResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntBitOrResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntBitXorResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntLeftShiftResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } bool CacheIRCompiler::emitBigIntRightShiftResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt); - return emitBigIntBinaryOperationShared(); + return emitBigIntBinaryOperationShared(); } template @@ -2829,25 +2830,25 @@ bool CacheIRCompiler::emitBigIntUnaryOperationShared() { bool CacheIRCompiler::emitBigIntNotResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt); - return emitBigIntUnaryOperationShared(); + return emitBigIntUnaryOperationShared(); } bool CacheIRCompiler::emitBigIntNegationResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt); - return emitBigIntUnaryOperationShared(); + return emitBigIntUnaryOperationShared(); } bool CacheIRCompiler::emitBigIntIncResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt); - return emitBigIntUnaryOperationShared(); + return emitBigIntUnaryOperationShared(); } bool CacheIRCompiler::emitBigIntDecResult() { JitSpew(JitSpew_Codegen, __FUNCTION__); using Fn = BigInt* (*)(JSContext*, HandleBigInt); - return emitBigIntUnaryOperationShared(); + return emitBigIntUnaryOperationShared(); } bool CacheIRCompiler::emitTruncateDoubleToUInt32() { diff --git a/js/src/jit/VMFunctionList-inl.h b/js/src/jit/VMFunctionList-inl.h index e37cdc8d145b..a306257c914b 100644 --- a/js/src/jit/VMFunctionList-inl.h +++ b/js/src/jit/VMFunctionList-inl.h @@ -16,6 +16,7 @@ #include "jit/VMFunctions.h" #include "vm/AsyncFunction.h" #include "vm/AsyncIteration.h" +#include "vm/BigIntType.h" #include "vm/EqualityOperations.h" #include "vm/Instrumentation.h" #include "vm/Interpreter.h" @@ -48,20 +49,20 @@ namespace jit { _(BaselineGetFunctionThis, js::jit::BaselineGetFunctionThis) \ _(BaselineThrowInitializedThis, js::jit::BaselineThrowInitializedThis) \ _(BaselineThrowUninitializedThis, js::jit::BaselineThrowUninitializedThis) \ - _(BigIntAdd, js::jit::BigIntAdd) \ - _(BigIntBitAnd, js::jit::BigIntBitAnd) \ - _(BigIntBitNot, js::jit::BigIntBitNot) \ - _(BigIntBitOr, js::jit::BigIntBitOr) \ - _(BigIntBitXor, js::jit::BigIntBitXor) \ - _(BigIntDec, js::jit::BigIntDec) \ - _(BigIntDiv, js::jit::BigIntDiv) \ - _(BigIntInc, js::jit::BigIntInc) \ - _(BigIntLeftShift, js::jit::BigIntLeftShift) \ - _(BigIntMod, js::jit::BigIntMod) \ - _(BigIntMul, js::jit::BigIntMul) \ - _(BigIntNeg, js::jit::BigIntNeg) \ - _(BigIntPow, js::jit::BigIntPow) \ - _(BigIntRightShift, js::jit::BigIntRightShift) \ + _(BigIntAdd, JS::BigInt::add) \ + _(BigIntBitAnd, JS::BigInt::bitAnd) \ + _(BigIntBitNot, JS::BigInt::bitNot) \ + _(BigIntBitOr, JS::BigInt::bitOr) \ + _(BigIntBitXor, JS::BigInt::bitXor) \ + _(BigIntDec, JS::BigInt::dec) \ + _(BigIntDiv, JS::BigInt::div) \ + _(BigIntInc, JS::BigInt::inc) \ + _(BigIntLeftShift, JS::BigInt::lsh) \ + _(BigIntMod, JS::BigInt::mod) \ + _(BigIntMul, JS::BigInt::mul) \ + _(BigIntNeg, JS::BigInt::neg) \ + _(BigIntPow, JS::BigInt::pow) \ + _(BigIntRightShift, JS::BigInt::rsh) \ _(BigIntStringEqual, \ js::jit::BigIntStringEqual) \ _(BigIntStringGreaterThanOrEqual, \ @@ -70,7 +71,7 @@ namespace jit { js::jit::BigIntStringCompare) \ _(BigIntStringNotEqual, \ js::jit::BigIntStringEqual) \ - _(BigIntSub, js::jit::BigIntSub) \ + _(BigIntSub, JS::BigInt::sub) \ _(BindVarOperation, js::BindVarOperation) \ _(BitAnd, js::BitAnd) \ _(BitLsh, js::BitLsh) \ diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp index fadca7d7135e..18fc10286727 100644 --- a/js/src/jit/VMFunctions.cpp +++ b/js/src/jit/VMFunctions.cpp @@ -2088,60 +2088,6 @@ void* AllocateBigIntNoGC(JSContext* cx) { return js::Allocate(cx); } -BigInt* BigIntAdd(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::add(cx, x, y); -} - -BigInt* BigIntSub(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::sub(cx, x, y); -} - -BigInt* BigIntMul(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::mul(cx, x, y); -} - -BigInt* BigIntDiv(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::div(cx, x, y); -} - -BigInt* BigIntMod(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::mod(cx, x, y); -} - -BigInt* BigIntPow(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::pow(cx, x, y); -} - -BigInt* BigIntBitAnd(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::bitAnd(cx, x, y); -} - -BigInt* BigIntBitOr(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::bitOr(cx, x, y); -} - -BigInt* BigIntBitXor(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::bitXor(cx, x, y); -} - -BigInt* BigIntLeftShift(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::lsh(cx, x, y); -} - -BigInt* BigIntRightShift(JSContext* cx, HandleBigInt x, HandleBigInt y) { - return BigInt::rsh(cx, x, y); -} - -BigInt* BigIntBitNot(JSContext* cx, HandleBigInt x) { - return BigInt::bitNot(cx, x); -} - -BigInt* BigIntNeg(JSContext* cx, HandleBigInt x) { return BigInt::neg(cx, x); } - -BigInt* BigIntInc(JSContext* cx, HandleBigInt x) { return BigInt::inc(cx, x); } - -BigInt* BigIntDec(JSContext* cx, HandleBigInt x) { return BigInt::dec(cx, x); } - template bool BigIntEqual(BigInt* x, BigInt* y) { AutoUnsafeCallWithABI unsafe; diff --git a/js/src/jit/VMFunctions.h b/js/src/jit/VMFunctions.h index be4b2e928e0e..8e1c7e516af2 100644 --- a/js/src/jit/VMFunctions.h +++ b/js/src/jit/VMFunctions.h @@ -1145,23 +1145,6 @@ bool DoToNumeric(JSContext* cx, HandleValue arg, MutableHandleValue ret); void* AllocateBigIntNoGC(JSContext* cx); -BigInt* BigIntAdd(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntSub(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntMul(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntDiv(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntMod(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntPow(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntBitAnd(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntBitOr(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntBitXor(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntLeftShift(JSContext* cx, HandleBigInt x, HandleBigInt y); -BigInt* BigIntRightShift(JSContext* cx, HandleBigInt x, HandleBigInt y); - -BigInt* BigIntBitNot(JSContext* cx, HandleBigInt x); -BigInt* BigIntNeg(JSContext* cx, HandleBigInt x); -BigInt* BigIntInc(JSContext* cx, HandleBigInt x); -BigInt* BigIntDec(JSContext* cx, HandleBigInt x); - template bool BigIntEqual(BigInt* x, BigInt* y);