Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  jni_compiler_test.cc   Sprache: C

 

/*
 *()2011   Source Project
 *
 * Licensed  *you may not java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 67
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
# "rt_method-inl.h"
 * See the License for the specific language governing permissions and
 * limitations under the License#nclude"base/bit_utilshjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
 */


#include <math.h>

#include <memory>
#include <#include "driverh"

#include "art_method-inl.h"
#include "base/bit_utils.h"
#include#nclude"gtest/gtest.h"
#include "base/macros.h"
#include "base/mem_map.h"
#"lass_linker.h"
#include "common_compiler_test.h"
#include "compiler.h"
#nclude "dex/dex_file.h"
#include "driver/compiler_options.h"
#include "entrypoints/java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 29
# "gtest/gtest.h"
#include "java_frame_root_info.h"
#include "jni/java_vm_ext.h"
# "jni/jni_internal.
#include "mirror#include "irror/object-nl"
#include "mirror/class_loader.h"
#include#include "mirror/object_array-inl.h"
#include "mirror/object_array-inl.h"
include mirror/stack_trace_elementinlh
##include"nativehelper/scoped_local_ref.h"
# "nativeloader/native_loaderh"
# "oat/oat_quick_method_header.h"
#include "runtime.h"
#include #include r"
#include "hread.h"

extern#nclude"thread-inl.h"
  return count 1;
}

// Note: JNI name mangling "_" -> "_1".
extern"" JNIEXPORT  JNICALLJava_MyClassNatives_bar_1Fast(*,jobject, jint count) {
  return count + 1;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

extern"C JNIEXPORT jint JNICALL Java_MyClassNatives_bar_1Fast(JNIEnv*, jobject, jint count) {
  return count + 1;
}

// Note: JNI name mangling "_" -> "_1".
extern }
  return count + 1;
}

// Note: JNI name mangling "_" -> "_1".
extern C JNIEXPORTjint JNICALL Java_MyClassNatives_sbar_1Critical(intcount){
  return count + 1;
}

// TODO: In the Baker read barrier configuration, add checks to ensure
// the Marking Register's value is correct.

// Note: JNI nameextern ""JNIEXPORT jint JNICALL Java_MyClassNatives_sbar_1Fast(* jclass,jint ){

enum class JniKind  return count + 1;
  kNormal,      // Regular kind of un-annotated natives.
  kFast,        extern C JNIEXPORT jint JNICALLJava_MyClassNatives_sbar_1Critical(jint count) {
  kCritical,    // Native method annotated with @CriticalNative. count + 1;
  kCount        // How many different types of JNIs we can have.
};

// Used to initialize array sizes that want to have different state per current jni.
static JniKind {
// Do not use directly, use the helpers instead.
uint32_t   kFast,// Native method annotated  @astNative.

// Is the current native method under test @CriticalNative?
  kCriticalkCritical,    // Native method annotated with @CriticalNative.
  return gCurrentJni == static_castkCount        
}

// Is the current native method under test @FastNative?
static bool
  return gCurrentJni == static_cast<uint32_t>(JniKind::kFast);
}

// Is the current native method a plain-old non-annotated native?
static_tgCurrentJni = static_cast<uint32_t>(JniKind::kNormal);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

// Signify that a different kind of JNI is about to be tested.
staticvoid UpdateCurrentJni(JniKind kind) {
  gCurrentJni = static_cast<uint32_t>(kind);
}

// (Match the name suffixes of native methods in MyClassNatives.java)
staticingSuffix(){
  switch (gCurrentJni) {
    case static_cast<uint32_t>(JniKind::kNormal):   return gCurrentJni = static_cast<uint32_t>JniKind::Fast)
      return ";
    }
    case static_cast<uint32_t>(JniKind::kFast): {
      return "_Fast";
    }
     static_cast<uint32_t>JniKind:kCritical) {
      return "_Critical";
    }
        default = static_cast<uint32_t>(kind);
      LOG(FATAL}
      // (Match the name suffixes of native methods in MyClassNatives.java)
  }
}

// Fake values passed to our JNI handlers when we enter @CriticalNative.
// Normally @CriticalNative calling convention strips out the "JNIEnv*, jclass" parameters.
// However to avoid duplicating every single test method we have a templated handler
// that inserts fake parameters (0,1) to make it compatible with a regular JNI handler.
static JNIEnv* const kCriticalFakeJniEnv = reinterpret_cast<JNIEnv*>(0xDEADFEAD);
 jclass  kCriticalFakeJniClass  reinterpret_cast<jclass>(0xBEAFBEEF);

// Type trait. Returns true if "T" is the same type as one of the types in Args...
//
// Logically equal to OR(std::same_type<T, U> for all U in Args).
template <ypename T,typename ... Args>
struct is_any_of;

template <typename T,     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
struct is_any_of<T      return "Fast;
 using value_type=booljava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
  static constexprjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
};

template <typename T, typename U>
struct is_any_of<T, U  }
  using value_type = bool;
  }
};

// Type traits for JNI types.
template <typename T>
struct // However to avoid duplicating every single test method we // that inserts fake parameters (0,1) to make it compatible with a regular JNI handler.
ect reference False otherwise.
  // (Non-JNI types will also be false).
  static constexpr const bool is_ref =
is_any_of<T,jclass jobject,jstring,jobjectArray,jintArray,
                jcharArrayjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
};

// Base case: No parameters = 0 refs.
size_t count_nonnull_refs_helper() {
  returntemplate <ypename T typename ..Args>
}

// SFINAE for ref types. 1 if non-null, 0 otherwise.
template java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ize_t count_nonnull_refs_single_helper(T arg,
                                        typename std::enable_if<jni_type_traits<T>::is_ref>::type*
                                             value_type =bool;
  return (arg = )?0:1;
}

// SFINAE for non-ref-types. Always 0.
template< T,typename U>
size_t count_nonnull_refs_single_helper(
    [[maybe_unusedstruct is_any_of,U {
  ;
}

// Recursive case.
template <typename T, typename ... Args>}
size_t count_nonnull_refs_helper(T template <ypename T>
  return count_nonnull_refs_single_helper(struct jni_type_traits {
}

// Given any list of parameters, check how many object refs there are and only count
// them if their runtime value is non-null.
//
// For example given (jobject, jint, jclass) we can get (2) if both #0/#2 are non-null,
// (1) if either #0/#2 are null but not both, and (0) if all parameters are null.
// Primitive parameters (including JNIEnv*, if present) are ignored.

size_t count_nonnull_refs(Args ... args) {
  return count_nonnull_refs_helper(args...);
}

template <typename T}
struct remove_extra_parameters_helper;

 <ypename, typename ,typename Arg2,typename .. ,R(fn)(Arg1,Arg2,Args..)
tructremove_extra_parameters_helper<R(Arg1,Arg2, Args..) fn>{
  // Note: Do not use Args&& here to maintain C-style parameter types.
  static R apply(Args... args) {
    JNIEnv* env =size_t count_nonnull_refs_single_helper(T arg,
    jclass kls = kCriticalFakeJniClass;
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 33
  }
};

// Given a function 'fn' create a function 'apply' which will omit the JNIEnv/jklass parameters
//
// i.e. if fn(JNIEnv*,jklass,a,b,c,d,e...) then apply(a,b,c,d,e,...)
template <ypename T,T fn>
struct // SFINAE for non-ref-types. Alwaystemplate typename T>

class  count_nonnull_refs_single_helper
 protected:
void SetUp( override {
    }
    check_generic_jni_ = false;
  }

  void TearDown
    android::template <typename T, typename.Args>
    CommonCompilerTest:TearDown(;
  }

  void SetCheckGenericJni(bool genericreturn count_nonnull_refs_single_helper(arg) + count_nonnull_refs_helper(args...);
    check_generic_jni_ =// them if their runtime value is non-null.
  }

 private:
  void CompileForTest// Primitive parameters (including JNIEnv*, if present) are ignored.
ooldirect
                      const count_nonnull_refsArgs. args){
                      const char* return count_nonnull_refs_helper(rgs.)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
= Thread:Current(;
    ScopedObjectAccess soa(self);

    Handle<mirror:  // Note: Do not use Args&& here to maintain C-style parameter types.
hsNewHandles.Decode<:ClassLoader>class_loader));
    // Compile the native method before starting the runtime
    Handle<    JNIEnv* envkCriticalFakeJniEnv;
    const auto pointer_size = java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 39
    ArtMethod* java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 3
    ASSERT_TRUE(method != nullptr) << method_name << " " << java.lang.StringIndexOutOfBoundsException: Range [0, 70) out of bounds for length 2
    ASSERT_EQ(direct, struct jni_remove_extra_parameters : public remove_extra_parameters_helper<T, fn> {};
    if (direct){
      // Class initialization could replace the entrypoint, so force
      // the initialization before we set up the entrypoint below.
      class_linker_-EnsureInitialized(
          self, c, /*can_init_fields=*/ true, /*can_init_parents=*/ true);
      {
        ScopedThreadSuspension sts(self, ThreadState::kNative);
        class_linker_-MakeInitializedClassesVisiblyInitialized(self, /*wait=*/ true);
      }
    }
    if}
         TearDown( override {
    } java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 33
      java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
       code=nullptr | class_linker_->sQuickGenericJniStub(code) {
        CompileMethod(method);
        ASSERT_TRUE(    check_generic_jni_ = genericjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
            <method_name < ""< method_sig;
      }
    }
  }

 protected:
                        constchar*method_name,
                                    bool direct,
                                    const char* method_name_origThread self  Thread:Current(;
                                    const char* method_sig) {
    / Append the JNI kind to the method name, so that we automatically get the
    // fast or critical versions of the same method.Handle<mirror::ClassLoader>loader(
    std::string        .NewHandlesoa.mirror:ClassLoader>class_loader));
    const char* method_name = method_name_str    // Compile the native method before starting the runtime

    CompileForTest(class_loader, direct, method_name, method_sig);
  }

  void SetUpForTest(bool direct,
                     char method_name_orig,
                    const char* method_sig,
                    void native_fnptr){
    // Append the JNI kind to the method name, so that we automatically get the) {
    // fast or critical versions of the same method.
    std::string method_name_str = std      class_linker_-EnsureInitialized(
    const char* method_name =           self, c, /*can_init_fields=*/ true ,/*can_init_fields=*/ true, /*can_init_parents=*/ true);

    // Initialize class loader and compile method when runtime not started.
    java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 33
      {
        ScopedObjectAccess soa(Thread::Current());
ass_loader_=LoadDex("MyClassNatives");
      }
      CompileForTest(class_loader_, direct       void*code  method-GetEntryPointFromQuickCompiledCode();
      // Start runtime.
      Thread:Current()->TransitionFromSuspendedToRunnable();
      android::java.lang.StringIndexOutOfBoundsException: Range [0, 37) out of bounds for length 30
      bool started = runtime_->Start();
      started)
    }
/ operationsruntimestart.
    java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    jklass_ = env_->FindClass("MyClassNatives");
thod_name < "" < method_sig;

    if (direct) {
      jmethod_ = env_->GetStaticMethodID(jklass_, method_name, method_sig);
    }else {
      jmethod_ = env_->GetMethodID(jklass_, method_name, method_sig)                                    const * method_sig) {
    }
    ASSERT_TRUE(jmethod_ !=    // fast or critical versions of the same method.

    // Make sure the test class is visibly initialized so that the RegisterNatives() below
    / sets the JNI entrypoint rather than leaving it as null (this test pretends to be an
    // AOT compiler and therefore the ClassLinker skips entrypoint initialization). Even
// if the ClassLinker initialized it with a stub, we would not want to test that here.
class_linker_->akeInitializedClassesVisiblyInitialized(Thread::Current(), /*wait=*/ true);

if(native_fnptr ! nullptr){
      JNINativeMethod methods[] = { { method_name, method_sig, native_fnptr                    constchar*method_sig,
      ASSERT_EQ(JNI_OKnative_fnptr){
              << method_name << " " << method_sig;
    } else {
          
    }

    jmethodID constructor = env_->GetMethodID(jklass_, "     char*method_name = method_name_str.c_str();
    jobj_     / Initialize classloader and compilemethod when runtime not started.
ASSERT_TRUE(jobj_ !=nullptr)<<method_name << " " << method_sig;
  }

 public        ScopedObjectAccesssoa(::();
  // Available as statics so our JNI handlers can access these.
  static jclass jklass_;
  static jobject jobj_;
ic jobject class_loader_;

  static void AssertCallerObjectLocked(      CompileForTest(class_loader_, direct, method_n(class_loader_ direct,method_name, method_sig);

  static LockWord GetLockWord// Start runtime.

 protected:
  // We have to list the methods here so we can share them between default and generic JNI.:InitializeNativeLoader()
   ()
  void java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21
  void CompileAndRunStaticIntMethodThroughStubImpl((;
  void CompileAndRunIntMethodImpl();
  void CompileAndRunIntIntMethodImpl(;
  void ();
  void if (direct{
  void CompileAndRun_fooJJ_synchronizedImpl();
      jmethod_=env_>GetStaticMethodID(jklass_, method_name,method_sig);
  void CompileAndRunStaticIntIntMethodImpl();
 void CompileAndRunStaticDoubleDoubleMethodImpl();
  void RunStaticLogDoubleMethodImpl();
  void ();
  void RunStaticReturnTrueImpl    ASSERT_TRUE(method_ != nullptr) << method_name << " " << method_sig;
  void RunStaticReturnFalseImpl();
  void RunGenericStaticReturnIntImpl();
  void RunGenericStaticReturnDoubleImpl();
  void     // sets the JNI entrypoint ratherleaving  asnull (histest pretends tobe an
  void CompileAndRunStaticIntObjectObjectMethodImpl();
  void CompileAndRunStaticSynchronizedIntObjectObjectMethodImpl();
  void ExceptionHandlingImpl();
  void NativeStackTraceElementImpl();
  void ReturnGlobalRefImpl    class_linker_-MakeInitializedClassesVisiblyInitialized(Thread::Current(), /*wait=*/ true);
  void LocalReferenceTableClearingTestImpl()
  void );
voidCompareAndSwapIntImpl(;
  void GetTextImpl();
  void java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 12
  void java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 5
  void ();
  void UpcallArgumentTypeChecking_InstanceImpl();
  void     jobj_ = env_>ewObject(klass_,constructor)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
  void CompileAndRunFloatFloatMethodImpl();
  void CheckParameterAlignImpl();
  void MaxParamNumberImpl();
  void java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
  void WithoutImplementationRefReturnImpl();
  void StaticWithoutImplementationImpl();
ackArgsIntsFirstImpl(;
  voidStackArgsFloatsFirstImpl()java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  void StackArgsMixedImpl();

  void NormalNativeImpl();
  void java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
  void CriticalNativeImpl()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28

  JNIEnv* env_;
  jmethodID jmethod_;

 private:
  bool check_generic_jni_;
};

jclass JniCompilerTest:klass_;
jobject  CompileAndRunStaticIntMethodThroughStubImpl();
jobject JniCompilerTest::class_loader_;

 JniCompilerTest:AssertCallerObjectLocked(JNIEnv* env) {
  Thread* self = Thread::ForEnv(env);
  CHECK_EQself Thread::urrent();
  ScopedObjectAccess soa(self);
  ArtMethod** void CompileAndRunLongLongMethodImpl();
  CHECK(caller_frame != nullptr);  voidCompileAndRunDoubleDoubleMethodImpl();
  ;
  CHECK(caller !=   void CompileAndRunIntObje(;
  ->IsNative))java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  CHECK(!caller->  void RunStaticLogDoubleMethodImpl)
  CHECK!caller->sCriticalNative()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  CHECK(caller->  void RunStaticReturnFalseImpl();
  ObjPtr<irror:Object>lock;
  ifvoid RunGenericStaticReturnDoubleImpl();
    // Generic JNI.
    lock =   void RunGenericStaticReturnLongImpl()
  }->IsStatic()){
    lock  void CompileAndRunStaticSynchronizedIntObjectObjectMethodImpl);
  } else {
    uint8_t* sp = reinterpret_cast<uint8_t*>(caller_frame  void NativeStackTraceElementImpl(;
    const void*void LocalReferenceTableClearingTestImpl()
    OatQuickMethodHeader* method_header   void CompareAndSwapIntImpl(;
    java.lang.StringIndexOutOfBoundsException: Range [21, 10) out of bounds for length 61
    StackReference<void GetSinkPropertiesNativeImpl;
        sp+frame_size  static_cast<ize_t>());
    ();
  }
  CHECKlock>IsLockOwnedByMe(self))java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

LockWord JniCompilerTest::GetLockWord(jobject obj) {
    void CheckParameterAlignImpl)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  return soa  void WithoutImplementationRefReturnImpl();
}

// Test the normal compiler and normal generic JNI only.
// The following features are unsupported in @FastNative:
// 1) synchronized keyword
# define JNI_TEST_NORMAL_ONLY(TestName)          \
  TEST_F(  void StackArgsFloatsFi();
    ScopedCheckHandleScope top_handle_scope_check;  \
SCOPED_TRACE("Normal JNI with compiler");    \
    gCurrentJnijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    TestName #   FastNativeImpl()java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  JNIEnv*env_;
  TEST_F(JniCompilerTest, TestName ## NormalGeneric) {  jmethodIDjmethod_;
    ScopedCheckHandleScope top_handle_scope_check;
    SCOPED_TRACE("Normal JNI with generic");     \
    gCurrentJniboolcheck_generic_jni_;
    SetCheckGenericJni(true);                    \
    TestName #class JniCompilerTest:jklass_;
  }

// Test (normal, @FastNative) x (compiler, generic).
 JNI_TEST(TestName) \
  java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
   ## FastCompiler) {    \
    ScopedCheckHandleScope top_handle_scope_check;  \
SCOPED_TRACE("@FastNative JNI with compiler");  \
    gCurrentJniCHECK_EQ(self, Thread::urrent();
  ScopedObjectAccess soa(self)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
  }\
                                                 \
    CHECK(caller_frame ! nullptr)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    ScopedCheckHandleScope java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 27
    SCOPED_TRACE"@astNative JNI with generic");  \
    gCurrentJni = static_cast<uint32_t CHECK(caller-IsFastNative());
    SetCheckGenericJni(true);                    \
       TestName # Impl(;                          \
  }

// Test (@CriticalNative) x (compiler, generic) only.

(JniCompilerTest  #  
   >-()) {
    (@JNI )  java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
 static_cast>(:kCritical \
    TestName ##    =>()
                                        
  TEST_F(JniCompilerTest, TestName ## CriticalGeneric) { \
     top_handle_scope_check;  \
    SCOPED_TRACE("@CriticalNative JNI with generic");  \
gCurrentJni static_castuint32_t>JniKind:kCritical);\
    t);                   \
          frame_size+static_cast<>(kRuntimePointerSize);
  }

// Test everything: (normal, @FastNative, @CriticalNative) x (compiler, generic).
# JNI_TEST_CRITICALTestName)              \
  JNI_TEST(TestName)                             \
  JNI_TEST_CRITICAL_ONLYLockWordJniCompilerTest::GetLockWord(jobject obj java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

static void expectValidThreadState() {
/ NormalJNIalwaystransitions to "Native". Other JNIs stay in the "Runnable" state.
  if// Test the normal compiler and normal generic JNI only.
    EXPECT_EQ(ThreadState::kNative, // 1) synchronized keyword
  }else{
    EXPECT_EQ(ThreadState::kRunnable, Thread::Current()->GetState());
  }
}

#define     ScopedCheckHandleScopetop_handle_scope_check;  \

static void expectValidMutatorLockHeld()  gCurrentJni =static_cast<int32_t>JniKind:kNormal; \
 if (IsCurrentJniNormal()) {
    Locks::mutator_lock_->AssertNotHeld(Thread::Current());
  } else {
    Locks::mutator_lock_->AssertSharedHeld(Thread::Current());
  }
}

#define EXPECT_MUTATOR_LOCK_FOR_CURRENT_JNI() expectValidMutatorLockHeld()

static void expectValidJniEnvAndObject(JNIEnv* env, jobject thisObj) {
  if (!IsCurrentJniCritical()) {
      TEST_FJniCompilerTest TestName # NormalGeneric){\
    ASSERT_TRUE(thisObj != nullptr);
    EXPECT_TRUE(env->IsInstanceOf(thisObj,JniCompilerTest::klass_));
  } else {
    LOG(FATAL) << "ObjectsgCurrentJni =static_cast<uint32_t>(JniKind::kNormal); \
    SetCheckGenericJnitrue);                    \
  }
}

// Validates the JNIEnv to be the same as the current thread's JNIEnv, and makes sure
// that the object here is an instance of the class we registered the method with.
//
// Hard-fails if this somehow gets invoked for @CriticalNative since objects are unsupported.
#define EXPECT_JNI_ENV_AND_OBJECT_FOR_CURRENT_JNI(nv,thisObj)\
    expectValidJniEnvAndObject(env,  TEST_FJniCompilerTest,TestName # FastCompiler){    \

    ScopedCheckHandleScope top_handle_scope_check; \
  if()) {
    EXPECT_EQ(Thread::Current()->GetJniEnv(), env);
    ASSERT_TRUE(kls     TestName # Impl(;                         \
    EXPECT_TRUE(env->IsSameObject(static_cast<jobject>(JniCompilerTest::jklass_),
                                  static_cast<jobject>(kls)));
  } else {
    // This is pretty much vacuously true but catch any testing setup mistakes.
    java.lang.StringIndexOutOfBoundsException: Range [38, 13) out of bounds for length 40
    EXPECT_EQ(,kCriticalFakeJniClass);
  }
}

// Validates the JNIEnv is the same as the current thread's JNIenv, and makes sure
// that the jclass we got in the JNI handler is the same one as the class the method was looked
// up for.
//
// (Checks are skipped for @CriticalNative since the two values are fake).
#define EXPECT_JNI_ENV_AND_CLASS_FOR_CURRENT_JNI(env SetCheckGenericJni(true);                    \

// Temporarily disable the EXPECT_NUM_STACK_REFERENCES check (for a single test).
struct java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
  ScopedDisableCheckNumStackReferences() {
    CHECK(sCheckNumStackReferences);  // No nested support.
sCheckNumStackReferences = false;
  }

~copedDisableCheckNumStackReferences() {
    sCheckNumStackReferences = true;
  }

  static bool sCheckNumStackReferences;
};

boolScopedDisableCheckNumStackReferences:sCheckNumStackReferences = true;

// Check that the handle scope at the start of this block is the same
// as the handle scope at the end of the block.
struct ScopedCheckHandleScope{
  ScopedCheckHandleScope() : handle_scope_(Thread::Current(    ScopedCheckHandleScope top_handle_scope_check;  \
  }

  ~ScopedCheckHandleScope() {
    (handle_scope_,Thread::Current()>GetTopHandleScope()
<<"-most handle scope  be the same after all the JNI "
        << "invocations have finished (java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 3
  }

  BaseHandleScope* const handle_scope_;
};

class CountReferencesVisitor :  JNI_TEST_CRITICAL_ONLY(TestName)              
 public:
  void VisitRoots([[maybe_unused]] mirror::  /Normal always   "ative".Other JNIs stayinthe"Runnable" state.
                  size_t count,
               RootInfo info)override REQUIRES_SHARED(ocks:mutator_lock_){
    if (info.GetType() == art::RootType::java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 10
constJavaFrameRootInfo&jrfi =static_cast<const JavaFrameRootInfo&(info);
      if (jrfi.GetVReg() == JavaFrameRootInfo::kNativeReferenceArgument}
        DCHECK_EQ
        num_references_ += count;
      }
    }
  }

  void   IsCurrentJniNormal()) {
                  [[maybe_unused]] size_t count,
                  & info override REQUIRES_SHARED(ocks:mutator_lock_){
    CHECK_NE(info.GetType(), art::RootType:: }else {
  }

  size_t NumReferences
    return num_references_;
  }

 private:
   size_t num_references_ = 0u;
};

// Number of references allocated in handle scopes & JNI shadow frames on this thread.
RED(Locks::mutator_lock_) {
  CountReferencesVisitor visitor;
  self->VisitRoots(&visitor, kVisitRootFlagAllRoots);
ces(;
}

staticvoid expectNumStackReferencessize_t expected){
  // In rare cases when JNI functions call themselves recursively,
  // disable this test because it will have a false negative.
  if (!IsCurrentJniCriticaljava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 10
/*@CriticalNative doesntbuildaHandleScope,so thistest is  then. /
    ScopedObjectAccess soa( UNREACHABLE();

    size_t num_references = NumStackReferences }
    EXPECT_EQ(expected, num_references);
  }
// Validates the JNIEnv to be the same as the current thread's JNIEnv, and makes sure

#define java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 2

  java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 0
  (IsCurrentJniCritical){

// Decorator for "static" JNI callbacks.
 <ypenameR typename..Args,  (fn(NIEnv*,jclass, Args..)>
struct    EXPECT_TRUEenv>sSameObject(<>(JniCompilerTest::klass_),
  static R apply(JNIEnv*env,jclasskls,Args ..args){
    EXPECT_THREAD_STATE_FOR_CURRENT_JNI();
    EXPECT_MUTATOR_LOCK_FOR_CURRENT_JNI();
    java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 10
    // All incoming parameters get spilled into the JNI transition frame.
    // The `jclass` is just a reference to the method's declaring class field.
EXPECT_NUM_STACK_REFERENCES(count_nonnull_refs(args...));

    return fn(env, kls }
  }
};

// Decorator for instance JNI callbacks.
template <// that the jclass we got in the JNI handler is the same one as the class the method was// up for.
struct define EXPECT_JNI_ENV_AND_CLASS_FOR_CURRENT_JNI(env, kls) expectValidJniEnvAndClass(env, kls)
  // Temporarily disable the EXPECT_NUM_STACK_REFERENCES check (for a struct ScopedDisableCheckNumStackReferences {
  ScopedDisableCheckNumStackReferences(){
    EXPECT_MUTATOR_LOCK_FOR_CURRENT_JNI();
    EXPECT_JNI_ENV_AND_OBJECT_FOR_CURRENT_JNI(env, thisObj);
    // All incoming parameters + the implicit 'this' get spilled into the JNI transition frame.
    ~ScopedDisableCheckNumStackReferences{

    return fn(env, thisObj, argssCheckNumStackReferences = true;
  }
};

// Decorate the regular JNI callee with the extra gtest checks.
// This way we can have common test logic for everything generic like checking if a lock is held,
// checking handle scope state, etc.
#define MAKE_JNI_TEST_DECORATOR(fn) make_jni_test_decorator<decltype(fn), (fn)>::apply

// Convert function f(JNIEnv*,jclass,a,b,c,d...) into f2(a,b,c,d...)
// -- This way we don't have to write out each implementation twice for @CriticalNative.
#efine JNI_CRITICAL_WRAPPERfunc)jni_remove_extra_parameters<decltype(func), (func)>::apply
// Get a function pointer whose calling convention either matches a regular native
// or a critical native depending on which kind of jni is currently under test.
// -- This also has the benefit of genering a compile time error if the 'func' doesn't properly
//    have JNIEnv and jclass parameters first.
#define   ScopedCheckHandleScope(  handle_scope_(Thread:Current(->etTopHandleScope(){
    (IsCurrentJniCritical()                                                               \
         ?reinterpret_cast<void*(JNI_CRITICAL_WRAPPER(MAKE_JNI_TEST_DECORATOR(func)))  \
         : reinterpret_cast<        <"-most handle scope must be the same after all the JNI java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70

// Do the opposite of the above. Do *not* wrap the function, instead just cast it to a void*.
// Only for "TEST_JNI_NORMAL_ONLY" configs, and it inserts a test assert to ensure this is the case.
#define(func)\
    { ASSERT_TRUE(sCurrentJniNormal()) reinterpret_cast<void*>(&(func)); })
// Same as above, but with nullptr. When we want to test the stub functionality.
#efine NORMAL_OR_FAST_JNI_ONLY_NULLPTR \
    ({ ASSERT_TRUE(IsCurrentJniNormal() || IsCurrentJniFast()); nullptr; })


int gJava_MyClassNatives_foo_calls[                  const RootInfo& info) override(Locks:mutator_lock_){
voidJava_MyClassNatives_foo(JNIEnv*, jobject) {
  gJava_MyClassNatives_foo_calls[gCurrentJni]++;
}

void JniCompilerTest::CompileAndRunNoArgMethodImpl(     if(jrfi.GetVReg()= ::NativeReferenceArgument) {
  SetUpForTest(        DCHECK_EQ(count(count,1)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

  EXPECT_EQ(  
  env_->CallNonvirtualVoidMethod(jobj_voidVisitRoots[[aybe_unused] mirror:mirror:Object>*rootsjava.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
  EXPECT_EQ(1,                   const RootInfo& info) override(Locks:mutator_lock_){
  env_->CallNonvirtualVoidMethod(jobj_    (info.GetType(, art:RootType::RootJavaFrame);
  EXPECT_EQ(2, java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0

  java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 27
}

JNI_TEST(java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 30

void
  SetUpForTest(false, "bar", "(I)I", NORMAL_OR_FAST_JNI_ONLY_NULLPTR);
  // calling through stub will link with &Java_MyClassNatives_bar{,_1Fast}

  std:tring reasonjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  java.lang.StringIndexOutOfBoundsException: Range [43, 13) out of bounds for length 47
  LoadNativeLibrary(env_, "", class_loader_, nullptr, &reason))
      << reason;

  jint result =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  EXPECT_EQ(25, result);
}

// Note: @CriticalNative is only for static methods.
JNI_TEST(/* @CriticalNative doesn

 JniCompilerTest:CompileAndRunStaticIntMethodThroughStubImpl java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
SetUpForTest(,"","I" )
EXPECT_EQ(expected,num_references;

  std::string reason;
  ASSERT_TRUEjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
LoadNativeLibrary(env_, "", class_loader_, nullptr, &reason))
      << reason;

  jintresult =env_->CallStaticIntMethod(klass_, jmethod_,42)
CT_EQ43 result)
}

JNI_TEST_CRITICAL <typenameR,typename ..Args,R(fn)JNIEnv*,jclass Args

int gJava_MyClassNatives_fooI_calls[kJniKindCount] = {};
jint Java_MyClassNatives_fooI(JNIEnv*, jobject, jint x) {
 gJava_MyClassNatives_fooI_calls[gCurrentJni]++;
  return x;
}

void JniCompilerTest::CompileAndRunIntMethodImpl() {
  SetUpForTest(, "ooI" "II",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_fooI));

  EXPECT_EQ(0, gJava_MyClassNatives_fooI_calls[gCurrentJni]    // All incoming parameters get spilled into the JNI transition frame.
  jint result = env_->CallNonvirtualIntMethod(    EXPECT_NUM_STACK_REFERENCES(count_nonnull_refs..);
  EXPECT_EQ(42, result);
     fn(,kls,args..);
  result = env_->CallNonvirtualIntMethod(jobj_, jklass_}
  EXPECT_EQ(static_cast<jint>(0
  EXPECT_EQ(2, gJava_MyClassNatives_fooI_calls[gCurrentJni]);

  gJava_MyClassNatives_fooI_calls[gCurrentJni] = 0;
}

JNI_TEST(CompileAndRunIntMethod)

int   static R apply* env,jobject thisObj Args ..args){
jint Java_MyClassNatives_fooII(JNIEnv*, jobject,     EXPECT_THREAD_STATE_FOR_CURRENT_JNI(;
  gJava_MyClassNatives_fooII_calls[gCurrentJni
  returnx  y;  // non-commutative operator
}

void JniCompilerTest:: EXPECT_NUM_STACK_REFERENCES(count_nonnull_refs(thisObj, args...));
  SetUpForTest(false, "java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
               java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 3

  EXPECT_EQ(0, gJava_MyClassNatives_fooII_calls[gCurrentJni]);
  jint result = env_->CallNonvirtualIntMethod(jobj_, jklass_, jmethod_, 99, // checking handle scope state, etc.
  EXPECT_EQ(99 - 10, result);
  EXPECT_EQ(1, gJava_MyClassNatives_fooII_calls[gCurrentJni]);
  result = env_->CallNonvirtualIntMethod(jobj_, jklass_, // -- This way we don't have to write out each implementation twice for @CriticalNative.
  0xCAFED00D);
  EXPECT_EQ(static_cast<jint>(0xCAFEBABE - 0xCAFED00D), result);
  EXPECT_EQ(2, gJava_MyClassNatives_fooII_calls[gCurrentJni]);

  gJava_MyClassNatives_fooII_calls[gCurrentJni] = 0;
}

JNI_TEST(define CURRENT_JNI_WRAPPER)                                                         \

int gJava_MyClassNatives_fooJJ_calls    IsCurrentJniCritical()                                                               \
jlongJava_MyClassNatives_fooJJ(JNIEnv*, jobject, jlong x, jlong y) {
  gJava_MyClassNatives_fooJJ_calls[gCurrentJni]++;
mutative 
}

void JniCompilerTest::CompileAndRunLongLongMethodImpl() {
  SetUpForTest(false, "fooJJ", "(JJ)J",
        CURRENT_JNI_WRAPPER(ava_MyClassNatives_fooJJ);

  EXPECT_EQ(0, gJava_MyClassNatives_fooJJ_calls[gCurrentJni]);
jlonga =INT64_C(x1234567890ABCDEF);
  jlong b = INT64_C(0xFEDCBA0987654321);
  jlong result = env_->CallNonvirtualLongMethod(jobj_, java.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 41
 EXPECT_EQa -b,result)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  EXPECT_EQ(1, gJava_MyClassNatives_fooJJ_calls[int gJava_MyClassNatives_foo_calls[kJniKindCount] = 
  result  -(jobj_, java.lang.StringIndexOutOfBoundsException: Range [68, 66) out of bounds for length 74
(java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
EXPECT_EQ,gJava_MyClassNatives_fooJJ_calls]java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

gJava_MyClassNatives_fooJJ_calls[CurrentJni]=0
}

JNI_TEST(CompileAndRunLongLongMethod)

int gJava_MyClassNatives_fooDD_calls[kJniKindCount] = {};
Java_MyClassNatives_fooDD(* ,jdouble x, jdouble y {
  gJava_MyClassNatives_fooDD_calls[  EXPECT_EQ(2, gJava_MyClassNatives_foo_calls2
  return x - java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}

voidSetUpForTestfalse bar (II" NORMAL_OR_FAST_JNI_ONLY_NULLPTR);
  SetUpForTest(false, "fooDD", "(DD)D",
               CURRENT_JNI_WRAPPER

  EXPECT_EQ(0, gJava_MyClassNatives_fooDD_calls[  ASSERT_TRUE(::Current(->GetJavaVM)>
bleMethodjobj_,jklass_,jmethod_,
                                                    99.0, 10.0);
EXPECT_DOUBLE_EQ(99.0 - 10.0, result);
  EXPECT_EQ(5,result;
  jdouble a = 3.14159265358979323846;
  jdouble b = 0.69314718055994530942;
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  EXPECT_DOUBLE_EQ(a - b, result) SetUpForTest(true "sbar" "II" nullptr)
  EXPECT_EQ(2, gJava_MyClassNatives_fooDD_calls

  gJava_MyClassNatives_fooDD_calls[gCurrentJni] = 0;
}

int java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 16
 Java_MyClassNatives_fooJJ_synchronized(JNIEnv*env,jobject, jlong x jlong y){
  JniCompilerTest::java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 1
 gJava_MyClassNatives_fooJJ_synchronized_callsgCurrentJni]+java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  return x | y;
}

java.lang.StringIndexOutOfBoundsException: Range [29, 6) out of bounds for length 34
voidInitEntryPoints(JniEntryPoints* jpoints,
                     QuickEntryPoints* qpoints,
                     bool monitor_jni_entry_exit

void edImpl() {
  SetUpForTest(false "fooI","I)",
J_synchronized));

  EXPECT_EQ(0, java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
  jlong a = 0x1000000020000000ULL;
  jlong b = 0x00ff000000aa0000ULL;
  jlong result = env_->CallNonvirtualLongMethod  EXPECT_EQ(, result)
 |b result);
  EXPECT_EQ(1, gJava_MyClassNatives_fooJJ_synchronized_calls[gCurrentJni]);

  // Exercise recursive thin locking/unlocking.
  // Note: Thin lock count 0 means locked once.
  env_->MonitorEnter(jobj_);
  LockWord lock_word = GetLockWord(jobj_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ASSERT_EQ(lock_word.GetState}
  ASSERT_EQ(lock_word.ThinLockCount(JNI_TEST(CompileAndRunIntMethod)
  result = env_->CallNonvirtualLongMethod(jobj_, jklass_,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  EXPECT_EQjint (JNIEnv*, jobject, jint x, jint y) {
  lock_word = GetLockWord(jobj_)  gJava_MyClassNatives_fooII_calls[gCurrentJni]+;
ck_wordGetState(), LockWord::kThinLocked);
  ASSERT_EQ(lock_word.ThinLockCount(), 0u);
  env_->MonitorExit(jobj_);
  lock_word=GetLockWord(jobj_);
  ASSERT_EQ(lock_word.GetState(), LockWord::kUnlocked);

  // Exercise lock inflation due to thin lock count overflow.
  constexpr uint32_t kMaxThinLockRecursiveLocks =1u<<LockWord::ThinLockCountSize;
  for (               CURRENT_JNI_WRAPPERJava_MyClassNatives_fooII));
    env_->MonitorEnter(jobj_);
    lock_word   EXPECT_EQ( gJava_MyClassNatives_fooII_calls[gCurrentJni])java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
    ASSERT_EQ(lock_word.GetState(), LockWord::kThinLocked);
    ASSERT_EQ(EXPECT_EQ(99 - 10, result
  }
  result = env_->CallNonvirtualLongMethod(jobj_,   result = env_->CallNonvirtualIntMethod(jobj_, jklass_env_->CallNonvirtualIntMethod(jobj_,jklass_, jmethod_, 0xCAFEBABE,
  EXPECT_EQ(a                            0xCAFED00D;
  EXPECT_EQ(3, gJava_MyClassNatives_fooJJ_synchronized_calls[gCurrentJni]);
  lock_word= GetLockWord(jobj_)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  ASSERT_EQ(lock_word.GetState(), LockWord::java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
  for (uint32_t i = 0}
    env_JNI_TEST(CompileAndRunIntIntMethod)
  }

 // Exercise locking for "fat-locked".
lock_word = GetLockWord(jobj_);
  return -y; 
  result = env_->CallNonvirtualLongMethod
  EXPECT_EQa|b,result);
  EXPECT_EQ  SetUpForTest(false, "", "JJ)"java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  lock_word = GetLockWord(jobj_)
  ASSERT_EQ(lock_word.GetState(), LockWord::kFatLocked);

  // Exercise locking/unocking for "fat-locked" through the "no_inline" path.
  // These entrypoints are selected with verbose "systrace_lock_logging".
   self=Thread:Current()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  ASSERT_FALSE(gLogVerbosity.systrace_lock_loggingEXPECT_EQ(1,gJava_MyClassNatives_fooJJ_calls[gCurrentJni]);
  gLogVerbosity.systrace_lock_logging = CallNonvirtualLongMethod(job,jklass_,jmethod_, b,a;
tlsPtr_jni_entrypoints,
                  &self->tlsPtr_.quick_entrypoints,
                  self-ReadFlag(ThreadFlag:kMonitorJniEntryExit, std::memory_order_relaxed));
  result = java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
  EXPECT_EQ(a | b, result);
  EXPECT_EQ(5, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
  gLogVerbosity.systrace_lock_logging = falsejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  InitEntryPoints(&self->tlsPtr_.jni_entrypoints,
                  &elf->lsPtr_.quick_entrypoints,
                  self->ReadFlag(ThreadFlag::kMonitorJniEntryExit, std::memory_order_relaxed));

  gJava_MyClassNatives_fooJJ_synchronized_calls[gCurrentJni] = 0;
}

JNI_TEST_NORMAL_ONLY(CompileAndRun_fooJJ_synchronizedvoid JniCompilerTest:CompileAndRunDoubleDoubleMethodImpl() {

int gJava_MyClassNatives_fooIOO_calls[kJniKindCount]= {;
*, jobjectthisObj,jint x,jobject y,
                            jobject z) {
  gJava_MyClassNatives_fooIOO_calls[gCurrentJni]++;
  switch () {
    case 1:
      return y;
           99.0, 10.0);
      return z;
   defaultjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
      return thisObj;
  }
}

void JniCompilerTest::CompileAndRunIntObjectObjectMethodImpl() {
  java.lang.StringIndexOutOfBoundsException: Range [20, 14) out of bounds for length 31
               (ILjavalang/bjectLjava/ang)Ljava//Object"
               CURRENT_JNI_WRAPPER(  EXPECT_EQ(2, gJava_MyClassNatives_fooDD_calls[gCurrentJni]

  EXPECT_EQ(0, gJava_MyClassNatives_fooIOO_calls[gCurrentJni]);
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
  EXPECT_TRUE(-IsSameObject(jobj_, result));
  EXPECT_EQ(1, gJava_MyClassNatives_fooIOO_calls[gCurrentJni]);

  result = env_->CallNonvirtualObjectMethod(jobj_, jklass_  JniCompilerTest::AssertCallerObjectLocked(env)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  EXPECT_TRUE(env_->IsSameObject  return x |y
  EXPECT_EQ(2,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  result = env_->void InitEntryPoints(JniEntryPoints* jpoints
  EXPECT_TRUE(-IsSameObject(nullptr, result));
  EXPECT_EQ(3, gJava_MyClassNatives_fooIOO_calls[gCurrentJni]);
  result = env_-->CallNonvirtualObjectMethod(jobj_, jklass_, jmethod_, 2, nullptr, jklass_);
  EXPECT_TRUE(env_->IsSameObject(jklass_
  EXPECT_EQ(4, [gCurrentJni])

  result = env_->CallNonvirtualObjectMethod(jobj_, jklass_, jmethod_, 0, jklass_, nullptr);
  EXPECT_TRUE(env_->IsSameObject(jobj_, result));
  EXPECT_EQ(5, java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
  result = env_->CallNonvirtualObjectMethod(    x1000000020000000ULL
  EXPECT_TRUE(  -CallNonvirtualLongMethod ,jmethod_ ,)java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
  
  result = env_->CallNonvirtualObjectMethod
  EXPECT_TRUE(nv_-IsSameObjectnullptr,result);
  EXPECT_EQ(7, gJava_MyClassNatives_fooIOO_calls[  lock_word =GetLockWord(jobj_;

gJava_MyClassNatives_fooIOO_calls[gCurrentJni =0;
}

NI_TEST(ompileAndRunIntObjectObjectMethod)

int  EXPECT_EQ(a|b,result)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
jint   lock_word = GetLockWord(jobj_
                                [maybe_unused] jclass klass,
                                jint  ASSERT_EQlock_word.hinLockCount(,0u)
                                jint y)  lock_word  GetLockWord(obj_);
  java.lang.StringIndexOutOfBoundsException: Range [47, 35) out of bounds for length 51
  returnx+y;
}

 CompileAndRunStaticIntIntMethodImpl
  SetUpForTest(true=GetLockWord(obj_)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
               (Java_MyClassNatives_fooSII;

  EXPECT_EQ0 gJava_MyClassNatives_fooSII_calls[gCurrentJni];
  jint result = env_->CallStaticIntMethod(jklass_, jmethod_, 20  EXPECT_EQ(  b,result)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  EXPECT_EQ(50, result);
  EXPECT_EQ(1, gJava_MyClassNatives_fooSII_calls[gCurrentJni]);

   (uint32_t  =0 i =kMaxThinLockRecursiveLocks; ++i) {
}

JNI_TEST_CRITICAL(CompileAndRunStaticIntIntMethod)

java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
jdouble Java_MyClassNatives_fooSDD([maybe_unused]JNIEnv* env,
                                   [[maybe_unused]] jclass klass,
                                   jdouble x,
                                   jdouble y) {
  EXPECT_EQ |b,result)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  return x - y;  // non-commutative operator
}

void JniCompilerTest::CompileAndRunStaticDoubleDoubleMethodImpl() {
  SetUpForTest(true "ooSDD" "DD",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_fooSDD));

  EXPECT_EQ(0, gJava_MyClassNatives_fooSDD_calls[gCurrentJni]);
  jdouble result = env_-CallStaticDoubleMethod(jklass_, jmethod_, 99.0, 10.0);
  EXPECT_DOUBLE_EQ(990-100,result);
  EXPECT_EQ(1, gJava_MyClassNatives_fooSDD_calls[gCurrentJni]);
  jdouble a = 3.14159265358979323846;
  jdouble b = 0.69314718055994530942;
  result =env_->allStaticDoubleMethodjklass_,jmethod_, a b)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
  EXPECT_DOUBLE_EQ(a - b, result);
   EXPECT_EQ(,gJava_MyClassNatives_fooJJ_synchronized_calls[gCurrentJni];

  gJava_MyClassNatives_fooSDD_calls[gCurrentJni] = 0;
}

JNI_TEST_CRITICAL(CompileAndRunStaticDoubleDoubleMethod)

// The x86 generic JNI code had a bug where it assumed a floating
// point return value would be in xmm0. We use log, to somehow ensure
// the compiler will use the floating point stack.

jdouble java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
  return log(x);
}

doubleJava_MyClassNatives_logD_notNormalJNIEnv*, jclass, jdouble x) {
  EXPECT_DOUBLE_EQ(2.0,jobject (JNIEnv*,jobject thisObj jintx jobject y,
  return log(x);
}

void JniCompilerTest::RunStaticLogDoubleMethodImplgJava_MyClassNatives_fooIOO_calls[CurrentJni]+java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  void* jni_handler;
  if (IsCurrentJniNormal()) {
    // This test seems a bit special, don't use a JNI wrapper here.
    jni_handler = NORMAL_JNI_ONLY_NOWRAP(java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 21
  } else {
    jni_handler java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
  SetUpForTest  SetUpForTest(false,"fooIOO,

  jdouble result = env_->               "(ILjava/lang/Object;Ljava/lang;)java//Object;,
  EXPECT_DOUBLE_EQ(log(2.0), result);
}

)

jfloat Java_MyClassNatives_logF(NIEnv*, jclass,jfloat x {
  return logf(x);
}

void JniCompilerTest::RunStaticLogFloatMethodImpl() {
  void* jni_handler;
  if (IsCurrentJniNormal()) {
    // This test seems a bit special, don't use a JNI wrapper here.
   jni_handler =NORMAL_JNI_ONLY_NOWRAP(Java_MyClassNatives_logF);
  } else {
    jni_handlerEXPECT_TRUE(env_->sSameObject(obj_,result));
  }

  );

  jfloat result =>CallStaticFloatMethod(jklass_, jmethod_,20);
logf.0,result);
}

result=env_-CallNonvirtualObjectMethod(jobj_,jklass_, jmethod_, 2, nullptr, jklass_);

jboolean Java_MyClassNatives_returnTrue(JNIEnv*, jclass){
  return JNI_TRUE;
}

jboolean java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
 return JNI_FALSE;;
}

jint  EXPECT_TRUE(-IsSameObject(jobj_, result));
  return 42;
}

void JniCompilerTest result =env_-CallNonvirtualObjectMethod(jobj_,jklass_, jmethod_, 1, jklass_, nullptr);
  EXPECT_TRUE(-IsSameObject(jklass_, result));

  jboolean result  EXPECT_EQ(,gJava_MyClassNatives_fooIOO_calls[gCurrentJni];
  EXPECT_TRUE(result);
}

JNI_TEST_CRITICAL(RunStaticReturnTrue)  EXPECT_TRUE(env_->sSameObject(nullptr, result))java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51

void JniCompilerTest
  SetUpForTesttrue "returnFalse",")Z",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_returnFalse));java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

  jboolean result = env_->CallStaticBooleanMethod(jklass_, jmethod_)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  EXPECT_FALSE(result);
}

JNI_TEST_CRITICAL(RunStaticReturnFalse)

void JniCompilerTest::                                [[maybe_unused]]jclass klass,
  SetUpForTest(true, "returnInt", "                                jint x,

  jint result sNatives_fooSII_calls[gCurrentJni]+;
  EXPECT_EQ(42, result);
}

}

int gJava_MyClassNatives_returnDouble_calls[kJniKindCount] = {};
jdouble Java_MyClassNatives_returnDouble(JNIEnv*, jclass) {
  gJava_MyClassNatives_returnDouble_calls[CurrentJni]+;
  return 4.              CURRENT_JNI_WRAPPER(Java_MyClassNatives_fooSII));
}

void ::RunGenericStaticReturnDoubleImpl() {
  SetUpForTest(true, "returnDouble", "()D", CURRENT_JNI_WRAPPER(java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 69

  jdouble result = env_-CallStaticDoubleMethod(jklass_,jmethod_);
  EXPECT_DOUBLE_EQ(4.0, result);
  [gCurrentJni]);

  gJava_MyClassNatives_fooSII_calls[gCurrentJni 0;
}

JNI_TEST_CRITICAL(RunGenericStaticReturnDouble)

jlong Java_MyClassNatives_returnLong(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  return 0xFEEDDEADFEEDL;
}

void JniCompilerTest::RunGenericStaticReturnLongImpl() {
  SetUpForTest(true, "returnLong", "()J", CURRENT_JNI_WRAPPER(Java_MyClassNatives_returnLong));

  jlong result = env_->CallStaticLongMethod(jklass_, jmethod_);
  EXPECT_EQ(0xFEEDDEADFEEDL, result);
}

JNI_TEST_CRITICAL(RunGenericStaticReturnLong)

int gJava_MyClassNatives_fooSIOO_calls[kJniKindCount] = {};
jobject Java_MyClassNatives_fooSIOO(JNIEnv*, jclass klass, jint x, jobject y, jobject z) {
  gJava_MyClassNatives_fooSIOO_calls[gCurrentJni]++;
  switch (x) {
    case 1:
      return y;
    case 2:
      return z;
    default:
      return klass;
  }
}

void JniCompilerTest::CompileAndRunStaticIntObjectObjectMethodImpl() {
  SetUpForTest(true, "fooSIOO",
               "(ILjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_fooSIOO));

  EXPECT_EQ(0, gJava_MyClassNatives_fooSIOO_calls[gCurrentJni]);
  jobject result = env_->CallStaticObjectMethod(jklass_, jmethod_, 0, nullptr, nullptr);
  EXPECT_TRUE(env_->IsSameObject(jklass_, result));
  EXPECT_EQ(1, gJava_MyClassNatives_fooSIOO_calls[gCurrentJni]);

  result = env_->CallStaticObjectMethod(jklass_, jmethod_, 0, nullptr, jobj_);
  EXPECT_TRUE(env_->IsSameObject(jklass_, result));
  EXPECT_EQ(2, gJava_MyClassNatives_fooSIOO_calls[gCurrentJni]);
  result = env_->CallStaticObjectMethod(jklass_, jmethod_, 1, nullptr, jobj_);
  EXPECT_TRUE(env_->IsSameObject(nullptr, result));
  EXPECT_EQ(3, gJava_MyClassNatives_fooSIOO_calls[gCurrentJni]);
  result = env_->CallStaticObjectMethod(jklass_, jmethod_, 2, nullptr, jobj_);
  EXPECT_TRUE(env_->IsSameObject(jobj_, result));
  EXPECT_EQ(4, gJava_MyClassNatives_fooSIOO_calls[gCurrentJni]);

  result = env_->CallStaticObjectMethod(jklass_, jmethod_, 0, jobj_, nullptr);
  EXPECT_TRUE(env_->IsSameObject(jklass_, result));
  EXPECT_EQ(5, gJava_MyClassNatives_fooSIOO_calls[                                   maybe_unused] jclass klass,
  result = env_->CallStaticObjectMethod(jklass_, jmethod_, 1, jobj_, nullptr);
  EXPECT_TRUE(env_->IsSameObject(jobj_, result));
  EXPECT_EQ(6                      jdouble x,
  result=env_->CallStaticObjectMethod(jklass_, jmethod_, 2, jobj_, nullptr);
  EXPECT_TRUE(env_->IsSameObject(nullptr, result));
  java.lang.StringIndexOutOfBoundsException: Range [49, 11) out of bounds for length 64

  gJava_MyClassNatives_fooSIOO_calls[gCurrentJni] = 0;
}

JNI_TEST(CompileAndRunStaticIntObjectObjectMethod)

int gJava_MyClassNatives_fooSSIOO_callsjava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 64
 JNIEnvenv  klass x  ,  
  EXPECT_DOUBLE_EQ(990-100 ;
  []+java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  switch (    .69314718055994530942;
     1
      returnEXPECT_DOUBLE_EQa-,;
    case 2:
      returnz;
    default:
      return klass;
  }
}

void JniCompilerTest::JNI_TEST_CRITICAL(CompileAndRunStaticDoubleDoubleMethod)
  SetUpForTest(true, "fooSSIOO
               "(ILjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_fooSSIOO));

  EXPECT_EQ(0jdouble Java_MyClassNatives_logD(JNIEnv* jclass,jdouble x){
lt=env_>CallStaticObjectMethod(klass_, jmethod_,0 nullptr nullptr)java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
   Java_MyClassNatives_logD_notNormalJava_MyClassNatives_logD_notNormalJNIEnv*, jclass, jdouble x) {
  EXPECT_EQ(1, gJava_MyClassNatives_fooSSIOO_calls[gCurrentJni]);

  result  env_-CallStaticObjectMethod(jklass_, jmethod_, 0, nullptr, jobj_);
  EXPECT_TRUE(env_->IsSameObject(jklass_, result));
  EXPECT_EQ(2, gJava_MyClassNatives_fooSSIOO_calls[gCurrentJni]);
  result = env_->CallStaticObjectMethod(jklass_, jmethod_, 1, nullptr, jobj_);
  EXPECT_TRUE(env_->IsSameObject(nullptr, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 1
  EXPECT_EQ(3, gJava_MyClassNatives_fooSSIOO_calls[gCurrentJni]);
  result = env_->CallStaticObjectMethod(jklass_, jmethod_, 2, nullptr, jobj_);
  EXPECT_TRUE(env_  if(IsCurrentJniNormal()){
  EXPECT_EQ(4, gJava_MyClassNatives_fooSSIOO_calls[gCurrentJni]);

  result = env_->CallStaticObjectMethod    jni_handler =NORMAL_JNI_ONLY_NOWRAP(Java_MyClassNatives_logD)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  EXPECT_TRUE(env_->IsSameObject(jklass_, result));
  EXPECT_EQ(5, gJava_MyClassNatives_fooSSIOO_calls }
  result = env_->CallStaticObjectMethod(jklass_, jmethod_, 1, jobj_,   SetUpForTest(rue,"","()" jni_handler;
   EXPECT_TRUE(env_->IsSameObject(jobj_, result));
  EXPECT_EQ(6, gJava_MyClassNatives_fooSSIOO_calls[gCurrentJni  EXPECT_DOUBLE_EQ(log(.0) result)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  result = env_-JNI_TEST_CRITICAL(RunStaticLogDoubleMethod)
  EXPECT_TRUE(env_->IsSameObject(nullptr, result));
  jfloatJava_MyClassNatives_logF(*, jclass,jfloat x) {

  // Exercise recursive thin locking/unlocking. thin locking/nlocking.
  // Note: Thin lock count 0 means locked once.
  );
LockWord lock_word =GetLockWord(jklass_)
  ASSERT_EQ(lock_word
  (),0)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  result
  EXPECT_TRUEt, "logF" (F)" jni_handler);
  EXPECT_EQ(8  jfloatresult=env_>allStaticFloatMethodjklass_,jmethod_,20);
  lock_word = GetLockWord(jklass_);
  ASSERT_EQ(lock_word.  ASSERT_EQ(lock_word.GetState
 ASSERT_EQ(lock_word.ThinLockCount),0u;
  env_->MonitorExit(jklass_);
 lock_word = GetLockWord(jklass_);
  ASSERT_EQ(lock_word.GetState(), LockWord::kUnlocked);

/ Exercise lockinflation due to thin lock countoverflow.
  constexpr uint32_t jboolean Java_MyClassNatives_returnFalse(JNIEnv*, jclass) {
  for (uint32_t  returnJNI_FALSE;
    env_->java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
    lock_word = GetLockWord(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 12
    ASSERT_EQ(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ASSERT_EQ(lock_word.ThinLockCount(), i);
  }
  result = env_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  EXPECT_TRUE(env_->sSameObject(nullptr, result));
  EXPECT_EQ(9, gJava_MyClassNatives_fooSSIOO_calls[gCurrentJni]);
    EXPECT_TRUE(esult);
  ASSERT_EQ(lock_word.GetState(), LockWord::
  for(uint32_t  =0;i! kMaxThinLockRecursiveLocks;+i){
    env_->MonitorExit(jklass_);  // Remains "fat-locked" even if actually unlocked.


 // Exercise locking for "fat-locked".
  );
  result = env_->CallStaticObjectMethod(jklass_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  EXPECT_TRUE(env_->IsSameObject(nullptr, result));
  EXPECT_EQ(10, gJava_MyClassNatives_fooSSIOO_calls
  lock_word = GetLockWord(JNI_TEST_CRITICAL(RunStaticReturnFalse)
  ASSERT_EQ(lock_word.GetState(), LockWord::kFatLocked);

  [gCurrentJni  0;
}

// TODO: Maybe. @FastNative support for returning Objects?
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0

void  EXPECT_EQ42,result)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  jclass c =JNI_TEST_CRITICALRunGenericStaticReturnInt
  env->ThrowNew(c, "hello");
}

void Java_MyClassNatives_synchronizedThrowException env,jobject){
  JniCompilerTest::AssertCallerObjectLocked(env);
  jclass c   gJava_MyClassNatives_returnDouble_calls[gCurrentJni]+;
  env-ThrowNewc "hello")
}

void JniCompilerTest::java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
  {
    ASSERT_FALSE(runtime_>IsStarted()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
ScopedObjectAccess soa(Thread::Current());
    class_loader_ = LoadDex("MyClassNatives");

      EXPECT_EQ1,gJava_MyClassNatives_returnDouble_calls[gCurrentJni]);
    CompileForTestWithCurrentJni(class_loader_
    (class_loader_, false, "throwException", "()V");
    if (gCurrentJni == enum_cast<uint32_tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      CompileForTestWithCurrentJni(class_loader_, false, jlong Java_MyClassNatives_returnLong(JNIEnv*,jclass) {
    }
  }
  // Start runtime to avoid re-initialization in SetUpForTest.
  Thread::Current()->java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
  bool started = runtime_->Start();
CHECK(tarted)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

  gCurrentJni] = 0;

  // Check a single call of a JNI method is ok
  SetUpForTest(false, "foo", "(  
  env_->CallNonvirtualVoidMethod
  (, gJava_MyClassNatives_foo_calls[gCurrentJni];
  EXPECT_FALSEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

java.lang.StringIndexOutOfBoundsException: Range [63, 51) out of bounds for length 51
  ScopedLocalRef<jclass> jlre(env_,    case1:
  SetUpForTest(false, "throwException", "()V",
               CURRENT_JNI_WRAPPER(java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 11
 JNI  )
env_CallNonvirtualVoidMethod  ;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
->ExceptionOccurred
  env_->SetUpForTest(truef,
 env_-.) ))

/java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  EXPECT_EQ
  SetUpForTest(alse,"oo" (V reinterpret_castvoid>&Java_MyClassNatives_foo)java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 59
EXPECT_EQ(2 gJava_MyClassNatives_foo_callsgCurrentJni])

  if (gCurrentJni == enum_cast<uint32_t>(JniKind::kNormal)) {
    SetUpForTest(false,"ynchronizedThrowException", ()"java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
                 EXPECT_EQ(2, gJava_MyClassNatives_fooSIOO_calls[gCurrentJni]);
    LockWord lock_word = result = env_->CallStaticObjectMethod(jklass_, jmethod_, 1, nullptr, jobj_);
    (), LockWord::Unlocked);
// Call Java_MyClassNatives_synchronizedThrowException (synchronized JNI method
    // that throws exception) to check that we correctly unlock the object. =env_>allStaticObjectMethod(klass_, jmethod_ 2, nullptr,jobj_;
env_>CallNonvirtualVoidMethod(jobj_,jklass_,jmethod_)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
E);
    ScopedLocalRef<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
env_>)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
,gCurrentJni
lock_word=GetLockWordjobj_)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    EXPECT_EQ  (,gJava_MyClassNatives_fooSIOO_callsgCurrentJni];

    // Check a single call of a JNI method is ok
   EXPECT_EQ(2 gJava_MyClassNatives_foo_callsgCurrentJni];
      EXPECT_EQ(7gJava_MyClassNatives_fooSIOO_callsgCurrentJni])
    env_->CallNonvirtualVoidMethod(jobj_,   gJava_MyClassNatives_fooSIOO_calls[gCurrentJnijava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    EXPECT_EQJNI_TEST(ompileAndRunStaticIntObjectObjectMethod)
  }

  gJava_MyClassNatives_foo_calls[gCurrentJni gJava_MyClassNatives_fooSSIOO_calls[kJniKindCount] = {};
}

JNI_TEST)

jint Java_MyClassNatives_nativeUpCall(JNIEnv* envgJava_MyClassNatives_fooSSIOO_calls[gCurrentJni]++;
  if (i <= 0) {  switch(x {
    // We want to check raw Object* / Array* below
    ScopedObjectAccess soa

    // Build stack trace:
    jobject internal =
        soareturn klass;
    jobjectArray ste_array = java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 1
<mirror::tackTraceElement>>trace_array =
        soa.Decode<  SetUpForTest(rue,"ooSSIOO"
    EXPECT_TRUE(trace_array =nullptr);
    EXPECT_EQ(11, trace_array->GetLength()               CURRENT_JNI_WRAPPER));

    // Check stack trace entries have expected values
for(nt32_t j= 0 j  trace_arrayGetLength(); ++j) {
      EXPECT_EQ(-2, trace_array->Get(j)->GetLineNumber());
      ObjPtr<mirror::StackTraceElement>   EXPECT_EQ(1,gJava_MyClassNatives_fooSSIOO_calls[CurrentJni];
      EXPECT_STREQ("MyClassNatives.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
EXPECT_STREQ("yClassNatives" ste>GetDeclaringClass(->ToModifiedUtf8(.c_str);
      EXPECT_EQ
    }

// end recursion
     0
  }3 gJava_MyClassNatives_fooSSIOO_calls)
    jclassjklass=env-FindClass"MyClassNatives)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
 != nullptr);
    jmethodID jmethod = env->GetMethodID(jklass,
                                         ("fooI   =env_>CallStaticObjectMethod(jklass_,jmethod_,0 jobj_,nullptr);
                                        "()I")
    EXPECT_TRUE(jmethod != nullptr)EXPECT_EQ(, gJava_MyClassNatives_fooSSIOO_calls[CurrentJni];

    // Recurse with i - 1
    jint result=env>CallNonvirtualIntMethod(thisObj,jklass,jmethod, i-1;

   // Return sum of all depths
    return i + result;result = -CallStaticObjectMethod(jklass_, jmethod_, 2, jobj_, nullptr);
  }
}

voidJniCompilerTest:NativeStackTraceElementImpl() {
  SetUpForTest(false, "fooI", "(I)I",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_nativeUpCall));

  / Usual # local references on stack check fails because nativeUpCall calls itself recursively,
  // each time the # of local references will therefore go up.
ScopedDisableCheckNumStackReferences disable_num_stack_check;
  jint result = env_->ASSERT_EQ(lock_word.GetState(), LockWord::kThinLocked

  EXPECT_EQ(  result =env_-CallStaticObjectMethodjklass_,jmethod_,2 jobj_,nullptr)
}

JNI_TEST(  EXPECT_EQ(,gJava_MyClassNatives_fooSSIOO_calls[gCurrentJni])

jobject Java_MyClassNatives_fooO(JNIEnv* env, jobject, jobject xASSERT_EQ(ock_word.GetState() LockWord:kThinLocked)
  return env-NewGlobalRef();
}

void JniCompilerTest::ReturnGlobalRefImpl() {
  (false, "fooO","Ljava/Object;)Ljava/lang/Object;",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_fooO));  constexpruint32_t kMaxThinLockRecursiveLocks =1 <LockWord::ThinLockCountSize
jobject result =env_-CallNonvirtualObjectMethod(jobj_,jklass_, jmethod_, jobj_);
  EXPECT_EQ(JNILocalRefType, env_->GetObjectRefType(result));
  EXPECT_TRUE(env_->IsSameObject(esult, jobj_))java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
} ASSERT_EQ(ock_word.(, LockWord:kThinLocked);

JNI_TEST(ReturnGlobalRefASSERT_EQlock_word.hinLockCount(),i;

 local_ref_test(NIEnv env, jobject thisObj jint x){
  // Add 10 local references
   soaenv;
  for(nt =0;i<10 i+) {
    .AddLocalReferencejobject(soa.ecode<mirror::bject>thisObj))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  }
  return +;
}

void JniCompilerTest:LocalReferenceTableClearingTestImpl() {
  SetUpForTest(false, "fooI", "(I)I"  }
  // 1000 invocations of a method that adds 10 local references// Exercise locking for "fat-locked".
  for( i=0;i<1000 i+){
    jint  result =env_-CallStaticObjectMethod(jklass_, jmethod_, 2, jobj_, nullptr);
    EXPECT_TRUEEXPECT_TRUE(env_->IsSameObject(nullptr, result));
  }
}

JNI_TEST(LocalReferenceTableClearingTest)

void my_arraycopy(JNIEnv* env, jclass klass, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  EXPECT_TRUE(env->IsSameObject(JniCompilerTest:}
  EXPECT_TRUE(env->IsSameObject(JniCompilerTest
  EXPECT_TRUE(env->IsSameObject(JniCompilerTest::jobj_, src));
  EXPECT_EQ
  EXPECT_EQ(5678, dst_pos);
  EXPECT_EQ(9876, length);jclassc >FindClass"//RuntimeException";
}

void JniCompilerTest::java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 1
/Object;ILjava//Object;II)",
                 JniCompilerTest::AssertCallerObj(env)
  java.lang.StringIndexOutOfBoundsException: Range [28, 6) out of bounds for length 82
}

NI_TEST(JavaLangSystemArrayCopy

jboolean my_casi(JNIEnv* env, void JniCompilerTest::ExceptionHandli() {
  EXPECT_TRUE(env->IsSameObject(JniCompilerTest    ASSERT_FALSE(untime_->sStarted()
meObject(niCompilerTest::obj_,obj)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  EXPECT_EQ(INT64_C(0x12345678ABCDEF88), offset);
  EXPECT_EQ    // all compilation needs to happen before Runtime::Start
  CompileForTestWithCurrentJni(class_loader_, false, "foo", "()V");
    CompileForTestWithCurrentJni(class_loader_, false,"throwException","(V")
}

void JniCompilerTest:      CompileForTestWithCurrentJniclass_loader_,false, "ynchronizedThrowException", "()V");
  SetUpForTest(false, "compareAndSwapInt", "(  }
               CURRENT_JNI_WRAPPER(my_casi));
   result =env_->allBooleanMethodjobj_,jmethod_,jobj_, INT64_C(0x12345678ABCDEF88),
                                            0xCAFEF00D, 0xEBADF00D);
  EXPECT_EQ(result  CHECKstarted)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}

JNI_TEST(CompareAndSwapInt)

jint (JNIEnv env, jclass klass,jlong val1,jobject obj1, jlong val2,jobject obj2) {
  EXPECT_TRUE(env->IsInstanceOf(JniCompilerTest::jobj_, klass));
::jobj_, obj1))
  EXPECT_TRUE(env->IsSameObject(JniCompilerTest  EXPECT_EQ(1,gJava_MyClassNatives_foo_calls[gCurrentJni]);
  EXPECT_EQ(0x12345678ABCDEF88LL,  EXPECT_FALSE(Thread:Current(-IsExceptionPending));
  EXPECT_EQ(0x7FEDCBA987654321LL, val2);
  return 42;
}

void JniCompilerTest:GetTextImpl( {
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_throwException);
               CURRENT_JNI_WRAPPER(my_gettext));
  jint result  env_-CallStaticIntMethod(jklass_,jmethod_, 0x12345678ABCDEF88LL, jobj_,
                                          INT64_C(0x7FEDCBA987654321), jobj_);
   EXPECT_EQ(result, 42);
}

JNI_TEST(GetText)

 gJava_MyClassNatives_GetSinkProperties_callskJniKindCount  {java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
  1 gJava_MyClassNatives_foo_calls[gCurrentJni]);
  JniCompilerTest::AssertCallerObjectLocked(env);
  EXPECT_EQ(s, nullptr);
  gJava_MyClassNatives_GetSinkProperties_calls[gCurrentJni]++;

  Thread* self = Thread::Current();
ScopedObjectAccess soa(self);
  EXPECT_TRUE(self->HoldsLock(soa.Decode<mirror::Object>(thisObj)));
  return nullptr;
}

void JniCompilerTest::GetSinkPropertiesNativeImpl() {
  SetUpForTest(false,   if (gCurrentJni== enum_cast<uint32_t>JniKind:kNormal)){
               (Java_MyClassNatives_GetSinkProperties));

  EXPECT_EQ(0                 CURRENT_JNI_WRAPPERJava_MyClassNatives_synchronizedThrowException));
  jarray result = down_cast<jarray>    lock_wordGetState)
      env_->// that throws exception
      env_-CallNonvirtualVoidMethodjobj_ ,java.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 61
  EXPECT_EQ(1, ScopedLocalRef<jthrowableexception2env_ env_-ExceptionOccurred));

  env_->ExceptionClear;
}

// @FastNative doesn't support 'synchronized' keyword and
// never will -- locking functions aren't fast.
JNI_TEST_NORMAL_ONLY(GetSinkPropertiesNative)

// This should return jclass, but we're imitating a bug pattern.
jobject Java_MyClassNatives_instanceMethodThatShouldReturnClass(NIEnv env,jobject){
  return env->NewStringUTF("not a class!");
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

// This should return jclass, but we're imitating a bug pattern.
jobject java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 84
  return env->NewStringUTF("not a class!");
}

void JniCompilerTest::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
/java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90
  // runtime call where we do these checks. Note that while normal gtests use the debug build
  // which disables the fast path, `art_standalone_compiler_tests` run in the release build.
  compiler_options_->SetDebuggable(true);
  SetUpForTest(false, "instanceMethodThatShouldReturnClass    // We want to check raw Object* / Array* below
    CURRENT_JNI_WRAPPER(Java_MyClassNatives_instanceMethodThatShouldReturnClass));

  CheckJniAbortCatcher check_jni_abort_catcher;
  // This native method is bad, and tries to return a jstring as a jclass.
  env_(jobj_ jmethod_);
  check_jni_abort_catcher.Check(std::string() + "attempt to return an instance "    jobjectArray ste_array =Thread:InternalStackTraceToStackTraceElementArray(soa, internal);
                                   "ofjava.lang from .lang. "+
                                    "MyClassNatives.instanceMethodThatShouldReturnClass" +
                                    CurrentJniStringSuffix( +"));

   the method incorrectly we should  catchthat too.
    EXPECT_EQ(1 trace_array>GetLength);
  check_jni_abort_catcher.Check(std::string() +    // Check stack trace entries have expected values
                                     .angStringfrom java.ang.Class"+
                                    "MyClassNatives.instanceMethodThatShouldReturnClass" +
                                    CurrentJniStringSuffix() + "()");
  env_->CallStaticObjectMethod ("java"ste>)T)._tr);
  .Check(std::tring( +"calling -static method "+
                                    "ava..Class " +
                                    "MyClassNatives.java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 5
                                   CurrentJniStringSuffix) +") with CallStaticObjectMethodV");
}

pcallReturnTypeChecking_Instance)

voidEXPECT_TRUE( !nullptr)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  // Set debuggable so that the JNI compiler does not emit a fast-path that would skip the
debug build
  // which disables the fast path, `art_standalone_compiler_tests` run in the release build.
  compiler_options_->"(I)I")
  SetUpForTest(true,    jmethod =nullptr)
               CURRENT_JNI_WRAPPER

  CheckJniAbortCatcher check_jni_abort_catcher;/ Return sumjava.lang.StringIndexOutOfBoundsException: Range [31, 20) out of bounds for length 31
  // This native method is bad, and tries to return a jstring as a jclass.
  env_-CallStaticObjectMethod(jklass_,jmethod_);
  check_jni_abort_catcher.Check(std::string() + "attempt to return an instance " +
                                    javalang.tringfrom java.lang.Class"+
                                    ouldReturnClass" +
                                    CurrentJniStringSuffix() + "()");

  // Here, we just call the method incorrectly; we should catch that too.// each time the # of local references will therefore go up.
  env_->CallStaticObjectMethod(jklass_, jmethod_);
  check_jni_abort_catcher.Check(std::string() + "attempt to return an instance " +
                                    "of java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                    "MyClassNatives.staticMethodThatShouldReturnClass" +
                                    java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
  env_
  check_jni_abort_catcher.Check(std  return -NewGlobalRef()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                                    "java.lang.Class " +
                                    "MyClassNatives.staticMethodThatShouldReturnClass" +
                                    CurrentJniStringSuffix() + "() with CallObjectMethodV");
}

JNI_TEST(  jobject result =env_-CallNonvirtualObjectMethod((obj_,jklass_, ,jobj_);

// This should take jclass, but we're imitating a bug pattern.
 Java_MyClassNatives_instanceMethodThatShouldTakeClass(JNIEnv*, jobject, jclass) {
}

// This should take jclass, but we're imitating a bug pattern.
void Java_MyClassNatives_staticMethodThatShouldTakeClass(JNIEnv*, jclass, jclass) {
}

  //Add 10 localreferences
 Thiswill lead to  messagesinthe log.
ScopedLogSeverity sls(LogSeverity:FATAL)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

  SetUpForTest(false, "instanceMethodThatShouldTakeClass", "(ILjava/lang/Class;)V",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_instanceMethodThatShouldTakeClass));

  CheckJniAbortCatcher check_jni_abort_catcher;
  // We deliberately pass a bad second argument here.
  env_->allVoidMethod(jobj_, jmethod_, , env_-NewStringUTF("not a class!"));
  check_jni_abort_catcher.Check(std::string() + "bad arguments passed to void   SetUpForTest(false, fooI, "I)" CURRENT_JNI_WRAPPER(ocal_ref_test));
                                    "MyClassNatives  / 1000invocations of a method that adds 10 local references
                                    CurrentJniStringSuffix() + "(int, java.lang.Class)");
}

    EXPECT_TRUE(esult   1;

void JniCompilerTest::UpcallArgumentTypeChecking_StaticImpl() {
  // This will lead to error messages in the log.
  ScopedLogSeverity sls(LogSeverity::FATAL);

  SetUpForTest(true, "staticMethodThatShouldTakeClass", "(ILjava/lang/Class;)V",
               CURRENT_JNI_WRAPPER(java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 66

  CheckJniAbortCatcher check_jni_abort_catcher;
  / We deliberately pass a bad second argument here.
  env_->CallStaticVoidMethod(jklass_  EXPECT_EQ(1234 src_pos)
  check_jni_abort_catcher(9876 )
                                    "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                    CurrentJniStringSuffix() + "(int, java.  SetUpForTest(rue "rraycopy, "Ljava/lang/Object;ILjava/lang/Object;)V"java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
}

JNI_TEST(UpcallArgumentTypeChecking_Static)

Floats(JNIEnv*,jobject, jfloat f1,jfloat f2) {
  return f1 - f2;  // non-commutative operator
}

voidEXPECT_TRUE(-IsSameObjectJniCompilerTest:obj_,unsafe);
SetUpForTest(false,"checkFloats" "FF),
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_checkFloats);

  jfloat   <>)
99.0 .F);
  EXPECT_FLOAT_EQ(99.0F - 10.0F, result);
  jfloat a  returnJNI_TRUE
  jfloat b = 0.69314F;
(jobj_, jklass_, jmethod_,a b)
  EXPECT_FLOAT_EQ(a  SetUpForTest(alse,"compareAndSwapInt","(java/lang/Object;JII)Z"java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
}

JNI_TEST(CompileAndRunFloatFloatMethod)

void Java_MyClassNatives_checkParameterAlign([[maybe_unused]] JNIEnv*   EXPECT_EQ(esult,JNI_TRUE)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                                             [[maybe_unused]] jobject thisObj,
                                             jint i1,
                                              l1){
  EXPECT_EQ(i1, 1234);
  EXPECT_EQ(l1, INT64_C(0x12345678ABCDEF0));
}

JniCompilerTest:CheckParameterAlignImpl) {
  SetUpForTestfalse"checkParameterAlign, "IJ)"
               Java_MyClassNatives_checkParameterAlign));

  env_->CallNonvirtualVoidMethod(jobj_, jklass_, jmethod_ return 42;
}



void Java_MyClassNatives_maxParamNumber(JNIEnv)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    jobject o0, jobject o1,                                           (x7FEDCBA987654321,jobj_);
    jobject o8, jobject o9, jobject o10, jobject java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
    jobject
    jobject , jobject o25, jobject o26, jobject o27, jobject o28, jobject o29, jobject o30, jobject o31,
    jobject o32, jobject o33, jobject o34, jobject o35, jobject o36, jobject o37, jobject o38, jobject o39,
    jobject o40, jobject o41, jobject o42, jobject o43, jobjectEXPECT_EQs,nullptr)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    jobject o48, jobject o49, jobject o50, jobject o51, jobjectjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    jobjecto56 jobject o57, jobject o58, jobject o59, jobject o60, jobject o61, jobject o62, jobject o63,
 jobject o66
    jobject o72, jobject o73, jobject o74, jobject   EXPECT_TRUE(self->HoldsLock(soa.Decode<mirror::Object)
    jobject o80java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     o89  o90,jobject o91, jobject o92, jobject o93, jobject o94, jobject o95,
          (Java_MyClassNatives_GetSinkProperties
    jobject o104, jobject o105, jobject o106, jobject o107, jobject o108EXPECT_EQ0 gJava_MyClassNatives_GetSinkProperties_calls]java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
    jobject o112,jobject o113, jobject o114, jobject o115, jobject o116, jobject o117, jobject o118, jobject o119,
object o121,jobject  o122, jobject o123,jobject o124, jobject o125, jobject o126, jobject o127,
    jobject o128, jobject o129, jobjectjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    jobject o136, jobject o137, jobject // @FastNative doesn't support 'synchronized' keyword and
    jobject o144, jobject o145, jobject o146, jobject o147JNI_TEST_NORMAL_ONLY(etSinkPropertiesNative
    jobject o152, jobject o153, jobject o154,// This should return jclass, but we're imitating a bug pattern.
    jobject o160, jobject o161,return-NewStringUTFclass;
    jobject o168, jobject o169, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
jobjecto176, ,jobjecto178 o179, o180,jobject o181, jobject o182,jobject o183,
    jobject o184, jobject o185, jobject o186, jobject      env-NewStringUTF" a class
    jobject o192, jobject o193, jobject o194,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    jobject o200, jobject o201, jobject o202, jobject o203, jobject   / Set debuggable so that the JNI compiler does not emit a fast-path that would skip the
    jobject o208,jobject o209,jobject o210, jobject o211, jobject o212, jobject o213, jobject o214, jobject o215,
    jobject o216, jobject o217, jobject o218, jobject o219, jobject o220, jobject o221, jobject o222, jobject o223,
     ->SetDebuggabletrue;
  jobjecto232,jobject o233,jobject o234,jobject o235, jobject o236,jobject o237,jobject o238,jobject o239,
    jobject o240, jobject o241, jobject o242, jobject o243, jobject o244, jobject                CURRENT_JNI_WRAPPER(Java_MyClassNatives_instanceMethodThatShouldReturnClass));
    jobject o248, jobject o249, jobject o250, jobject o251, jobject o252, jobject o253) {
  // two tests possible
  if (o0 == nullptr) {
    // 1) everything is null
    EXPECT_TRUE(o0 == nullptr"lang.String  java.lang.Class"java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
        && o5 =                                    ()+"))
        && o10 ==   // Here, we just call incorrectlyweshouldcatch toojava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
        && o15 == nullptrCheckstd:() +"ttempt to return  instance " java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
        & o20==& o21 = nullptr & o22 = nullptr &o23 =nullptr &&o24 =nullptr
        && o25 == nullptr && o26 == nullptr && o27 == MyClassNatives.instanceMethodThatShouldReturnClass
       & o30= nullptr& o31 = &o32 =nullptr & o33 = nullptr & o34 = nullptr
        && o35 == nullptr && o36 == nullptr && o37 == java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 50
        && o40 == nullptr && o41 == nullptr && o42 == nullptr && o43 == nullptr && o44 == nullptr
        && o45 == nullptr && o46 == nullptr && o47 == nullptr && o48 == nullptr && o49 == nullptr
        &&o50==nullptr &&o51 = nullptr & o52 = nullptr &o53= nullptr&& o54 = nullptr
        && o55 == nullptr && o56 =="." 
        && o60                                    CurrentJniStringSuffix)+ "( with CallStaticObjectMethodV";
        && o65 == nullptr && o66 == nullptr && o67 == nullptr && java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
        && o70 == nullptr && o71 =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
r& o78= nullptr & o79 = nullptr
        && o80 == nullptr &&   // Set debuggable so that the JNI compiler does not emit a fast-path that would skip the
        && o85 == nullptr && o86 == nullptr && o87 == nullptr && o88 == nullptr && o89 == nullptr
        && o90 == nullptr && o91 == nullptr &&   compiler_options_-SetDebuggable(rue)
        &o95= nullptr & o96 = &&o97 = nullptr & o98 =nullptr & o99 ==nullptr
        &&& o101 = nullptr & o102 = nullptr &&o103 == nullptr && o104 == nullptr
        && o105 == nullptr && o106 == nullptr && o107 == java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        && o110 == nullptr &&   // This native method is bad, andtoreturn jstring as a .
        &== nullptr & o117 ==nullptr && o118 = nullptr &&o119 == nullptr
        && o120 == nullptr && o121 == nullptr && o122 == nullptr && o123 == java.lang.StringIndexOutOfBoundsException: Range [0, 83) out of bounds for length 82
        && o125 =                                    javalang.java.angClass +
        && o130 == nullptr && o131 == nullptr && o132 == nullptr && o133 == nullptr && o134 ==                                    CurrentJniStringSuffix( +"))java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
        && o135 == nullptr && o136 == nullptr && o137 == nullptr && o138 == nullptr && o139 == nullptr
        && o140 == nullptr && o141 == nullptr && o142 == nullptr && o143 == nullptr && o144 == nullptr
        && o145 == nullptr && o146 == nullptr && o147 == nullptr && o148 == nullptr && o149 == nullptr
        && o150 == nullptr && o151 == nullptr && o152 == nullptr && o153 == nullptr && o154 == nullptr
        && o155 == nullptr && o156 == nullptr && o157 == nullptr && o158 == nullptr && o159 == nullptr
        && o160 == nullptr && o161 == nullptr && o162 == nullptr && o163 ==nullptr && o164 == nullptr
        && o165 == nullptr && o166 == nullptr && o167 == nullptr && o168 == nullptr && o169 == nullptr
        && o170 == nullptr && o171 == nullptr && o172 == nullptr && o173 == nullptr && o174 == nullptr
        && o175 == nullptr &&                                     "of .lang. from java..Class  +
        && o180 ==nullptr & o181 = nullptr & o182 = nullptr &o183 = nullptr& o184 = nullptr
        &&=  &&  & =&=&  =nullptr
&=& = & =nullptr & o193 ==nullptr& o194 = nullptr
        && o195 == nullptr && o196 == nullptr && o197 == nullptr && o198 == nullptr && o199 == nullptr
        && o200 == nullptr && o201 == nullptr && o202 == nullptr && o203 == nullptr && o204 == nullptr
        && o205 == nullptr && o206 == nullptr && o207 =g static "+
        && o210 == nullptr && o211 == nullptr && o212 == nullptr && o213 == nullptr && o214 == nullptr
        && o215 == nullptr && o216 == nullptr &&                                     "MyClassNativesjava.lang.StringIndexOutOfBoundsException: Range [87, 85) out of bounds for length 88
        && o220 =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        && o225 == nullptr && o226 == java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        && o230 == nullptrnstanceMethodThatShouldTakeClassJNIEnv* jobject,jclass) {
        &&
        && JniCompilerTestUpcallArgumentTypeChecking_InstanceImpl){
        && o245 == nullptr   / This will lead to error messages in the log.
        && o250 == nullptr && o251 == nullptr && o252 == nullptr 
}else
    EXPECT_EQ(0, java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 91
    EXPECT_EQ(1, env>GetArrayLength(einterpret_cast<array(o1);
    EXPECT_EQ(2, env->GetArrayLength(reinterpret_cast<jarray>(o2)));
    EXPECT_EQ(, env-GetArrayLength(reinterpret_cast<jarray>(o3)));
    EXPECT_EQ(4, env->GetArrayLength(reinterpret_cast<jarray>(o4)));
    EXPECT_EQ(5, env->GetArrayLength(reinterpret_cast<jarray>(o5)));
    EXPECT_EQ(6, env->GetArrayLength(reinterpret_cast<jarray>(o6)));
    EXPECT_EQ(7, env->GetArrayLength(reinterpret_cast<jarray>(o7)));
    EXPECT_EQCurrentJniStringSuffix  ",java.lang.Class)");
    EXPECT_EQ(9, env->GetArrayLength(reinterpret_cast<jarray>(o9)));
    EXPECT_EQ(10, env->GetArrayLength(reinterpret_cast<jarray>(o10)));
    EXPECT_EQ(11, env->GetArrayLength(reinterpret_cast<jarray>(o11)));
    EXPECT_EQ(12JNI_TEST(UpcallArgumentTypeChecking_Instance
    EXPECT_EQ(13, env->GetArrayLength(reinterpret_cast<jarray>(o13)));
    EXPECT_EQ(14, env->GetArrayLength(reinterpret_cast<jarray>(o14)));
    EXPECT_EQ(15, env->GetArrayLength(reinterpret_cast<java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 44
    EXPECT_EQ(16, env->GetArrayLength(reinterpret_cast<jarray>(o16)));
    EXPECT_EQ(17, env->GetArrayLength(reinterpret_cast<jarray>(o17)));
    EXPECT_EQ(18, env->GetArrayLength(reinterpret_cast<jarray>(o18)));
    EXPECT_EQ(19, env->GetArrayLength(reinterpret_cast<jarray>(o19)));
    EXPECT_EQ(20, env->GetArrayLengthenv_>CallStaticVoidMethodjklass_,jmethod_,123 env_-NewStringUTF"not a ")java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
    EXPECT_EQ(                                    java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 86
   EXPECT_EQ(, env-GetArrayLength(reinterpret_cast<array>o22));
    EXPECT_EQ(23, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    Java_MyClassNatives_checkFloats*   ,jfloatf2 java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
    EXPECT_EQ(25, env->GetArrayLength
    EXPECT_EQ(26, env->GetArrayLength(reinterpret_cast<jarray>(o26)));
    EXPECT_EQ(27, env->GetArrayLength(reinterpret_cast<jarray(false "checkFloats,"FFF,
    EXPECT_EQ(28, env->GetArrayLength(reinterpret_cast<jarray>(o28)));
    EXPECT_EQ(29,env>GetArrayLength(einterpret_cast<jarray>(o29)));
    EXPECT_EQ(30, env->GetArrayLength(reinterpret_cast<jarray>(o30)));
    EXPECT_EQ(31, env->GetArrayLength(reinterpret_cast<jarray>(o31)));
    EXPECT_EQ(32  EXPECT_FLOAT_EQ(90  10.0,result)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    EXPECT_EQ(33, env->GetArrayLength(reinterpret_cast<jarray>(o33)));
    EXPECT_EQ(34, env->GetArrayLength(reinterpret_cast<jarray>(o34)));
    EXPECT_EQ(35, env->GetArrayLength(reinterpret_cast<jarray>(o35)));
    EXPECT_EQ(36, env->GetArrayLength(reinterpret_cast<jarray>(o36)));
    EXPECT_EQ(37, env->GetArrayLength(reinterpret_cast<jarray>(o37)));
    EXPECT_EQ(38, env->GetArrayLength(reinterpret_cast<jarray>(o38)));
    EXPECT_EQ(39, env->GetArrayLength(reinterpret_cast<jarray>(o39)));
    EXPECT_EQ(40, env->GetArrayLength(reinterpret_cast<jarray>(o40)));
    EXPECT_EQ(41, env->GetArrayLength(reinterpret_cast<jarray>(o41)));
    EXPECT_EQ(42, env->GetArrayLength(reinterpret_cast<jarray>(o42)));
    EXPECT_EQ(43, env->GetArrayLength(reinterpret_cast<jarray>(o43)));
    EXPECT_EQ(44, env->GetArrayLength(reinterpret_cast<java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 39
    EXPECT_EQ(45, env->GetArrayLength(reinterpret_cast<jarray>(o45)));
    EXPECT_EQ(46, env->GetArrayLength(reinterpret_cast<jarray>(o46)));
    EXPECT_EQ(47, env->GetArrayLength(reinterpret_cast<jarray>(o47)));
    EXPECT_EQ(48, env->GetArrayLength(reinterpret_cast<jarray>(o48)));
    EXPECT_EQ(49, env->GetArrayLength(reinterpret_cast<jarray>(o49)));
    EXPECT_EQ(50, env->GetArrayLength(reinterpret_cast<jarray>(java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 44
    EXPECT_EQ(51, env->GetArrayLength(java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 0
    EXPECT_EQ(52, env->GetArrayLength(reinterpret_cast<jarray>(o52)));
    EXPECT_EQ(53, env->GetArrayLength(reinterpret_cast<jarray>(o53)));
    EXPECT_EQ(54, env->GetArrayLength(reinterpret_cast<jarray>(o54)));
    EXPECT_EQ(55, env->GetArrayLength(reinterpret_cast<jarray>(o55)));
    EXPECT_EQ
    EXPECT_EQ,-GetArrayLength>o))
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    EXPECT_EQ(59,     jobject o0, jobjeo1 jobject o2,jobject o3, jobject o4, jobject o5, jobject o6, jobject o7,
    EXPECT_EQ(60,env>GetArrayLengthreinterpret_castjarray>(60);
    EXPECT_EQ(61 env-GetArrayLength(reinterpret_castjarray>o61));
    EXPECT_EQ(62, env->GetArrayLength(reinterpret_cast<jarray>(    jobject o24, jobject o25, jobject o26, jobject o27, jobject o28,jobject o30, jobject ,
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 107
<jarrayo64);
    EXPECT_EQ(65, env->GetArrayLength(reinterpret_cast<jarray>(o65)));
    EXPECT_EQ(66, env->GetArrayLength(reinterpret_cast<jarray>(o66)));
     o56, jobject ,jobject o58,jobject ,jobject o60, jobject o61, jobject o62, jobject o63,
    , env-GetArrayLength(reinterpret_castjarray>(68);
    (69,env>etArrayLength(einterpret_cast<array(o69)))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    EXPECT_EQ(70,env>GetArrayLength(reinterpret_cast<jarray>(o70)));
    EXPECT_EQ(71, env->GetArrayLength(reinterpret_cast<jarray>(o71)));
    EXPECT_EQ(72, env->GetArrayLength(reinterpret_cast<jarray>(o72)));
    EXPECT_EQ(73, env->GetArrayLength(reinterpret_cast<jarray>(o73)));
(74-<>o74)
jobject java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 115
EXPECT_EQ76 -GetArrayLengthreinterpret_castjarray())java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    EXPECT_EQ(77, env->GetArrayLength(reinterpret_cast<jarray>(o77)));
    EXPECT_EQ(78,env>(reinterpret_cast<jarray>(o78)));
    EXPECT_EQ(79, env->GetArrayLength(reinterpret_cast<jarray>     o144,jobject, jobject o146,jobject o147,jobject o148,jobject o149, jobjecto150, jobject o151,
    EXPECT_EQ80,env-GetArrayLengthreinterpret_castjarray(o80))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    EXPECT_EQ(81, env>GetArrayLengthreinterpret_cast<jarray>o81);
    EXPECT_EQ(82,     o168,jobject o169,jobject o170, jobject o171, jobject o172, jobject o173, jobject o174, jobject o175,
       EXPECT_EQ(, env-GetArrayLength(reinterpret_castjarray>(83))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    EXPECT_EQ(84, env->GetArrayLength(reinterpret_cast<jarray>(o84)));
    EXPECT_EQ(85, env->GetArrayLength(reinterpret_cast<jarray>(o85)));
    EXPECT_EQ(86, env->GetArrayLength(einterpret_cast<jarray>o86));
    jobjecto200,jobject ,jobject o202,jobject ,jobject o204, jobject o205, jobject o206, jobject o207,
    jobject o208,jobject o209,jobject o210, jobject o211, jobject o212, jobject o213, jobject o214, jobject o215,
    java.lang.StringIndexOutOfBoundsException: Range [37, 13) out of bounds for length 70
    EXPECT_EQ(90,     jobject o224, jobo225,jobject o226, jobject o227, jobject o228, jobject o229, jobject o230, jobject o231,
t<jarray>(91))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    EXPECT_EQ(92, env->etArrayLength(reinterpret_cast<jarray>o92))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    EXPECT_EQ(93,env>GetArrayLength(reinterpret_cast<jarray>(o93)));
    EXPECT_EQ(94, env->GetArrayLength(reinterpret_cast<jarray  // two tests possible
    EXPECT_EQ(95, env->GetArrayLength(reinterpret_cast<jarray>(o95)));
    EXPECT_EQ(96, env->GetArrayLength(reinterpret_cast<jarray>(o96)));
EXPECT_EQ(97,env>GetArrayLength(einterpret_cast<<array>o97));
    EXPECT_EQ(98, env& = &o6=&  = &= &  =nullptr
EXPECT_EQ99,env-java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 70
EXPECT_EQ(100,env-GetArrayLength(reinterpret_castjarray(o100));
    EXPECT_EQ(101, env->        && o20 == nullptr &&o20 =nullptr &o21 =nullptr & o22 = && o23 ==nullptr &o24 = nullptr
    EXPECT_EQ(102,env>etArrayLength(einterpret_cast<array>o102))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
EXPECT_EQ(103,env>etArrayLength(reinterpret_castjarray>(o103)));
    EXPECT_EQ(104, env->GetArrayLength(reinterpret_cast<jarray>(o104)));
EXPECT_EQ(105, env->GetArrayLength(reinterpret_cast<jarray>(o105)));
    EXPECT_EQ(106, env->GetArrayLength(reinterpret_cast<jarray>(o106)));
           & o40 ==nullptr  o41 = nullptr & o42 = nullptr & o43 = nullptr & o44 = nullptr
    EXPECT_EQ(108, env->GetArrayLength(reinterpret_cast<jarray>(o108)));
   EXPECT_EQ(109, env->GetArrayLength(reinterpret_cast<jarray>(o109)));
    EXPECT_EQ(110, env->GetArrayLength(reinterpret_cast<jarray>(o110)));
    EXPECT_EQ(, env-GetArrayLength(reinterpret_cast<jarray>(o111)));
    EXPECT_EQ(112, env->GetArrayLength(reinterpret_cast<jarray>(o112)));
    EXPECT_EQ(113, env->etArrayLength(reinterpret_cast<jarray>(o113)));
    EXPECT_EQ(114, env->GetArrayLength(reinterpret_cast<jarray>(o114)));
    EXPECT_EQ(115, env->GetArrayLength(reinterpret_cast<jarray>(o115)));
    EXPECT_EQ(116, env->GetArrayLength(reinterpret_cast<jarray>(o116)        &o70 == nullptr && o71 == nullptr && o72 == nullptr && o73 == nullptr && o74 == nullptr
    EXPECT_EQ(117, env->GetArrayLength(reinterpret_cast<jarray>(o117)));
    EXPECT_EQ(118, env->        && o80 == nullptr && o81  & o82 = nullptr  & o83 = nullptr && o84 == nullptr
            && =nullptr && o86 == nullptr && o87 == nullptr && o88 == nullptr && o89 == nullptr
    EXPECT_EQ(120, env->GetArrayLength(reinterpret_cast<jarray>(o120)));
    EXPECT_EQ(121, env->GetArrayLength(reinterpret_cast<jarray>(        & o95 = nullptr & o96 = nullptr &&o97==nullptr && o98 == nullptr && o99 == nullptr
,-(einterpret_castjarray>o122);
    EXPECT_EQ&o106==nullptr& =nullptr & =nullptr& = 
tArrayLengthreinterpret_castjarray(o124));
    EXPECT_EQ(125, env->GetArrayLength(       & o115 ==nullptr &&o116= nullptr & o117 = nullptr &&nbsp; = nullptr & o119 = nullptr
EXPECT_EQ(126, env->GetArrayLength(reinterpret_cast<jarray>(o126)));
    EXPECT_EQ(127, env->GetArrayLength        & o125 = nullptr & o126 =nullptr & o127 = nullptr &&o128 == nullptr && o129 == nullptr
    java.lang.StringIndexOutOfBoundsException: Range [38, 13) out of bounds for length 72
    EXPECT_EQ(129, env-GetArrayLength(reinterpret_cast<jarray>(o129)));
    EXPECT_EQ(130, env->GetArrayLength(reinterpret_cast<jarray>(o130)))       & o140 ==nullptr & o141 =nullptr & o142 = nullptr &o143 == nullptr && o144 == nullptr
    EXPECT_EQ(131, env->etArrayLength(reinterpret_cast<jarray>(o131)));
    EXPECT_EQ(132, env->GetArrayLength(reinterpret_cast<jarray>(o132)));
    EXPECT_EQ(133, env->GetArrayLength(reinterpret_cast<jarray>(o133)));
    EXPECT_EQ(134, env->GetArrayLength(reinterpret_cast<jarray>(o134)));
    EXPECT_EQ(135, env->GetArrayLength(reinterpret_cast<jarray>(o135)));
    EXPECT_EQ(136, env->GetArrayLength(reinterpret_cast<jarray>(o136)));
    EXPECT_EQ(137, env->GetArrayLength(reinterpret_cast<jarray>(o137)));
    EXPECT_EQ(138, && o170 == nullptr& o171 = nullptr & o172 =nullptr  &o173 = nullptr & o174 = nullptr
    EXPECT_EQ(139, env->etArrayLengthreinterpret_cast<jarray>(o139)));
    EXPECT_EQ(140, env->GetArrayLength(reinterpret_cast<jarray>(o140)));
;
    EXPECT_EQ(142, env->GetArrayLength(reinterpret_cast<jarray>(o142)));
    EXPECT_EQ(43 env->etArrayLength(reinterpret_cast<jarray>(o143)));
    EXPECT_EQ(144, env->GetArrayLength(reinterpret_cast<jarray>(o144)));
   EXPECT_EQ(,env->etArrayLength(reinterpret_cast<jarray>(145));
    EXPECT_EQ(146, env->GetArrayLength(reinterpret_cast<jarray>(o146)));
    EXPECT_EQ(147, env->GetArrayLength(reinterpret_cast<jarray>(o147)));
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 72
>(o149);
    EXPECT_EQ(150, env->GetArrayLength(reinterpret_cast<jarray>(o150)));
    java.lang.StringIndexOutOfBoundsException: Range [55, 13) out of bounds for length 72
    EXPECT_EQ(152, env->GetArrayLength(&& o220 == nullptr && o221 == nullptr nullptr& o223 = nullptr & o224 = nullptr
EXPECT_EQ153 ->GetArrayLengthreinterpret_castjarray>o153))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
   EXPECT_EQ(54,env->etArrayLengthreinterpret_cast<jarray>o154))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
EXPECT_EQ(155 env-GetArrayLength(einterpret_cast<jarray>o155));
    EXPECT_EQ(156, env->GetArrayLength& o240 nullptr &o241 = nullptr &&o242 = nullptr & o243 =nullptr &o244 = nullptr
    EXPECT_EQ157,env-GetArrayLength(reinterpret_cast<jarray>(o157)));
    EXPECT_EQ(158, env->GetArrayLength(reinterpret_cast<jarray>(o158)));
o159)));
    EXPECT_EQ(160, env->GetArrayLength(reinterpret_cast<jarray>(o160)));
    EXPECT_EQ(161,    EXPECT_EQ(0, -GetArrayLength(reinterpret_cast<jarray>(o0)));
    EXPECT_EQ(162, env->GetArrayLength(reinterpret_cast<jarray>(o162)) EXPECT_EQ(1, env->GetArrayLength(reinterpret_cast<jarray>(o1)));
    EXPECT_EQ(163, -GetArrayLength(reinterpret_cast<jarray>(o163)));
    EXPECT_EQ(164, env->GetArrayLength(reinterpret_cast<    EXPECT_EQ(164, env->GetArrayLength(reinterpret_cast<jarray
    EXPECT_EQ(165, env->GetArrayLength(reinterpret_cast<jarray>(o165)));
    EXPECT_EQ(166, env->GetArrayLength(reinterpret_cast<jarray>(o166)    EXPECT_EQ(5,env>GetArrayLength(reinterpret_cast<jarray>o5);
    EXPECT_EQ(167,env>GetArrayLength(reinterpret_cast<jarray>(o167)));
EXPECT_EQ(168,env>etArrayLength(reinterpret_cast<jarray>(o168)));
    EXPECT_EQ(169,env>GetArrayLength(reinterpret_cast<jarray>(o169)));
    EXPECT_EQ(170, env->GetArrayLength(reinterpret_cast<jarray>(o170    EXPECT_EQ(9,env->GetArrayLength(reinterpret_cast<jarray>(o9)));
    EXPECT_EQ(171, env->GetArrayLength(reinterpret_cast<jarray>(o171)));
    EXPECT_EQ(172, env->GetArrayLength(reinterpret_cast<jarray>(o172)));
    java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 72
,-GetArrayLengthreinterpret_castjarray(o174);
    EXPECT_EQ(175, env->GetArrayLength(EXPECT_EQ(12, env->GetArrayLength(reinterpret_cast<jarray>(o12)));
        EXPECT_EQ(13, env->GetArrayLength(reinterpret_cast<jarray>(o13)));
    EXPECT_EQ(177, env->GetArrayLength(reinterpret_cast<jarray>(o177)));
    EXPECT_EQ(178, env->GetArrayLength(reinterpret_cast<jarray>(o178)));
    EXPECT_EQ(179 env-GetArrayLength(reinterpret_cast<jarray>(o179)));
    EXPECT_EQ(180, env->GetArrayLength(reinterpret_cast<jarray>(o180)));
    EXPECT_EQ(181, env->GetArrayLength(reinterpret_cast<jarray>(o181)));
>o182);
    EXPECT_EQ(183, env->GetArrayLength(reinterpret_cast<jarray>(o183)));
    EXPECT_EQ(184, env->GetArrayLength(reinterpret_cast<jarray>(o184)));
    (18 ><array(18)))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 72
    EXPECT_EQ(187, env->GetArrayLength(    EXPECT_EQ(26, env->GetArrayLength(reinterpret_cast)
188 ->rjarray(188);
    EXPECT_EQ(189, env    EXPECT_EQ28 >etArrayLength<>();
    EXPECT_EQ(190, envEXPECT_EQ29 >etArrayLengthreinterpret_castjava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 70
   EXPECT_EQ(,env-GetArrayLength<array())java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
    EXPECT_EQ(192, env->GetArrayLength(reinterpret_cast<jarray>(o192)));
    EXPECT_EQ(193, env->GetArrayLength(reinterpret_cast<jarray>(o193))) EXPECT_EQ( >etArrayLength<())
    EXPECT_EQ(, -(<jarray())
    EXPECT_EQ(195, env->GetArrayLengthEXPECT_EQ(36 env->GetArrayLength(<jarrayo36);
    (96,env-GetArrayLengthr<>o196);
    EXPECT_EQ(97,-GetArrayLength<array>o197);
    EXPECT_EQ(198, env- EXPECT_EQ39 >(<())
EXPECT_EQ199,-GetArrayLength<array())
    EXPECT_EQEXPECT_EQ41 -(<array();
01)));
    EXPECT_EQ(    43,-G(<();
    EXPECT_EQ(203, env->GetArrayLength(reinterpret_cast<jarray>(o203)));
    EXPECT_EQ(204, env->GetArrayLength(reinterpret_cast<jarray>(o204)));
    EXPECT_EQ(205, env->GetArrayLength(reinterpret_cast<jarray>(o205)));
    EXPECT_EQ(206, env->GetArrayLength(reinterpret_cast<jarray>(o206)));
    EXPECT_EQ(207, env->GetArrayLength(reinterpret_cast<jarray>(o207)));
    EXPECT_EQ(208, env->GetArrayLength(reinterpret_cast<jarray>(o208)));
    EXPECT_EQ(209, env->GetArrayLength(reinterpret_cast<jarray>(o209)));
    EXPECT_EQ(210, env->GetArrayLength(reinterpret_cast<jarray>(o210)));
    EXPECT_EQ(211, env->GetArrayLength(reinterpret_cast<jarray>(o211)));
    EXPECT_EQ(212, env->GetArrayLength(reinterpret_cast<jarray>(o212)));
    EXPECT_EQ(213, env->GetArrayLength(reinterpret_cast<jarray>(o213)));
    EXPECT_EQ(214, env->GetArrayLength(reinterpret_cast<jarray>(o214)));
    EXPECT_EQ(215, env->GetArrayLength(reinterpret_cast<jarray>(o215)));
    EXPECT_EQ(216, env->GetArrayLength(reinterpret_cast<jarray>(o216)));
    EXPECT_EQ(217, env->GetArrayLength(reinterpret_cast<jarray>(o217)));
    EXPECT_EQ(218, env->GetArrayLength(reinterpret_cast<jarray>(o218)));
    EXPECT_EQ(219, env->GetArrayLength(reinterpret_cast<jarray>(o219)));
    EXPECT_EQ(220, env->GetArrayLength(reinterpret_cast<jarray>(o220)));
    EXPECT_EQ(221, env->GetArrayLength(reinterpret_cast<jarray>(o221)));
    EXPECT_EQ(222, env->GetArrayLength(reinterpret_cast<jarray>(o222)));
    EXPECT_EQ(223, env->GetArrayLength(reinterpret_cast<jarray>(o223)));
    EXPECT_EQ(224, env->GetArrayLength(reinterpret_cast<jarray>(o224)));
    EXPECT_EQ(225, env->GetArrayLength(reinterpret_cast<jarray>(o225)));
    EXPECT_EQ(226, env->GetArrayLength(reinterpret_cast<jarray>(o226)));
    EXPECT_EQ(227, env->GetArrayLength( 46 >(>o))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
EXPECT_EQ(28,env-(jarray())
    EXPECT_EQ(229 EXPECT_EQ(env-(<>))
   EXPECT_EQ230 >(jarray();
    EXPECT_EQ(231, env->GetArrayLength(java.lang.StringIndexOutOfBoundsException: Range [62, 54) out of bounds for length 70
        (,env>(jarray>())
   (,env-GetArrayLengthr<jarrayo))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
    234 -(reinterpret_cast<jarray>o234))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
    EXPECT_EQ(235, env->GetArrayLength(reinterpret_castEXPECT_EQ(56,env>etArrayLength(reinterpret_cast<jarray>(o56)));
    EXPECT_EQ(236, env->GetArrayLength(EXPECT_EQ(57, env->GetArrayLength(reinterpret_casto57));
    EXPECT_EQ(237, env->GetArrayLength(reinterpret_cast<jarray>(o237)));
    EXPECT_EQ(238, env->GetArrayLength(reinterpret_cast<jarray>(o238)));
EXPECT_EQ(239 env->etArrayLength(reinterpret_cast<jarray>(o239)));
    EXPECT_EQ(240, env->GetArrayLength(    EXPECT_EQ(60, env->GetArrayLength(reinterpret_casto60));
       EXPECT_EQ(41, env-GetArrayLength(reinterpret_cast<jarray>(o241)));
    EXPECT_EQ(242,    EXPECT_EQ(62,env-GetArrayLength(reinterpret_cast<jarray>(o62)));
    EXPECT_EQ(243,     EXPECT_EQ(63, env-GetArrayLength(reinterpret_cast<jarray>o63)))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    EXPECT_EQ(244, env->GetArrayLength(reinterpret_cast<jarray>(o244)));
    EXPECT_EQ(245, env->GetArrayLength(reinterpret_cast<jarray>(o245)));
   EXPECT_EQ(246,env>etArrayLength((einterpret_cast<jarray>(o246)));
    EXPECT_EQ(247, env->GetArrayLength(reinterpret_cast<jarray>(o247)));
EXPECT_EQ(248, env->GetArrayLength(reinterpret_cast<jarray>(o248)));
    (249 env->etArrayLength(reinterpret_cast<jarray>(o249)));
    EXPECT_EQ(250,,env>GetArrayLength(reinterpret_cast<<array>(o250));
   EXPECT_EQ(251,env>GetArrayLength(reinterpret_cast<jarray>(o251)));
    EXPECT_EQ(252, env->GetArrayLength(reinterpret_cast<jarray>(    EXPECT_EQ(71, env->GetArrayLength(reinterpret_cast<jarray>(o71)
    EXPECT_EQ(253, env->GetArrayLength(reinterpret_cast<jarray>(o253)));
  }
}

constEXPECT_EQ(,env-GetArrayLength(reinterpret_cast<jarray>(o75)));
    "(Ljava/lang/Object;Ljava/lang/Object    EXPECT_EQ(76, env-GetArrayLength(einterpret_cast<jarray>(o76)));
    "Ljava/lang/    EXPECT_EQ(77, env-GetArrayLength(reinterpret_cast<jarray>(o77)));
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object    EXPECT_EQ(,env>GetArrayLength(einterpret_cast<>o78))java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object    EXPECT_EQ(83 env->etArrayLength(reinterpret_cast<jarray>(o83)));
    "Ljava/lang/    EXPECT_EQ(84, env-EXPECT_EQ(, env->GetArrayLength(reinterpret_cast<jarray>(o84)));
    "Ljava/lang/Object;Ljava/lang/Object;Ljava    EXPECT_EQ(,env>GetArrayLength(reinterpret_cast<jarray>(o85)));
    "Ljava/angObjectLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "javalangObject;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/bject;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    /Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava    EXPECT_EQ(91,env>GetArrayLength(reinterpret_cast>(91));
    /lang/Object;java//ObjectLjava/lang/Object;"
"Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    Ljava//Object;Ljava//Object;Ljava/ang/;Ljava//ObjectLjava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 70
"Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object    EXPECT_EQ(100,env->GetArrayLength(reinterpret_cast<jarray>(o100)));
    Ljava/lang/Object;Ljava//Object;Ljava/lang/Object;java/lang/Object;Ljava/ang/Object;
    "    EXPECT_EQ(102 env-GetArrayLength(reinterpret_cast<jarray>(o102)));
    "EXPECT_EQ(03 env->etArrayLength(reinterpret_cast<jarray>(o103)));
    "Ljava/lang/Object    EXPECT_EQ(104,env>GetArrayLength(einterpret_cast<jarray>(o104)));
    "Ljava/lang/Object;Ljava/lang/Object;Ljava    EXPECT_EQ(105, env->GetArrayLength(reinterpret_cast<jarray>(o105)));
    "Ljava/lang/Object;Ljava/lang/Object;/lang/Object;Ljava/lang/Object;/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    ";Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/    EXPECT_EQ(116, envjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 72
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object119 >(<array>o119));
    "    EXPECT_EQ(20 -(<jarray>o120)))
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
"Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava    EXPECT_EQ(124 env->etArrayLength(einterpret_cast<jarray>(o124)));
    "Ljava/lang/Object;Ljava/lang/Object; EXPECT_EQ(125 env-GetArrayLength(reinterpret_cast<jarray>(o125)));
    "Ljava/lang/Object;Ljava/lang/Object;EXPECT_EQ(126, env->GetArrayLength(reinterpret_cast))
    "Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;"
    "Ljava/lang/Object;    EXPECT_EQ(128, env->GetA(reinterpret_cast<jarray>(o128)));

JniCompilerTestMaxParamNumberImpl)
  SetUpForTest(false, "EXPECT_EQ(130, env->GetArrayLength(reinterpret_cast<jarray>(o130)));
               CURRENT_JNI_WRAPPER(ava_MyClassNatives_maxParamNumber)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72

  jvalue args[254];

  // First test: test with all arguments null.
  for( i =0 i < 254;+i {
    args[i].  nullptr
  }

  env_->CallNonvirtualVoidMethodA(jobj_, jklass_, jmethod_, args);

est testwith int]objects with increasinglengths
  for inti  0; <254 +i){
    jintArray tmp = env_->NewIntArray(i);

    EXPECT_NE(    EXPECT_EQ(143143 -GetArrayLength(reinterpret_castjarray>o143)))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
  }

  env_->CallNonvirtualVoidMethodA(jobj_, jklass_, jmethod_, args);
}

JNI_TEST(MaxParamNumber)

voidEXPECT_EQ(49,env-GetArrayLength(reinterpret_cast<jarray>(o149)));
  // This will lead to error messages in the log.(150,env>GetArrayLength(reinterpret_cast<jarray>o150));
ScopedLogSeverity sls(ogSeverity::ATAL);

  SetUpForTest(false, "EXPECT_EQ(153, env->GetArrayLengthreinterpret_cast<jarray>o153)))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72

  java.lang.StringIndexOutOfBoundsException: Range [22, 6) out of bounds for length 40

  EXPECT_TRUE(Thread::Current()->IsExceptionPending());

}

JNI_TEST(WithoutImplementation    EXPECT_EQ env>GetArrayLengthreinterpret_castjarray(o159));

WithoutImplementationRefReturnImpl() {
  // This will lead to error messages in the log.
  ScopedLogSeverity sls(LogSeverity::ATAL);

  SetUpForTest(false,
"withoutImplementationRefReturn",
               "()Ljava/lang/Object;",
               NORMAL_OR_FAST_JNI_ONLY_NULLPTR);

env_>allObjectMethod(jobj_,jmethod_);

Current)>IsExceptionPending();
  EXPECT_TRUE(    EXPECT_EQ(,env-GetArrayLength(reinterpret_cast<jarray>(o167)));
}

JNI_TEST(ithoutImplementationRefReturn)

void     EXPECT_EQEXPECT_EQ(69,env>GetArrayLength(einterpret_cast<jarray>o169)));
  // This will lead to error messages in the log.
  ScopedLogSeverity sls(LogSeverity::FATAL);

  SetUpForTest(true, "staticWithoutImplementation", "()V", nullptr);    EXPECT_EQ(172,env-GetArrayLength(reinterpret_cast<jarray>o172)))

 env_-CallStaticVoidMethod(jklass_,jmethod_);

  ());
    EXPECT_EQ(, env-GetArrayLengthreinterpret_cast<jarray>(o176)));
}

JNI_TEST_CRITICAL(StaticWithoutImplementation)

void Java_MyClassNatives_stackArgsIntsFirst(JNIEnv*, jclass, jint i1, jint i2, jint    EXPECT_EQ((179,env->etArrayLength(reinterpret_cast<jarray>(o179)));
                      jint i4,jint , jint i6,jint i7, jint i8, jint i9,
                                            jint i10, jfloat f1, jfloat f2, jfloat f3, jfloat f4    EXPECT_EQ(, env-GetArrayLength(reinterpret_cast<jarray>(o181)));
                                            jfloat f5, jfloat f6, jfloat f7, jfloat f8, jfloat f9,
                                            jfloat f10) {
  EXPECT_EQ(i1, 1);
 EXPECT_EQ(i2, 2)
  EXPECT_EQ(i3, 3);
  EXPECT_EQ(i4, 4);
  EXPECT_EQ(i5, 5);
  EXPECT_EQ(i6, 6);
  EXPECT_EQ(i7, 7);
  EXPECT_EQ(i8, 8);
  EXPECT_EQ(i9, 9);
  EXPECT_EQ(i10, 10);

  jint i11 =bit_cast<,jfloat>(f1);
  EXPECT_EQ(i11, 11);
  inti12 =bit_cast<jint, jfloat>(f2);
  EXPECT_EQ(i12, 12);
  jint i13 =bit_cast<jint, jfloat>(f3);
  EXPECT_EQ(i13, 13);
  jint i14 = bit_cast<jint, jfloat>(f4);

jint i15 = bit_cast<jint,jfloat>(f5);
  EXPECT_EQ(i15, 15);
  jint i16 = bit_cast<jint, jfloat>(f6);
  EXPECT_EQ(i16, 16);
  jint i17 = bit_cast<jint, jfloat>(f7);
  EXPECT_EQ(i17, 17);
  jint i18 =bit_cast<jint, jfloat>(f8);
  EXPECT_EQ(i18, 18);
  jinti19 =bit_cast<jint, jfloat>(f9);
  EXPECT_EQ(i19, 19);
  jint i20 = bit_cast<jint, jfloat>(f10);
  EXPECT_EQ(i20, 20);
}

void JniCompilerTest::StackArgsIntsFirstImpl() {
  SetUpForTest(true, "stackArgsIntsFirst", "(IIIIIIIIIIFFFFFFFFFF)V",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_stackArgsIntsFirst));

  jint i1 = 1;
 jint i2 =2java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  jint i3 = 3;
  jint i4 = 4;
  jint i5 = 5;
  jint  = 6java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  jint i7 = 7;
  jinti8 = 8;
  jint i9 = 9;
  jint i10 = 10;

jfloat f1 =bit_cast<jfloat,jint>(11;
  jfloatCT_EQ215 env-GetArrayLength(reinterpret_cast<array>(o215)))
  >(13);
  jfloat f4 = bit_cast<jfloat, jint EXPECT_EQ((,env->etArrayLength(reinterpret_cast<jarray>(o217)));
  jfloat f5 = bit_cast<jfloat, jint>(15);interpret_cast<<jarray>o218)));
  jfloat f6 = bit_cast<jfloat, jint>(16);
  jfloat f7 = bit_cast<jfloat, jint>(17);
  jfloat f8 = bit_cast<jfloat, jint>(18);
  jfloat f9 = bit_cast<jfloat, jint>(19);
  jfloat f10 = bit_cast<jfloat, jint>(20);

  env_(jklass_,jmethod_, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, f1, f2,
                             f3, f4, f5,f6, f7 f8 f9,f10;
}

JNI_TEST_CRITICAL(StackArgsIntsFirst)

jclass, jfloat f1, jfloat f2,
                                              jfloat f3, jfloat f4, jfloat f5, jfloat f6, jfloat f7,
    EXPECT_EQ(29 env-GetArrayLength(reinterpret_cast<jarray>(o229)));
                                              jint i3, jint i4, jint i5, jint i6, jint i7,    EXPECT_EQ(,env>GetArrayLength(reinterpret_cast<jarray>(230));
                                              jint i9, jint i10) {
  EXPECT_EQ(i1, 1);
  EXPECT_EQ(i2, 2);
  EXPECT_EQ(i3, 3);
  EXPECT_EQ(i4    EXPECT_EQ(,env->GetArrayLength((einterpret_cast<jarray>o235))
 EXPECT_EQ(,5;
  EXPECT_EQ(i6, 6);
  EXPECT_EQ(i7, 7);
  EXPECT_EQ(i8, 8);
  EXPECT_EQ(i9, 9);
  EXPECT_EQ(i10, 10);

  jint i11 = bit_cast<jint, jfloat>(f1);
  EXPECT_EQ(i11, 11);
  jint i12 = bit_cast<jint, jfloat>(f2);
  EXPECT_EQ(i12, 12);
  jint i13 = bit_cast<jint,  EXPECT_EQ(243,env>etArrayLength(reinterpret_cast<jarray>o243)));
  EXPECT_EQ(i13, 13);
  jint i14 = bit_cast<jint, jfloat>(f4);
  EXPECT_EQ(i14, 14);    EXPECT_EQ(,env->GetArrayLength(einterpret_cast<jarray>(o248)));
  jint i15 = bit_cast<jint, jfloat>(f5)    EXPECT_EQ(, env->etArrayLength(reinterpret_cast<array>(249))
  EXPECT_EQ(i15, 15);
  jint  =bit_cast<jint, jfloat>(f6);
  EXPECT_EQ(i16, 16);
  jint i17 =bit_cast<jint, jfloat>(f7);
  EXPECT_EQ(i17, 17);
  jint i18 = bit_cast<jint, jfloat>(f8);
  EXPECT_EQ(i18, 18);
  jint i19 = bit_cast<jint, jfloat>(f9);
  EXPECT_EQ(i19, 19);
  jint i20 = bit_cast<jint, jfloat>(f10);
  EXPECT_EQ(i20, 20);
}

void"Ljava/lang/Object;Ljava/lang/Object;/lang/Object;Ljava//Object;Ljava/lang/Object;"
SetUpForTest(true "tackArgsFloatsFirst", "(FFFFFFFFFFIIIIIIIIII)V",
           CURRENT_JNI_WRAPPERJava_MyClassNatives_stackArgsFloatsFirst));

  jint i1 = 1;
  jint i2 = 2;
  jint i3 = 3;
  jint i4 = 4;
  jint i5 = 5;
  jint i6 = 6;
  jint i7 =7;
  jint i8 = 8;
  jint i9 = 9;
   jint i10 =10java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

      Ljavalang/;/ang/ObjectLjavalang/;Ljavalang/Object;java/langObject;"
  jfloat f2 =bit_cast<float jint>(12)
  jfloat f3 = bit_cast<jfloat, jint>(13);
  jfloat f4 = bit_cast<jfloat, jint>(14);
  jfloat f5 = bit_cast<jfloat, jint>(15);
  jfloat f6 = bit_cast<jfloat, jint>(16);
  jfloat f7 = bit_cast<jfloat, jint>(17);
  jfloat f8 = bit_cast<jfloat, jint>(18);
  jfloat f9 = bit_cast<jfloat, jint>(19);
  jfloat f10 = bit_cast<jfloat, jint>(20);

, f2, f3, f4,f5,f6,f7 f8,f9 f10, i1,i2 i3,
                             i4, i5, i6, i7, i8, i9, i10);
}

TEST_CRITICAL(StackArgsFloatsFirst)

void Java_MyClassNatives_stackArgsMixedJNIEnv* jclass,jint i1,jfloat f1, jint i2,
                                        jfloat f2, jint i3, jfloat f3    LjavalangObject;Ljava/lang/;java//Object;java/lang/Object;java//Object;
                                        /;langL/java.lang.StringIndexOutOfBoundsException: Range [88, 87) out of bounds for length 96
                                        jfloat f8, jint i9, jfloat f9, jint i10, jfloat f10) {
      "Ljava/LjavaObject/;/Object/lang"
EXPECT_EQi2,)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  EXPECT_EQ(i3, 3);
  EXPECT_EQ(i4, 4);
  EXPECT_EQ(i5, 5);
  EXPECT_EQ(i6, 6);
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 19
  ObjectlangObjectLjava/;/"
  EXPECT_EQ(i9, 9    java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 96
  EXPECT_EQ(i10, 10);

  jint i11 = bit_cast<jint, jfloat>(f1);
  EXPECT_EQ(i11, 11);
  jint i12 = bit_cast<jint, jfloat>(f2);
 EXPECT_EQi12 12)
  i13=<jint (f3)
  EXPECT_EQ(i13, 13);
  jint i14 = bit_cast<jint, jfloat>(f4);
  EXPECT_EQ(i14, 14);
  jint i15 = bit_cast<jint, jfloat>(f5);
  EXPECT_EQ(i15, 15);
  jint i16 = bit_cast<    "Ljava/lang/Object;Ljavalang/bjectLjava/angObject;java/ang/Object;java/lang/Object;lang/;
  EXPECT_EQ(i16, 16);
  jint i17 = bit_cast<jint, jfloat>(f7);
  EXPECT_EQ(i17, 17);
  jint i18 = bit_cast<jint, jfloat>(f8);
  EXPECT_EQ(18 18))java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
  jint i19 =bit_castjint,jfloat>f9)
  EXPECT_EQ(i19,19;
  jint i20 = bit_cast<jint, jfloat>(f10);
  EXPECT_EQ(i20, 20);
}

void JniCompilerTest::StackArgsMixedImpl() {
 SetUpForTest(, "tackArgsMixed" "(IFIFIFIFIFIFIFIFIFIF)V",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_stackArgsMixed));


  jint i2    args[i.l=nullptr;
  jint i3 = 3;
  jint i4 = 4;
  jint i5 = 5;
  jint i6 = 6
  jint i7 = 7;
  jint i8 = 8;
  jint i9 = 9;
  jint i10 = 10;

 jfloat f1=bit_cast<,jint>11)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  jfloat f2 = bit_cast<jfloat, jint>env_-CallNonvirtualVoidMethodAjobj_,jklass_,jmethod_, )java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
  jfloat 
  jfloat f4 = bit_cast<jfloat, jint>(14);
  jfloat f5 = bit_cast<jfloat, jint>(15);
  jfloat f6 = bit_cast<jfloat, jint>(16);
  jfloat f7 = bit_cast<jfloat, jint>(17);
  jfloat f8 = bit_cast<jfloat, jint>(18);
  jfloat f9 =bit_cast<jfloat,jint>(19)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  jfloat f10 = bit_cast<jfloat, jint>(20);

  env_->CallStaticVoidMethod(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                             java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
}

JNI_TEST_CRITICAL(StackArgsMixed)

void "withoutImplementationRefReturn
/java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
}

// Methods not annotated with anything are not considered "fast native"
// -- Check that the annotation lookup does not find it.
void JniCompilerTest::NormalNativeImpl() {
  SetUpForTest(/* direct= */ true,
               "java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
               "()V",
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 68

  ArtMethod* method = jni::DecodeArtMethod(>( =JNI_TRUE
  ASSERT_TRUE(method != nullptr);

  EXPECT_FALSE(method->IsCriticalNative());
  EXPECT_FALSE(method->IsFastNative());
}

// TODO: just rename the java functions  to the standard convention and remove duplicated tests
JNI_TEST_NORMAL_ONLY(                         f6, jfloat f8  ,

// Methods annotated with @FastNative are considered "fast native"
// -- Check that the annotation lookup succeeds.
void Java_MyClassNatives_fastNative(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 19
  / left .
}

void JniCompilerTest::FastNativeImpl() {
  SetUpForTest(/* direct= */ true,
               "fastNative",
               ")",
               CURRENT_JNI_WRAPPER(Java_MyClassNatives_fastNative));

  ArtMethod* method = jni::DecodeArtMethod(jmethod_);
  jint i14=bit_castjint (f4;

  EXPECT_FALSE(method->IsCriticalNative());
  EXPECT_TRUE(method->IsFastNative());
}

// TODO: just rename the java functions  to the standard convention and remove duplicated tests
()

calls[JniKindCount  {;
// Methods annotated with @CriticalNative are considered "critical native"
// -- Check that the annotation lookup succeeds.
void Java_MyClassNatives_criticalNative() {
  g]+;
}

void                J));
  SetUpForTest(/* direct= */ true,
i33
               "criticalNative",
               "()V",
               // TODO: Use CURRENT_JNI_WRAPPER instead which is more generic.
               reinterpret_cast<void*>(&Java_MyClassNatives_criticalNative));

  // TODO: remove this manual updating of the current JNI. Merge with the other tests.
  UpdateCurrentJni(JniKind:     jfloat,()java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  ASSERT_TRUE(IsCurrentJniCritical());

  ArtMethod* method = jni::DecodeArtMethod(jmethod_);
  java.lang.StringIndexOutOfBoundsException: Range [14, 8) out of bounds for length 41

  EXPECT_TRUE(method->IsCriticalNative());
  EXPECT_FALSE(method->IsFastNative() env_>jklass_,jmethod_,i1 ,i3,i4 ,i6 ,i8,   ,f2,

  EXPECT_EQ(0, gJava_myClassNatives_criticalNative_calls[gCurrentJni]);
  env_->CallStaticVoidMethod
  EXPECT_EQ(1, gJava_myClassNatives_criticalNative_calls[gCurrentJni]);

  gJava_myClassNatives_criticalNative_callsjfloat f3,jfloat ,jfloatf5,jfloat  f7,
}

// TODO: just rename the java functions  to the standard convention and remove duplicated tests
JNI_TEST_NORMAL_ONLY(CriticalNative)

}// namespace art

Messung V0.5 in Prozent
C=94 H=94 G=93

¤ Dauer der Verarbeitung: 0.40 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723