You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by 史成荣 <ic...@gmail.com> on 2007/12/06 13:13:54 UTC
[drlvm][jitrino][optimizer]
I try to get CFG of the callee of current method with the following code
just like the escape analysis pass does. But I found the methodDesc of some
callees was abnormal, the ByteCode size is 0 and the ByteCode Address is
invalid. Why does this happen?
//call is a method invoke instruction
MethodDesc* methodDesc = 0;
if (call == NULL) { // scanned Op_DirectCall, not scanned
Op_IndirectMemoryCall
return true;
}
methodDesc = call->asMethodCallInst()->getMethodDesc();
OpndManager& _opndManager(irManager.getOpndManager());
Opnd *returnOpnd = 0;
if(call->getDst()->isNull())
returnOpnd = _opndManager.getNullOpnd();
else
returnOpnd = _opndManager.createSsaTmpOpnd(call->getDst()->getType());
IRManager* inlinedIRM = new (mm) IRManager(irManager.getMemoryManager(),
irManager, *methodDesc, returnOpnd);
CompilationInterface& ci= inlinedIRM->getCompilationInterface();
bool cibcmap = ci.isBCMapInfoRequired();
if (cibcmap) {
ci.setBCMapInfoRequired(false);
}
CompilationContext inlineCC(irManager.getMemoryManager(), &ci,
irManager.getCurrentJITContext());
inlineCC.setPipeline(irManager.getCompilationContext()->getPipeline());
inlineCC.setHIRManager(inlinedIRM);
TranslatorSession* traSession =
(TranslatorSession*)translatorAction->createSession(
inlineCC.getCompilationLevelMemoryManager());
traSession->setCompilationContext(&inlineCC);
inlineCC.setCurrentSessionAction(traSession);
traSession->run();
inlineCC.setCurrentSessionAction(NULL);
Re: [drlvm][jitrino][optimizer]
Posted by 史成荣 <ic...@gmail.com>.
You are right, it's a native method.
Thanks,
Chengrong
在07-12-11,Pavel Ozhdikhin <pa...@gmail.com> 写道:
>
> I'm catching up dev list meassages after vacation. Is the problem still
> exists?
> My guess is that you encountered a call to a native method. You may check
> this with methodDesc->isNative().
>
> Thanks,
> Pavel
>
>
> On 12/6/07, 史成荣 <ic...@gmail.com> wrote:
> >
> > I try to get CFG of the callee of current method with the following code
> > just like the escape analysis pass does. But I found the methodDesc of
> > some
> > callees was abnormal, the ByteCode size is 0 and the ByteCode Address
> is
> > invalid. Why does this happen?
> >
> > //call is a method invoke instruction
> >
> > MethodDesc* methodDesc = 0;
> >
> > if (call == NULL) { // scanned Op_DirectCall, not scanned
> > Op_IndirectMemoryCall
> > return true;
> > }
> > methodDesc = call->asMethodCallInst()->getMethodDesc();
> >
> > OpndManager& _opndManager(irManager.getOpndManager());
> > Opnd *returnOpnd = 0;
> > if(call->getDst()->isNull())
> > returnOpnd = _opndManager.getNullOpnd();
> > else
> > returnOpnd = _opndManager.createSsaTmpOpnd(call->getDst()->getType());
> >
> > IRManager* inlinedIRM = new (mm) IRManager(irManager.getMemoryManager(),
> > irManager, *methodDesc, returnOpnd);
> > CompilationInterface& ci= inlinedIRM->getCompilationInterface();
> > bool cibcmap = ci.isBCMapInfoRequired();
> > if (cibcmap) {
> > ci.setBCMapInfoRequired(false);
> > }
> >
> >
> > CompilationContext inlineCC(irManager.getMemoryManager(), &ci,
> > irManager.getCurrentJITContext());
> > inlineCC.setPipeline(irManager.getCompilationContext()->getPipeline());
> > inlineCC.setHIRManager(inlinedIRM);
> > TranslatorSession* traSession =
> > (TranslatorSession*)translatorAction->createSession(
> > inlineCC.getCompilationLevelMemoryManager());
> > traSession->setCompilationContext(&inlineCC);
> > inlineCC.setCurrentSessionAction(traSession);
> > traSession->run();
> > inlineCC.setCurrentSessionAction(NULL);
> >
>
Re: [drlvm][jitrino][optimizer]
Posted by Pavel Ozhdikhin <pa...@gmail.com>.
I'm catching up dev list meassages after vacation. Is the problem still
exists?
My guess is that you encountered a call to a native method. You may check
this with methodDesc->isNative().
Thanks,
Pavel
On 12/6/07, 史成荣 <ic...@gmail.com> wrote:
>
> I try to get CFG of the callee of current method with the following code
> just like the escape analysis pass does. But I found the methodDesc of
> some
> callees was abnormal, the ByteCode size is 0 and the ByteCode Address is
> invalid. Why does this happen?
>
> //call is a method invoke instruction
>
> MethodDesc* methodDesc = 0;
>
> if (call == NULL) { // scanned Op_DirectCall, not scanned
> Op_IndirectMemoryCall
> return true;
> }
> methodDesc = call->asMethodCallInst()->getMethodDesc();
>
> OpndManager& _opndManager(irManager.getOpndManager());
> Opnd *returnOpnd = 0;
> if(call->getDst()->isNull())
> returnOpnd = _opndManager.getNullOpnd();
> else
> returnOpnd = _opndManager.createSsaTmpOpnd(call->getDst()->getType());
>
> IRManager* inlinedIRM = new (mm) IRManager(irManager.getMemoryManager(),
> irManager, *methodDesc, returnOpnd);
> CompilationInterface& ci= inlinedIRM->getCompilationInterface();
> bool cibcmap = ci.isBCMapInfoRequired();
> if (cibcmap) {
> ci.setBCMapInfoRequired(false);
> }
>
>
> CompilationContext inlineCC(irManager.getMemoryManager(), &ci,
> irManager.getCurrentJITContext());
> inlineCC.setPipeline(irManager.getCompilationContext()->getPipeline());
> inlineCC.setHIRManager(inlinedIRM);
> TranslatorSession* traSession =
> (TranslatorSession*)translatorAction->createSession(
> inlineCC.getCompilationLevelMemoryManager());
> traSession->setCompilationContext(&inlineCC);
> inlineCC.setCurrentSessionAction(traSession);
> traSession->run();
> inlineCC.setCurrentSessionAction(NULL);
>