[206] | 1 | #include "stdafx.h"
|
---|
| 2 |
|
---|
[193] | 3 | #include <Compiler.h>
|
---|
| 4 |
|
---|
[3] | 5 | #include "../BasicCompiler_Common/common.h"
|
---|
| 6 | #include "Opcode.h"
|
---|
| 7 |
|
---|
[484] | 8 | #include "FunctionValue.h"
|
---|
[431] | 9 |
|
---|
[3] | 10 | int GetFunctionFromName(char *FuncName){
|
---|
[325] | 11 | if( lstrcmpi( FuncName, "CUDbl" ) == 0 ) return FUNC_CUDBL;
|
---|
| 12 | if( lstrcmpi( FuncName, "Fix" ) == 0 ) return FUNC_FIX;
|
---|
| 13 | if( lstrcmpi( FuncName, "Len" ) == 0 ) return FUNC_LEN;
|
---|
| 14 | if( lstrcmpi( FuncName, "AddressOf" ) == 0 ) return FUNC_ADDRESSOF;
|
---|
| 15 | if( lstrcmpi( FuncName, "SizeOf" ) == 0 ) return FUNC_SIZEOF;
|
---|
[666] | 16 | if( lstrcmpi( FuncName, "__ClassSizeOf" ) == 0 ) return FUNC_CLASS_SIZEOF;
|
---|
[325] | 17 | if( lstrcmpi( FuncName, "VarPtr" ) == 0 ) return FUNC_VARPTR;
|
---|
| 18 | if( lstrcmpi( FuncName, "ObjPtr" ) == 0 ) return FUNC_OBJPTR;
|
---|
| 19 | if( lstrcmpi( FuncName, "__delegate_dynamicmethod_call" ) == 0 ) return FUNC_DELEGATE_DYNAMICMETHOD_CALL;
|
---|
| 20 | if( lstrcmpi( FuncName, "__delegate_staticmethod_call" ) == 0 ) return FUNC_DELEGATE_STATICMETHOD_CALL;
|
---|
[357] | 21 | if( lstrcmpi( FuncName, "_System_GetNowScopeCatchAddresses" ) == 0 )return FUNC_SYSTEM_GET_NOW_SCOPE_CATCH_ADDRESS;
|
---|
[359] | 22 | if( lstrcmpi( FuncName, "_System_GetNowScopeFinallyAddresses" ) == 0 )return FUNC_SYSTEM_GET_NOW_SCOPE_FINALLY_ADDRESS;
|
---|
[357] | 23 | if( lstrcmpi( FuncName, "_System_GetBp" ) == 0 ) return FUNC_SYSTEM_GET_BP;
|
---|
[358] | 24 | if( lstrcmpi( FuncName, "_System_GetSp" ) == 0 ) return FUNC_SYSTEM_GET_SP;
|
---|
[431] | 25 | if( lstrcmp( FuncName, "_System_GetComVtbl" ) == 0 ) return FUNC_SYSTEM_GET_COM_VTBL;
|
---|
| 26 | if( lstrcmp( FuncName, "_System_GetVtblList" ) == 0 ) return FUNC_SYSTEM_GET_VTBL_LIST;
|
---|
| 27 | if( lstrcmp( FuncName, "_System_GetDefaultConstructor" ) == 0 ) return FUNC_SYSTEM_GET_DEFAULT_CONSTRUCTOR;
|
---|
| 28 | if( lstrcmp( FuncName, "_System_GetDestructor" ) == 0 ) return FUNC_SYSTEM_GET_DESTRUCTOR;
|
---|
[325] | 29 | if( lstrcmpi( FuncName, "GetDouble" ) == 0 ) return FUNC_GETDOUBLE;
|
---|
| 30 | if( lstrcmpi( FuncName, "GetSingle" ) == 0 ) return FUNC_GETSINGLE;
|
---|
| 31 | if( lstrcmpi( FuncName, "GetQWord" ) == 0 ) return FUNC_GETQWORD;
|
---|
| 32 | if( lstrcmpi( FuncName, "GetDWord" ) == 0 ) return FUNC_GETDWORD;
|
---|
| 33 | if( lstrcmpi( FuncName, "GetWord" ) == 0 ) return FUNC_GETWORD;
|
---|
| 34 | if( lstrcmpi( FuncName, "GetByte" ) == 0 ) return FUNC_GETBYTE;
|
---|
[3] | 35 | return 0;
|
---|
| 36 | }
|
---|
| 37 |
|
---|
[76] | 38 | void Opcode_Func_Fix(const char *lpszParms){
|
---|
| 39 | Type resultType;
|
---|
| 40 | if( !NumOpe( lpszParms, Type(), resultType ) ){
|
---|
| 41 | return;
|
---|
| 42 | }
|
---|
[3] | 43 |
|
---|
[76] | 44 | if( resultType.IsDouble() ){
|
---|
[3] | 45 | //fld qword ptr[esp]
|
---|
[225] | 46 | compiler.codeGenerator.op_fld_ptr_esp(DEF_DOUBLE);
|
---|
[3] | 47 |
|
---|
| 48 | //fnstcw word ptr[esp]
|
---|
[250] | 49 | compiler.codeGenerator.PutOld(
|
---|
| 50 | (char)0xD9,
|
---|
| 51 | (char)0x3C,
|
---|
| 52 | (char)0x24
|
---|
| 53 | );
|
---|
[3] | 54 |
|
---|
| 55 | //mov ax,word ptr[esp]
|
---|
[250] | 56 | compiler.codeGenerator.op_mov_RM( sizeof(short), REG_EAX, REG_ESP, 0, MOD_BASE );
|
---|
[3] | 57 |
|
---|
| 58 | //or ah,0Ch
|
---|
[250] | 59 | compiler.codeGenerator.PutOld(
|
---|
| 60 | (char)0x80,
|
---|
| 61 | (char)0xCC,
|
---|
| 62 | (char)0x0C
|
---|
| 63 | );
|
---|
[3] | 64 |
|
---|
| 65 | //mov word ptr[esp-2],ax
|
---|
[250] | 66 | compiler.codeGenerator.op_mov_MR( sizeof(short), REG_EAX, REG_ESP, -2, MOD_BASE_DISP8 );
|
---|
[3] | 67 |
|
---|
| 68 | //fldcw word ptr[esp-2]
|
---|
[250] | 69 | compiler.codeGenerator.PutOld(
|
---|
| 70 | (char)0xD9,
|
---|
| 71 | (char)0x6C,
|
---|
| 72 | (char)0x24,
|
---|
| 73 | (char)0xFE
|
---|
| 74 | );
|
---|
[3] | 75 |
|
---|
| 76 | //fistp dword ptr[esp+4]
|
---|
[250] | 77 | compiler.codeGenerator.PutOld(
|
---|
| 78 | (char)0xDB,
|
---|
| 79 | (char)0x5C,
|
---|
| 80 | (char)0x24,
|
---|
| 81 | (char)0x04
|
---|
| 82 | );
|
---|
[3] | 83 |
|
---|
| 84 | //fldcw word ptr[esp]
|
---|
[250] | 85 | compiler.codeGenerator.PutOld(
|
---|
| 86 | (char)0xD9,
|
---|
| 87 | (char)0x2C,
|
---|
| 88 | (char)0x24
|
---|
| 89 | );
|
---|
[3] | 90 |
|
---|
| 91 | //add esp,4
|
---|
[225] | 92 | compiler.codeGenerator.op_add_esp(4);
|
---|
[3] | 93 | }
|
---|
[76] | 94 | else if( resultType.IsSingle() ){
|
---|
[3] | 95 | //fld dword ptr[esp]
|
---|
[225] | 96 | compiler.codeGenerator.op_fld_ptr_esp(DEF_SINGLE);
|
---|
[3] | 97 |
|
---|
| 98 | //sub esp,4
|
---|
[225] | 99 | compiler.codeGenerator.op_sub_esp(4);
|
---|
[3] | 100 |
|
---|
| 101 | //fnstcw word ptr[esp]
|
---|
[250] | 102 | compiler.codeGenerator.PutOld(
|
---|
| 103 | (char)0xD9,
|
---|
| 104 | (char)0x3C,
|
---|
| 105 | (char)0x24
|
---|
| 106 | );
|
---|
[3] | 107 |
|
---|
| 108 | //mov ax,word ptr[esp]
|
---|
[250] | 109 | compiler.codeGenerator.op_mov_RM( sizeof(short), REG_EAX, REG_ESP, 0, MOD_BASE );
|
---|
[3] | 110 |
|
---|
| 111 | //or ah,0Ch
|
---|
[250] | 112 | compiler.codeGenerator.PutOld(
|
---|
| 113 | (char)0x80,
|
---|
| 114 | (char)0xCC,
|
---|
| 115 | (char)0x0C
|
---|
| 116 | );
|
---|
[3] | 117 |
|
---|
| 118 | //mov word ptr[esp-2],ax
|
---|
[250] | 119 | compiler.codeGenerator.op_mov_MR( sizeof(short), REG_EAX, REG_ESP, -2, MOD_BASE_DISP8 );
|
---|
[3] | 120 |
|
---|
| 121 | //fldcw word ptr[esp-2]
|
---|
[250] | 122 | compiler.codeGenerator.PutOld(
|
---|
| 123 | (char)0xD9,
|
---|
| 124 | (char)0x6C,
|
---|
| 125 | (char)0x24,
|
---|
| 126 | (char)0xFE
|
---|
| 127 | );
|
---|
[3] | 128 |
|
---|
| 129 | //fistp dword ptr[esp+4]
|
---|
[250] | 130 | compiler.codeGenerator.PutOld(
|
---|
| 131 | (char)0xDB,
|
---|
| 132 | (char)0x5C,
|
---|
| 133 | (char)0x24,
|
---|
| 134 | (char)0x04
|
---|
| 135 | );
|
---|
[3] | 136 |
|
---|
| 137 | //fldcw word ptr[esp]
|
---|
[250] | 138 | compiler.codeGenerator.PutOld(
|
---|
| 139 | (char)0xD9,
|
---|
| 140 | (char)0x2C,
|
---|
| 141 | (char)0x24
|
---|
| 142 | );
|
---|
[3] | 143 |
|
---|
| 144 | //add esp,4
|
---|
[225] | 145 | compiler.codeGenerator.op_add_esp(4);
|
---|
[3] | 146 | }
|
---|
[76] | 147 | else if( resultType.Is64() ){
|
---|
[3] | 148 | //pop eax
|
---|
[225] | 149 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 150 |
|
---|
| 151 | //add esp,4
|
---|
[225] | 152 | compiler.codeGenerator.op_add_esp(4);
|
---|
[3] | 153 |
|
---|
| 154 | //push eax
|
---|
[225] | 155 | compiler.codeGenerator.op_push(REG_EAX);
|
---|
[3] | 156 | }
|
---|
| 157 |
|
---|
| 158 | //pop eax
|
---|
[225] | 159 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 160 | }
|
---|
| 161 |
|
---|
[46] | 162 | void Opcode_Func_CUDbl(const char *Parameter){
|
---|
[76] | 163 | Type resultType;
|
---|
| 164 | if( !NumOpe(Parameter,Type(),resultType) ){
|
---|
| 165 | return;
|
---|
| 166 | }
|
---|
| 167 | ChangeTypeToLong(resultType.GetBasicType());
|
---|
[3] | 168 |
|
---|
| 169 | //pop eax
|
---|
[225] | 170 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 171 |
|
---|
| 172 | //push 0
|
---|
[235] | 173 | compiler.codeGenerator.op_push_V( 0 );
|
---|
[3] | 174 |
|
---|
| 175 | //push eax
|
---|
[225] | 176 | compiler.codeGenerator.op_push(REG_EAX);
|
---|
[3] | 177 |
|
---|
| 178 | //fild qword ptr[esp]
|
---|
[235] | 179 | compiler.codeGenerator.op_fld_ptr_esp(DEF_INT64);
|
---|
[3] | 180 |
|
---|
| 181 | //add esp,8
|
---|
[225] | 182 | compiler.codeGenerator.op_add_esp(8);
|
---|
[3] | 183 | }
|
---|
[46] | 184 | void Opcode_Func_Len(const char *Parameter){
|
---|
[3] | 185 | BOOL bArrayHead;
|
---|
| 186 |
|
---|
[46] | 187 | const char *tempParm=Parameter;
|
---|
[3] | 188 | char temporary[VN_SIZE];
|
---|
| 189 | char temp2[32];
|
---|
[76] | 190 | Type type;
|
---|
| 191 | if( !GetVarType(Parameter,type,0) ){
|
---|
[3] | 192 | sprintf(temporary,"_System_DummyStr2=%s",Parameter);
|
---|
| 193 | OpcodeCalc(temporary);
|
---|
| 194 |
|
---|
| 195 | lstrcpy(temp2,"_System_DummyStr2");
|
---|
| 196 | tempParm=temp2;
|
---|
| 197 |
|
---|
[265] | 198 | type.SetType( DEF_OBJECT, compiler.GetObjectModule().meta.GetClasses().GetStringClassPtr() );
|
---|
[3] | 199 | }
|
---|
| 200 |
|
---|
[97] | 201 | if( type.IsStringClass() ){
|
---|
[3] | 202 | //Stringオブジェクトの場合
|
---|
| 203 | sprintf(temporary,"%s.Length",tempParm);
|
---|
| 204 |
|
---|
[76] | 205 | int reg=REG_RAX;
|
---|
| 206 | NumOpe(temporary,Type(),Type());
|
---|
[3] | 207 |
|
---|
| 208 | //pop eax
|
---|
[225] | 209 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 210 |
|
---|
| 211 | return;
|
---|
| 212 | }
|
---|
| 213 |
|
---|
[206] | 214 | Subscripts subscripts;
|
---|
[3] | 215 | RELATIVE_VAR RelativeVar;
|
---|
[206] | 216 | if(!GetVarOffsetReadOnly(tempParm,&RelativeVar,type,&subscripts)) return;
|
---|
[3] | 217 |
|
---|
[76] | 218 | if(type.GetBasicType()&FLAG_PTR){
|
---|
| 219 | type.SetBasicType( type.GetBasicType() & ( ~FLAG_PTR ) );
|
---|
[3] | 220 |
|
---|
| 221 | bArrayHead=1;
|
---|
| 222 | }
|
---|
| 223 | else bArrayHead=0;
|
---|
| 224 |
|
---|
[76] | 225 | int typeSize = type.GetSize();
|
---|
[3] | 226 |
|
---|
[206] | 227 | if(bArrayHead) typeSize*=JumpSubScripts(subscripts);
|
---|
[3] | 228 |
|
---|
[235] | 229 | //mov eax,typeSize
|
---|
| 230 | compiler.codeGenerator.op_mov_RV( REG_EAX, typeSize );
|
---|
[3] | 231 | }
|
---|
| 232 |
|
---|
[332] | 233 | void _Opcode_Func_AddressOf( const char *methodInstanceName, const UserProc &userProc )
|
---|
| 234 | {
|
---|
| 235 | if( userProc.IsVirtual() ){
|
---|
[3] | 236 | ///////////////////////////////
|
---|
| 237 | // 仮想関数の場合
|
---|
| 238 | // thisポインタをrcxにコピー
|
---|
| 239 | ///////////////////////////////
|
---|
| 240 |
|
---|
[114] | 241 | const CClass *pobj_c;
|
---|
[3] | 242 |
|
---|
| 243 | char ObjectName[VN_SIZE];
|
---|
[290] | 244 | ReferenceKind referenceKind;
|
---|
[332] | 245 | SplitObjectName( methodInstanceName, ObjectName, referenceKind );
|
---|
[3] | 246 |
|
---|
| 247 | if(ObjectName[0]){
|
---|
| 248 | if(lstrcmpi(ObjectName,"Super")==0) goto InClassMember;
|
---|
| 249 | else{
|
---|
| 250 | RELATIVE_VAR RelativeVar;
|
---|
[76] | 251 | Type type;
|
---|
| 252 | if(!GetVarOffsetReadOnly(ObjectName,&RelativeVar,type)) return;
|
---|
[3] | 253 | SetVarPtrToEax(&RelativeVar);
|
---|
| 254 |
|
---|
| 255 | //mov ecx,eax
|
---|
[225] | 256 | compiler.codeGenerator.op_mov_RR(REG_ECX,REG_EAX);
|
---|
[3] | 257 |
|
---|
| 258 | //参照タイプが整合しているかをチェック
|
---|
[290] | 259 | if( !( type.IsObject() && referenceKind == RefDot
|
---|
| 260 | || type.IsObjectPtr() && referenceKind == RefPointer ) )
|
---|
| 261 | {
|
---|
[465] | 262 | compiler.errorMessenger.Output(104,ObjectName,cp);
|
---|
[290] | 263 | }
|
---|
[3] | 264 |
|
---|
[76] | 265 | if(type.IsObjectPtr()){
|
---|
[3] | 266 | //mov ecx,dword ptr[ecx]
|
---|
[225] | 267 | compiler.codeGenerator.op_mov_RM(sizeof(long),REG_ECX,REG_ECX,0,MOD_BASE);
|
---|
[3] | 268 | }
|
---|
| 269 | }
|
---|
| 270 | }
|
---|
| 271 | else{
|
---|
| 272 | InClassMember:
|
---|
| 273 | //自身のオブジェクトのThisポインタをrcxにコピー
|
---|
| 274 | SetThisPtrToReg(REG_RCX);
|
---|
| 275 |
|
---|
[536] | 276 | pobj_c = &compiler.GetCompilingClass();
|
---|
[3] | 277 | }
|
---|
| 278 |
|
---|
| 279 |
|
---|
[349] | 280 | int vtblIndex;
|
---|
| 281 | if( pobj_c->IsInterface() )
|
---|
| 282 | {
|
---|
| 283 | // インターフェイスメソッド呼び出し
|
---|
[3] | 284 |
|
---|
[349] | 285 | int offset_vtbl = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__vtbl" );
|
---|
[348] | 286 |
|
---|
[3] | 287 |
|
---|
[349] | 288 | // vtblのポインタを取得
|
---|
| 289 | //mov edx,dword ptr[ecx+offset_vtbl]
|
---|
| 290 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, offset_vtbl, MOD_BASE_DISP8 );
|
---|
| 291 |
|
---|
| 292 | int offset_this = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__this" );
|
---|
| 293 |
|
---|
| 294 |
|
---|
| 295 |
|
---|
| 296 | // インターフェイスの場合は更に__thisを取得する
|
---|
| 297 | //mov rcx,qword ptr[rcx+offset_this]
|
---|
| 298 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_ECX, REG_ECX, offset_this, MOD_BASE_DISP8 );
|
---|
| 299 |
|
---|
| 300 | int vtblMasterListIndex;
|
---|
| 301 | pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
|
---|
| 302 | if( vtblMasterListIndex != 0 )
|
---|
| 303 | {
|
---|
[465] | 304 | compiler.errorMessenger.OutputFatalError();
|
---|
[349] | 305 | }
|
---|
| 306 | }
|
---|
[370] | 307 | else if( pobj_c->IsComInterface() )
|
---|
| 308 | {
|
---|
| 309 | // COMインターフェイス メソッド呼び出し
|
---|
| 310 |
|
---|
| 311 | //仮想関数(オブジェクトメソッド)呼び出し
|
---|
| 312 | // pObj -> vtbl1 -> func1
|
---|
| 313 | // -> func2
|
---|
| 314 | // -> func3
|
---|
| 315 |
|
---|
| 316 | int vtblMasterListIndex;
|
---|
| 317 | pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
|
---|
| 318 |
|
---|
| 319 | // vtblのポインタを取得
|
---|
| 320 | //mov edx,dword ptr[ecx]
|
---|
| 321 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, 0, MOD_BASE );
|
---|
| 322 | }
|
---|
[349] | 323 | else
|
---|
| 324 | {
|
---|
| 325 | //仮想関数(オブジェクトメソッド)呼び出し
|
---|
| 326 | // pObj -> vtbl_master_list -> vtbl1 -> func1
|
---|
| 327 | // -> func2
|
---|
| 328 | // -> func3
|
---|
| 329 | // -> vtbl2 -> func1
|
---|
| 330 | // -> func2
|
---|
| 331 | // -> func3
|
---|
| 332 |
|
---|
| 333 | int vtblMasterListIndex;
|
---|
| 334 | pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
|
---|
| 335 |
|
---|
| 336 | // vtblマスターリストのポインタを取得
|
---|
[370] | 337 | //mov edx,dword ptr[ecx+sizeof(com_vtbl)]
|
---|
| 338 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, PTR_SIZE, MOD_BASE_DISP8 );
|
---|
[349] | 339 |
|
---|
| 340 | // vtblのポインタを取得
|
---|
| 341 | //mov edx,dword ptr[edx+vtblMasterListIndex]
|
---|
[350] | 342 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex*PTR_SIZE, MOD_BASE_DISP32 );
|
---|
[349] | 343 | }
|
---|
| 344 |
|
---|
[3] | 345 | //mov eax,dword ptr[edx+func_index]
|
---|
[342] | 346 | if( vtblIndex * PTR_SIZE <= 0x7F )
|
---|
| 347 | {
|
---|
| 348 | compiler.codeGenerator.op_mov_RM(sizeof(long),REG_EAX,REG_EDX,vtblIndex*PTR_SIZE,MOD_BASE_DISP8);
|
---|
[3] | 349 | }
|
---|
| 350 | else{
|
---|
[342] | 351 | compiler.codeGenerator.op_mov_RM(sizeof(long),REG_EAX,REG_EDX,vtblIndex*PTR_SIZE,MOD_BASE_DISP32);
|
---|
[3] | 352 | }
|
---|
| 353 | }
|
---|
| 354 | else{
|
---|
| 355 | //一般の関数
|
---|
| 356 |
|
---|
| 357 | //mov eax,ProcAddr
|
---|
[332] | 358 | compiler.codeGenerator.op_addressof( REG_EAX, &userProc );
|
---|
[3] | 359 | }
|
---|
| 360 |
|
---|
[332] | 361 | userProc.Using();
|
---|
[3] | 362 | }
|
---|
[335] | 363 | void Opcode_CreateDelegate( const CClass &dgClass, const char *methodInstanceName, const UserProc &userProc )
|
---|
[332] | 364 | {
|
---|
| 365 | /////////////////////////////////////////////////////////////////
|
---|
| 366 | // 関数ポインタをpush
|
---|
| 367 | /////////////////////////////////////////////////////////////////
|
---|
| 368 |
|
---|
| 369 | //push AddressOf(userProc)
|
---|
| 370 | _Opcode_Func_AddressOf( methodInstanceName, userProc );
|
---|
| 371 | compiler.codeGenerator.op_push( REG_EAX );
|
---|
| 372 |
|
---|
| 373 |
|
---|
[336] | 374 | if( userProc.GetMethod().IsDynamic() )
|
---|
| 375 | {
|
---|
| 376 | /////////////////////////////////////////////////////////////////
|
---|
| 377 | // オブジェクト ポインタをpush
|
---|
| 378 | /////////////////////////////////////////////////////////////////
|
---|
[332] | 379 |
|
---|
[336] | 380 | // オブジェクト名を取得
|
---|
| 381 | char objectName[VN_SIZE];
|
---|
| 382 | char memberName[VN_SIZE];
|
---|
| 383 | char *thisPtrName = "This";
|
---|
| 384 | Type type;
|
---|
| 385 | if( SplitMemberName( methodInstanceName, objectName, memberName ) )
|
---|
[332] | 386 | {
|
---|
[336] | 387 | if( GetVarType( objectName, type, false ) )
|
---|
| 388 | {
|
---|
| 389 | thisPtrName = objectName;
|
---|
| 390 | }
|
---|
[332] | 391 | }
|
---|
| 392 |
|
---|
[336] | 393 | // オブジェクト ポインタを取得
|
---|
| 394 | RELATIVE_VAR relativeVar;
|
---|
| 395 | GetVarOffsetReadOnly( thisPtrName, &relativeVar, type );
|
---|
| 396 | if( !type.IsObject() )
|
---|
| 397 | {
|
---|
| 398 | extern int cp;
|
---|
[465] | 399 | compiler.errorMessenger.Output(1,NULL,cp);
|
---|
[336] | 400 | return;
|
---|
| 401 | }
|
---|
[332] | 402 |
|
---|
[336] | 403 | SetVarPtrToEax( &relativeVar );
|
---|
[332] | 404 |
|
---|
[336] | 405 | //mov eax,dword ptr[eax]
|
---|
| 406 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE );
|
---|
[332] | 407 |
|
---|
[336] | 408 | //push eax
|
---|
| 409 | compiler.codeGenerator.op_push( REG_EAX );
|
---|
| 410 | }
|
---|
[332] | 411 |
|
---|
| 412 |
|
---|
| 413 | /////////////////////////////////////////////////////////////////
|
---|
[336] | 414 | // call _CreateDynamicDelegate/_CreateStaticDelegate
|
---|
[332] | 415 | /////////////////////////////////////////////////////////////////
|
---|
| 416 |
|
---|
[334] | 417 | std::vector<const UserProc *> subs;
|
---|
[336] | 418 | if( userProc.GetMethod().IsDynamic() )
|
---|
| 419 | {
|
---|
| 420 | dgClass.GetStaticMethods().Enum( "_CreateDynamicDelegate", subs );
|
---|
| 421 | }
|
---|
| 422 | else
|
---|
| 423 | {
|
---|
| 424 | dgClass.GetStaticMethods().Enum( "_CreateStaticDelegate", subs );
|
---|
| 425 | }
|
---|
[334] | 426 |
|
---|
[336] | 427 | // call _CreateDynamicDelegate
|
---|
[334] | 428 | compiler.codeGenerator.op_call( subs[0] );
|
---|
[332] | 429 | }
|
---|
[339] | 430 | void Opcode_Func_AddressOf( const char *name, const Type &baseType, bool isCallOn, Type &resultType )
|
---|
| 431 | {
|
---|
[332] | 432 | extern int cp;
|
---|
| 433 |
|
---|
| 434 | const Parameters *pBaseParams = NULL;
|
---|
[449] | 435 | const Type *pBaseReturnType = NULL;
|
---|
[332] | 436 | if( baseType.IsProcPtr() )
|
---|
| 437 | {
|
---|
| 438 | // 左辺で関数ポインタを要求されているとき
|
---|
[449] | 439 | const ProcPointer *pTempProcPointer = compiler.GetObjectModule().meta.GetProcPointers()[baseType.GetIndex()];
|
---|
| 440 | pBaseParams = &pTempProcPointer->Params();
|
---|
| 441 | pBaseReturnType = &pTempProcPointer->ReturnType();
|
---|
[332] | 442 | }
|
---|
[334] | 443 | else if( baseType.IsDelegate() )
|
---|
[332] | 444 | {
|
---|
| 445 | // 左辺でデリゲートを要求されているとき
|
---|
[562] | 446 | const Delegate *pTempDelegate = &compiler.GetObjectModule().meta.ToDelegate( baseType.GetClass() );
|
---|
[449] | 447 | pBaseParams = &pTempDelegate->Params();
|
---|
| 448 | pBaseReturnType = &pTempDelegate->ReturnType();
|
---|
[332] | 449 | }
|
---|
| 450 |
|
---|
[449] | 451 | const UserProc *pUserProc;
|
---|
| 452 | if( pBaseParams && pBaseReturnType )
|
---|
[332] | 453 | {
|
---|
| 454 | //左辺の型にのっとり、オーバーロードを解決
|
---|
| 455 |
|
---|
| 456 | std::vector<const UserProc *> subs;
|
---|
| 457 | GetOverloadSubHash( name, subs );
|
---|
| 458 | if( subs.size() == 0 ){
|
---|
[465] | 459 | compiler.errorMessenger.Output(27,name,cp);
|
---|
[332] | 460 | return;
|
---|
| 461 | }
|
---|
| 462 |
|
---|
| 463 | //オーバーロードを解決
|
---|
[424] | 464 | pUserProc=OverloadSolution( name, subs, *pBaseParams, Type(), Type() );
|
---|
[332] | 465 |
|
---|
[449] | 466 | if( isCallOn )
|
---|
[337] | 467 | {
|
---|
| 468 | // コード生成を伴う場合はエラーチェックを行う
|
---|
[449] | 469 |
|
---|
| 470 | if( baseType.IsDelegate() )
|
---|
[337] | 471 | {
|
---|
[449] | 472 | // デリゲート
|
---|
| 473 | // 共変戻り値、反変引数をサポート
|
---|
| 474 | if( !(
|
---|
| 475 | pBaseParams->Equals( pUserProc->Params(), true )
|
---|
| 476 | && ( pBaseReturnType->Equals( pUserProc->ReturnType() ) || pBaseReturnType->IsCovariant( pUserProc->ReturnType() ) )
|
---|
| 477 | ) )
|
---|
[337] | 478 | {
|
---|
[465] | 479 | compiler.errorMessenger.Output(67, name, cp );
|
---|
[337] | 480 | }
|
---|
[449] | 481 | }
|
---|
| 482 | else
|
---|
| 483 | {
|
---|
| 484 | // 関数ポインタ
|
---|
| 485 | if( !(
|
---|
| 486 | pBaseParams->Equals( pUserProc->Params() )
|
---|
| 487 | && pBaseReturnType->Equals( pUserProc->ReturnType() )
|
---|
| 488 | ) )
|
---|
[337] | 489 | {
|
---|
[465] | 490 | compiler.errorMessenger.Output(66, name, cp );
|
---|
[337] | 491 | }
|
---|
| 492 | }
|
---|
| 493 | }
|
---|
| 494 |
|
---|
[332] | 495 | if(!pUserProc){
|
---|
[465] | 496 | compiler.errorMessenger.Output(27,name,cp);
|
---|
[332] | 497 | return;
|
---|
| 498 | }
|
---|
| 499 | }
|
---|
| 500 | else{
|
---|
| 501 | pUserProc=GetSubHash(name);
|
---|
| 502 | if(!pUserProc){
|
---|
[465] | 503 | compiler.errorMessenger.Output(27,name,cp);
|
---|
[332] | 504 | return;
|
---|
| 505 | }
|
---|
| 506 | }
|
---|
| 507 |
|
---|
[334] | 508 | if( baseType.IsDelegate() )
|
---|
[332] | 509 | {
|
---|
| 510 | if( isCallOn )
|
---|
| 511 | {
|
---|
| 512 | // デリゲートのとき
|
---|
[335] | 513 | Opcode_CreateDelegate( baseType.GetClass(), name, *pUserProc );
|
---|
[332] | 514 | }
|
---|
| 515 | resultType = baseType;
|
---|
| 516 | }
|
---|
| 517 | else
|
---|
| 518 | {
|
---|
| 519 | if( isCallOn )
|
---|
| 520 | {
|
---|
| 521 | // 関数ポインタのとき
|
---|
| 522 | _Opcode_Func_AddressOf( name, *pUserProc );
|
---|
| 523 | }
|
---|
| 524 | resultType.SetBasicType( DEF_PTR_VOID );
|
---|
| 525 | }
|
---|
| 526 | }
|
---|
[666] | 527 | void Opcode_Func_SizeOf( const std::string &typeName )
|
---|
| 528 | {
|
---|
[79] | 529 | Type tempType;
|
---|
[299] | 530 | if( !compiler.StringToType( typeName, tempType ) ){
|
---|
[465] | 531 | compiler.errorMessenger.Output(3,typeName,cp);
|
---|
[79] | 532 | return;
|
---|
[3] | 533 | }
|
---|
| 534 |
|
---|
[666] | 535 | //mov eax,size
|
---|
[672] | 536 | compiler.codeGenerator.op_mov_RV( REG_EAX, compiler.SizeOf( tempType ) );
|
---|
[666] | 537 | }
|
---|
| 538 | void Opcode_Func_ClassSizeOf( const std::string &typeName )
|
---|
| 539 | {
|
---|
| 540 | Type tempType;
|
---|
| 541 | if( !compiler.StringToType( typeName, tempType ) ){
|
---|
| 542 | compiler.errorMessenger.Output(3,typeName,cp);
|
---|
| 543 | return;
|
---|
| 544 | }
|
---|
| 545 |
|
---|
[672] | 546 | if( !tempType.IsObject() )
|
---|
| 547 | {
|
---|
| 548 | compiler.errorMessenger.Output(1,typeName,cp);
|
---|
| 549 | return;
|
---|
| 550 | }
|
---|
[79] | 551 |
|
---|
[3] | 552 | //mov eax,size
|
---|
[672] | 553 | compiler.codeGenerator.op_mov_RV( REG_EAX, tempType.GetClass().GetSize() );
|
---|
[3] | 554 | }
|
---|
[76] | 555 | void Opcode_Func_VarPtr( const char *Parameter, Type &resultType, bool isCallOn ){
|
---|
| 556 | if( isCallOn == false ){
|
---|
| 557 | // 戻り値の型を取得するだけ
|
---|
| 558 |
|
---|
| 559 | //変数のアドレスを取得
|
---|
| 560 | if(!GetVarType( Parameter, resultType, true )) return;
|
---|
| 561 |
|
---|
| 562 | resultType.PtrLevelUp();
|
---|
| 563 |
|
---|
| 564 | return;
|
---|
| 565 | }
|
---|
| 566 |
|
---|
[3] | 567 | RELATIVE_VAR RelativeVar;
|
---|
| 568 |
|
---|
| 569 | //変数のアドレスを取得
|
---|
[76] | 570 | if(!GetVarOffsetReadOnly( Parameter, &RelativeVar, resultType )) return;
|
---|
[3] | 571 |
|
---|
[76] | 572 | int beforeType = resultType.GetBasicType();
|
---|
[64] | 573 |
|
---|
[76] | 574 | resultType.PtrLevelUp();
|
---|
[46] | 575 |
|
---|
[3] | 576 | SetVarPtrToEax(&RelativeVar);
|
---|
| 577 | }
|
---|
[109] | 578 | void Opcode_Func_ObjPtr( const char *Parameter, Type &resultType, bool isCallOn ){
|
---|
| 579 | if( isCallOn == false ){
|
---|
| 580 | // 戻り値の型を取得するだけ
|
---|
| 581 |
|
---|
| 582 | //変数のアドレスを取得
|
---|
| 583 | if(!GetVarType( Parameter, resultType, true )) return;
|
---|
| 584 |
|
---|
| 585 | resultType.PtrLevelUp();
|
---|
| 586 |
|
---|
| 587 | return;
|
---|
| 588 | }
|
---|
| 589 |
|
---|
| 590 | RELATIVE_VAR RelativeVar;
|
---|
| 591 |
|
---|
| 592 | //変数のアドレスを取得
|
---|
| 593 | if(!GetVarOffsetReadOnly( Parameter, &RelativeVar, resultType )) return;
|
---|
| 594 |
|
---|
| 595 | int beforeType = resultType.GetBasicType();
|
---|
| 596 |
|
---|
| 597 | resultType.PtrLevelUp();
|
---|
| 598 |
|
---|
| 599 | SetVarPtrToEax(&RelativeVar);
|
---|
| 600 |
|
---|
[111] | 601 | if( lstrcmpi( Parameter, "This" )==0 ){
|
---|
| 602 | // Thisの場合は特別にオブジェクトポインタが返ってくるので、何もせずに抜ける
|
---|
| 603 | }
|
---|
| 604 | else if( beforeType == DEF_OBJECT ){
|
---|
[109] | 605 | //参照をオブジェクトポインタに変更
|
---|
| 606 |
|
---|
| 607 | //mov eax,dword ptr[eax]
|
---|
[225] | 608 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE );
|
---|
[109] | 609 | }
|
---|
| 610 | else{
|
---|
[465] | 611 | compiler.errorMessenger.Output(134,NULL,cp );
|
---|
[109] | 612 | }
|
---|
| 613 | }
|
---|
[325] | 614 |
|
---|
| 615 | void Opcode_Func_delegate_call( const char *paramsStr, Type &resultType, bool isDynamicCall, bool isCallOn )
|
---|
| 616 | {
|
---|
| 617 | if( isCallOn )
|
---|
| 618 | {
|
---|
| 619 | int i = 0;
|
---|
| 620 | char methodPtrParamStr[VN_SIZE];
|
---|
| 621 | i = GetOneParameter( paramsStr, i, methodPtrParamStr );
|
---|
| 622 |
|
---|
[336] | 623 | char objPtrValueStr[VN_SIZE]="";
|
---|
[325] | 624 | if( isDynamicCall )
|
---|
| 625 | {
|
---|
| 626 | i = GetOneParameter( paramsStr, i, objPtrValueStr );
|
---|
| 627 | }
|
---|
| 628 |
|
---|
[562] | 629 | Opcode_CallDelegate( compiler.GetObjectModule().meta.ToDelegate( compiler.GetCompilingClass() ), methodPtrParamStr, objPtrValueStr, paramsStr + i );
|
---|
[325] | 630 | }
|
---|
| 631 |
|
---|
[537] | 632 | resultType = compiler.GetCompilingUserProc().ReturnType();
|
---|
[325] | 633 | }
|
---|
[357] | 634 | void Opcode_Func_System_Get_Bp()
|
---|
| 635 | {
|
---|
| 636 | //mov eax,ebp
|
---|
| 637 | compiler.codeGenerator.op_mov_RR(REG_EAX,REG_EBP);
|
---|
| 638 | }
|
---|
[358] | 639 | void Opcode_Func_System_Get_Sp()
|
---|
| 640 | {
|
---|
| 641 | //mov eax,esp
|
---|
| 642 | compiler.codeGenerator.op_mov_RR(REG_EAX,REG_ESP);
|
---|
| 643 | }
|
---|
[325] | 644 |
|
---|
[431] | 645 | void Opcode_Func_System_GetComVtbl( const char *parameter )
|
---|
[426] | 646 | {
|
---|
[431] | 647 | Type classType;
|
---|
| 648 | compiler.StringToType( parameter, classType );
|
---|
| 649 |
|
---|
| 650 | // mov eax,com_vtbl
|
---|
| 651 | compiler.codeGenerator.op_mov_RV_com_vtbl( REG_EAX, &classType.GetClass() );
|
---|
| 652 | }
|
---|
| 653 | void Opcode_Func_System_GetVtblList( const char *parameter )
|
---|
| 654 | {
|
---|
| 655 | Type classType;
|
---|
| 656 | compiler.StringToType( parameter, classType );
|
---|
| 657 |
|
---|
| 658 | // mov eax,com_vtbl
|
---|
| 659 | compiler.codeGenerator.op_mov_RV_vtbl( REG_EAX, &classType.GetClass() );
|
---|
| 660 | }
|
---|
| 661 | void Opcode_Func_System_GetDefaultConstructor( const char *parameter )
|
---|
| 662 | {
|
---|
| 663 | Type classType;
|
---|
| 664 | compiler.StringToType( parameter, classType );
|
---|
| 665 |
|
---|
| 666 | if( classType.GetClass().GetConstructorMethod() )
|
---|
[426] | 667 | {
|
---|
[431] | 668 | //mov eax,ProcAddr
|
---|
| 669 | compiler.codeGenerator.op_addressof( REG_EAX, &classType.GetClass().GetConstructorMethod()->GetUserProc() );
|
---|
[426] | 670 | }
|
---|
[431] | 671 | else
|
---|
[426] | 672 | {
|
---|
[431] | 673 | // デフォルトコンストラクタを持たない
|
---|
[426] | 674 |
|
---|
[431] | 675 | //xor eax,eax
|
---|
| 676 | compiler.codeGenerator.op_zero_reg( REG_EAX );
|
---|
[426] | 677 | }
|
---|
| 678 | }
|
---|
[431] | 679 | void Opcode_Func_System_GetDestructor( const char *parameter )
|
---|
| 680 | {
|
---|
| 681 | Type classType;
|
---|
| 682 | compiler.StringToType( parameter, classType );
|
---|
[426] | 683 |
|
---|
[431] | 684 | //mov eax,ProcAddr
|
---|
| 685 | compiler.codeGenerator.op_addressof( REG_EAX, &classType.GetClass().GetDestructorMethod()->GetUserProc() );
|
---|
| 686 | }
|
---|
| 687 |
|
---|
[46] | 688 | void Opcode_Func_GetPtrData(const char *Parameter,const int type){
|
---|
[76] | 689 | Type tempType;
|
---|
| 690 | if( !NumOpe(Parameter,Type(),tempType) ){
|
---|
| 691 | return;
|
---|
| 692 | }
|
---|
| 693 | if(!tempType.IsWhole()){
|
---|
[465] | 694 | compiler.errorMessenger.Output(11,Parameter,cp);
|
---|
[76] | 695 | return;
|
---|
| 696 | }
|
---|
| 697 | ChangeTypeToLong(tempType.GetBasicType());
|
---|
[3] | 698 |
|
---|
| 699 | if(type==DEF_DOUBLE){
|
---|
| 700 | //pop eax
|
---|
[225] | 701 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 702 |
|
---|
| 703 | //fld qword ptr[eax]
|
---|
[235] | 704 | compiler.codeGenerator.PutOld(
|
---|
| 705 | (char)0xDD,
|
---|
| 706 | (char)0x00
|
---|
| 707 | );
|
---|
[3] | 708 | }
|
---|
| 709 | else if(type==DEF_SINGLE||type==DEF_DWORD){
|
---|
| 710 | //pop eax
|
---|
[225] | 711 | compiler.codeGenerator.op_pop(REG_EAX);
|
---|
[3] | 712 |
|
---|
| 713 | //mov eax,dword ptr[eax]
|
---|
[235] | 714 | compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE );
|
---|
[3] | 715 | }
|
---|
| 716 | else if(type==DEF_QWORD){
|
---|
| 717 | //pop ecx
|
---|
[225] | 718 | compiler.codeGenerator.op_pop(REG_ECX);
|
---|
[3] | 719 |
|
---|
| 720 | //mov eax,dword ptr[ecx]
|
---|
[225] | 721 | compiler.codeGenerator.op_mov_RM(sizeof(long),REG_EAX,REG_ECX,0,MOD_BASE);
|
---|
[3] | 722 |
|
---|
| 723 | //mov edx,dword ptr[ecx+sizeof(long)]
|
---|
[225] | 724 | compiler.codeGenerator.op_mov_RM(sizeof(long),REG_EDX,REG_ECX,sizeof(long),MOD_BASE_DISP8);
|
---|
[3] | 725 | }
|
---|
| 726 | else if(type==DEF_WORD){
|
---|
| 727 | //pop ebx
|
---|
[225] | 728 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 729 |
|
---|
| 730 | //xor eax,eax
|
---|
[227] | 731 | compiler.codeGenerator.op_xor_RR(REG_EAX);
|
---|
[3] | 732 |
|
---|
| 733 | //mov ax,word ptr[ebx]
|
---|
[235] | 734 | compiler.codeGenerator.op_mov_RM( sizeof(short), REG_EAX, REG_EBX, 0, MOD_BASE );
|
---|
[3] | 735 | }
|
---|
| 736 | else if(type==DEF_BYTE){
|
---|
| 737 | //pop ebx
|
---|
[225] | 738 | compiler.codeGenerator.op_pop(REG_EBX);
|
---|
[3] | 739 |
|
---|
| 740 | //xor eax,eax
|
---|
[227] | 741 | compiler.codeGenerator.op_xor_RR(REG_EAX);
|
---|
[3] | 742 |
|
---|
| 743 | //mov al,byte ptr[ebx]
|
---|
[235] | 744 | compiler.codeGenerator.op_mov_RM( sizeof(char), REG_EAX, REG_EBX, 0, MOD_BASE );
|
---|
[3] | 745 | }
|
---|
| 746 | }
|
---|
| 747 |
|
---|
[331] | 748 | bool Opcode_CallFunc( const char *Parameter, const int FuncNum, const Type &baseType, Type &resultType, bool isCallOn )
|
---|
| 749 | {
|
---|
[3] | 750 | switch(FuncNum){
|
---|
| 751 | case FUNC_FIX:
|
---|
[76] | 752 | if( isCallOn ) Opcode_Func_Fix(Parameter);
|
---|
| 753 | resultType.SetBasicType( DEF_LONG );
|
---|
[46] | 754 | break;
|
---|
[3] | 755 | case FUNC_CUDBL:
|
---|
[76] | 756 | if( isCallOn ) Opcode_Func_CUDbl(Parameter);
|
---|
| 757 | resultType.SetBasicType( DEF_DOUBLE );
|
---|
[46] | 758 | break;
|
---|
[3] | 759 | case FUNC_LEN:
|
---|
[76] | 760 | if( isCallOn ) Opcode_Func_Len(Parameter);
|
---|
| 761 | resultType.SetBasicType( DEF_LONG );
|
---|
[46] | 762 | break;
|
---|
[3] | 763 | case FUNC_ADDRESSOF:
|
---|
[332] | 764 | Opcode_Func_AddressOf( Parameter, baseType, isCallOn, resultType );
|
---|
[46] | 765 | break;
|
---|
[3] | 766 | case FUNC_SIZEOF:
|
---|
[76] | 767 | if( isCallOn ) Opcode_Func_SizeOf(Parameter);
|
---|
| 768 | resultType.SetBasicType( DEF_LONG );
|
---|
[46] | 769 | break;
|
---|
[666] | 770 | case FUNC_CLASS_SIZEOF:
|
---|
| 771 | if( isCallOn ) Opcode_Func_ClassSizeOf(Parameter);
|
---|
| 772 | resultType.SetBasicType( DEF_LONG );
|
---|
| 773 | break;
|
---|
[3] | 774 | case FUNC_VARPTR:
|
---|
[76] | 775 | Opcode_Func_VarPtr( Parameter, resultType, isCallOn );
|
---|
[46] | 776 | break;
|
---|
[109] | 777 | case FUNC_OBJPTR:
|
---|
| 778 | Opcode_Func_ObjPtr( Parameter, resultType, isCallOn );
|
---|
| 779 | break;
|
---|
[325] | 780 | case FUNC_DELEGATE_DYNAMICMETHOD_CALL:
|
---|
| 781 | Opcode_Func_delegate_call( Parameter, resultType, true, isCallOn );
|
---|
| 782 | break;
|
---|
| 783 | case FUNC_DELEGATE_STATICMETHOD_CALL:
|
---|
| 784 | Opcode_Func_delegate_call( Parameter, resultType, false, isCallOn );
|
---|
| 785 | break;
|
---|
[357] | 786 | case FUNC_SYSTEM_GET_NOW_SCOPE_CATCH_ADDRESS:
|
---|
| 787 | if( isCallOn ) Exception::Opcode_Func_System_GetNowScopeCatchAddress();
|
---|
[358] | 788 | resultType.SetBasicType( DEF_PTR_VOID );
|
---|
[357] | 789 | break;
|
---|
[359] | 790 | case FUNC_SYSTEM_GET_NOW_SCOPE_FINALLY_ADDRESS:
|
---|
| 791 | if( isCallOn ) Exception::Opcode_Func_System_GetNowScopeFinallyAddress();
|
---|
| 792 | resultType.SetBasicType( DEF_PTR_VOID );
|
---|
| 793 | break;
|
---|
[357] | 794 | case FUNC_SYSTEM_GET_BP:
|
---|
| 795 | if( isCallOn ) Opcode_Func_System_Get_Bp();
|
---|
| 796 | resultType.SetBasicType( DEF_LONG );
|
---|
| 797 | break;
|
---|
[358] | 798 | case FUNC_SYSTEM_GET_SP:
|
---|
| 799 | if( isCallOn ) Opcode_Func_System_Get_Sp();
|
---|
| 800 | resultType.SetBasicType( DEF_LONG );
|
---|
| 801 | break;
|
---|
[431] | 802 | case FUNC_SYSTEM_GET_COM_VTBL:
|
---|
| 803 | if( isCallOn ) Opcode_Func_System_GetComVtbl( Parameter );
|
---|
| 804 | resultType.SetBasicType( DEF_PTR_VOID );
|
---|
[426] | 805 | break;
|
---|
[431] | 806 | case FUNC_SYSTEM_GET_VTBL_LIST:
|
---|
| 807 | if( isCallOn ) Opcode_Func_System_GetVtblList( Parameter );
|
---|
| 808 | resultType.SetBasicType( DEF_PTR_VOID );
|
---|
| 809 | break;
|
---|
| 810 | case FUNC_SYSTEM_GET_DEFAULT_CONSTRUCTOR:
|
---|
| 811 | if( isCallOn ) Opcode_Func_System_GetDefaultConstructor( Parameter );
|
---|
| 812 | resultType.SetBasicType( DEF_PTR_VOID );
|
---|
| 813 | break;
|
---|
| 814 | case FUNC_SYSTEM_GET_DESTRUCTOR:
|
---|
| 815 | if( isCallOn ) Opcode_Func_System_GetDestructor( Parameter );
|
---|
| 816 | resultType.SetBasicType( DEF_PTR_VOID );
|
---|
| 817 | break;
|
---|
[3] | 818 |
|
---|
| 819 | case FUNC_GETDOUBLE:
|
---|
[76] | 820 | if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_DOUBLE);
|
---|
| 821 | resultType.SetBasicType( DEF_DOUBLE );
|
---|
[46] | 822 | break;
|
---|
[3] | 823 | case FUNC_GETSINGLE:
|
---|
[76] | 824 | if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_SINGLE);
|
---|
| 825 | resultType.SetBasicType( DEF_SINGLE );
|
---|
[46] | 826 | break;
|
---|
[3] | 827 | case FUNC_GETQWORD:
|
---|
[76] | 828 | if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_QWORD);
|
---|
| 829 | resultType.SetBasicType( DEF_QWORD );
|
---|
[46] | 830 | break;
|
---|
[3] | 831 | case FUNC_GETDWORD:
|
---|
[76] | 832 | if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_DWORD);
|
---|
| 833 | resultType.SetBasicType( DEF_DWORD );
|
---|
[46] | 834 | break;
|
---|
[3] | 835 | case FUNC_GETWORD:
|
---|
[76] | 836 | if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_WORD);
|
---|
| 837 | resultType.SetBasicType( DEF_WORD );
|
---|
[46] | 838 | break;
|
---|
[3] | 839 | case FUNC_GETBYTE:
|
---|
[76] | 840 | if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_BYTE);
|
---|
| 841 | resultType.SetBasicType( DEF_BYTE );
|
---|
[46] | 842 | break;
|
---|
[76] | 843 | default:
|
---|
| 844 | return false;
|
---|
[3] | 845 | }
|
---|
[76] | 846 | return true;
|
---|
[3] | 847 | }
|
---|