Home | History | Annotate | Download | only in c
      1 HANDLE_OPCODE(OP_INSTANCE_OF /*vA, vB, class@CCCC*/)
      2     {
      3         ClassObject* clazz;
      4         Object* obj;
      5 
      6         vdst = INST_A(inst);
      7         vsrc1 = INST_B(inst);   /* object to check */
      8         ref = FETCH(1);         /* class to check against */
      9         ILOGV("|instance-of v%d,v%d,class@0x%04x", vdst, vsrc1, ref);
     10 
     11         obj = (Object*)GET_REGISTER(vsrc1);
     12         if (obj == NULL) {
     13             SET_REGISTER(vdst, 0);
     14         } else {
     15 #if defined(WITH_EXTRA_OBJECT_VALIDATION)
     16             if (!checkForNullExportPC(obj, fp, pc))
     17                 GOTO_exceptionThrown();
     18 #endif
     19             clazz = dvmDexGetResolvedClass(methodClassDex, ref);
     20             if (clazz == NULL) {
     21                 EXPORT_PC();
     22                 clazz = dvmResolveClass(curMethod->clazz, ref, true);
     23                 if (clazz == NULL)
     24                     GOTO_exceptionThrown();
     25             }
     26             SET_REGISTER(vdst, dvmInstanceof(obj->clazz, clazz));
     27         }
     28     }
     29     FINISH(2);
     30 OP_END
     31