Changeset 308 in dev for trunk/abdev/BasicCompiler64/stack_frame.cpp
- Timestamp:
- Aug 29, 2007, 9:05:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/stack_frame.cpp
r263 r308 11 11 ///////////////////////// 12 12 13 CStackFrame::CStackFrame(){13 StackFrame::StackFrame(){ 14 14 lowest_sp=0; 15 15 now_sp=0; 16 16 max_parm_size=0; 17 17 } 18 CStackFrame::~CStackFrame(){18 StackFrame::~StackFrame(){ 19 19 //オブジェクト破棄時に不整合がないかをチェック(バグ回避) 20 20 error_check(); 21 21 } 22 int CStackFrame::GetFrameSize( int localParamSize ){22 int StackFrame::GetFrameSize( int localParamSize ){ 23 23 int answer_sp; 24 24 … … 31 31 return -(answer_sp-0x10); 32 32 } 33 int CStackFrame::GetNowSp(){33 int StackFrame::GetNowSp(){ 34 34 return now_sp; 35 35 } 36 void CStackFrame::mov_sp( int reg ){36 void StackFrame::mov_sp( int reg ){ 37 37 //mov reg,rsp 38 38 compiler.codeGenerator.op_mov_RR( reg, REG_RSP ); … … 43 43 ); 44 44 } 45 int CStackFrame::push(int reg){45 int StackFrame::push(int reg){ 46 46 now_sp-=sizeof(_int64); 47 47 if(lowest_sp>now_sp) lowest_sp=now_sp; … … 56 56 return now_sp; 57 57 } 58 void CStackFrame::push(int xmm_reg,int varSize){58 void StackFrame::push(int xmm_reg,int varSize){ 59 59 now_sp-=sizeof(_int64); 60 60 if(lowest_sp>now_sp) lowest_sp=now_sp; … … 73 73 } 74 74 } 75 void CStackFrame::ref_offset_data( int reg, int sp_offset ){75 void StackFrame::ref_offset_data( int reg, int sp_offset ){ 76 76 //mov reg,qword ptr[rsp+offset] ※スタックフレームを利用 77 77 pertialSchedules.push_back( … … 79 79 ); 80 80 } 81 void CStackFrame::ref(int reg){81 void StackFrame::ref(int reg){ 82 82 ref_offset_data( reg, now_sp ); 83 83 } 84 void CStackFrame::ref(int xmm_reg,int varSize){84 void StackFrame::ref(int xmm_reg,int varSize){ 85 85 if(varSize==sizeof(double)){ 86 86 //movlpd xmm_reg,qword ptr[rsp+offset] … … 96 96 } 97 97 } 98 void CStackFrame::pop(int reg){98 void StackFrame::pop(int reg){ 99 99 if(reg!=REG_NON) ref(reg); 100 100 101 101 now_sp+=sizeof(_int64); 102 102 } 103 void CStackFrame::pop(int xmm_reg,int varSize){103 void StackFrame::pop(int xmm_reg,int varSize){ 104 104 ref(xmm_reg,varSize); 105 105 106 106 now_sp+=sizeof(_int64); 107 107 } 108 void CStackFrame::parameter_allocate(int size){108 void StackFrame::parameter_allocate(int size){ 109 109 if(max_parm_size<size) max_parm_size=size; 110 110 } 111 void CStackFrame::RunningSchedule( int stackFrameSize ){111 void StackFrame::RunningSchedule( int stackFrameSize ){ 112 112 BOOST_FOREACH( const PertialSchedule *pPertialSchedule, pertialSchedules ) 113 113 { … … 116 116 } 117 117 118 void CStackFrame::error_check(){118 void StackFrame::error_check(){ 119 119 if(now_sp){ 120 120 SetError(300,NULL,cp); … … 123 123 124 124 //スタックフレーム管理用オブジェクトポインタ 125 CStackFrame *pobj_sf;125 StackFrame *pobj_sf;
Note:
See TracChangeset
for help on using the changeset viewer.