Changeset 225 in dev for trunk/abdev/BasicCompiler32/OperatorProc.cpp
- Timestamp:
- Jul 21, 2007, 11:47:40 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/OperatorProc.cpp
r206 r225 2 2 3 3 #include <jenga/include/smoothie/LexicalAnalysis.h> 4 5 #include <Compiler.h> 4 6 5 7 #include "../BasicCompiler_Common/common.h" … … 12 14 if( method ){ 13 15 //push reg 14 op_push(reg);16 compiler.codeGenerator.op_push(reg); 15 17 16 18 //call DestructorProcAddr 17 op_call( &method->GetUserProc() );19 compiler.codeGenerator.op_call( &method->GetUserProc() ); 18 20 } 19 21 20 22 //push reg 21 op_push(reg);23 compiler.codeGenerator.op_push(reg); 22 24 23 25 //call free 24 26 extern const UserProc *pSub_free; 25 op_call(pSub_free);27 compiler.codeGenerator.op_call(pSub_free); 26 28 } 27 29 … … 108 110 109 111 //push object_size 110 op_push_V(object_size);112 compiler.codeGenerator.op_push_V(object_size); 111 113 112 114 //call calloc 113 115 extern const UserProc *pSub_calloc; 114 op_call(pSub_calloc);116 compiler.codeGenerator.op_call(pSub_calloc); 115 117 116 118 //mov ebx,eax 117 op_mov_RR(REG_EBX,REG_EAX);119 compiler.codeGenerator.op_mov_RR(REG_EBX,REG_EAX); 118 120 } 119 121 … … 123 125 if(right_side_size==sizeof(_int64)){ 124 126 //pop eax 125 op_pop(REG_EAX);127 compiler.codeGenerator.op_pop(REG_EAX); 126 128 127 129 //pop edx 128 op_pop(REG_EDX);130 compiler.codeGenerator.op_pop(REG_EDX); 129 131 } 130 132 else{ 131 133 //pop eax 132 op_pop(REG_EAX);134 compiler.codeGenerator.op_pop(REG_EAX); 133 135 } 134 136 } 135 137 136 138 //pop ecx 137 op_pop(REG_ECX);139 compiler.codeGenerator.op_pop(REG_ECX); 138 140 139 141 … … 141 143 if(bUseHeap[sp-1]){ 142 144 //mov esi,eax 143 op_mov_RR(REG_ESI,REG_EAX);145 compiler.codeGenerator.op_mov_RR(REG_ESI,REG_EAX); 144 146 } 145 147 if(bUseHeap[sp-2]){ 146 148 //mov edi,ecx 147 op_mov_RR(REG_EDI,REG_ECX);149 compiler.codeGenerator.op_mov_RR(REG_EDI,REG_ECX); 148 150 } 149 151 … … 153 155 if(right_side_size==sizeof(_int64)){ 154 156 //push edx 155 op_push(REG_EDX);157 compiler.codeGenerator.op_push(REG_EDX); 156 158 157 159 //push eax 158 op_push(REG_EAX);160 compiler.codeGenerator.op_push(REG_EAX); 159 161 } 160 162 else{ 161 163 //push eax 162 op_push(REG_EAX);164 compiler.codeGenerator.op_push(REG_EAX); 163 165 } 164 166 … … 167 169 168 170 //mov eax,esp 169 op_mov_RR( REG_EAX, REG_ESP );171 compiler.codeGenerator.op_mov_RR( REG_EAX, REG_ESP ); 170 172 171 173 //push eax 172 op_push( REG_EAX );174 compiler.codeGenerator.op_push( REG_EAX ); 173 175 } 174 176 } … … 176 178 if( pUserProc->ReturnType().IsStruct() ){ 177 179 //push ebx 178 op_push(REG_EBX);180 compiler.codeGenerator.op_push(REG_EBX); 179 181 } 180 182 181 183 //push ecx 182 op_push(REG_ECX);184 compiler.codeGenerator.op_push(REG_ECX); 183 185 184 186 //call operator_proc 185 op_call(pUserProc);187 compiler.codeGenerator.op_call(pUserProc); 186 188 187 189 if(bTwoTerm){ 188 190 if( pUserProc->RealParams()[1]->IsRef() ){ 189 191 //一時参照を破棄 190 op_pop( REG_NON );192 compiler.codeGenerator.op_pop( REG_NON ); 191 193 } 192 194 }
Note:
See TracChangeset
for help on using the changeset viewer.