Skip to content

Commit

Permalink
Bug 1657609 - share PARAM_BUFFER_COUNT among xptcall implementations;…
Browse files Browse the repository at this point in the history
… r=mccr8

Everybody uses the same value; we might as well put it in a single place.

Differential Revision: https://phabricator.services.mozilla.com/D86211
  • Loading branch information
froydnj committed Aug 7, 2020
1 parent 1514163 commit fdd22de
Show file tree
Hide file tree
Showing 31 changed files with 4 additions and 30 deletions.
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ extern "C" nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
uint64_t *gprData, double *fprData)
{
#define PARAM_BUFFER_COUNT 16
#define PARAM_GPR_COUNT 8
#define PARAM_FPR_COUNT 8

Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_alpha_openbsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ __asm__("PrepareAndDispatch") ATTRIBUTE_USED;
static nsresult
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
{
const uint8_t PARAM_BUFFER_COUNT = 16;
const uint8_t NUM_ARG_REGS = 6-1; // -1 for "this" pointer

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
extern "C" nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
{
#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_arm_netbsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
{
#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_arm_openbsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ DONT_DROP_OR_WARN;
static nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
{
#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_gcc_x86_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ static nsresult ATTRIBUTE_USED
__attribute__ ((regparm (3)))
PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
{
#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_ipf32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
uint64_t* intargs, uint64_t* floatargs, uint64_t* restargs)
{

#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_ipf64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
uint64_t* intargs, uint64_t* floatargs, uint64_t* restargs)
{

#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_linux_alpha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ __asm__("PrepareAndDispatch") ATTRIBUTE_USED;
static nsresult
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
{
const uint8_t PARAM_BUFFER_COUNT = 16;
const uint8_t NUM_ARG_REGS = 6-1; // -1 for "this" pointer

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_linux_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ static nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
uint32_t* a_gpr, uint64_t *a_fpr, uint32_t *a_ov)
{
#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_linux_s390x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ static nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
uint64_t* a_gpr, uint64_t *a_fpr, uint64_t *a_ov)
{
#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_mips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
{
args++; // always skip over a0

#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_mips64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ extern "C" nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
uint64_t *gprData, double *fprData)
{
#define PARAM_BUFFER_COUNT 16
#define PARAM_GPR_COUNT 7
#define PARAM_FPR_COUNT 7

Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_pa32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
uint32_t lo;
} DU;

#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_ppc64_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// allocated for these by the caller. The rest of the parameters are passed
// in the caller's stack area. The stack pointer must stay 16-byte aligned.

const uint32_t PARAM_BUFFER_COUNT = 16;
const uint32_t GPR_COUNT = 7;
const uint32_t FPR_COUNT = 13;

Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, u
uint32_t lo; // have to move 64 bit entities as 32 bit halves since
} DU; // stack slots are not guaranteed 16 byte aligned

#define PARAM_BUFFER_COUNT 16
#define PARAM_GPR_COUNT 7

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ extern "C" nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args, uint64_t *gprData, double *fprData)
{

#define PARAM_BUFFER_COUNT 16
#define PARAM_GPR_COUNT 7

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#else
#define GPR_COUNT 8
#endif
#define PARAM_BUFFER_COUNT 16
// PrepareAndDispatch() is called by SharedStub() and calls the actual method.
//
// - 'args[]' contains the arguments passed on stack
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_openbsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// area. The stack pointer has to retain 16-byte alignment, longlongs
// and doubles are aligned on 8-byte boundaries.

#define PARAM_BUFFER_COUNT 16
#define GPR_COUNT 8
#define FPR_COUNT 8

Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_rhapsody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ PrepareAndDispatch(
uint32_t *argsStack,
uint32_t *argsGPR,
double *argsFPR) {
#define PARAM_BUFFER_COUNT 16
#define PARAM_FPR_COUNT 13
#define PARAM_GPR_COUNT 7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ extern "C" nsresult ATTRIBUTE_USED
PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
{

#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_netbsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
} DU; // have to move 64 bit entities as 32 bit halves since
// stack slots are not guaranteed 16 byte aligned

#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_openbsd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
} DU; // have to move 64 bit entities as 32 bit halves since
// stack slots are not guaranteed 16 byte aligned

#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
} DU; // have to move 64 bit entities as 32 bit halves since
// stack slots are not guaranteed 16 byte aligned

#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_darwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// caller. The rest of the parameters are passed in the callers stack
// area.

const uint32_t PARAM_BUFFER_COUNT = 16;
const uint32_t GPR_COUNT = 6;
const uint32_t FPR_COUNT = 8;

Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// caller. The rest of the parameters are passed in the callers stack
// area.

const uint32_t PARAM_BUFFER_COUNT = 16;
const uint32_t GPR_COUNT = 6;
const uint32_t FPR_COUNT = 8;

Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/win32/xptcstubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ nsresult __stdcall
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
uint32_t* args, uint32_t* stackBytesToPop)
{
#define PARAM_BUFFER_COUNT 16

nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = nullptr;
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/win32/xptcstubs_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ extern "C" nsresult
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
uint64_t *gprData, double *fprData)
{
#define PARAM_BUFFER_COUNT 16
#define PARAM_GPR_COUNT 8
#define PARAM_FPR_COUNT 8

Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/win32/xptcstubs_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ extern "C" nsresult
PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
uint64_t *gprData, double *fprData)
{
#define PARAM_BUFFER_COUNT 16
//
// "this" pointer is first parameter, so parameter count is 3.
//
Expand Down
1 change: 0 additions & 1 deletion xpcom/reflect/xptcall/md/win32/xptcstubs_x86_64_gnu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ extern "C" nsresult __attribute__((__used__))
PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
uint64_t * args, uint64_t * gprData, double *fprData)
{
#define PARAM_BUFFER_COUNT 16
//
// "this" pointer is first parameter, so parameter count is 3.
//
Expand Down
4 changes: 4 additions & 0 deletions xpcom/reflect/xptinfo/xptinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ struct nsXPTMethodInfo {
// The fields in nsXPTMethodInfo were carefully ordered to minimize size.
static_assert(sizeof(nsXPTMethodInfo) == 8, "wrong size");

// Maximum number of stack allocated nsXPTCMiniVariant structures for argument
// passing purposes.
#define PARAM_BUFFER_COUNT 16

/**
* A nsXPTConstantInfo is used to describe a single interface constant.
*/
Expand Down

0 comments on commit fdd22de

Please sign in to comment.