Ejemplo n.º 1
0
void
FooBarTest::compileTestMethods()
   {
   int32_t rc = 0;

   TR::TypeDictionary types;

   //_bar = &FooBarTest::bar;
   BarIlInjector barIlInjector(&types, this);
   int32_t numberOfArguments = 1;
   TR::IlType *Int32 = types.PrimitiveType(TR::Int32);
   TR::IlType **argTypes = new TR::IlType*[numberOfArguments];
   argTypes[0] = Int32;
   bool argIsArray[1] = { false };
   TR::ResolvedMethod barCompilee(__FILE__, LINETOSTR(__LINE__), "bar", numberOfArguments, argTypes, Int32, 0, &barIlInjector);
   _barCompilee = &barCompilee;
   TR::IlGeneratorMethodDetails barDetails(&barCompilee);

   _bar = (BarMethodType *) (compileMethod(barDetails, warm, rc));
   barCompilee.setEntryPoint((void *)_bar);

   FooIlInjector fooIlInjector(&types, this);
   TR::ResolvedMethod fooCompilee(__FILE__, LINETOSTR(__LINE__), "foo", numberOfArguments, argTypes, Int32, 0, &fooIlInjector);
   TR::IlGeneratorMethodDetails fooDetails(&fooCompilee);
   _foo = (FooMethodType *) (compileMethod(fooDetails, warm, rc));

   }
Ejemplo n.º 2
0
/**
 * @brief Compiles the method.
 *
 * This is called by Verify() and VerifiyAndInvoke().
 * The default implementation gets a #ResolvedMethod from #MethodInfo,
 * adds the IlVerifier, then compiles the method.
 */
void TestCompiler::OptTestDriver::compileTestMethods()
   {
   TR::ResolvedMethod resolvedMethod = _methodInfo->ResolvedMethod();
   TR::IlGeneratorMethodDetails details(&resolvedMethod);
   details.setIlVerifier(_ilVer);

   int32_t rc = 0;
   _compiledMethod = compileMethod(details, warm, rc);
   }
Ejemplo n.º 3
0
int32_t
TestDriver::compileMethodBuilder(TR::MethodBuilder *m, uint8_t ** entry)
   {
   TR::ResolvedMethod resolvedMethod(m);
   TR::IlGeneratorMethodDetails details(&resolvedMethod);

   int32_t rc=0;
   *entry = (uint8_t *) compileMethod(details, warm, rc);
   return rc;
   }
Ejemplo n.º 4
0
bool Jitrino::CompileMethod(CompilationContext* cc) {
    CompilationInterface* compilationInterface = cc->getVMCompilationInterface();
    bool success = false;
    MethodDesc& methodDesc = *compilationInterface->getMethodToCompile();
    initialize_parameters(cc, methodDesc);
    
    if (methodDesc.getByteCodeSize() <= 0) {
        Log::out() << " ... Skipping because of 0 byte codes ..." << ::std::endl;
        assert(0);
    } else {
        success = compileMethod(cc);
    }
    return success;
}
Ejemplo n.º 5
0
void
Qux2Test::compileTestMethods()
   {
   int32_t rc = 0;

   TR::TypeDictionary types;
   Qux2IlInjector quxIlInjector(&types, this);
   int32_t numberOfArguments = 1;
   TR::IlType ** argTypes = new TR::IlType*[numberOfArguments];
   TR::IlType *Int32 = types.PrimitiveType(TR::Int32);
   argTypes[0]= Int32;
   TR::ResolvedMethod qux2Compilee(__FILE__, LINETOSTR(__LINE__), "qux2", numberOfArguments, argTypes, Int32, 0, &quxIlInjector);
   TR::IlGeneratorMethodDetails qux2Details(&qux2Compilee);
   _qux2 = (testMethodType *) (compileMethod(qux2Details, warm, rc));
   }
Ejemplo n.º 6
0
void
SimplifierFoldAndTest::compileTestMethods()
   {
   int32_t rc = 0;

   TR::TypeDictionary types;

   TR::IlType* Int32 = types.PrimitiveType(TR::Int32);
   TR::IlType* Int64 = types.PrimitiveType(TR::Int64);

   int32_t numberOfArguments = 1;

   TR::IlType** argTypes = new TR::IlType*[numberOfArguments]
   {
      Int32
   };

   SimplifierFoldAndIlInjector ilInjector(&types, this);

   TR::ResolvedMethod compilee(__FILE__, LINETOSTR(__LINE__), "simplifierFoldAnd", numberOfArguments, argTypes, Int64, 0, &ilInjector);

   TR::IlGeneratorMethodDetails details(&compilee);

   testCompiledMethod = reinterpret_cast<SimplifierFoldAndTest::TestCompiledMethodType>(compileMethod(details, warm, rc));
   }