Home | History | Annotate | Download | only in common
      1 /*
      2  * Copyright (C) 2009 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 /* common includes */
     18 #include "Dalvik.h"
     19 
     20 /*
     21  * Look up an interface on a class using the cache.
     22  *
     23  * This function used to be defined in mterp/c/header.c, but it is now used by
     24  * the JIT compiler as well so it is separated into its own header file to
     25  * avoid potential out-of-sync changes in the future.
     26  */
     27 INLINE Method* dvmFindInterfaceMethodInCache(ClassObject* thisClass,
     28     u4 methodIdx, const Method* method, DvmDex* methodClassDex)
     29 {
     30 #define ATOMIC_CACHE_CALC \
     31     dvmInterpFindInterfaceMethod(thisClass, methodIdx, method, methodClassDex)
     32 
     33     return (Method*) ATOMIC_CACHE_LOOKUP(methodClassDex->pInterfaceCache,
     34                 DEX_INTERFACE_CACHE_SIZE, thisClass, methodIdx);
     35 
     36 #undef ATOMIC_CACHE_CALC
     37 }
     38