зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1657609
- delete dynamic allocation of parameter buffers; r=mccr8
Now that we've statically ensured everything fits into the stack-allocated array(s), we can delete the case that handled dynamic allocation. Differential Revision: https://phabricator.services.mozilla.com/D86213
This commit is contained in:
Родитель
c4c7337cad
Коммит
87ff812afd
|
@ -24,7 +24,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
#define PARAM_FPR_COUNT 8
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = NULL;
|
||||
const nsXPTMethodInfo* info;
|
||||
|
||||
NS_ASSERTION(self,"no self");
|
||||
|
@ -34,14 +33,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
|
||||
uint32_t paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if (paramCount > PARAM_BUFFER_COUNT) {
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
} else {
|
||||
dispatchParams = paramBuffer;
|
||||
}
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -50,7 +41,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
for (uint32_t i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (next_gpr < PARAM_GPR_COUNT)
|
||||
|
@ -180,11 +171,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if (dispatchParams != paramBuffer) {
|
||||
delete [] dispatchParams;
|
||||
}
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
|||
const uint8_t NUM_ARG_REGS = 6-1; // -1 for "this" pointer
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -29,14 +28,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
// args[0] to args[NUM_ARG_REGS] hold floating point register values
|
||||
|
@ -45,7 +36,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -92,10 +83,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
{
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -49,13 +48,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -63,7 +55,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -99,10 +91,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
{
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTInterfaceInfo* iface_info = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
|
@ -28,19 +27,12 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
uint32_t* ap = args;
|
||||
for(i = 0; i < paramCount; i++, ap++)
|
||||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if(param.IsOut() || !type.IsArithmetic())
|
||||
{
|
||||
|
@ -70,10 +62,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
{
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -38,14 +37,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -53,7 +44,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -86,10 +77,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
|
|||
{
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -25,13 +24,6 @@ PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
|
|||
self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -39,7 +31,7 @@ PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -61,10 +53,7 @@ PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint64_t* iargs = intargs;
|
||||
uint64_t* fargs = floatargs;
|
||||
|
@ -36,13 +35,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
for(i = 0; i < paramCount; ++i)
|
||||
|
@ -50,7 +42,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
int isfloat = 0;
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
MOZ_CRASH("NYI: support implicit JSContext*, bug 1475699");
|
||||
|
||||
|
@ -118,10 +110,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t) methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint64_t* iargs = intargs;
|
||||
uint64_t* fargs = floatargs;
|
||||
|
@ -39,13 +38,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
for(i = 0; i < paramCount; ++i)
|
||||
|
@ -53,7 +45,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
int isfloat = 0;
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
MOZ_CRASH("NYI: support implicit JSContext*, bug 1475699");
|
||||
|
||||
|
@ -121,10 +113,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t) methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
|||
const uint8_t NUM_ARG_REGS = 6-1; // -1 for "this" pointer
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -29,13 +28,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
// args[0] to args[NUM_ARG_REGS] hold floating point register values
|
||||
|
@ -44,7 +36,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -91,10 +83,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
{
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -26,13 +25,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t gpr = 1, fpr = 0;
|
||||
|
@ -41,7 +33,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (gpr < 5)
|
||||
|
@ -146,10 +138,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
{
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -26,13 +25,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t gpr = 1, fpr = 0;
|
||||
|
@ -41,7 +33,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (gpr < 5)
|
||||
|
@ -146,10 +138,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -33,13 +32,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -47,7 +39,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -95,10 +87,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
#define PARAM_FPR_COUNT 7
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -39,13 +38,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -54,7 +46,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (iCount < PARAM_GPR_COUNT)
|
||||
|
@ -174,10 +166,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
int32_t regwords = 1; /* self pointer is not in the variant records */
|
||||
uint8_t paramCount;
|
||||
|
@ -40,20 +39,13 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
for(i = 0; i < paramCount; ++i, --args)
|
||||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
MOZ_CRASH("NYI: support implicit JSContext*, bug 1475699");
|
||||
|
||||
|
@ -116,10 +108,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t) methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,6 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
uint64_t * args, uint64_t * gpregs, double *fpregs)
|
||||
{
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint32_t paramCount;
|
||||
uint32_t i;
|
||||
|
@ -80,14 +79,6 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -100,7 +91,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
for(i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (nr_gpr < GPR_COUNT)
|
||||
|
@ -167,10 +158,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t) methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if (dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, u
|
|||
#define PARAM_GPR_COUNT 7
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info = nullptr;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -38,13 +37,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, u
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -54,7 +46,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, u
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (iCount < PARAM_GPR_COUNT)
|
||||
|
@ -170,10 +162,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, u
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args, u
|
|||
#define PARAM_GPR_COUNT 7
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info = nullptr;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -33,13 +32,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args, u
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -49,7 +41,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args, u
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (iCount < PARAM_GPR_COUNT)
|
||||
|
@ -157,10 +149,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args, u
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ PrepareAndDispatch(nsXPTCStubBase* self,
|
|||
double *fprData)
|
||||
{
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info = nullptr;
|
||||
uint32_t paramCount;
|
||||
uint32_t i;
|
||||
|
@ -50,14 +49,6 @@ PrepareAndDispatch(nsXPTCStubBase* self,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -71,7 +62,7 @@ PrepareAndDispatch(nsXPTCStubBase* self,
|
|||
for(i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (gpr < GPR_COUNT)
|
||||
|
@ -160,10 +151,7 @@ PrepareAndDispatch(nsXPTCStubBase* self,
|
|||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex,
|
||||
info,
|
||||
dispatchParams);
|
||||
|
||||
if (dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ PrepareAndDispatch(nsXPTCStubBase* self,
|
|||
double *fprData)
|
||||
{
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info = nullptr;
|
||||
uint32_t paramCount;
|
||||
uint32_t i;
|
||||
|
@ -48,14 +47,6 @@ PrepareAndDispatch(nsXPTCStubBase* self,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -67,7 +58,7 @@ PrepareAndDispatch(nsXPTCStubBase* self,
|
|||
for(i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (gpr < GPR_COUNT)
|
||||
|
@ -142,10 +133,7 @@ PrepareAndDispatch(nsXPTCStubBase* self,
|
|||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex,
|
||||
info,
|
||||
dispatchParams);
|
||||
|
||||
if (dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ PrepareAndDispatch(
|
|||
#define PARAM_GPR_COUNT 7
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant *dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo *methodInfo;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -64,18 +63,10 @@ PrepareAndDispatch(
|
|||
|
||||
paramCount = methodInfo->GetParamCount();
|
||||
|
||||
if(paramCount > PARAM_BUFFER_COUNT) {
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
}
|
||||
else {
|
||||
dispatchParams = paramBuffer;
|
||||
}
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
for(i = 0; i < paramCount; i++, argIndex++) {
|
||||
const nsXPTParamInfo ¶m = methodInfo->GetParam(i);
|
||||
const nsXPTType &type = param.GetType();
|
||||
nsXPTCMiniVariant *dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant *dp = ¶mBuffer[i];
|
||||
uint32_t theParam;
|
||||
|
||||
if(argIndex < PARAM_GPR_COUNT)
|
||||
|
@ -143,10 +134,7 @@ PrepareAndDispatch(
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->
|
||||
CallMethod((uint16_t)methodIndex, methodInfo, dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
CallMethod((uint16_t)methodIndex, methodInfo, paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
|
|||
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -28,14 +27,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -43,7 +34,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -76,10 +67,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTInterfaceInfo* iface_info = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
|
@ -37,19 +36,12 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
uint32_t* ap = args;
|
||||
for(i = 0; i < paramCount; i++, ap++)
|
||||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if(param.IsOut() || !type.IsArithmetic())
|
||||
{
|
||||
|
@ -85,10 +77,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTInterfaceInfo* iface_info = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
|
@ -37,20 +36,12 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
uint32_t* ap = args;
|
||||
for(i = 0; i < paramCount; i++, ap++)
|
||||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if(param.IsOut() || !type.IsArithmetic())
|
||||
{
|
||||
|
@ -86,10 +77,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -33,13 +32,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -47,7 +39,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -86,10 +78,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
uint64_t * args, uint64_t * gpregs, double *fpregs)
|
||||
{
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint32_t paramCount;
|
||||
uint32_t i;
|
||||
|
@ -47,14 +46,6 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if (paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -65,7 +56,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
for (i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (nr_gpr < GPR_COUNT)
|
||||
|
@ -124,10 +115,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t) methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if (dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
uint64_t * args, uint64_t * gpregs, double *fpregs)
|
||||
{
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info;
|
||||
uint32_t paramCount;
|
||||
uint32_t i;
|
||||
|
@ -47,14 +46,6 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if (paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -65,7 +56,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
for (i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (nr_gpr < GPR_COUNT)
|
||||
|
@ -122,10 +113,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t) methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if (dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
{
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info = nullptr;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -37,13 +36,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint32_t* ap = args;
|
||||
|
@ -51,7 +43,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext)
|
||||
ap++;
|
||||
|
@ -85,10 +77,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex,
|
|||
*stackBytesToPop = ((uint32_t)ap) - ((uint32_t)args);
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
#define PARAM_FPR_COUNT 8
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = NULL;
|
||||
const nsXPTMethodInfo* info;
|
||||
|
||||
NS_ASSERTION(self,"no self");
|
||||
|
@ -32,14 +31,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
|
||||
uint32_t paramCount = info->GetParamCount();
|
||||
|
||||
// setup variant array pointer
|
||||
if (paramCount > PARAM_BUFFER_COUNT) {
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
} else {
|
||||
dispatchParams = paramBuffer;
|
||||
}
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -48,7 +39,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
for (uint32_t i = 0; i < paramCount; i++) {
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (next_gpr < PARAM_GPR_COUNT)
|
||||
|
@ -178,11 +169,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if (dispatchParams != paramBuffer) {
|
||||
delete [] dispatchParams;
|
||||
}
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
#define PARAM_FPR_COUNT 3
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info = nullptr;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -34,17 +33,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
//
|
||||
// setup variant array pointer
|
||||
//
|
||||
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -54,7 +42,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (iCount < PARAM_GPR_COUNT)
|
||||
|
@ -178,10 +166,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint64_t* args,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
#define PARAM_FPR_COUNT 3
|
||||
|
||||
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
|
||||
nsXPTCMiniVariant* dispatchParams = nullptr;
|
||||
const nsXPTMethodInfo* info = nullptr;
|
||||
uint8_t paramCount;
|
||||
uint8_t i;
|
||||
|
@ -42,13 +41,6 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
// setup variant array pointer
|
||||
//
|
||||
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
else
|
||||
dispatchParams = paramBuffer;
|
||||
|
||||
NS_ASSERTION(dispatchParams,"no place for params");
|
||||
|
||||
const uint8_t indexOfJSContext = info->IndexOfJSContext();
|
||||
|
||||
uint64_t* ap = args;
|
||||
|
@ -58,7 +50,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
{
|
||||
const nsXPTParamInfo& param = info->GetParam(i);
|
||||
const nsXPTType& type = param.GetType();
|
||||
nsXPTCMiniVariant* dp = &dispatchParams[i];
|
||||
nsXPTCMiniVariant* dp = ¶mBuffer[i];
|
||||
|
||||
if (i == indexOfJSContext) {
|
||||
if (iCount < PARAM_GPR_COUNT)
|
||||
|
@ -182,10 +174,7 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
|
|||
}
|
||||
|
||||
nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
|
||||
dispatchParams);
|
||||
|
||||
if(dispatchParams != paramBuffer)
|
||||
delete [] dispatchParams;
|
||||
paramBuffer);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче