本文整理汇总了C++中CodeGenerator::finalize方法的典型用法代码示例。如果您正苦于以下问题:C++ CodeGenerator::finalize方法的具体用法?C++ CodeGenerator::finalize怎么用?C++ CodeGenerator::finalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeGenerator
的用法示例。
在下文中一共展示了CodeGenerator::finalize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compile
//.........这里部分代码省略.........
if (LocalCopyPropagate) {
bbIterator->localCopyPropagate();
if (verifyOften) bbIterator->verify();
}
//if (PrintCode) print_code(false);
if (GlobalCopyPropagate) {
bbIterator->globalCopyPropagate();
if (verifyOften) bbIterator->verify();
}
//if (PrintCode) print_code(false);
if (BruteForcePropagate) {
bbIterator->bruteForceCopyPropagate();
if (verifyOften) bbIterator->verify();
}
//if (PrintCode) print_code(false);
if (EliminateUnneededNodes) {
bbIterator->eliminateUnneededResults();
if (verifyOften) bbIterator->verify();
}
//if (PrintCode) print_code(false);
if (OptimizeIntegerLoops) {
// run after copy propagation so that loop increment is easier to recognize
// also run after eliminateUnneededResults so that cpInfo is set for eliminated PRegs
topScope->optimizeLoops();
if (verifyOften) bbIterator->verify();
}
//if (PrintCode) print_code(false);
// compute existence & format of run-time context objects and blocks
computeBlockInfo();
// allocate floats
_totalNofFloatTemporaries = topScope->allocateFloatTemporaries(0);
// HACK: Fix preallocation
// Necessary because a few primitives (allocateContext/Closure) need self or
// the previous context after calling a primitive; i.e., self or the previous
// context should not be allocated to a register. Currently not working correctly
// -> allocated to stack as a temporary fix for the problem.
theAllocator->preAllocate(topScope->self()->preg());
bbIterator->localAlloc(); // allocate regs within basic blocks
theAllocator->allocate(bbIterator->globals);
if (PrintCode) print_code(false);
#ifdef ASSERT
bbIterator->verify();
#endif
if (PrintDebugInfoGeneration) {
std->cr();
std->cr();
std->print_cr("Start of debugging info.");
}
topScope->generateDebugInfo(); // must come before gen to set scopeInfo
topScope->generateDebugInfoForNonInlinedBlocks();
// generate machine code
theMacroAssm = new MacroAssembler(_code);
if (UseNewBackend) {
PRegMapping* mapping = new PRegMapping(theMacroAssm, topScope->nofArguments(), 6, topScope->nofTemporaries());
CodeGenerator* cgen = new CodeGenerator(theMacroAssm, mapping);
cgen->initialize(topScope);
bbIterator->apply(cgen);
cgen->finalize(topScope);
} else {
// use a node visitor to generate code
OldCodeGenerator* cgen = new OldCodeGenerator();
bbIterator->apply(cgen);
}
theMacroAssm->finalize();
theMacroAssm = NULL;
#ifndef ASSERT
if (verifyOften) {
#endif
bool ok = bbIterator->verifyLabels();
if (!ok) print_code(false);
#ifndef ASSERT
}
#endif
rec->generate(); // write debugging info
nmethod* nm = new_nmethod(this); // construct new nmethod
em.event.args[1] = nm;
if (PrintAssemblyCode) Disassembler::decode(nm);
reporter->finish_reporting();
if (should_trace) {
lprintf(": %#lx (%d bytes; level %ld v%d)\n", nm, nm->instsLen(), nm->level(), nm->version());
flush_logFile();
}
if (verifyOften) nm->verify();
if (PrintDebugInfo) nm->print_inlining(std, true);
return nm;
}