本文整理汇总了C++中LOGVV函数的典型用法代码示例。如果您正苦于以下问题:C++ LOGVV函数的具体用法?C++ LOGVV怎么用?C++ LOGVV使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOGVV函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dvmMterpStdRun
/*
* C mterp entry point. This just calls the various C fallbacks, making
* this a slow but portable interpeter.
*
* This is only used for the "allstubs" variant.
*/
void dvmMterpStdRun(Thread* self)
{
jmp_buf jmpBuf;
self->interpSave.bailPtr = &jmpBuf;
/* We exit via a longjmp */
if (setjmp(jmpBuf)) {
LOGVV("mterp threadid=%d returning", dvmThreadSelf()->threadId);
return;
}
/* run until somebody longjmp()s out */
while (true) {
typedef void (*Handler)(Thread* self);
u2 inst = /*self->interpSave.*/pc[0];
/*
* In mterp, dvmCheckBefore is handled via the altHandlerTable,
* while in the portable interpreter it is part of the handler
* FINISH code. For allstubs, we must do an explicit check
* in the interpretation loop.
*/
if (self->interpBreak.ctl.subMode) {
dvmCheckBefore(pc, fp, self);
}
Handler handler = (Handler) gDvmMterpHandlers[inst & 0xff];
(void) gDvmMterpHandlerNames; /* avoid gcc "defined but not used" */
LOGVV("handler %p %s",
handler, (const char*) gDvmMterpHandlerNames[inst & 0xff]);
(*handler)(self);
}
}
示例2: check_nic_compatibility
/* Certain VI functionalities are only supported on certain NIC types.
* This function validates that the requested functionality is present
* on the selected NIC. */
static int check_nic_compatibility(unsigned vi_flags, unsigned ef_vi_arch)
{
switch (ef_vi_arch) {
case EFHW_ARCH_FALCON:
if (vi_flags & EF_VI_TX_PUSH_ALWAYS) {
LOGVV(ef_log("%s: ERROR: TX PUSH ALWAYS flag not supported"
" on FALCON architecture", __FUNCTION__));
return -EOPNOTSUPP;
}
if (vi_flags & EF_VI_RX_TIMESTAMPS) {
LOGVV(ef_log("%s: ERROR: RX TIMESTAMPS flag not supported"
" on FALCON architecture", __FUNCTION__));
return -EOPNOTSUPP;
}
if (vi_flags & EF_VI_TX_TIMESTAMPS) {
LOGVV(ef_log("%s: ERROR: TX TIMESTAMPS flag not supported"
" on FALCON architecture", __FUNCTION__));
return -EOPNOTSUPP;
}
return 0;
case EFHW_ARCH_EF10:
return 0;
default:
return -EINVAL;
}
}
示例3: dvmConvertArgument
/*
* Convert types and widen primitives. Puts the value of "arg" into
* "destPtr".
*
* Returns the width of the argument in 32-bit words (1 or 2), or -1 on error.
*/
int dvmConvertArgument(DataObject* arg, ClassObject* type, s4* destPtr)
{
int retVal;
if (dvmIsPrimitiveClass(type)) {
/* e.g.: "arg" is java/lang/Float instance, "type" is VM float class */
PrimitiveType srcType;
s4* valuePtr;
srcType = getBoxedType(arg);
if (srcType == PRIM_NOT) { // didn't pass a boxed primitive in
LOGVV("conv arg: type '%s' not boxed primitive",
arg->clazz->descriptor);
return -1;
}
/* assumes value is stored in first instance field */
valuePtr = (s4*) arg->instanceData;
retVal = dvmConvertPrimitiveValue(srcType, type->primitiveType,
valuePtr, destPtr);
} else {
/* verify object is compatible */
if ((arg == NULL) || dvmInstanceof(arg->clazz, type)) {
*destPtr = (s4) arg;
retVal = 1;
} else {
LOGVV("Arg %p (%s) not compatible with %s",
arg, arg->clazz->descriptor, type->descriptor);
retVal = -1;
}
}
return retVal;
}
示例4: dvmMterpStd
/*
* "Standard" mterp entry point. This sets up a "glue" structure and then
* calls into the assembly interpreter implementation.
*
* (There is presently no "debug" entry point.)
*/
bool dvmMterpStd(Thread* self, InterpState* glue)
{
int changeInterp;
/* configure mterp items */
glue->self = self;
glue->methodClassDex = glue->method->clazz->pDvmDex;
glue->interpStackEnd = self->interpStackEnd;
glue->pSelfSuspendCount = &self->suspendCount;
glue->cardTable = gDvm.biasedCardTableBase;
#if defined(WITH_JIT)
glue->pJitProfTable = gDvmJit.pProfTable;
glue->ppJitProfTable = &gDvmJit.pProfTable;
glue->jitThreshold = gDvmJit.threshold;
#endif
if (gDvm.jdwpConfigured) {
glue->pDebuggerActive = &gDvm.debuggerActive;
} else {
glue->pDebuggerActive = NULL;
}
glue->pActiveProfilers = &gDvm.activeProfilers;
IF_LOGVV() {
char* desc = dexProtoCopyMethodDescriptor(&glue->method->prototype);
LOGVV("mterp threadid=%d entry %d: %s.%s %s\n",
dvmThreadSelf()->threadId,
glue->entryPoint,
glue->method->clazz->descriptor,
glue->method->name,
desc);
free(desc);
}
//LOGI("glue is %p, pc=%p, fp=%p\n", glue, glue->pc, glue->fp);
//LOGI("first instruction is 0x%04x\n", glue->pc[0]);
changeInterp = dvmMterpStdRun(glue);
#if defined(WITH_JIT)
if (glue->jitState != kJitSingleStep) {
glue->self->inJitCodeCache = NULL;
}
#endif
if (!changeInterp) {
/* this is a "normal" exit; we're not coming back */
#ifdef LOG_INSTR
LOGD("|-- Leaving interpreter loop");
#endif
return false;
} else {
/* we're "standard", so switch to "debug" */
LOGVV(" mterp returned, changeInterp=%d\n", changeInterp);
glue->nextMode = INTERP_DBG;
return true;
}
}
示例5: dvmResolveInstField
/*
* Resolve an instance field reference.
*
* Returns NULL and throws an exception on error (no such field, illegal
* access).
*/
InstField* dvmResolveInstField(const ClassObject* referrer, u4 ifieldIdx)
{
DvmDex* pDvmDex = referrer->pDvmDex;
ClassObject* resClass;
const DexFieldId* pFieldId;
InstField* resField;
LOGVV("--- resolving field %u (referrer=%s cl=%p)",
ifieldIdx, referrer->descriptor, referrer->classLoader);
pFieldId = dexGetFieldId(pDvmDex->pDexFile, ifieldIdx);
/*
* Find the field's class.
*/
resClass = dvmResolveClass(referrer, pFieldId->classIdx, false);
if (resClass == NULL) {
assert(dvmCheckException(dvmThreadSelf()));
return NULL;
}
resField = dvmFindInstanceFieldHier(resClass,
dexStringById(pDvmDex->pDexFile, pFieldId->nameIdx),
dexStringByTypeIdx(pDvmDex->pDexFile, pFieldId->typeIdx));
if (resField == NULL) {
dvmThrowNoSuchFieldError(
dexStringById(pDvmDex->pDexFile, pFieldId->nameIdx));
return NULL;
}
/*
* Class must be initialized by now (unless verifier is buggy). We
* could still be in the process of initializing it if the field
* access is from a static initializer.
*/
assert(dvmIsClassInitialized(resField->clazz) ||
dvmIsClassInitializing(resField->clazz));
/*
* The class is initialized (or initializing), the field has been
* found. Add a pointer to our data structure so we don't have to
* jump through the hoops again.
*
* Anything that uses the resolved table entry must have an instance
* of the class, so any class init activity has already happened (or
* been deliberately bypassed when <clinit> created an instance).
* So it's always okay to update the table.
*/
dvmDexSetResolvedField(pDvmDex, ifieldIdx, (Field*)resField);
LOGVV(" field %u is %s.%s",
ifieldIdx, resField->clazz->descriptor, resField->name);
return resField;
}
示例6: dvmFindClassByName
/*
* Find a class by name, initializing it if requested.
*/
ClassObject* dvmFindClassByName(StringObject* nameObj, Object* loader,
bool doInit)
{
ClassObject* clazz = NULL;
char* name = NULL;
char* descriptor = NULL;
if (nameObj == NULL) {
dvmThrowException("Ljava/lang/NullPointerException;", NULL);
goto bail;
}
name = dvmCreateCstrFromString(nameObj);
/*
* We need to validate and convert the name (from x.y.z to x/y/z). This
* is especially handy for array types, since we want to avoid
* auto-generating bogus array classes.
*/
if (!validateClassName(name)) {
LOGW("dvmFindClassByName rejecting '%s'\n", name);
dvmThrowException("Ljava/lang/ClassNotFoundException;", name);
goto bail;
}
descriptor = dvmDotToDescriptor(name);
if (descriptor == NULL) {
goto bail;
}
if (doInit)
clazz = dvmFindClass(descriptor, loader);
else
clazz = dvmFindClassNoInit(descriptor, loader);
if (clazz == NULL) {
LOGVV("FAIL: load %s (%d)\n", descriptor, doInit);
Thread* self = dvmThreadSelf();
Object* oldExcep = dvmGetException(self);
dvmAddTrackedAlloc(oldExcep, self); /* don't let this be GCed */
dvmClearException(self);
dvmThrowChainedException("Ljava/lang/ClassNotFoundException;",
name, oldExcep);
dvmReleaseTrackedAlloc(oldExcep, self);
} else {
LOGVV("GOOD: load %s (%d) --> %p ldr=%p\n",
descriptor, doInit, clazz, clazz->classLoader);
}
bail:
free(name);
free(descriptor);
return clazz;
}
示例7: dvmJitHandlePackedSwitch
/* return the number of bytes to increase the bytecode pointer by */
s4 dvmJitHandlePackedSwitch(const s4* entries, s4 firstKey, u2 size, s4 testVal)
{
if (testVal < firstKey || testVal >= firstKey + size) {
LOGVV("Value %d not found in switch (%d-%d)",
testVal, firstKey, firstKey+size-1);
return 2*3;//bytecode packed_switch is 6(2*3) bytes long
}
LOGVV("Value %d found in slot %d (goto 0x%02x)",
testVal, testVal - firstKey,
s4FromSwitchData(&entries[testVal - firstKey]));
return 2*s4FromSwitchData(&entries[testVal - firstKey]); //convert from u2 to byte
}
示例8: dvmIterativeSleep
/*
* Call this repeatedly, with successively higher values for "iteration",
* to sleep for a period of time not to exceed "maxTotalSleep".
*
* For example, when called with iteration==0 we will sleep for a very
* brief time. On the next call we will sleep for a longer time. When
* the sum total of all sleeps reaches "maxTotalSleep", this returns false.
*
* The initial start time value for "relStartTime" MUST come from the
* dvmGetRelativeTimeUsec call. On the device this must come from the
* monotonic clock source, not the wall clock.
*
* This should be used wherever you might be tempted to call sched_yield()
* in a loop. The problem with sched_yield is that, for a high-priority
* thread, the kernel might not actually transfer control elsewhere.
*
* Returns "false" if we were unable to sleep because our time was up.
*/
bool dvmIterativeSleep(int iteration, int maxTotalSleep, u8 relStartTime)
{
/*
* Minimum sleep is one millisecond, it is important to keep this value
* low to ensure short GC pauses since dvmSuspendAllThreads() uses this
* function.
*/
const int minSleep = 1000;
u8 curTime;
int curDelay;
/*
* Get current time, and see if we've already exceeded the limit.
*/
curTime = dvmGetRelativeTimeUsec();
if (curTime >= relStartTime + maxTotalSleep) {
LOGVV("exsl: sleep exceeded (start=%llu max=%d now=%llu)",
relStartTime, maxTotalSleep, curTime);
return false;
}
/*
* Compute current delay. We're bounded by "maxTotalSleep", so no
* real risk of overflow assuming "usleep" isn't returning early.
* (Besides, 2^30 usec is about 18 minutes by itself.)
*
* For iteration==0 we just call sched_yield(), so the first sleep
* at iteration==1 is actually (minSleep * 2).
*/
curDelay = minSleep;
while (iteration-- > 0)
curDelay *= 2;
assert(curDelay > 0);
if (curTime + curDelay >= relStartTime + maxTotalSleep) {
LOGVV("exsl: reduced delay from %d to %d",
curDelay, (int) ((relStartTime + maxTotalSleep) - curTime));
curDelay = (int) ((relStartTime + maxTotalSleep) - curTime);
}
if (iteration == 0) {
LOGVV("exsl: yield");
sched_yield();
} else {
LOGVV("exsl: sleep for %d", curDelay);
usleep(curDelay);
}
return true;
}
示例9: convertSignatureToClassArray
/*
* Convert the method signature to an array of classes.
*
* The tokenization process may mangle "*pSignature". On return, it will
* be pointing at the closing ')'.
*
* "defClass" is the method's class, which is needed to make class loaders
* happy.
*/
static ArrayObject* convertSignatureToClassArray(char** pSignature,
ClassObject* defClass)
{
char* signature = *pSignature;
assert(*signature == '(');
signature++;
/* count up the number of parameters */
size_t count = 0;
char* cp = signature;
while (*cp != ')') {
count++;
if (*cp == '[') {
while (*++cp == '[')
;
}
if (*cp == 'L') {
while (*++cp != ';')
;
}
cp++;
}
LOGVV("REFLECT found %d parameters in '%s'", count, *pSignature);
/* create an array to hold them */
ArrayObject* classArray = dvmAllocArrayByClass(gDvm.classJavaLangClassArray,
count, ALLOC_DEFAULT);
if (classArray == NULL)
return NULL;
/* fill it in */
cp = signature;
for (size_t i = 0; i < count; i++) {
ClassObject* clazz = convertSignaturePartToClass(&cp, defClass);
if (clazz == NULL) {
assert(dvmCheckException(dvmThreadSelf()));
return NULL;
}
LOGVV("REFLECT %d: '%s'", i, clazz->descriptor);
dvmSetObjectArrayElement(classArray, i, (Object *)clazz);
}
*pSignature = cp;
/* caller must call dvmReleaseTrackedAlloc */
return classArray;
}
示例10: dvmResolveInstField
/*
* Resolve an instance field reference.
*
* Returns NULL and throws an exception on error (no such field, illegal
* access).
*/
InstField* dvmResolveInstField(const ClassObject* referrer, u4 ifieldIdx)
{
DvmDex* pDvmDex = referrer->pDvmDex;
ClassObject* resClass;
const DexFieldId* pFieldId;
InstField* resField;
LOGVV("--- resolving field %u (referrer=%s cl=%p)\n",
ifieldIdx, referrer->descriptor, referrer->classLoader);
pFieldId = dexGetFieldId(pDvmDex->pDexFile, ifieldIdx);
/*
* Find the field's class.
*/
resClass = dvmResolveClass(referrer, pFieldId->classIdx, false);
if (resClass == NULL) {
assert(dvmCheckException(dvmThreadSelf()));
return NULL;
}
resField = dvmFindInstanceFieldHier(resClass,
dexStringById(pDvmDex->pDexFile, pFieldId->nameIdx),
dexStringByTypeIdx(pDvmDex->pDexFile, pFieldId->typeIdx));
if (resField == NULL) {
dvmThrowException("Ljava/lang/NoSuchFieldError;",
dexStringById(pDvmDex->pDexFile, pFieldId->nameIdx));
return NULL;
}
/*
* Class must be initialized by now (unless verifier is buggy). We
* could still be in the process of initializing it if the field
* access is from a static initializer.
*/
assert(dvmIsClassInitialized(resField->field.clazz) ||
dvmIsClassInitializing(resField->field.clazz));
/*
* The class is initialized, the method has been found. Add a pointer
* to our data structure so we don't have to jump through the hoops again.
*/
dvmDexSetResolvedField(pDvmDex, ifieldIdx, (Field*)resField);
LOGVV(" field %u is %s.%s\n",
ifieldIdx, resField->field.clazz->descriptor, resField->field.name);
return resField;
}
示例11: Dalvik_java_lang_VMClassLoader_findLoadedClass
/*
* static Class findLoadedClass(ClassLoader cl, String name)
*/
static void Dalvik_java_lang_VMClassLoader_findLoadedClass(const u4* args,
JValue* pResult)
{
Object* loader = (Object*) args[0];
StringObject* nameObj = (StringObject*) args[1];
ClassObject* clazz = NULL;
char* name = NULL;
char* descriptor = NULL;
if (nameObj == NULL) {
dvmThrowException("Ljava/lang/NullPointerException;", NULL);
goto bail;
}
/*
* Get a UTF-8 copy of the string, and convert dots to slashes.
*/
name = dvmCreateCstrFromString(nameObj);
if (name == NULL)
goto bail;
descriptor = dvmDotToDescriptor(name);
if (descriptor == NULL)
goto bail;
clazz = dvmLookupClass(descriptor, loader, false);
LOGVV("look: %s ldr=%p --> %p\n", descriptor, loader, clazz);
bail:
free(name);
free(descriptor);
RETURN_PTR(clazz);
}
示例12: dvmMterpStd
/*
* "Mterp entry point.
*/
void dvmMterpStd(Thread* self)
{
/* configure mterp items */
self->interpSave.methodClassDex = self->interpSave.method->clazz->pDvmDex;
IF_LOGVV() {
char* desc = dexProtoCopyMethodDescriptor(
&self->interpSave.method->prototype);
LOGVV("mterp threadid=%d : %s.%s %s",
dvmThreadSelf()->threadId,
self->interpSave.method->clazz->descriptor,
self->interpSave.method->name,
desc);
free(desc);
}
//ALOGI("self is %p, pc=%p, fp=%p", self, self->interpSave.pc,
// self->interpSave.curFrame);
//ALOGI("first instruction is 0x%04x", self->interpSave.pc[0]);
/*
* Handle any ongoing profiling and prep for debugging
*/
if (self->interpBreak.ctl.subMode != 0) {
TRACE_METHOD_ENTER(self, self->interpSave.method);
self->debugIsMethodEntry = true; // Always true on startup
}
dvmMterpStdRun(self);
#ifdef LOG_INSTR
ALOGD("|-- Leaving interpreter loop");
#endif
}
示例13: dvmAllocObject
/*
* Create an instance of the specified class.
*
* Returns NULL and throws an exception on failure.
*/
Object* dvmAllocObject(ClassObject* clazz, int flags)
{
Object* newObj;
assert(dvmIsClassInitialized(clazz) || dvmIsClassInitializing(clazz));
if (IS_CLASS_FLAG_SET(clazz, CLASS_ISFINALIZABLE)) {
flags |= ALLOC_FINALIZABLE;
}
/* allocate on GC heap; memory is zeroed out */
newObj = dvmMalloc(clazz->objectSize, flags);
if (newObj != NULL) {
DVM_OBJECT_INIT(newObj, clazz);
Monitor* mon = NULL;//dvmCreateMonitor(newObj);
newObj->lock = (u4)mon | LW_SHAPE_FAT;
LOGVV("AllocObject: %s (%d)\n", clazz->descriptor,
(int) clazz->objectSize);
#if WITH_HPROF && WITH_HPROF_STACK
hprofFillInStackTrace(newObj);
#endif
dvmTrackAllocation(clazz, clazz->objectSize);
}
return newObj;
}
示例14: dvmPopLocalFrame
/*
* Pop one frame pushed on by JNI PushLocalFrame.
*
* If we've gone too far, the previous frame is either a break frame or
* an interpreted frame. Either way, the method pointer won't match.
*/
bool dvmPopLocalFrame(Thread* self)
{
StackSaveArea* saveBlock = SAVEAREA_FROM_FP(self->interpSave.curFrame);
assert(!dvmIsBreakFrame((u4*)self->interpSave.curFrame));
if (saveBlock->method != SAVEAREA_FROM_FP(saveBlock->prevFrame)->method) {
/*
* The previous frame doesn't have the same method pointer -- we've
* been asked to pop too much.
*/
assert(dvmIsBreakFrame((u4*)saveBlock->prevFrame) ||
!dvmIsNativeMethod(
SAVEAREA_FROM_FP(saveBlock->prevFrame)->method));
return false;
}
LOGVV("POP JNI local frame: removing %s, now %s",
saveBlock->method->name,
SAVEAREA_FROM_FP(saveBlock->prevFrame)->method->name);
dvmPopJniLocals(self, saveBlock);
self->interpSave.curFrame = saveBlock->prevFrame;
#ifdef WITH_OFFLOAD
offStackFramePopped(self);
#endif
return true;
}
示例15: ef_vi_free
int ef_vi_free(ef_vi* ep, ef_driver_handle fd)
{
int rc;
if( ep->vi_io_mmap_ptr != NULL ) {
rc = ci_resource_munmap(fd, ep->vi_io_mmap_ptr, ep->vi_io_mmap_bytes);
if( rc < 0 ) {
LOGV(ef_log("%s: ci_resource_munmap %d", __FUNCTION__, rc));
return rc;
}
}
if( ep->vi_mem_mmap_ptr != NULL ) {
/* TODO: support variable sized DMAQ and evq */
rc = ci_resource_munmap(fd, ep->vi_mem_mmap_ptr, ep->vi_mem_mmap_bytes);
if( rc < 0 ) {
LOGVV(ef_log("%s: ci_resource_munmap iobuffer %d", __FUNCTION__, rc));
return rc;
}
}
free(ep->ep_state);
EF_VI_DEBUG(memset(ep, 0, sizeof(*ep)));
LOGVVV(ef_log("%s: DONE", __FUNCTION__));
return 0;
}