Bug 1599465 - Part 8: Remove function call indirection when calling BigInt operations from jit-code. r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D54764

--HG--
extra : moz-landing-system : lando
This commit is contained in:
André Bargull 2019-12-02 17:37:07 +00:00
Родитель 6c0ebea0c8
Коммит c206352de3
4 изменённых файлов: 32 добавлений и 101 удалений

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

@ -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<Fn, jit::BigIntAdd>();
return emitBigIntBinaryOperationShared<Fn, BigInt::add>();
}
bool CacheIRCompiler::emitBigIntSubResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntSub>();
return emitBigIntBinaryOperationShared<Fn, BigInt::sub>();
}
bool CacheIRCompiler::emitBigIntMulResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntMul>();
return emitBigIntBinaryOperationShared<Fn, BigInt::mul>();
}
bool CacheIRCompiler::emitBigIntDivResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntDiv>();
return emitBigIntBinaryOperationShared<Fn, BigInt::div>();
}
bool CacheIRCompiler::emitBigIntModResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntMod>();
return emitBigIntBinaryOperationShared<Fn, BigInt::mod>();
}
bool CacheIRCompiler::emitBigIntPowResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntPow>();
return emitBigIntBinaryOperationShared<Fn, BigInt::pow>();
}
bool CacheIRCompiler::emitBigIntBitAndResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntBitAnd>();
return emitBigIntBinaryOperationShared<Fn, BigInt::bitAnd>();
}
bool CacheIRCompiler::emitBigIntBitOrResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntBitOr>();
return emitBigIntBinaryOperationShared<Fn, BigInt::bitOr>();
}
bool CacheIRCompiler::emitBigIntBitXorResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntBitXor>();
return emitBigIntBinaryOperationShared<Fn, BigInt::bitXor>();
}
bool CacheIRCompiler::emitBigIntLeftShiftResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntLeftShift>();
return emitBigIntBinaryOperationShared<Fn, BigInt::lsh>();
}
bool CacheIRCompiler::emitBigIntRightShiftResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt, HandleBigInt);
return emitBigIntBinaryOperationShared<Fn, jit::BigIntRightShift>();
return emitBigIntBinaryOperationShared<Fn, BigInt::rsh>();
}
template <typename Fn, Fn fn>
@ -2829,25 +2830,25 @@ bool CacheIRCompiler::emitBigIntUnaryOperationShared() {
bool CacheIRCompiler::emitBigIntNotResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt);
return emitBigIntUnaryOperationShared<Fn, jit::BigIntBitNot>();
return emitBigIntUnaryOperationShared<Fn, BigInt::bitNot>();
}
bool CacheIRCompiler::emitBigIntNegationResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt);
return emitBigIntUnaryOperationShared<Fn, jit::BigIntNeg>();
return emitBigIntUnaryOperationShared<Fn, BigInt::neg>();
}
bool CacheIRCompiler::emitBigIntIncResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt);
return emitBigIntUnaryOperationShared<Fn, jit::BigIntInc>();
return emitBigIntUnaryOperationShared<Fn, BigInt::inc>();
}
bool CacheIRCompiler::emitBigIntDecResult() {
JitSpew(JitSpew_Codegen, __FUNCTION__);
using Fn = BigInt* (*)(JSContext*, HandleBigInt);
return emitBigIntUnaryOperationShared<Fn, jit::BigIntDec>();
return emitBigIntUnaryOperationShared<Fn, BigInt::dec>();
}
bool CacheIRCompiler::emitTruncateDoubleToUInt32() {

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

@ -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<js::jit::EqualityKind::Equal>) \
_(BigIntStringGreaterThanOrEqual, \
@ -70,7 +71,7 @@ namespace jit {
js::jit::BigIntStringCompare<js::jit::ComparisonKind::LessThan>) \
_(BigIntStringNotEqual, \
js::jit::BigIntStringEqual<js::jit::EqualityKind::NotEqual>) \
_(BigIntSub, js::jit::BigIntSub) \
_(BigIntSub, JS::BigInt::sub) \
_(BindVarOperation, js::BindVarOperation) \
_(BitAnd, js::BitAnd) \
_(BitLsh, js::BitLsh) \

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

@ -2088,60 +2088,6 @@ void* AllocateBigIntNoGC(JSContext* cx) {
return js::Allocate<BigInt, NoGC>(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 <EqualityKind Kind>
bool BigIntEqual(BigInt* x, BigInt* y) {
AutoUnsafeCallWithABI unsafe;

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

@ -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 <EqualityKind Kind>
bool BigIntEqual(BigInt* x, BigInt* y);