Changeset 672 in dev for trunk/ab5.0/abdev/compiler_x64
- Timestamp:
- Jun 29, 2008, 2:08:44 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/compiler_x64/Compile_Func.cpp
r667 r672 377 377 } 378 378 } 379 void Opcode_Func_SizeOf( const std::string &typeName ){ 379 void Opcode_Func_SizeOf( const std::string &typeName ) 380 { 380 381 Type tempType; 381 if( !compiler.StringToType( typeName, tempType ) ){ 382 if( !compiler.StringToType( typeName, tempType ) ) 383 { 382 384 compiler.errorMessenger.Output(3,typeName,cp); 383 385 return; 384 386 } 385 387 386 int typeSize = tempType.GetSize();387 388 388 //mov rax,size 389 compiler.codeGenerator.op_mov_RV( sizeof(_int64),REG_RAX,typeSize);389 compiler.codeGenerator.op_mov_RV( sizeof(_int64), REG_RAX, compiler.SizeOf( tempType ) ); 390 390 } 391 391 void Opcode_Func_ClassSizeOf( const std::string &typeName ) 392 392 { 393 393 Type tempType; 394 if( !compiler.StringToType( typeName, tempType ) ){ 394 if( !compiler.StringToType( typeName, tempType ) ) 395 { 395 396 compiler.errorMessenger.Output(3,typeName,cp); 396 397 return; 397 398 } 398 399 399 int typeSize = ( tempType.IsObject() ) ? 400 tempType.GetClass().GetSize() : tempType.GetSize(); 400 if( !tempType.IsObject() ) 401 { 402 compiler.errorMessenger.Output(1,typeName,cp); 403 return; 404 } 401 405 402 406 //mov rax,size 403 compiler.codeGenerator.op_mov_RV( sizeof(_int64),REG_RAX,typeSize);407 compiler.codeGenerator.op_mov_RV( sizeof(_int64), REG_RAX, tempType.GetClass().GetSize() ); 404 408 } 405 409 void Opcode_Func_VarPtr( const char *Parameter, Type &resultType, bool isCallOn ){
Note:
See TracChangeset
for help on using the changeset viewer.