source: dev/trunk/abdev/BasicCompiler32/Compile_Func.cpp@ 358

Last change on this file since 358 was 358, checked in by dai_9181, 16 years ago

Try-Catchを試験的に実装。
(まだ下記の動作しか実装していません)
・Try
・Catch(パラメータ無し)
・Throw(パラメータ無し)

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