cpu:PowerPC。
源代码中有一函数:REX_Thread::LockContext();
正常情况下,编译之后为:bl 0x......(上述函数的地址)
但下面这个函数(请看代码一)很奇怪,编译之后根本找不到bl指令,而且我在源代码中添加一些测试代码后(请看代码二),编译出来的指令序列还是一样。
代码一:
MicrosecondsType DCRCLASS::StopRLPFwdBufferGuardTimer()
{
MicrosecondsType remainingTime = 0;
//This method is frequently called when the timer is already stopped
if ( RLPFwdBufferGuardTimerPtr != NULL )
{
REX_Thread::LockContext();
REXCALLB *tempRLPFwdBufferGuardTimerPtr = RLPFwdBufferGuardTimerPtr;
if ( RLPFwdBufferGuardTimerPtr != NULL )
{
RLPFwdBufferGuardTimerPtr = NULL;
remainingTime = tempRLPFwdBufferGuardTimerPtr->Stop();
}
REX_Thread::UnlockContext();
delete tempRLPFwdBufferGuardTimerPtr;
}
return remainingTime;
}
代码二:
MicrosecondsType DCRCLASS::StopRLPFwdBufferGuardTimerPV()
{
MicrosecondsType remainingTime = 0;
//This method is frequently called when the timer is already stopped
if ( RLPFwdBufferGuardTimerPtr != NULL )
{
Eric_Temp = 0xab4;
REX_Thread::LockContext();
Eric_Temp = 0xab5;
REXCALLB *tempRLPFwdBufferGuardTimerPtr = RLPFwdBufferGuardTimerPtr;
if ( RLPFwdBufferGuardTimerPtr != NULL )
{
RLPFwdBufferGuardTimerPtr = NULL;
remainingTime = tempRLPFwdBufferGuardTimerPtr->Stop();
}
Eric_Temp = 0xab6;
REX_Thread::UnlockContext();
Eric_Temp = 0xab7;
Eric_Temp = 0xab8;
Eric_Temp = 0xab9;
Eric_Temp = 0xaba;
Eric_Temp = 0xabb;
Eric_Temp = 0xabc;
Eric_Temp = 0xabd;
Eric_Temp = 0xabe;
Eric_Temp = 0xabf;
delete tempRLPFwdBufferGuardTimerPtr;
}
Cao_Temp = Eric_Temp;
return remainingTime;
}
指令序列:
StopRLPFwdBufferGuardTimerPV__8DCRCLASSFv:
0x18bbca0 7c0802a6 mfspr r0,LR
0x18bbca4 9421ffe8 stwu r1,-24(r1)
0x18bbca8 93e10014 stw r31,20(r1)
0x18bbcac 93c10010 stw r30,16(r1)
0x18bbcb0 93a1000c stw r29,12(r1)
0x18bbcb4 9001001c stw r0,28(r1)
0x18bbcb8 7c7d1b78 or r29,r3,r3
0x18bbcbc 801d0154 lwz r0,340(r29)
0x18bbcc0 28000000 cmpli crf0,0,r0,0x0 # 0
0x18bbcc4 3be00000 li r31,0x0 # 0
0x18bbcc8 41820098 bc 0xc,2, 0x18bbd60 # 0x018bbd60
0x18bbccc 3d800043 lis r12,0x43 # 67
0x18bbcd0 398ca150 addi r12,r12,0xa150 # -24240
0x18bbcd4 7d8903a6 mtspr CTR,r12
0x18bbcd8 4e800421 bcctrl 0x14,0
0x18bbcdc 28030000 cmpli crf0,0,r3,0x0 # 0
0x18bbce0 40820014 bc 0x4,2, 0x18bbcf4 # 0x018bbcf4
0x18bbce4 3d800022 lis r12,0x22 # 34
0x18bbce8 398c5c98 addi r12,r12,0x5c98 # 23704
0x18bbcec 7d8903a6 mtspr CTR,r12
0x18bbcf0 4e800421 bcctrl 0x14,0
0x18bbcf4 83dd0154 lwz r30,340(r29)
0x18bbcf8 281e0000 cmpli crf0,0,r30,0x0 # 0
0x18bbcfc 41820024 bc 0xc,2, 0x18bbd20 # 0x018bbd20
0x18bbd00 3d8001b3 lis r12,0x1b3 # 435
0x18bbd04 398ca4c8 addi r12,r12,0xa4c8 # -23352
0x18bbd08 38000000 li r0,0x0 # 0
0x18bbd0c 7d8903a6 mtspr CTR,r12
0x18bbd10 901d0154 stw r0,340(r29)
0x18bbd14 7fc3f378 or r3,r30,r30
0x18bbd18 4e800421 bcctrl 0x14,0
0x18bbd1c 7c7f1b78 or r31,r3,r3
0x18bbd20 3d800043 lis r12,0x43 # 67
0x18bbd24 398ca150 addi r12,r12,0xa150 # -24240
0x18bbd28 7d8903a6 mtspr CTR,r12
0x18bbd2c 4e800421 bcctrl 0x14,0
0x18bbd30 28030000 cmpli crf0,0,r3,0x0 # 0
0x18bbd34 40820014 bc 0x4,2, 0x18bbd48 # 0x018bbd48
0x18bbd38 3d800022 lis r12,0x22 # 34
0x18bbd3c 398c5cbc addi r12,r12,0x5cbc # 23740
0x18bbd40 7d8903a6 mtspr CTR,r12
0x18bbd44 4e800421 bcctrl 0x14,0
0x18bbd48 3d8001b3 lis r12,0x1b3 # 435
0x18bbd4c 398ca0b4 addi r12,r12,0xa0b4 # -24396
0x18bbd50 7d8903a6 mtspr CTR,r12
0x18bbd54 7fc3f378 or r3,r30,r30
0x18bbd58 38800003 li r4,0x3 # 3
0x18bbd5c 4e800421 bcctrl 0x14,0
0x18bbd60 8001001c lwz r0,28(r1)
0x18bbd64 83a1000c lwz r29,12(r1)
0x18bbd68 7c0803a6 mtspr LR,r0
0x18bbd6c 83c10010 lwz r30,16(r1)
0x18bbd70 7fe3fb78 or r3,r31,r31
0x18bbd74 83e10014 lwz r31,20(r1)
0x18bbd78 38210018 addi r1,r1,0x18 # 24
0x18bbd7c 4e800020 blr