Changeset 244 in dev
- Timestamp:
- Jul 27, 2007, 12:14:00 PM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Object.cpp
r235 r244 191 191 192 192 //mov ecx,DestructorProcAddr 193 OpBuffer[obp++]=(char)0xB9; 194 pobj_SubAddrSchedule->add(&method->GetUserProc(),0); 195 method->GetUserProc().Using(); 196 obp+=sizeof(long); 193 compiler.codeGenerator.op_addressof( REG_ECX, &method->GetUserProc() ); 197 194 198 195 //mov dword ptr[eax],ecx(デストラクタの関数ポインタ) -
trunk/abdev/BasicCompiler32/MakePeHdr.cpp
r241 r244 206 206 compiler.GetMeta().GetDllProcs().Iterator_Init(); 207 207 208 208 /* 209 209 if( !compiler.GetMeta().WriteXml( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) ) 210 210 { … … 216 216 MessageBox(0,"XML読み込みに失敗","test",0); 217 217 } 218 /* 218 219 219 if( !compiler.GetMeta().WriteBinaly( Jenga::Common::Environment::GetAppDir() + "\\meta_test.dat" ) ) 220 220 { … … 234 234 { 235 235 MessageBox(0,"バイナリ読み込みに失敗","test",0); 236 } */237 compiler.GetMeta() = (*pTempMeta); 236 } 237 compiler.GetMeta() = (*pTempMeta);*/ 238 238 239 239 -
trunk/abdev/BasicCompiler32/x86CodeGenerator.cpp
r240 r244 1183 1183 1184 1184 pNativeCode->Put( (char)0xE8 ); 1185 pobj_SubAddrSchedule->add(pUserProc,1); 1186 pNativeCode->Put( (long)0 ); 1185 pNativeCode->PutUserProcSchedule( pUserProc, true ); 1187 1186 } 1188 1187 void CodeGenerator::op_ret(){ … … 1194 1193 pNativeCode->Put( stackFrameSize ); 1195 1194 } 1195 void CodeGenerator::op_addressof( int reg, const UserProc *pUserProc ) 1196 { 1197 //mov reg,userProcAddress 1198 1199 //オペコード、レジスタ 1200 pNativeCode->Put( (char)(0xB8|REGISTER_OPERAND(reg)) ); 1201 1202 //DISP32 1203 pNativeCode->PutUserProcSchedule( pUserProc, false ); 1204 } -
trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h
r243 r244 300 300 void op_ret(); 301 301 void op_ret( short stackFrameSize ); 302 void op_addressof( int reg, const UserProc *pUserProc ); 302 303 #endif 303 304 -
trunk/abdev/BasicCompiler_Common/include/NativeCode.h
r241 r244 9 9 void AddLocalVarAddrSchedule(); 10 10 void ObpPlus( int step = 1 ); 11 12 class UserProc; 11 13 12 14 class Schedule … … 20 22 DataTable, // データテーブル スケジュール 21 23 Relocation, // リロケーション情報スケジュール 24 UserProc, // ユーザ定義関数呼び出し側スケジュール 25 AddressOf, // ユーザ定義関数位置スケジュール 22 26 }; 23 27 24 28 private: 25 29 Type type; 26 int offset; 30 long offset; 31 32 union{ 33 LONG_PTR lpValue; 34 const ::UserProc *pUserProc; 35 }; 27 36 28 37 // XMLシリアライズ用 … … 39 48 { 40 49 } 41 Schedule( Type type, intoffset )50 Schedule( Type type, long offset ) 42 51 : type( type ) 43 52 , offset( offset ) 53 , lpValue( 0 ) 54 { 55 } 56 Schedule( const ::UserProc *pUserProc, long offest ) 57 : type( Schedule::UserProc ) 58 , offset( offset ) 59 , pUserProc( pUserProc ) 44 60 { 45 61 } 46 62 ~Schedule() 47 63 { 64 } 65 66 void SpecifyAddressOf() 67 { 68 if( type != Schedule::UserProc ) 69 { 70 SetError(); 71 } 72 type = Schedule::AddressOf; 48 73 } 49 74 }; … … 191 216 { 192 217 case Schedule::None: 218 // 何もしない 193 219 break; 194 220 case Schedule::GlobalVar: … … 204 230 break; 205 231 case Schedule::Relocation: 232 // 未完成 206 233 break; 207 234 default: … … 214 241 ObpPlus( sizeof(long) ); 215 242 } 243 void PutUserProcSchedule( const UserProc *pUserProc, bool isCall ) 244 { 245 Schedule schedule( pUserProc, size ); 246 if( isCall == false ) 247 { 248 schedule.SpecifyAddressOf(); 249 } 250 schedules.push_back( schedule ); 251 252 *((long *)(codeBuffer+size))=0; 253 size += sizeof(long); 254 255 256 257 // 未完成 258 if( isCall ) 259 { 260 pobj_SubAddrSchedule->add(pUserProc,1); 261 } 262 else 263 { 264 pobj_SubAddrSchedule->add(pUserProc,0); 265 } 266 extern char *OpBuffer; 267 extern int obp; 268 *((long *)(OpBuffer+obp))=0; 269 ObpPlus( sizeof(long) ); 270 } 216 271 void Put( short s ) 217 272 {
Note:
See TracChangeset
for help on using the changeset viewer.