Esempio n. 1
0
uint8_t *
compileMethod(
      OMR_VMThread *omrVMThread,
      TR_ResolvedMethod &compilee,
      TR_Hotness hotness,
      int32_t &rc)
   {
   TR::IlGeneratorMethodDetails details(&compilee);
   return compileMethodFromDetails(omrVMThread, details, hotness, rc);
   }
Esempio n. 2
0
TEST_F(IlGenTest, Return3) {
    auto trees = parseString("(block (ireturn (iconst 3)))");

    TR::TypeDictionary types;
    auto Int32 = types.PrimitiveType(TR::Int32);
    TR::IlType* argTypes[] = {Int32};

    auto injector = Tril::TRLangBuilder{trees, &types};
    TR::ResolvedMethod compilee{__FILE__, LINETOSTR(__LINE__), "Return3InIL", sizeof(argTypes)/sizeof(TR::IlType*), argTypes, Int32, 0, &injector};
    TR::IlGeneratorMethodDetails methodDetails{&compilee};
    int32_t rc = 0;
    auto entry_point = compileMethodFromDetails(NULL, methodDetails, warm, rc);

    ASSERT_EQ(0, rc) << "Compilation failed";
    ASSERT_NOTNULL(entry_point) << "Entry point of compiled body cannot be null";

    auto entry = reinterpret_cast<int32_t(*)(void)>(entry_point);
    ASSERT_EQ(3, entry()) << "Compiled body did not return expected value";
}
Esempio n. 3
0
uint8_t *
compileMethod(TR::IlGeneratorMethodDetails & details, TR_Hotness hotness, int32_t &rc)
   {
   return compileMethodFromDetails(NULL, details, hotness, rc);
   }