Changeset 276 in dev for trunk/abdev/BasicCompiler_Common/include
- Timestamp:
- Aug 12, 2007, 1:25:20 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/include
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h
r263 r276 10 10 #endif 11 11 12 void ReallocNativeCodeBuffer();13 14 12 // コード生成時の部分的なスケジューリング 15 13 class PertialSchedule … … 18 16 int typeSize; // 対象サイズ(一般的には8bit/32bit) 19 17 20 int _obpOld; // 未完成21 18 public: 22 19 PertialSchedule( int codePos, int typeSize ) … … 24 21 , typeSize( typeSize ) 25 22 { 26 extern int obp;27 _obpOld = obp;28 23 } 29 24 ~PertialSchedule() … … 38 33 { 39 34 return typeSize; 40 }41 int GetObpOld() const42 {43 return _obpOld;44 35 } 45 36 }; … … 201 192 // Continue用のコード位置情報の管理 202 193 std::vector<long> continueCodePositions; 203 std::vector<long> _continueCodePositions_ObpOld;204 194 205 195 public: … … 210 200 // Exit Subスケジュールの管理 211 201 std::vector<long> exitSubCodePositions; 212 std::vector<int> _exitSubCodePositions_ObpOld;213 202 214 203 // Gotoスケジュールの管理 … … 239 228 pNativeCode = &nativeCode; 240 229 } 230 long GetNativeCodeSize() const 231 { 232 return pNativeCode->GetSize(); 233 } 241 234 242 235 void NextSourceLine() … … 256 249 { 257 250 continueCodePositions.clear(); 258 _continueCodePositions_ObpOld.clear();259 251 } 260 252 void ContinueAreaBegin() 261 253 { 262 254 continueCodePositions.push_back( pNativeCode->GetSize() ); 263 264 extern int obp;265 _continueCodePositions_ObpOld.push_back( obp );266 255 } 267 256 void ContinueAreaEnd() 268 257 { 269 258 continueCodePositions.pop_back(); 270 _continueCodePositions_ObpOld.pop_back();271 }272 long GetContinueCodePosOld() const273 {274 if( _continueCodePositions_ObpOld.size() == 0 )275 {276 return -1;277 }278 return _continueCodePositions_ObpOld[_continueCodePositions_ObpOld.size()-1];279 259 } 280 260 … … 489 469 void PutOld( const NativeCode &nativeCode ) 490 470 { 491 pNativeCode->Put( nativeCode , true);471 pNativeCode->Put( nativeCode ); 492 472 } 493 473 void PutOld( char c ) -
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 -
trunk/abdev/BasicCompiler_Common/include/Procedure.h
r271 r276 373 373 return *pCompilingUserProc; 374 374 } 375 376 377 378 mutable long _beginOpAddressOld;379 mutable long _endOpAddressOld;380 375 }; 381 376 -
trunk/abdev/BasicCompiler_Common/include/Prototype.h
r215 r276 30 30 { 31 31 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol ); 32 ar & BOOST_SERIALIZATION_NVP( isUsing ); 32 33 } 33 34 -
trunk/abdev/BasicCompiler_Common/include/option.h
r270 r276 34 34 35 35 // モジュールサイズに関するログを生成する 36 //#define USE_TRACE_FOR_SIZE36 #define USE_TRACE_FOR_SIZE 37 37 38 38 // XMLシリアライズに関するログを生成する
Note:
See TracChangeset
for help on using the changeset viewer.