コード例 #1
0
 /** Get the code array that corresponds to the entry point (prologue) for the method. */
 public final synchronized CodeArray getCurrentEntryCodeArray() {
   RVMClass declaringClass = getDeclaringClass();
   if (VM.VerifyAssertions) VM._assert(declaringClass.isResolved());
   if (isCompiled()) {
     return currentCompiledMethod.getEntryCodeArray();
   } else if (!VM.writingBootImage || isNative()) {
     if (!isStatic() && !isObjectInitializer() && !isPrivate()) {
       // A non-private virtual method.
       if (declaringClass.isJavaLangObjectType()
           || declaringClass.getSuperClass().findVirtualMethod(getName(), getDescriptor())
               == null) {
         // The root method of a virtual method family can use the lazy method invoker directly.
         return Entrypoints.lazyMethodInvokerMethod.getCurrentEntryCodeArray();
       } else {
         // All other virtual methods in the family must use unique stubs to
         // ensure correct operation of the method test (guarded inlining of virtual calls).
         // It is TIBs job to marshall between the actual trampoline and this marker.
         return LazyCompilationTrampoline.instructions;
       }
     } else {
       // We'll never do a method test against this method.
       // Therefore we can use the lazy method invoker directly.
       return Entrypoints.lazyMethodInvokerMethod.getCurrentEntryCodeArray();
     }
   } else {
     compile();
     return currentCompiledMethod.getEntryCodeArray();
   }
 }