Changeset 276 in dev for trunk/abdev/BasicCompiler_Common/include/NativeCode.h
- Timestamp:
- Aug 12, 2007, 1:25:20 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/NativeCode.h
r273 r276 6 6 7 7 #include <BoostSerializationSupport.h> 8 9 void ObpPlus( int step = 1 );10 8 11 9 class UserProc; … … 270 268 { 271 269 } 272 NativeCode( const NativeCode &nativeCode , bool isOpBuffer)270 NativeCode( const NativeCode &nativeCode ) 273 271 : allocateSize( 8192 ) 274 272 , codeBuffer( (char *)malloc( allocateSize ) ) 275 273 , size( 0 ) 276 274 { 277 Put( nativeCode , isOpBuffer);278 } 279 NativeCode( const char *codeBuffer, int size , bool isOpBuffer)275 Put( nativeCode ); 276 } 277 NativeCode( const char *codeBuffer, int size ) 280 278 : allocateSize( 8192 ) 281 279 , codeBuffer( (char *)malloc( allocateSize ) ) 282 280 , size( 0 ) 283 281 { 284 Put( codeBuffer, size , isOpBuffer);282 Put( codeBuffer, size ); 285 283 } 286 284 ~NativeCode() … … 296 294 { 297 295 Clear(); 298 Put( nativeCode , false);296 Put( nativeCode ); 299 297 } 300 298 … … 316 314 return *(long *)(this->codeBuffer+codePos); 317 315 } 318 long _GetLong_ObpOld( int _obpOld ) const319 {320 extern char *OpBuffer;321 return *(long *)(OpBuffer+_obpOld);322 }323 316 324 317 void Overwrite( int codePos, char c ) … … 326 319 codeBuffer[codePos] = c; 327 320 } 328 void OverwriteOld( int _obpOld, char c )329 {330 // 未完成331 extern char *OpBuffer;332 OpBuffer[_obpOld] = c;333 }334 321 void Overwrite( int codePos, long newLongValue ) 335 322 { 336 323 *(long *)(this->codeBuffer+codePos) = newLongValue; 337 324 } 338 void OverwriteOld( int _obpOld, long newLongValue ) 339 { 340 // 未完成 341 extern char *OpBuffer; 342 *(long *)(OpBuffer+_obpOld) = newLongValue; 343 } 344 345 void Put( const char *codeBuffer, int size, bool isOpBuffer = true ) 325 326 void Put( const char *codeBuffer, int size ) 346 327 { 347 328 Realloc( this->size + size ); … … 349 330 memcpy( this->codeBuffer + this->size, codeBuffer, size ); 350 331 this->size += size; 351 352 // 未完成 353 if( isOpBuffer ) 354 { 355 extern char *OpBuffer; 356 extern int obp; 357 memcpy( OpBuffer + obp, codeBuffer, size ); 358 ObpPlus( size ); 359 } 360 } 361 void Put( const NativeCode &nativeCode, bool isOpBuffer ); 332 } 333 void Put( const NativeCode &nativeCode ); 362 334 void Put( _int64 i64data ) 363 335 { … … 373 345 *((long *)(codeBuffer+size))=l; 374 346 size += sizeof(long); 375 376 377 378 // 未完成379 switch( scheduleType )380 {381 case Schedule::None:382 // 何もしない383 break;384 case Schedule::GlobalVar:385 extern CSchedule *pobj_GlobalVarSchedule;386 pobj_GlobalVarSchedule->add();387 break;388 case Schedule::DataTable:389 extern CSchedule *pobj_DataTableSchedule;390 pobj_DataTableSchedule->add();391 break;392 case Schedule::Relocation:393 // 未完成394 break;395 default:396 Jenga::Throw( "scheduleTypeが無効な値を保持している" );397 break;398 }399 extern char *OpBuffer;400 extern int obp;401 *((long *)(OpBuffer+obp))=l;402 ObpPlus( sizeof(long) );403 347 } 404 348 void PutUserProcSchedule( const UserProc *pUserProc, bool isCall ); … … 412 356 Realloc( size + 1 ); 413 357 codeBuffer[size++] = c; 414 415 416 417 // 未完成418 extern char *OpBuffer;419 extern int obp;420 OpBuffer[obp]=c;421 ObpPlus();422 358 } 423 359
Note:
See TracChangeset
for help on using the changeset viewer.