Esempio n. 1
0
//
// code generator entry point
//
void HIR2LIRSelectorSessionAction::run() {

#if defined(_IPF_)
#else
    CompilationContext* cc = getCompilationContext();
    IRManager& irManager = *cc->getHIRManager();
    CompilationInterface* ci = cc->getVMCompilationInterface();
    MethodDesc* methodDesc  = ci->getMethodToCompile();
    OpndManager& opndManager = irManager.getOpndManager();
    const OptimizerFlags& optFlags = irManager.getOptimizerFlags();
    VarOpnd* varOpnds   = opndManager.getVarOpnds();
    MemoryManager& mm  = cc->getCompilationLevelMemoryManager();

    MethodCodeSelector* mcs = new (mm) _MethodCodeSelector(irManager,methodDesc,varOpnds,&irManager.getFlowGraph(),
        opndManager, optFlags.sink_constants, optFlags.sink_constants1);

    Ia32::CodeGenerator cg;
    cg.genCode(this, *mcs);
#endif
#if defined(ORDER) && !defined(DISABLE_PTHREAD_OPT)
    cc->getLIRManager()->pthread_opt_enable = cc->getHIRManager()->pthread_opt_enable;
#endif



}
Esempio n. 2
0
 virtual void run () {
     CompilationContext* cc = getCompilationContext();
     CompilationInterface* ci = cc->getVMCompilationInterface();
     ci->lockMethodData();
     MethodDesc* methDesc = ci->getMethodToCompile();
     if (methDesc->getCodeBlockSize(0) > 0 || methDesc->getCodeBlockSize(1) > 0){
         cc->setCompilationFinished(true);
         ci->unlockMethodData();
     }
 }
Esempio n. 3
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;
}