more debug information. r=jband.

This commit is contained in:
dougt%netscape.com 2000-07-21 00:53:07 +00:00
Родитель b04a585420
Коммит 07462eab19
2 изменённых файлов: 27 добавлений и 3 удалений

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

@ -485,10 +485,15 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJS* wrapper, uint16 methodIndex,
SET_CALLER_NATIVE(xpcc);
#ifdef DEBUG_stats_jband
PRIntervalTime startTime = PR_IntervalNow();
PRIntervalTime endTime = 0;
static int totalTime = 0;
static int count = 0;
static const int interval = 10;
if(0 == (++count % interval))
printf("<<<<<<<< %d calls on nsXPCWrappedJSs made\n", count);
printf("<<<<<<<< %d calls on nsXPCWrappedJSs made. (%d)\n", count, PR_IntervalToMilliseconds(totalTime));
#endif
// XXX ASSUMES that retval is last arg.
@ -732,7 +737,9 @@ pre_call_clean_up:
}
oldsp = fp->sp;
fp->sp = sp;
success = js_Invoke(cx, argc, JSINVOKE_INTERNAL);
result = fp->sp[-1];
fp->sp = oldsp;
if(oldfp != fp)
@ -1071,7 +1078,11 @@ done:
JS_SetErrorReporter(cx, older);
NS_IF_RELEASE(xpc);
#ifdef DEBUG_stats_jband
endTime = PR_IntervalNow();
printf("%s::%s %d ( c->js ) \n", GetInterfaceName(), info->GetName(), PR_IntervalToMilliseconds(endTime-startTime));
totalTime += endTime-startTime;
#endif
return retval;
}

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

@ -561,10 +561,13 @@ nsXPCWrappedNativeClass::CallWrappedMethod(JSContext* cx,
nsXPConnect* xpc;
#ifdef DEBUG_stats_jband
PRIntervalTime startTime = PR_IntervalNow();
PRIntervalTime endTime = 0;
static int totalTime = 0;
static int count = 0;
static const int interval = 10;
if(0 == (++count % interval))
printf(">>>>>>>> %d calls on nsXPCWrappedNatives made\n", count);
printf(">>>>>>>> %d calls on nsXPCWrappedNatives made. (%d)\n", count, PR_IntervalToMilliseconds(totalTime));
#endif
if(vp)
@ -910,6 +913,7 @@ nsXPCWrappedNativeClass::CallWrappedMethod(JSContext* cx,
// do the invoke
invokeResult = XPTC_InvokeByIndex(callee, vtblIndex,
paramCount, dispatchParams);
xpcc->SetLastResult(invokeResult);
cc->SetData(oldccdata);
@ -1088,6 +1092,15 @@ done:
if(dispatchParams && dispatchParams != paramBuffer)
delete [] dispatchParams;
#ifdef DEBUG_stats_jband
endTime = PR_IntervalNow();
printf("%s::%s %d ( js->c ) \n", GetInterfaceName(), GetMemberName(desc), PR_IntervalToMilliseconds(endTime-startTime));
totalTime += (endTime-startTime);
#endif
return retval;
}