source: dev/BasicCompiler64/Compile_Var.cpp@ 44

Last change on this file since 44 was 41, checked in by dai_9181, 18 years ago

ByVal演算子を追加

File size: 32.4 KB
Line 
1#include "../BasicCompiler_Common/common.h"
2#include "Opcode.h"
3
4//変数
5VARIABLE *GlobalVar;
6int MaxGlobalVarNum;
7int AllGlobalVarSize;
8int AllInitGlobalVarSize;
9VARIABLE *LocalVar;
10int MaxLocalVarNum;
11int AllLocalVarSize;
12
13
14void SetRelativeOffset(int *pType,LONG_PTR lpIndex,RELATIVE_VAR *pRelativeVar,char *lpPtrOffset){
15 int i2;
16
17
18 /////////////////////////////////////////////
19 // 先頭ポインタをr12に取得してメモリへ退避
20 /////////////////////////////////////////////
21
22 SetReg_WholeVariable(DEF_INT64,pRelativeVar,REG_R11);
23
24 //mov qword ptr[rsp+offset],r11 ※スタックフレームを利用
25 pobj_sf->push(REG_R11);
26
27
28 ////////////////////////////////
29 // 添え字を計算する
30 ////////////////////////////////
31
32 int reg=REG_NON;
33 i2=NumOpe(&reg,lpPtrOffset,0,0,0);
34 if(!IsWholeNumberType(i2)) SetError(46,NULL,cp);
35 ExtendTypeTo64(i2,reg);
36
37 if(reg==REG_R14){
38 //mov r14,qword ptr[rsp+offset] ※スタックフレームを利用
39 pobj_sf->pop(REG_R14);
40 }
41
42 if(PTR_LEVEL(*pType)){
43 *pType=MAKE_PTR_TYPE(NATURAL_TYPE(*pType),PTR_LEVEL(*pType)-1);
44 if((*pType)==DEF_OBJECT){
45 //imul reg,objsize
46 op_imul_value(sizeof(_int64),reg,GetSizeOfClassMember((CClass *)lpIndex,NULL,NULL));
47 }
48 else{
49 i2=GetTypeSize(*pType,-1);
50 if(i2>=2){
51 //imul reg,i2
52 op_imul_value(sizeof(_int64),reg,i2);
53 }
54 }
55 }
56 else{
57 //エラー
58 SetError(1,NULL,cp);
59 return;
60 }
61
62
63 //////////////////////////////
64 // 先頭ポインタに添え字を加算
65 //////////////////////////////
66
67 //mov r11,qword ptr[rsp+offset] ※スタックフレームを利用
68 pobj_sf->pop(REG_R11);
69
70 //add r11,reg
71 op_add64_reg(REG_R11,reg);
72}
73BOOL GetArrayOffset(int *SubScripts,char *array,int type,LONG_PTR lpIndex){
74 extern HANDLE hHeap;
75 int i,i2,i3,i4,TypeSize;
76 char temporary[VN_SIZE],*pParm[MAX_PARMS];
77
78 for(i=0,i2=0,i3=0;;i++,i2++){
79 if(array[i]=='('){
80 i4=GetStringInPare(temporary+i2,array+i);
81 i+=i4-1;
82 i2+=i4-1;
83 continue;
84 }
85 if(array[i]=='['){
86 i4=GetStringInBracket(temporary+i2,array+i);
87 i+=i4-1;
88 i2+=i4-1;
89 continue;
90 }
91 if(array[i]==','||array[i]=='\0'){
92 if(SubScripts[i3]==-1){
93 for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
94 return 0;
95 }
96
97 temporary[i2]=0;
98
99 pParm[i3]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
100 lstrcpy(pParm[i3],temporary);
101
102 i3++;
103
104 if(array[i]=='\0'){
105 if(SubScripts[i3]!=-1){
106 for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
107 return 0;
108 }
109 break;
110 }
111
112 i2=-1;
113 continue;
114 }
115 temporary[i2]=array[i];
116 }
117
118 //mov qword ptr[rsp+offset],r11 ※スタックフレームを利用
119 pobj_sf->push(REG_R11);
120
121 //xor r12,r12
122 op_zero_reg(REG_R12);
123
124 for(i=i3-1;i>=0;i--){
125 //mov qword ptr[rsp+offset],r12 ※スタックフレームを利用
126 pobj_sf->push(REG_R12);
127
128 int reg=REG_NON;
129 TYPEINFO TypeInfo;
130 BOOL bUseHeap;
131 TypeInfo.type=NumOpe(&reg,pParm[i],DEF_LONG,-1,&TypeInfo.u.lpIndex,&bUseHeap);
132 if(TypeInfo.type==DEF_OBJECT){
133 //キャスト演算子のオーバーロードに対応する
134 CallCastOperatorProc(reg,
135 TypeInfo.type,TypeInfo.u.lpIndex,
136 bUseHeap,DEF_LONG,-1);
137 TypeInfo.type=DEF_LONG;
138 }
139
140 if(!IsWholeNumberType(TypeInfo.type)) SetError(46,NULL,cp);
141 ExtendTypeTo64(TypeInfo.type,reg);
142
143 if(reg==REG_R14){
144 //mov r14,qword ptr[rsp+offset] ※スタックフレームを利用
145 pobj_sf->pop(REG_R14);
146 }
147
148 //mov r12,qword ptr[rsp+offset] ※スタックフレームを利用
149 pobj_sf->pop(REG_R12);
150
151 for(i2=i+1,i4=1;i2<i3;i2++) i4*=SubScripts[i2]+1;
152
153 //imul reg,i4
154 op_imul_value(sizeof(_int64),reg,i4);
155
156 //add r12,reg
157 op_add64_reg(REG_R12,reg);
158
159 HeapDefaultFree(pParm[i]);
160 }
161
162 TypeSize=GetTypeSize(type,lpIndex);
163
164 //imul r12,TypeSize
165 OpBuffer[obp++]=(char)0x4D;
166 OpBuffer[obp++]=(char)0x69;
167 OpBuffer[obp++]=(char)0xE4;
168 *((long *)(OpBuffer+obp))=TypeSize;
169 obp+=sizeof(long);
170
171 //mov r11,qword ptr[rsp+offset] ※スタックフレームを利用
172 pobj_sf->pop(REG_R11);
173
174 //add r11,r12
175 OpBuffer[obp++]=(char)0x4D;
176 OpBuffer[obp++]=(char)0x03;
177 OpBuffer[obp++]=(char)0xDC;
178
179 return 1;
180}
181BOOL GetMemberOffset(bool isErrorEnabled, bool isWriteAccess, CClass *pobj_c, char *member, int *pType, RELATIVE_VAR *pRelativeVar, LONG_PTR *plpNestIndex, BOOL bPrivateAccess){
182 int i,offset;
183
184
185 //////////////////////////////////////
186 // クラス、配列の構成要素を解析する
187 //////////////////////////////////////
188
189 char VarName[VN_SIZE]; //変数名
190 char array[VN_SIZE]; //第1次配列
191 char lpPtrOffset[VN_SIZE]; //第2次配列
192 char NestMember[VN_SIZE]; //入れ子メンバ
193 int RefType; //"."参照のときは0、"->"参照のときは1
194 lstrcpy(VarName,member);
195 if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,&RefType)) return 0;
196
197
198 ////////////////////////////
199 // メンバオフセットを取得
200 ////////////////////////////
201
202 offset=GetSizeOfClassMember(pobj_c,VarName,&i);
203 if(i==pobj_c->iMemberNum){
204 if(isErrorEnabled) SetError(103,VarName,cp);
205 return 0;
206 }
207
208 CMember *pMember=pobj_c->ppobj_Member[i];
209
210
211 //アクセシビリティをチェック
212 if(pobj_c==pobj_CompilingClass){
213 //同一クラスオブジェクトの場合はプライベートアクセスを容認する
214 if(pMember->dwAccess==ACCESS_NON){
215 if(isErrorEnabled) SetError(107,VarName,cp);
216 return 0;
217 }
218 }
219 else{
220 if((bPrivateAccess==0&&pMember->dwAccess==ACCESS_PRIVATE)||
221 pMember->dwAccess==ACCESS_NON){
222 if(isErrorEnabled) SetError(107,VarName,cp);
223 return 0;
224 }
225 else if(bPrivateAccess==0&&pMember->dwAccess==ACCESS_PROTECTED){
226 if(isErrorEnabled) SetError(108,VarName,cp);
227 return 0;
228 }
229 }
230
231 //Const定義の場合は書き込みアクセスを制限する
232 //※コンストラクタをコンパイル中の場合は例外的に許可する
233 if( pMember->IsConst() && //定数メンバである
234 isWriteAccess && //書き込みアクセスを要求されている
235 pobj_c->IsCompilingConstructor() == false //コンストラクタ コンパイル中を除く
236 ){
237 //Const定義の変数に書き込みアクセスをしようとした場合
238 SetError(61,VarName,cp);
239 }
240
241 *pType=pMember->TypeInfo.type;
242 *plpNestIndex=pMember->TypeInfo.u.lpIndex;
243
244 //ポインタ変数の場合
245 if(IsPtrType(*pType)){
246 if(pMember->SubScripts[0]==-1){
247 lstrcpy(lpPtrOffset,array);
248 array[0]=0;
249 }
250 }
251 else{
252 if(lpPtrOffset[0]){
253 if(isErrorEnabled) SetError(16,member,cp);
254 return 0;
255 }
256 }
257
258 if(offset){
259 //add r11,offset
260 OpBuffer[obp++]=(char)0x49;
261 OpBuffer[obp++]=(char)0x81;
262 OpBuffer[obp++]=(char)0xC3;
263 *((long *)(OpBuffer+obp))=offset;
264 obp+=sizeof(long);
265 }
266
267 if(array[0]){
268 //配列オフセット
269 if(!GetArrayOffset(pMember->SubScripts,array,*pType,pMember->TypeInfo.u.lpIndex)){
270 if(isErrorEnabled) SetError(14,member,cp);
271 }
272 }
273 else if(pMember->SubScripts[0]!=-1){
274 *pType|=FLAG_PTR;
275 }
276
277 if(NestMember[0]){
278 //入れ子構造の場合
279
280 if(*pType==DEF_OBJECT && pMember->IsRef() == false){
281 if(RefType!=DEF_OBJECT){
282 if(isErrorEnabled) SetError(104,member,cp);
283 return 0;
284 }
285 }
286 else if(*pType==DEF_PTR_OBJECT || ( *pType==DEF_OBJECT && pMember->IsRef() )){
287 //構造体ポインタ型メンバ変数
288
289 if(lpPtrOffset[0]){
290 //pObj[n].member
291 if(*pType==DEF_PTR_OBJECT&&RefType!=DEF_OBJECT){
292 if(isErrorEnabled) SetError(104,member,cp);
293 return 0;
294 }
295
296 //直接参照に切り替え
297 SetRelativeOffset(pType,*plpNestIndex,pRelativeVar,lpPtrOffset);
298 pRelativeVar->dwKind=VAR_DIRECTMEM;
299
300 lpPtrOffset[0]=0;
301 }
302 else{
303 //pObj->member
304 if(*pType==DEF_PTR_OBJECT&&RefType!=DEF_PTR_OBJECT){
305 if(isErrorEnabled) SetError(104,member,cp);
306 return 0;
307 }
308
309 if(pRelativeVar->dwKind==VAR_DIRECTMEM){
310 //mov r11,qword ptr[r11]
311 op_mov_RM(sizeof(_int64),REG_R11,REG_R11,0,MOD_BASE);
312 }
313 else{
314 //直接参照に切り替え
315 SetVarPtrToReg(REG_R12,pRelativeVar);
316 pRelativeVar->dwKind=VAR_DIRECTMEM;
317
318 //mov r11,qword ptr[r12]
319 op_mov_RM(sizeof(_int64),REG_R11,REG_R12,0,MOD_BASE);
320 }
321 }
322 }
323 else if(*pType==MAKE_PTR_TYPE(DEF_OBJECT,2)){
324 //構造体ポインタのポインタ型メンバ変数
325
326 if(lpPtrOffset[0]){
327 //ppObj[n]->member
328 if(RefType!=DEF_PTR_OBJECT){
329 if(isErrorEnabled) SetError(104,member,cp);
330 return 0;
331 }
332
333 //直接参照に切り替え
334 SetRelativeOffset(pType,*plpNestIndex,pRelativeVar,lpPtrOffset);
335 pRelativeVar->dwKind=VAR_DIRECTMEM;
336
337 lpPtrOffset[0]=0;
338
339 //mov r11,qword ptr[r11]
340 op_mov_RM(sizeof(_int64),REG_R11,REG_R11,0,MOD_BASE);
341 }
342 else{
343 if(isErrorEnabled) SetError(104,member,cp);
344 return 0;
345 }
346 }
347
348 if(!GetMemberOffset(
349 isErrorEnabled,
350 isWriteAccess,
351 pMember->TypeInfo.u.pobj_Class,
352 NestMember,
353 pType,
354 pRelativeVar,
355 plpNestIndex,
356 0)) return 0;
357 }
358
359 if(lpPtrOffset[0]){
360 SetRelativeOffset(pType,*plpNestIndex,pRelativeVar,lpPtrOffset);
361 pRelativeVar->dwKind=VAR_DIRECTMEM;
362 }
363
364 return 1;
365}
366void GetWithName(char *buffer){
367 extern WITHINFO WithInfo;
368 int i;
369
370 buffer[0]=0;
371 for(i=0;i<WithInfo.num;i++)
372 lstrcat(buffer,WithInfo.ppName[i]);
373}
374
375int LocalVar_ThisPtrOffset;
376void SetThisPtrToReg(int reg){
377 //自身のオブジェクトのThisポインタをregにコピー
378
379 extern VARIABLE *LocalVar;
380 RELATIVE_VAR RelativeVar;
381 RelativeVar.dwKind=VAR_LOCAL;
382 RelativeVar.bOffsetOffset=0;
383 RelativeVar.offset=-LocalVar_ThisPtrOffset;
384
385 SetReg_WholeVariable(DEF_PTR_VOID,&RelativeVar,reg);
386}
387BOOL GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss){
388 extern BOOL bCompilingGlobal;
389 int i,RefType;
390 char variable[VN_SIZE],member[VN_SIZE],VarName[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];
391
392 if(NameBuffer[0]=='.'){
393 GetWithName(variable);
394 lstrcat(variable,NameBuffer);
395 }
396 else lstrcpy(variable,NameBuffer);
397
398 lstrcpy(VarName,variable);
399 GetVarFormatString(VarName,array,lpPtrOffset,member,&RefType);
400
401 LONG_PTR lpIndex;
402 int *pSubScripts;
403 bool bConst = false;
404
405
406 if(bCompilingGlobal==0){
407 //////////////////
408 // ローカル変数
409 //////////////////
410
411 for(i=MaxLocalVarNum-1;i>=0;i--){ //レキシカルスコープを考慮してバックサーチ
412 if( LocalVar[i].bLiving //現在のスコープで有効なもの
413 && LocalVar[i].ScopeLevel <= obj_LexScopes.GetNowLevel() //現在のスコープレベルを超さないもの(Returnによる解放処理中を考慮)
414 ){
415 if(lstrcmp(VarName,LocalVar[i].name)==0) break;
416 }
417 }
418 if(i>=0){
419 //ポインタ変数の場合
420 if(IsPtrType(LocalVar[i].type)){
421 if(LocalVar[i].SubScripts[0]==-1){
422 lstrcpy(lpPtrOffset,array);
423 array[0]=0;
424 }
425 }
426 else{
427 if(lpPtrOffset[0]){
428 SetError(16,variable,cp);
429 pRelativeVar->dwKind=NON_VAR;
430 return 0;
431 }
432 }
433
434 pRelativeVar->offset=-LocalVar[i].offset;
435 pRelativeVar->bOffsetOffset=0;
436 if(LocalVar[i].fRef){
437 // 参照型
438 pRelativeVar->dwKind = VAR_REFLOCAL;
439 }
440 else pRelativeVar->dwKind=VAR_LOCAL;
441 *pType=LocalVar[i].type;
442 lpIndex=LocalVar[i].u.index;
443 if(plpIndex) *plpIndex=lpIndex;
444 pSubScripts=LocalVar[i].SubScripts;
445 bConst = LocalVar[i].bConst;
446
447 goto ok;
448 }
449 }
450
451
452 if(pobj_CompilingClass){
453 //////////////////////
454 // クラスメンバの参照
455 //////////////////////
456
457 if(lstrcmpi(variable,"This")==0){
458 //自身のオブジェクトのThisポインタをr11にコピー
459 SetThisPtrToReg(REG_R11);
460
461 *pType=DEF_OBJECT;
462 pRelativeVar->dwKind=VAR_DIRECTMEM;
463
464 if(plpIndex) *plpIndex=(LONG_PTR)pobj_CompilingClass;
465 return 1;
466 }
467
468 if(memicmp(variable,"This.",5)==0){
469 //Thisオブジェクトのメンバを参照するとき
470 SlideString(variable+5,-5);
471 lstrcpy(VarName,variable);
472 }
473 else{
474 //クラス内メンバを参照するとき(通常)
475
476 for(i=0;i<pobj_CompilingClass->iMemberNum;i++){
477 if(lstrcmp(VarName,pobj_CompilingClass->ppobj_Member[i]->name)==0) break;
478 }
479 if(i==pobj_CompilingClass->iMemberNum) goto NonClassMember;
480 }
481
482 //Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき
483 //(コンストラクタ、デストラクタ内を除く)
484 CMethod *pMethod = pobj_DBClass->GetNowCompilingMethodInfo();
485 if( isWriteAccess &&
486 pMethod->isConst &&
487 pobj_CompilingClass->IsCompilingConstructor() == false &&
488 pobj_CompilingClass->IsCompilingDestructor() == false
489 ){
490 SetError(131, NULL, cp );
491 }
492
493 //自身のオブジェクトのThisポインタをr11にコピー
494 SetThisPtrToReg(REG_R11);
495
496 pRelativeVar->dwKind=VAR_DIRECTMEM;
497 if(!GetMemberOffset(
498 isErrorEnabled,
499 isWriteAccess,
500 pobj_CompilingClass,
501 variable,
502 pType,
503 pRelativeVar,
504 &lpIndex,1)) return 0;
505 if(plpIndex) *plpIndex=lpIndex;
506 return 1;
507 }
508
509NonClassMember:
510
511 //////////////////////////
512 // 静的ローカル変数
513 // ※"Static.Object.Method.Variable"
514 //////////////////////////
515
516 char temporary[VN_SIZE];
517 extern SUBINFO *pCompilingSubInfo;
518 if(pCompilingSubInfo){
519 GetNowStaticVarFullName(VarName,temporary);
520
521 for(i=0;i<MaxGlobalVarNum;i++){
522 if(lstrcmp(temporary,GlobalVar[i].name)==0) break;
523 }
524 if(i!=MaxGlobalVarNum){
525 goto GlobalOk;
526 }
527 }
528
529
530 //////////////////////////
531 // クラスの静的メンバ
532 //////////////////////////
533
534 if(member[0]){
535 lstrcpy(temporary,member);
536
537 char tempMember[VN_SIZE];
538 char tempArray[VN_SIZE];
539 GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember,&i);
540
541 char temp2[VN_SIZE];
542 sprintf(temp2,"%s.%s",VarName,temporary);
543 for(i=0;i<MaxGlobalVarNum;i++){
544 if(lstrcmp(temp2,GlobalVar[i].name)==0) break;
545 }
546
547 if(i!=MaxGlobalVarNum){
548 lstrcpy(member,tempMember);
549 lstrcpy(array,tempArray);
550 goto GlobalOk;
551 }
552 }
553
554 if(pobj_CompilingClass){
555 //自身のクラスから静的メンバを参照する場合
556 char temp2[VN_SIZE];
557 sprintf(temp2,"%s.%s",pobj_CompilingClass->name,VarName);
558 for(i=0;i<MaxGlobalVarNum;i++){
559 if(lstrcmp(temp2,GlobalVar[i].name)==0) break;
560 }
561
562 if(i!=MaxGlobalVarNum){
563 goto GlobalOk;
564 }
565 }
566
567
568 /////////////////////
569 // グローバル変数
570 /////////////////////
571
572 for(i=MaxGlobalVarNum-1;i>=0;i--){ //レキシカルスコープを考慮してバックサーチ
573 if( GlobalVar[i].bLiving //現在のスコープで有効なもの
574 && GlobalVar[i].ScopeLevel <= obj_LexScopes.GetNowLevel() //現在のスコープレベルを超さないもの(Returnによる解放処理中を考慮)
575 ){
576 if(lstrcmp(VarName,GlobalVar[i].name)==0) break;
577 }
578 }
579 if(i>=0){
580 goto GlobalOk;
581 }
582
583 if(isErrorEnabled) SetError(3,variable,cp);
584 pRelativeVar->dwKind=NON_VAR;
585 return 0;
586
587
588
589GlobalOk:
590 //ポインタ変数の場合
591 if(IsPtrType(GlobalVar[i].type)){
592 if(GlobalVar[i].SubScripts[0]==-1){
593 lstrcpy(lpPtrOffset,array);
594 array[0]=0;
595 }
596 }
597 else{
598 if(lpPtrOffset[0]){
599 SetError(16,variable,cp);
600 pRelativeVar->dwKind=NON_VAR;
601 return 0;
602 }
603 }
604
605 pRelativeVar->offset=GlobalVar[i].offset;
606 pRelativeVar->bOffsetOffset=0;
607 pRelativeVar->dwKind=VAR_GLOBAL;
608 *pType=GlobalVar[i].type;
609 lpIndex=GlobalVar[i].u.index;
610 if(plpIndex) *plpIndex=lpIndex;
611 pSubScripts=GlobalVar[i].SubScripts;
612 bConst = GlobalVar[i].bConst;
613
614
615
616ok:
617
618 if( bConst && isWriteAccess ){
619 //Const定義の変数に書き込みアクセスをしようとした場合
620 if( *pType == DEF_OBJECT ){
621 //オブジェクト定数
622 SetError(130, VarName, cp );
623 }
624 else{
625 //一般のConst変数
626 SetError(61,VarName,cp);
627 }
628 }
629
630 if(array[0]==0&&pSubScripts[0]!=-1){
631 //配列の先頭ポインタを示す場合
632 *pType|=FLAG_PTR;
633 if(pss) memcpy(pss,pSubScripts,MAX_ARRAYDIM);
634 return 1;
635 }
636
637 if(array[0]||member[0]){
638 //xor r11,r11(r11を0に初期化する)
639 //※r11は変数ベースアドレスからの相対オフセットを示す
640 op_zero_reg(REG_R11);
641
642 pRelativeVar->bOffsetOffset=1;
643 }
644 if(array[0]){
645 if(!GetArrayOffset(pSubScripts,array,*pType,lpIndex)){
646 SetError(14,variable,cp);
647 pRelativeVar->dwKind=NON_VAR;
648 return 0;
649 }
650 }
651 if(member[0]){
652 if(*pType==DEF_OBJECT){
653 //実態オブジェクトのメンバを参照(obj.member)
654 if(RefType!=DEF_OBJECT){
655 SetError(104,VarName,cp);
656 pRelativeVar->dwKind=NON_VAR;
657 return 0;
658 }
659 }
660 else if(*pType==DEF_PTR_OBJECT){
661 //ポインタオブジェクトが示すメンバを参照
662 if(lpPtrOffset[0]){
663 //pObj[n].member
664 if(RefType!=DEF_OBJECT){
665 SetError(104,VarName,cp);
666 pRelativeVar->dwKind=NON_VAR;
667 return 0;
668 }
669 SetRelativeOffset(pType,lpIndex,pRelativeVar,lpPtrOffset);
670 pRelativeVar->dwKind=VAR_DIRECTMEM;
671 }
672 else{
673 //pObj->member
674 if(RefType!=DEF_PTR_OBJECT){
675 SetError(104,VarName,cp);
676 pRelativeVar->dwKind=NON_VAR;
677 return 0;
678 }
679
680 SetVarPtrToReg(REG_R12,pRelativeVar);
681 pRelativeVar->dwKind=VAR_DIRECTMEM;
682
683 //mov r11,qword ptr[r12]
684 op_mov_RM(sizeof(_int64),REG_R11,REG_R12,0,MOD_BASE);
685 }
686 }
687 else if(*pType==MAKE_PTR_TYPE(DEF_OBJECT,2)){
688 //ポインタオブジェクトが示すメンバを参照
689 if(lpPtrOffset[0]){
690 //ppObj[n]->member
691 if(RefType!=DEF_PTR_OBJECT){
692 SetError(104,VarName,cp);
693 pRelativeVar->dwKind=NON_VAR;
694 return 0;
695 }
696
697 SetRelativeOffset(pType,lpIndex,pRelativeVar,lpPtrOffset);
698 pRelativeVar->dwKind=VAR_DIRECTMEM;
699
700
701 SetVarPtrToReg(REG_R12,pRelativeVar);
702
703 //mov r11,qword ptr[r12]
704 op_mov_RM(sizeof(_int64),REG_R11,REG_R12,0,MOD_BASE);
705 }
706 else{
707 SetError(104,VarName,cp);
708 pRelativeVar->dwKind=NON_VAR;
709 return 0;
710 }
711 }
712 else{
713 SetError(102,VarName,cp);
714 pRelativeVar->dwKind=NON_VAR;
715 return 0;
716 }
717
718 LONG_PTR lp2;
719 if(!GetMemberOffset(
720 isErrorEnabled,
721 isWriteAccess,
722 (CClass *)lpIndex,
723 member,pType,pRelativeVar,&lp2,0)) return 0;
724 if(plpIndex) *plpIndex=lp2;
725
726 return 1;
727 }
728
729 if(lpPtrOffset[0]){
730 SetRelativeOffset(pType,lpIndex,pRelativeVar,lpPtrOffset);
731 pRelativeVar->dwKind=VAR_DIRECTMEM;
732 }
733
734 return 1;
735}
736
737BOOL SetInitGlobalData(int offset,int type,LONG_PTR lpIndex,int *SubScripts,char *InitBuf){
738 extern BYTE *initGlobalBuf;
739 int i,i2,i3,TypeSize;
740 char temporary[VN_SIZE];
741
742 if(InitBuf[0]=='['){
743 SlideString(InitBuf+1,-1);
744 InitBuf[lstrlen(InitBuf)-1]=0;
745
746 TypeSize=GetTypeSize(type,lpIndex);
747
748 if(SubScripts[0]!=-1){
749 TypeSize*=JumpSubScripts(SubScripts+1);
750 i=0;
751 i2=0;
752 while(1){
753 if(SubScripts[0]<i2){
754 SetError(41,0,cp);
755 return 0;
756 }
757 i=GetOneParameter(InitBuf,i,temporary);
758 if(!SetInitGlobalData(
759 offset+i2*TypeSize,
760 type,
761 lpIndex,
762 SubScripts+1,
763 temporary)) return 0;
764 i2++;
765 if(InitBuf[i]=='\0') break;
766 }
767 return -1;
768 }
769
770 if(type==DEF_OBJECT){
771 CClass *pobj_c;
772 pobj_c=(CClass *)lpIndex;
773
774 for(i=0,i2=0;i2<pobj_c->iMemberNum;i2++){
775 i=GetOneParameter(InitBuf,i,temporary);
776
777 i3=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i2]->name,NULL);
778
779 if(!SetInitGlobalData(offset+i3,
780 pobj_c->ppobj_Member[i2]->TypeInfo.type,
781 pobj_c->ppobj_Member[i2]->TypeInfo.u.lpIndex,
782 pobj_c->ppobj_Member[i2]->SubScripts,
783 temporary)) return 0;
784
785 if(InitBuf[i]=='\0') break;
786 }
787 if(i2+1!=pobj_c->iMemberNum){
788 SetError(41,0,cp);
789 return 0;
790 }
791 return 1;
792 }
793
794 SetError(41,0,cp);
795 return 0;
796 }
797
798
799 ///////////////////////////////////////
800 // 単発式([]で囲まれていない)
801 ///////////////////////////////////////
802
803 if( type == DEF_OBJECT){
804 //オブジェクトの場合はありえない
805 SetError(300,NULL,cp);
806 return 0;
807 }
808
809 if(SubScripts[0]!=-1){
810 SetError(41,0,cp);
811 return 0;
812 }
813
814 double dbl;
815 _int64 i64data;
816 int CalcType;
817 LONG_PTR lpCalcIndex;
818
819 CalcType=StaticCalculation(false, InitBuf,type,&i64data,&lpCalcIndex);
820 if(!CalcType){
821 //動的データだった場合
822 return 0;
823 }
824 if(IsRealNumberType(CalcType)){
825 memcpy(&dbl,&i64data,sizeof(double));
826 i64data=(_int64)dbl;
827 }
828 else dbl=(double)i64data;
829
830 //型チェック
831 CheckDifferentType(
832 type,
833 lpIndex,
834 CalcType,
835 lpCalcIndex,
836 0,0);
837
838 if(type==DEF_DOUBLE)
839 *(double *)(initGlobalBuf+offset)=(double)dbl;
840 else if(type==DEF_SINGLE)
841 *(float *)(initGlobalBuf+offset)=(float)dbl;
842 else if(type==DEF_INT64||type==DEF_QWORD||IsPtrType(type)){
843 if(type==DEF_PTR_BYTE&&lpCalcIndex==LITERAL_STRING){
844 //文字列定数のとき
845
846 char *temp;
847 temp=(char *)i64data;
848 i2=AddDataTable(temp,lstrlen(temp));
849 HeapDefaultFree(temp);
850
851 //mov rax,DataPos
852 op_mov_RV(sizeof(_int64),REG_RAX,i2);
853 obp-=sizeof(long);
854 pobj_DataTableSchedule->add();
855 obp+=sizeof(long);
856
857 //mov qword ptr[offset],rax
858 op_mov_MR(sizeof(_int64),REG_RAX,0,offset,MOD_DISP32);
859 obp-=sizeof(long);
860 pobj_GlobalVarSchedule->add();
861 obp+=sizeof(long);
862 }
863 else{
864 *(_int64 *)(initGlobalBuf+offset)=i64data;
865 }
866 }
867 else if(type==DEF_LONG||type==DEF_DWORD)
868 *(DWORD *)(initGlobalBuf+offset)=(DWORD)i64data;
869 else if(type==DEF_INTEGER||type==DEF_WORD)
870 *(WORD *)(initGlobalBuf+offset)=(WORD)i64data;
871 else if(type==DEF_CHAR||type==DEF_BYTE||type==DEF_BOOLEAN)
872 *(BYTE *)(initGlobalBuf+offset)=(BYTE)i64data;
873
874 return 1;
875}
876BOOL InitLocalVar(int offset,int type,LONG_PTR lpIndex,int *SubScripts,char *InitBuf){
877 int i,i2,i3,TypeSize;
878 char temporary[VN_SIZE];
879
880 if(InitBuf[0]=='['){
881 SlideString(InitBuf+1,-1);
882 InitBuf[lstrlen(InitBuf)-1]=0;
883
884 TypeSize=GetTypeSize(type,lpIndex);
885
886 if(SubScripts[0]!=-1){
887 TypeSize*=JumpSubScripts(SubScripts+1);
888 i=0;
889 i2=0;
890 while(1){
891 if(SubScripts[0]<i2){
892 SetError(41,0,cp);
893 return 0;
894 }
895 i=GetOneParameter(InitBuf,i,temporary);
896 if(!InitLocalVar(
897 offset+i2*TypeSize,
898 type,
899 lpIndex,
900 SubScripts+1,
901 temporary)) return 0;
902 i2++;
903 if(InitBuf[i]=='\0') break;
904 }
905 return -1;
906 }
907
908 if(type==DEF_OBJECT){
909 CClass *pobj_c;
910 pobj_c=(CClass *)lpIndex;
911
912 for(i=0,i2=0;i2<pobj_c->iMemberNum;i2++){
913 i=GetOneParameter(InitBuf,i,temporary);
914
915 i3=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i2]->name,NULL);
916
917 if(!InitLocalVar(offset+i3,
918 pobj_c->ppobj_Member[i2]->TypeInfo.type,
919 pobj_c->ppobj_Member[i2]->TypeInfo.u.lpIndex,
920 pobj_c->ppobj_Member[i2]->SubScripts,
921 temporary)) return 0;
922
923 if(InitBuf[i]=='\0') break;
924 }
925 if(i2+1!=pobj_c->iMemberNum){
926 SetError(41,0,cp);
927 return 0;
928 }
929 return 1;
930 }
931
932 SetError(41,0,cp);
933 return 0;
934 }
935
936
937 ///////////////////////////////////////
938 // 単発式([]で囲まれていない)
939 ///////////////////////////////////////
940
941 if(SubScripts[0]!=-1){
942 SetError(41,0,cp);
943 return 0;
944 }
945
946 double dbl;
947 _int64 i64data;
948 int CalcType;
949 LONG_PTR lpCalcIndex;
950 CalcType=StaticCalculation(false, InitBuf,type,&i64data,&lpCalcIndex);
951 if(!CalcType){
952 //動的データだった場合
953 return 0;
954 }
955 if(IsRealNumberType(CalcType)){
956 memcpy(&dbl,&i64data,sizeof(double));
957 i64data=(_int64)dbl;
958 }
959 else dbl=(double)i64data;
960
961 //型チェック
962 CheckDifferentType(
963 type,
964 lpIndex,
965 CalcType,
966 lpCalcIndex,
967 0,0);
968
969 if(type==DEF_DOUBLE){
970 memcpy(&i64data,&dbl,sizeof(double));
971
972 //mov rax,i64data
973 op_mov64_ToReg(REG_RAX,i64data);
974
975 //mov qword ptr[rsp+offset],rax
976 op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32);
977 obp-=sizeof(long);
978 AddLocalVarAddrSchedule();
979 obp+=sizeof(long);
980 }
981 else if(type==DEF_SINGLE){
982 float flt;
983 flt=(float)dbl;
984
985 //mov dword ptr[rsp+offset],value
986 op_mov_MV(sizeof(long),REG_RSP,offset,USE_OFFSET,*(int *)&flt);
987 obp-=sizeof(long)+sizeof(long);
988 AddLocalVarAddrSchedule();
989 obp+=sizeof(long)+sizeof(long);
990 }
991 else if(type==DEF_INT64||type==DEF_QWORD||IsPtrType(type)){
992 if(type==DEF_PTR_BYTE&&lpCalcIndex==LITERAL_STRING){
993 //文字列定数のとき
994
995 char *temp;
996 temp=(char *)i64data;
997 i2=AddDataTable(temp,lstrlen(temp));
998 HeapDefaultFree(temp);
999
1000 //mov rax,i2
1001 op_mov_RV(sizeof(_int64),REG_RAX,i2);
1002 obp-=sizeof(long);
1003 pobj_DataTableSchedule->add();
1004 obp+=sizeof(long);
1005
1006 //mov qword ptr[rsp+offset],rax
1007 op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32);
1008 obp-=sizeof(long);
1009 AddLocalVarAddrSchedule();
1010 obp+=sizeof(long);
1011 }
1012 else{
1013 if(i64data&0xFFFFFFFF00000000){
1014 //mov rax,i64data
1015 op_mov64_ToReg(REG_RAX,i64data);
1016
1017 //mov qword ptr[rsp+offset],rax
1018 op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32);
1019 obp-=sizeof(long);
1020 AddLocalVarAddrSchedule();
1021 obp+=sizeof(long);
1022 }
1023 else{
1024 //mov qword ptr[rsp+offset],value
1025 op_mov_MV(sizeof(_int64),REG_RSP,offset,USE_OFFSET,(int)i64data);
1026 obp-=sizeof(long)+sizeof(long);
1027 AddLocalVarAddrSchedule();
1028 obp+=sizeof(long)+sizeof(long);
1029 }
1030 }
1031 }
1032 else if(type==DEF_LONG||type==DEF_DWORD){
1033 //mov dword ptr[rsp+offset],value
1034 op_mov_MV(sizeof(long),REG_RSP,offset,USE_OFFSET,(int)i64data);
1035 obp-=sizeof(long)+sizeof(long);
1036 AddLocalVarAddrSchedule();
1037 obp+=sizeof(long)+sizeof(long);
1038 }
1039 else if(type==DEF_INTEGER||type==DEF_WORD){
1040 //mov word ptr[rsp+offset],value
1041 op_mov_MV(sizeof(short),REG_RSP,offset,USE_OFFSET,(int)i64data);
1042 obp-=sizeof(long)+sizeof(short);
1043 AddLocalVarAddrSchedule();
1044 obp+=sizeof(long)+sizeof(short);
1045 }
1046 else if(type==DEF_CHAR||type==DEF_BYTE||type==DEF_BOOLEAN){
1047 //mov byte ptr[rsp+offset],value
1048 op_mov_MV(sizeof(char),REG_RSP,offset,USE_OFFSET,(int)i64data);
1049 obp-=sizeof(long)+sizeof(char);
1050 AddLocalVarAddrSchedule();
1051 obp+=sizeof(long)+sizeof(char);
1052 }
1053 return 1;
1054}
1055
1056
1057void dim(char *Parameter,DWORD dwFlags){
1058 extern BOOL bCompilingGlobal;
1059 extern HANDLE hHeap;
1060 int i2,i3,VarSize;
1061 char VarName[VN_SIZE];
1062
1063 //参照型かどうか
1064 bool isRef = false;
1065
1066 i2 = 0;
1067
1068 if( Parameter[i2] == 1 && Parameter[i2+1] == ESC_BYREF ){
1069 //参照型
1070 isRef = true;
1071 Parameter += 2;
1072 }
1073
1074 if(dwFlags & DIMFLAG_CONST){
1075
1076 //////////////////////////////////
1077 // 定数変数の場合を考慮
1078 //////////////////////////////////
1079 for(;;i2++){
1080 if(Parameter[i2] == '=' ||
1081 Parameter[i2] == 1 && Parameter[i2] == ESC_AS ||
1082 Parameter[i2] =='('){
1083 VarName[i2] = 0;
1084 break;
1085 }
1086 VarName[i2] = Parameter[i2];
1087 }
1088
1089 //定数と2重定義されていないる場合は抜け出す
1090 if(CDBConst::obj.GetType(VarName)){
1091 return;
1092 }
1093
1094 //定数マクロとして定義されている場合は抜け出す
1095 if(GetConstHash(VarName)){
1096 return;
1097 }
1098 }
1099
1100
1101 //構文を解析
1102 int SubScripts[MAX_ARRAYDIM];
1103 TYPEINFO TypeInfo;
1104 char InitBuf[8192];
1105 char ConstractParameter[VN_SIZE];
1106 if(!GetDimentionFormat(Parameter, isRef , VarName,SubScripts,&TypeInfo,InitBuf,ConstractParameter))
1107 return;
1108
1109
1110 //定数と2重定義されていないかを調べる
1111 if(CDBConst::obj.GetType(VarName)){
1112 SetError(15,VarName,cp);
1113 return;
1114 }
1115
1116 //定数マクロとして定義されている場合
1117 if(GetConstHash(VarName)){
1118 SetError(15,VarName,cp);
1119 return;
1120 }
1121
1122
1123 //タイプサイズを取得
1124 int TypeSize;
1125 TypeSize=GetTypeSize(TypeInfo.type,TypeInfo.u.lpIndex);
1126
1127 if(dwFlags&DIMFLAG_STATIC){
1128 if(bCompilingGlobal){
1129 SetError(60,NULL,cp);
1130 return;
1131 }
1132
1133 /////////////////////
1134 // Static変数
1135 // ※"Static.Object.Method.Variable"
1136 /////////////////////
1137
1138 char temporary[VN_SIZE];
1139 GetNowStaticVarFullName(VarName,temporary);
1140
1141 AddGlobalVariable(temporary,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);
1142
1143 /*
1144 Note: 静的変数のコンストラクタ呼び出しは
1145 _System_InitStaticLocalVariables関数内で一括して行う
1146 */
1147 }
1148 else{
1149 if(bCompilingGlobal){
1150 /////////////////////////
1151 // グローバル変数
1152 /////////////////////////
1153
1154 AddGlobalVariable(VarName,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);
1155 }
1156 else{
1157 /////////////////
1158 // ローカル変数
1159 /////////////////
1160
1161 for(i2=0;i2<MaxLocalVarNum;i2++){
1162 if(LocalVar[i2].bLiving&&obj_LexScopes.GetNowLevel()==LocalVar[i2].ScopeLevel){
1163 if(lstrcmp(LocalVar[i2].name,VarName)==0){
1164 //2重定義のエラー
1165 SetError(15,VarName,cp);
1166 return;
1167 }
1168 }
1169 }
1170
1171 LocalVar=(VARIABLE *)HeapReAlloc(hHeap,0,LocalVar,(MaxLocalVarNum+1)*sizeof(VARIABLE));
1172 VARIABLE *pVar = &LocalVar[MaxLocalVarNum];
1173 MaxLocalVarNum++;
1174
1175 if( isRef ){
1176 //参照型
1177 pVar->fRef = REF_VARIABLE;
1178 TypeSize = PTR_SIZE;
1179 }
1180 else pVar->fRef=0;
1181
1182 for(i2=1,i3=0;i3<255;i3++){
1183 //配列要素数
1184 pVar->SubScripts[i3]=SubScripts[i3];
1185
1186 if(SubScripts[i3]==-1) break;
1187 i2*=SubScripts[i3]+1;
1188 }
1189 VarSize=TypeSize*i2;
1190 if(VarSize%8) VarSize+=8-(VarSize%8);
1191
1192 //変数データを追加
1193 lstrcpy(pVar->name,VarName);
1194 if(dwFlags & DIMFLAG_CONST) pVar->bConst = true;
1195 else pVar->bConst = false;
1196 if(SubScripts[0]==-1) pVar->bArray=0;
1197 else pVar->bArray=1;
1198 pVar->type=TypeInfo.type;
1199 pVar->u.index=TypeInfo.u.lpIndex;
1200 AllLocalVarSize+=VarSize;
1201 pVar->offset=AllLocalVarSize;
1202
1203 //レキシカルスコープ
1204 pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
1205 pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
1206 pVar->bLiving=TRUE;
1207
1208 if(InitBuf[0]){
1209 //初期代入時のみ、書き込みアクセスを許可する
1210 bool bConstBack = pVar->bConst;
1211 pVar->bConst = false;
1212
1213 int result = InitLocalVar(-pVar->offset,
1214 pVar->type,
1215 pVar->u.index,
1216 pVar->SubScripts,
1217 InitBuf);
1218
1219 if(!result){
1220 //動的な式だった場合は代入演算を行う
1221 if( isRef ){
1222 SetRefVariable( VarName, InitBuf );
1223 }
1224 else{
1225 char temporary[8192];
1226 sprintf(temporary,"%s=%s",VarName,InitBuf);
1227 OpcodeCalc(temporary);
1228 }
1229 }
1230
1231 pVar->bConst = bConstBack;
1232 }
1233 else{
1234 //0初期化
1235
1236 //mov r8, 0
1237 op_zero_reg( REG_R8 );
1238
1239 //mov rdx, VarSize
1240 op_mov_RV( sizeof(_int64), REG_RDX, VarSize );
1241
1242 //mov rcx, rsp
1243 op_mov_RR( REG_RCX, REG_RSP );
1244
1245 //add rcx, offset
1246 op_add64_value( REG_RCX, -pVar->offset );
1247 obp-=sizeof(long);
1248 AddLocalVarAddrSchedule();
1249 obp+=sizeof(long);
1250
1251 //call FillMemory
1252 DECLAREINFO *pdi;
1253 pdi=GetDeclareHash("FillMemory");
1254 op_call( pdi );
1255 }
1256 }
1257
1258 //コンストラクタ呼び出し
1259 if(TypeInfo.type==DEF_OBJECT&&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0&& isRef == false ){
1260 CallConstractor(VarName,SubScripts,TypeInfo,ConstractParameter);
1261 }
1262 }
1263
1264 if(TypeInfo.type==DEF_OBJECT){
1265 if(TypeInfo.u.pobj_Class->IsAbstract()){
1266 //抽象クラスだったとき
1267 SetError(125,TypeInfo.u.pobj_Class->name,cp);
1268 }
1269 }
1270}
1271void OpcodeDim(char *Parameter,DWORD dwFlags){
1272 int i,i2,i3,IsStr=0;
1273 char temporary[8192];
1274
1275 for(i=0,i2=0;;i++,i2++){
1276 if(Parameter[i]=='\"') IsStr^=1;
1277 if(Parameter[i]=='('&&IsStr==0){
1278 i3=GetStringInPare(temporary+i2,Parameter+i);
1279 i+=i3-1;
1280 i2+=i3-1;
1281 continue;
1282 }
1283 if(Parameter[i]=='['&&IsStr==0){
1284 i3=GetStringInBracket(temporary+i2,Parameter+i);
1285 i+=i3-1;
1286 i2+=i3-1;
1287 continue;
1288 }
1289 if((Parameter[i]==','&&IsStr==0)||
1290 Parameter[i]=='\0'){
1291 temporary[i2]=0;
1292
1293 dim(temporary,dwFlags);
1294
1295 if(Parameter[i]=='\0') break;
1296 i2=-1;
1297 continue;
1298 }
1299 temporary[i2]=Parameter[i];
1300 }
1301}
1302
1303void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar){
1304 if(!IsGeneralReg(reg)) SetError(300,NULL,cp);
1305
1306 if(pRelativeVar->dwKind==VAR_GLOBAL){
1307 if(pRelativeVar->bOffsetOffset){
1308 //add r11,offset
1309 OpBuffer[obp++]=(char)0x49;
1310 OpBuffer[obp++]=(char)0x81;
1311 OpBuffer[obp++]=(char)0xC3;
1312 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
1313 pobj_GlobalVarSchedule->add();
1314 obp+=sizeof(long);
1315
1316 //mov reg,r11
1317 op_mov64_ToReg_FromReg(reg,REG_R11);
1318 }
1319 else{
1320 //mov reg,offset
1321 op_mov64_ToReg(reg,(int)pRelativeVar->offset);
1322 obp-=sizeof(long);
1323 pobj_GlobalVarSchedule->add();
1324 obp+=sizeof(long);
1325 }
1326 }
1327 else if(pRelativeVar->dwKind==VAR_LOCAL){
1328 if(pRelativeVar->bOffsetOffset){
1329 //add r11,offset
1330 OpBuffer[obp++]=(char)0x49;
1331 OpBuffer[obp++]=(char)0x81;
1332 OpBuffer[obp++]=(char)0xC3;
1333 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
1334 AddLocalVarAddrSchedule();
1335 obp+=sizeof(long);
1336
1337 //add r11,rsp
1338 op_add64_reg(REG_R11,REG_RSP);
1339
1340 //mov reg,r11
1341 op_mov64_ToReg_FromReg(reg,REG_R11);
1342 }
1343 else{
1344 //mov reg,rsp
1345 op_mov64_ToReg_FromReg(reg,REG_RSP);
1346
1347 //add reg,offset
1348 op_add64_value(reg,(int)pRelativeVar->offset);
1349 obp-=sizeof(long);
1350 AddLocalVarAddrSchedule();
1351 obp+=sizeof(long);
1352 }
1353 }
1354 else if( pRelativeVar->dwKind == VAR_REFLOCAL ){
1355 if(pRelativeVar->bOffsetOffset){
1356 //add r11,qword ptr[rsp+offset]
1357 OpBuffer[obp++]=(char)0x4C;
1358 OpBuffer[obp++]=(char)0x03;
1359 OpBuffer[obp++]=(char)0x9C;
1360 OpBuffer[obp++]=(char)0x24;
1361 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
1362 AddLocalVarAddrSchedule();
1363 obp+=sizeof(long);
1364 }
1365 else{
1366 //mov r11,qword ptr[rsp+offset]
1367 op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
1368 obp-=sizeof(long);
1369 AddLocalVarAddrSchedule();
1370 obp+=sizeof(long);
1371 }
1372
1373 goto directmem;
1374 }
1375 else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
1376directmem:
1377 //mov reg,r11
1378 op_mov64_ToReg_FromReg(reg,REG_R11);
1379 }
1380}
Note: See TracBrowser for help on using the repository browser.