source: dev/trunk/ab5.0/abdev/compiler_x64/NumOpe.cpp@ 592

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

[591]を64bit版にマージ。

File size: 37.6 KB
Line 
1#include "stdafx.h"
2
3#include <Compiler.h>
4
5#include "../BasicCompiler_Common/common.h"
6#include "Opcode.h"
7
8void NewStringObject(int reg, const char *str){
9 ///////////////////////////////////////////////////////
10 // lpszTextを元にStringオブジェクトを生成し、
11 // オブジェクトポインタをregに格納する
12 ///////////////////////////////////////////////////////
13
14
15 //////////////////////////////////////////////////////
16 ///// レジスタ資源のバックアップ
17 { BACKUP_REGISTER_RESOURCE
18 //////////////////////////////////////////////////////
19
20 char *parameter = (char *)malloc( lstrlen( str ) + 32 );
21 sprintf( parameter, "%s%c%c*Char", str, 1, ESC_AS );
22
23 Operator_New( *compiler.GetObjectModule().meta.GetClasses().GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *compiler.GetObjectModule().meta.GetClasses().GetStringClassPtr() ) );
24
25 free( parameter );
26
27 //mov reg,rax
28 compiler.codeGenerator.op_mov_RR( reg, REG_RAX );
29
30 /////////////////////////////////////////////
31 ////// レジスタ資源を復元
32 RESTORE_REGISTER_RESOURCE
33 }////////////////////////////////////////////
34}
35
36void SetUseRegFromRax(int type,int UseReg,int XmmReg){
37 if(IsRealNumberType(type)){
38 //実数型
39 if(XmmReg==REG_XMM4){
40 if(type==DEF_DOUBLE){
41 //movsd qword ptr[rsp+offset],xmm0 ※スタックフレームを利用
42 pobj_sf->push(REG_XMM0,sizeof(double));
43 }
44 if(type==DEF_SINGLE){
45 //movss dword ptr[rsp+offset],xmm0 ※スタックフレームを利用
46 pobj_sf->push(REG_XMM0,sizeof(float));
47 }
48 }
49 else{
50 if(type==DEF_DOUBLE){
51 //movsd xmm_reg,xmm0
52 compiler.codeGenerator.op_movsd_RR(XmmReg,REG_XMM0);
53 }
54 else if(type==DEF_SINGLE){
55 //movss xmm_reg,xmm0
56 compiler.codeGenerator.op_movss_RR(XmmReg,REG_XMM0);
57 }
58 }
59 }
60 else{
61 //整数型
62 if(UseReg==REG_R14){
63 //mov qword ptr[rsp+offset],rax ※スタックフレームを利用
64 pobj_sf->push(REG_RAX);
65 }
66 else{
67 //mov reg,rax
68 compiler.codeGenerator.op_mov_RR(UseReg,REG_RAX);
69 }
70 }
71}
72
73void ExtendRegToBigType( int reg, int bigBasicType, int baseBasicType ){
74 switch( Type::GetBasicSize( bigBasicType ) ){
75 case sizeof(_int64):
76 ExtendTypeTo64(baseBasicType,reg);
77 break;
78 case sizeof(long):
79 ExtendTypeTo32(baseBasicType,reg);
80 break;
81 case sizeof(short):
82 ExtendTypeTo16(baseBasicType,reg);
83 break;
84 }
85}
86
87
88bool VarToReg( RELATIVE_VAR &relativeVar, const Type &baseType, Type &resultType ){
89 int UseReg=pobj_reg->GetNextReg();
90 int XmmReg=pobj_reg->GetNextXmmReg();
91
92 //大きな型への暗黙の変換
93 int bigType = AutoBigCast(baseType.GetBasicType(),resultType.GetBasicType());
94
95 if(resultType.GetBasicType()&FLAG_PTR){
96 //配列ポインタ
97 resultType.SetBasicType( GetPtrType(resultType.GetBasicType()^FLAG_PTR) );
98
99 SetVarPtrToReg(UseReg,&relativeVar);
100 }
101 else if(resultType.IsReal()){
102 //実数型
103 if( resultType.IsDouble() )
104 SetXmmReg_DoubleVariable(&relativeVar,XmmReg);
105 if( resultType.IsSingle() )
106 SetXmmReg_SingleVariable(&relativeVar,XmmReg);
107 }
108 else if( resultType.IsWhole() || resultType.IsObject()){
109 //整数型
110 SetReg_WholeVariable(resultType,&relativeVar,UseReg);
111 }
112 else if( resultType.IsStruct() ){
113 //構造体ポインタをUseRegへ格納(構造体は値型)
114 SetVarPtrToReg(UseReg,&relativeVar);
115 }
116 else{
117 return false;
118 }
119
120 if( resultType.GetBasicType() != bigType ){
121 // 大きな型へ変換された場合
122 // ※レジスタの値をキャストする
123 ExtendRegToBigType( UseReg, bigType, resultType.GetBasicType() );
124
125 resultType.SetBasicType( bigType );
126 }
127
128 return true;
129}
130bool TermMemberOpe( const Type &leftType, bool &isNeedHeapFreeStructure, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member, bool &isVariable, RELATIVE_VAR &relativeVar )
131{
132 const CClass &objClass = leftType.GetClass();
133
134 const int useReg=pobj_reg->GetNextReg();
135 const int xmmReg=pobj_reg->GetNextXmmReg();
136
137
138 ////////////////////////////////
139 // インデクサ(getアクセサ)
140 ////////////////////////////////
141 char VarName[VN_SIZE],ArrayElements[VN_SIZE];
142 GetArrayElement(member,VarName,ArrayElements);
143 if(ArrayElements[0]){
144 Type classType;
145 if( VarName[0] == '\0' )
146 {
147 classType = leftType;
148
149 if( classType.IsObject() )
150 {
151 // 既にuseRegにオブジェクトポインタが格納されており、それに対するインデクサを呼び出す場合
152 // ※「プロパティ値として返ってきたオブジェクトインスタンスのインデクサを呼び出す」場合にここにくる
153
154 // オブジェクトメンバのポインタは既にraxに入っている
155 }
156 }
157 else
158 {
159 GetMemberType( leftType, VarName, classType, 0, false );
160
161 if( classType.IsObject() )
162 {
163 //オブジェクトポインタをr11にコピー
164 compiler.codeGenerator.op_mov_RR( REG_R11, useReg );
165
166 RELATIVE_VAR tempRelativeVar;
167 tempRelativeVar.dwKind=VAR_DIRECTMEM;
168
169 if( !_member_offset(
170 true, //エラー表示あり
171 false, //読み込み専用
172 leftType,
173 VarName,&tempRelativeVar,classType,0)){
174 return false;
175 }
176
177 // オブジェクトメンバのポインタをraxにコピー
178 if( !VarToReg( tempRelativeVar, baseType, resultType ) ){
179 compiler.errorMessenger.Output(11,termFull,cp);
180 }
181 }
182 }
183
184 if( classType.IsObject() )
185 {
186 //////////////////////////////////////////////////////
187 ///// レジスタ資源のバックアップ
188 { BACKUP_REGISTER_RESOURCE
189 //////////////////////////////////////////////////////
190
191 //オブジェクトポインタをスタックに入れておく
192 //mov qword ptr[rsp+offset],reg ※スタックフレームを利用
193 pobj_sf->push( useReg );
194
195 char objectFullName[VN_SIZE], dummyArrayElements[VN_SIZE];
196 GetArrayElement(termFull,objectFullName,dummyArrayElements);
197
198 CallIndexerGetterProc(useReg,classType,objectFullName, ArrayElements,resultType, PROCFLAG_NEW );
199
200 pobj_sf->pop();
201
202 /////////////////////////////////////////////
203 ////// レジスタ資源を復元
204 RESTORE_REGISTER_RESOURCE
205 }////////////////////////////////////////////
206
207 return true;
208 }
209 }
210
211
212 ///////////////////////////////////////////////////////////////////
213 // メンバを検索
214 ///////////////////////////////////////////////////////////////////
215 if( GetMemberType( leftType, member, resultType, 0, false ) ){
216 // メンバが見つかったとき
217
218 if( isNeedHeapFreeStructure )
219 {
220 if( !leftType.IsStruct() )
221 {
222 compiler.errorMessenger.OutputFatalError();
223 }
224
225 pobj_reg->LockReg();
226
227 // 親となる構造体が一時メモリに存在していた場合、後ほど解放する必要がある
228 compiler.codeGenerator.op_AddNeedFreeTempStructure( useReg );
229 isNeedHeapFreeStructure = false;
230
231 pobj_reg->UnlockReg();
232 }
233
234 //オブジェクトポインタをr11にコピー
235 compiler.codeGenerator.op_mov_RR( REG_R11, useReg );
236
237 relativeVar.dwKind=VAR_DIRECTMEM;
238
239 if( !_member_offset(
240 true, //エラー表示あり
241 false, //読み込み専用
242 leftType,
243 member,&relativeVar,resultType,0)){
244 return false;
245 }
246
247 // 変数として扱う
248 isVariable = true;
249
250 return true;
251 }
252
253
254 ///////////////////////////////////////////////////////////////////
255 // 動的メソッドを検索
256 ///////////////////////////////////////////////////////////////////
257 std::vector<const UserProc *> userProcs;
258
259 char methodName[VN_SIZE], lpPtrOffset[VN_SIZE], parameter[VN_SIZE], dummy[1];
260 ReferenceKind refType;
261 PareOrBracket pareOrBracket = None;
262 lstrcpy( methodName, member );
263 GetVarFormatString( methodName, parameter, lpPtrOffset, dummy, refType, &pareOrBracket );
264
265 objClass.EnumDynamicMethodsOrInterfaceMethods( methodName, userProcs );
266 if(userProcs.size()){
267 //オーバーロードを解決
268 const UserProc *pUserProc = OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
269
270 if( pUserProc )
271 {
272 if(
273 pUserProc->Params().size() == 0 // 仮引数の個数は0
274 && parameter[0] // 実引数は1つ以上
275 && pUserProc->ReturnType().IsObject() // 戻り値がクラス型の場合
276 && pareOrBracket == Bracket ) // 実引数は[]で囲まれている
277 {
278 // プロパティ値として返ってきたオブジェクトインスタンスのインデクサを呼び出す
279
280 // まずはプロパティ値を取得
281 bool dummyIsVariable;
282 RELATIVE_VAR dummyRelativeVar;
283 TermMemberOpe( leftType, isNeedHeapFreeStructure, baseType, resultType, termFull, termLeft, methodName, dummyIsVariable, dummyRelativeVar );
284
285 // 戻り値のオブジェクトインスタンスのインデクサを呼び出す
286 char temporary[VN_SIZE], temp2[VN_SIZE];
287 sprintf( temporary, "[%s]", parameter );
288 sprintf( temp2, "%s.%s", termLeft, methodName );
289 Type classType = resultType;
290 return TermMemberOpe( classType, isNeedHeapFreeStructure, baseType, resultType, termFull, temp2, temporary, isVariable, relativeVar );
291 }
292
293 resultType = pUserProc->ReturnType();
294
295
296 //////////////////////////////////////////////////////
297 ///// レジスタ資源のバックアップ
298 { BACKUP_REGISTER_RESOURCE
299 //////////////////////////////////////////////////////
300
301 //オブジェクトポインタをスタックに入れておく
302 //mov qword ptr[rsp+offset],reg ※スタックフレームを利用
303 pobj_sf->push( useReg );
304
305 if( !Opcode_CallProc(parameter,pUserProc,PROCFLAG_NEW,termLeft ) ){
306 //レジスタ資源を復元
307 RESTORE_REGISTER_RESOURCE
308
309 return false;
310 }
311
312 pobj_sf->pop();
313
314 /////////////////////
315 // 戻り値の処理
316 /////////////////////
317
318 //大きな型への暗黙の変換
319 int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
320
321 if( resultType.GetBasicType() != bigType ){
322 // 大きな型へ変換された場合
323 // ※レジスタの値をキャストする
324 ExtendRegToBigType( REG_RAX, bigType, resultType.GetBasicType() );
325
326 resultType.SetBasicType( bigType );
327 }
328
329 SetUseRegFromRax(resultType.GetBasicType(),useReg,xmmReg);
330
331 // 型パラメータを解決
332 ResolveFormalGenericTypeParameter( resultType, leftType, pUserProc );
333
334
335 /////////////////////////////////////////////
336 ////// レジスタ資源を復元
337 RESTORE_REGISTER_RESOURCE
338 }////////////////////////////////////////////
339
340 return true;
341 }
342 }
343 else if( pareOrBracket == Pare )
344 {
345 // 関数ポインタ
346 compiler.errorMessenger.OutputFatalError();
347
348 ///////////////////////////////////////////////////////////////////
349 // メンバを検索
350 ///////////////////////////////////////////////////////////////////
351 if( GetMemberType( leftType, methodName, resultType, 0, false ) ){
352 // メンバが見つかったとき
353 }
354 }
355
356 compiler.errorMessenger.OutputFatalError();
357
358 return false;
359}
360bool _TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, bool &isNeedHeapFreeStructure, bool *pIsClassName, bool isProcedureCallOnly, bool &isVariable, RELATIVE_VAR &relativeVar, bool isWriteAccess )
361{
362 char parameter[VN_SIZE];
363
364 // Withを解決
365 char termFull[VN_SIZE];
366 if(term[0]=='.'){
367 GetWithName(termFull);
368 lstrcat(termFull,term);
369 }
370 else lstrcpy(termFull,term);
371
372 char termLeft[VN_SIZE];
373 lstrcpy(termLeft,termFull);
374
375 // パース
376 char member[VN_SIZE];
377 ReferenceKind refType;
378 if( SplitMemberName( termFull, termLeft, member, refType ) ){
379 ///////////////////////////////////////////////////////////////////
380 // オブジェクトとメンバに分解できるとき
381 // termLeft.member
382 ///////////////////////////////////////////////////////////////////
383
384 isLiteral = false;
385
386 // オブジェクト側の型を取得
387 bool isClassName = false;
388 Type leftType;
389 if( GetTermType( termLeft, Type(), leftType, isLiteral, &isClassName ) ){
390 if( isClassName == false && compiler.GetObjectModule().meta.GetBlittableTypes().IsExist( leftType ) ){
391 // 左側のオブジェクト部分がBlittable型のとき
392
393 char temporary[VN_SIZE];
394 lstrcpy( temporary, termLeft );
395 sprintf( termLeft, "%s(%s)",
396 compiler.GetObjectModule().meta.GetBlittableTypes().Find( leftType ).GetCreateStaticMethodFullName().c_str(),
397 temporary );
398 }
399 }
400
401 if( !TermOpe( termLeft, baseType, leftType, isLiteral, isNeedHeapFreeStructure, &isClassName ) ){
402 goto globalArea;
403 }
404
405 if( isClassName ){
406 // 静的メンバ/メソッドの場合
407 goto globalArea;
408 }
409
410 if( !leftType.HasMember() ){
411 // メンバを持たない型の場合
412 if( isProcedureCallOnly )
413 {
414 compiler.errorMessenger.Output(1,NULL,cp);
415 }
416 return false;
417 }
418
419 return TermMemberOpe( leftType, isNeedHeapFreeStructure, baseType, resultType, termFull, termLeft, member, isVariable, relativeVar );
420 }
421globalArea:
422
423 //////////////////////////////////////////////
424 // クラス名かどうかをチェック(静的メンバ用)
425 //////////////////////////////////////////////
426
427 if( pIsClassName ){
428 if( compiler.GetObjectModule().meta.FindClassSupportedTypeDef( termFull ) ){
429 *pIsClassName = true;
430 return true;
431 }
432 }
433
434
435 /////////////////////////////////////////////////////////////////
436 // グローバル属性エリア
437 /////////////////////////////////////////////////////////////////
438
439 int UseReg=pobj_reg->GetNextReg();
440 int XmmReg=pobj_reg->GetNextXmmReg();
441
442
443 if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){
444 if( !compiler.IsCompilingClass() )
445 {
446 compiler.errorMessenger.Output(142,NULL,cp);
447 return false;
448 }
449
450 //Thisオブジェクト
451 resultType.SetType( DEF_OBJECT, &compiler.GetCompilingClass() );
452
453 SetThisPtrToReg( UseReg );
454
455 isLiteral = false;
456
457 return true;
458 }
459
460
461 //////////////////////////////////////
462 // 関数(DLL、ユーザー定義、組み込み)
463 //////////////////////////////////////
464 char procName[VN_SIZE];
465 char temporary[8192];
466
467 int i2=GetCallProcName(termFull,procName);
468 if(termFull[i2]=='('){
469 int i4=GetStringInPare_RemovePare(parameter,termFull+i2+1);
470
471 void *pInfo;
472 int idProc=GetProc(procName,(void **)&pInfo);
473
474 if(idProc){
475 //閉じカッコ")"に続く文字がNULLでないとき
476 if(termFull[i2+1+i4+1]!='\0'){
477 compiler.errorMessenger.Output(42,NULL,cp);
478 }
479
480
481 //////////////////////////////////////////////////////
482 ///// レジスタ資源のバックアップ
483 { BACKUP_REGISTER_RESOURCE
484 //////////////////////////////////////////////////////
485
486
487 ////////////////
488 // 呼び出し
489 ////////////////
490
491 CallProc(idProc,pInfo,procName,parameter, baseType,resultType);
492
493
494 /////////////////////
495 // 戻り値の処理
496 /////////////////////
497
498 //大きな型への暗黙の変換
499 int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
500
501 if( resultType.GetBasicType() != bigType ){
502 // 大きな型へ変換された場合
503 // ※レジスタの値をキャストする
504 ExtendRegToBigType( REG_RAX, bigType, resultType.GetBasicType() );
505
506 resultType.SetBasicType( bigType );
507 }
508
509 SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
510
511 /////////////////////////////////////////////
512 ////// レジスタ資源を復元
513 RESTORE_REGISTER_RESOURCE
514 }////////////////////////////////////////////
515
516 if(resultType.IsStruct())
517 {
518 //構造体が戻ったときはヒープ領域にインスタンスが格納されている
519 //※後にfreeする必要あり
520 // TODO: 解放はGCに任せる
521 isNeedHeapFreeStructure = true;
522 }
523
524 isLiteral = false;
525
526 return true;
527 }
528
529 ConstMacro *pConstMacro = compiler.GetObjectModule().meta.GetGlobalConstMacros().Find(
530 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( procName )
531 );
532 if( pConstMacro )
533 {
534 if( ActiveBasic::Compiler::LexicalAnalyzer::ConstMacroToExpression( *pConstMacro, parameter, temporary ) )
535 {
536 /////////////////////////
537 // マクロ関数
538 /////////////////////////
539
540 //閉じカッコ")"に続く文字がNULLでないときはエラーにする
541 if(termFull[i2+1+i4+1]!='\0') compiler.errorMessenger.Output(42,NULL,cp);
542
543 //マクロ関数の場合
544 NumOpe(&UseReg, temporary,Type(),resultType);
545
546 if(!IS_LITERAL(resultType.GetIndex())){
547 //リテラル値ではなかったとき
548 isLiteral = false;
549 }
550
551 return true;
552 }
553 }
554 }
555 else if( isProcedureCallOnly ){
556 // 関数呼び出し以外は受け付けない
557 return false;
558 }
559
560
561 ////////////////////////////////
562 // インデクサ(getアクセサ)
563 ////////////////////////////////
564
565 char VarName[VN_SIZE],ArrayElements[VN_SIZE];
566 GetArrayElement(termFull,VarName,ArrayElements);
567 if(ArrayElements[0]){
568 Type classType;
569 GetVarType(VarName,classType,false);
570 if( classType.IsObject() )
571 {
572 CallIndexerGetterProc(UseReg,classType,VarName,ArrayElements,resultType);
573
574 isLiteral = false;
575
576 return true;
577 }
578 }
579
580
581 ////////////////////////////////
582 // 変数
583 ////////////////////////////////
584
585 if(GetVarOffset(
586 false, //エラー表示なし
587 isWriteAccess,
588 termFull,
589 &relativeVar,resultType)){
590 //////////
591 // 変数
592 //////////
593
594 // 変数として扱う
595 isVariable = true;
596
597 isLiteral = false;
598
599 return true;
600 }
601
602/*
603 ////////////////////////////////
604 // 型名
605 ////////////////////////////////
606
607 if( compiler.StringToType( termFull, resultType ) ){
608 resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
609 return true;
610 }*/
611
612
613 /////////////////////////////////
614 // プロパティ用のメソッド
615 /////////////////////////////////
616
617 //配列要素を排除
618 GetArrayElement(termFull,VarName,ArrayElements);
619
620 if(GetSubHash(VarName,0)){
621
622 //////////////////////////////////////////////////////
623 ///// レジスタ資源のバックアップ
624 { BACKUP_REGISTER_RESOURCE
625 //////////////////////////////////////////////////////
626
627 CallPropertyMethod(termFull,NULL,resultType);
628
629 //大きな型への暗黙の変換
630 int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
631
632 if( resultType.GetBasicType() != bigType ){
633 // 大きな型へ変換された場合
634 // ※レジスタの値をキャストする
635 ExtendRegToBigType( REG_RAX, bigType, resultType.GetBasicType() );
636
637 resultType.SetBasicType( bigType );
638 }
639
640 SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
641
642 /////////////////////////////////////////////
643 ////// レジスタ資源を復元
644 RESTORE_REGISTER_RESOURCE
645 }////////////////////////////////////////////
646
647 if(resultType.IsStruct())
648 {
649 //構造体が戻ったときはヒープ領域にインスタンスが格納されている
650 //※後にfreeする必要あり
651 // TODO: 解放はGCに任せる
652 isNeedHeapFreeStructure = true;
653 }
654
655 isLiteral = false;
656
657 return true;
658 }
659
660 if( isProcedureCallOnly )
661 {
662 compiler.errorMessenger.Output(3, termLeft, cp );
663 }
664
665 return false;
666}
667
668bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, bool &isNeedHeapFreeStructure, bool *pIsClassName, bool isProcedureCallOnly, bool isWriteAccess )
669{
670 bool isInitRegSwitch = false;
671 if( !pobj_reg )
672 {
673 isInitRegSwitch = true;
674
675 //作業用レジスタを取得
676 pobj_reg = new CRegister( REG_RAX );
677 }
678
679 //エラー時の復旧用
680 CRegister objReg_Backup = *pobj_reg;
681
682
683 RELATIVE_VAR relativeVar;
684 bool isVariable = false;
685 bool result = _TermOpe( term, baseType, resultType, isLiteral, isNeedHeapFreeStructure, pIsClassName, isProcedureCallOnly, isVariable, relativeVar, isWriteAccess );
686
687 if( isVariable )
688 {
689 // 変数の場合はeaxに変数ポインタを格納する
690 if( !VarToReg( relativeVar, baseType, resultType ) ){
691 compiler.errorMessenger.Output(11,term,cp);
692 }
693 }
694
695
696 if( !result )
697 {
698 *pobj_reg = objReg_Backup;
699 }
700
701 if( isInitRegSwitch ){
702 //整合性をチェック(バグ回避)
703 if( result )
704 {
705 pobj_reg->bug_check();
706 }
707
708 //作業レジスタを解放
709 delete pobj_reg;
710 pobj_reg = NULL;
711 }
712
713 return result;
714}
715bool TermOpeOnlyVariable( const char *term, Type &resultType, RELATIVE_VAR &relativeVar, bool isWriteAccess )
716{
717 if( pobj_reg )
718 {
719 compiler.errorMessenger.OutputFatalError();
720 }
721
722 //作業用レジスタを取得
723 pobj_reg = new CRegister( REG_NON );
724
725 bool isLiteral, isVariable = false, isNeedHeapFreeStructure = false;
726 bool result = _TermOpe( term, Type(), resultType, isLiteral, isNeedHeapFreeStructure, NULL, false, isVariable, relativeVar, isWriteAccess );
727
728 if( !isVariable )
729 {
730 compiler.errorMessenger.OutputFatalError();
731 }
732
733 //整合性をチェック(バグ回避)
734 if( result )
735 {
736 pobj_reg->bug_check();
737 }
738
739 //作業レジスタを解放
740 delete pobj_reg;
741 pobj_reg=0;
742
743 return result;
744}
745
746
747bool _numope( int *pReg,
748 const char *expression,
749 const Type &baseType,
750 Type &resultType,
751 bool *pbIsNeedHeapFreeStructure )
752{
753 int i,i2,i3;
754 char temporary[1024],temp2[1024];
755
756 if(expression[0]=='\0'){
757 compiler.errorMessenger.Output(1,NULL,cp);
758 return false;
759 }
760
761 if( !baseType.IsNull() && expression[0] == '[' ){
762 // リテラル配列の場合
763
764 int dataTableOffset;
765 if( !ActiveBasic::Compiler::DataTableGenerator::MakeLiteralArrayBuffer( compiler.GetObjectModule().dataTable, expression, baseType, dataTableOffset ) )
766 {
767 return false;
768 }
769
770 //mov reg,i2
771 compiler.codeGenerator.op_mov_RV( sizeof(_int64), *pReg, dataTableOffset, Schedule::DataTable );
772
773 resultType = baseType;
774
775 return true;
776 }
777
778 bool isLiteralCalculation;
779 if( NumOpe_GetType( expression, baseType, resultType, &isLiteralCalculation ) )
780 {
781 if( isLiteralCalculation )
782 {
783 //右辺値が数値の定数式の場合
784 _int64 i64data;
785 StaticCalculation(true, expression,baseType.GetBasicType(),&i64data,resultType);
786
787 if(resultType.IsReal()){
788 if(baseType.IsReal()) resultType=baseType;
789
790 int xmmReg = pobj_reg->GetNextXmmReg();
791 *pReg = xmmReg;
792
793 if(resultType.IsDouble()){
794 i3 = compiler.GetObjectModule().dataTable.Add( i64data );
795
796 //movlpd xmm_reg,qword ptr[data table offset]
797 compiler.codeGenerator.op_movlpd_RM( xmmReg, 0, i3, MOD_DISP32, Schedule::DataTable );
798 }
799 if(resultType.IsSingle()){
800 double dbl;
801 memcpy(&dbl,&i64data,sizeof(_int64));
802
803 float flt;
804 int i32data;
805 flt=(float)dbl;
806 memcpy(&i32data,&flt,sizeof(long));
807
808 i3 = compiler.GetObjectModule().dataTable.Add( i32data );
809
810 //movss xmm_reg,dword ptr[data table offset]
811 compiler.codeGenerator.op_movss_RM( xmmReg, 0, i3, MOD_DISP32, Schedule::DataTable );
812 }
813 }
814 else{
815 if(!resultType.Is64()){
816 //整数(符号有り/無し)
817
818 i3=(long)i64data;
819
820 if(resultType.GetBasicSize()==sizeof(char)) i3=i3&0x000000FF;
821 if(resultType.GetBasicSize()==sizeof(short)) i3=i3&0x0000FFFF;
822
823 i64data=(_int64)i3;
824 }
825
826 //mov reg,i64data
827 compiler.codeGenerator.op_mov_RV64(*pReg,i64data);
828 }
829 return true;
830 }
831 }
832
833 if( expression[0] == 1 )
834 {
835 if( expression[1]==ESC_NEW )
836 {
837 //New演算子(オブジェクト生成)
838
839 if( pobj_BlockReg->check(REG_RAX) ){
840 compiler.errorMessenger.OutputFatalError();
841 }
842
843 //////////////////////////////////////////////////////
844 ///// レジスタ資源のバックアップ
845 { BACKUP_REGISTER_RESOURCE
846 //////////////////////////////////////////////////////
847
848 if( !Operator_New( expression+2, baseType, resultType ) ){
849 return false;
850 }
851
852 /////////////////////////////////////////////
853 ////// レジスタ資源を復元
854 RESTORE_REGISTER_RESOURCE
855 }////////////////////////////////////////////
856
857 //mov reg,rax
858 compiler.codeGenerator.op_mov_RR( *pReg, REG_RAX );
859
860 return true;
861 }
862 else if( expression[1] == ESC_SYSTEM_STATIC_NEW )
863 {
864 // 静的領域にオブジェクトを作る
865
866 // 静的領域にオブジェクトを生成
867 int dataTableOffset;
868 if( !ActiveBasic::Compiler::DataTableGenerator::MakeConstObjectToProcessStaticBuffer( compiler.GetObjectModule().dataTable, expression + 2, resultType, dataTableOffset ) )
869 {
870 return false;
871 }
872
873 //mov reg,i2
874 compiler.codeGenerator.op_mov_RV( sizeof(_int64), *pReg, dataTableOffset, Schedule::DataTable);
875
876 return true;
877 }
878 }
879
880
881 /////////////////////////////////
882 // 式要素を逆ポーランド式で取得
883 /////////////////////////////////
884
885 char *values[255];
886 long calc[255];
887 long stack[255];
888 int pnum;
889 if(!GetNumOpeElements(expression,&pnum,values,calc,stack)){
890 for(i=0;i<pnum;i++){
891 if(values[i]) HeapDefaultFree(values[i]);
892 }
893 return 0;
894 }
895
896
897 ////////////////////////////////
898 // 演算部分のコード生成を開始
899 ////////////////////////////////
900
901 BOOL bError;
902 bError=0;
903
904 //リテラル値のみの計算かどうかを判別するためのフラグ
905 BOOL bLiteralCalculation=1;
906
907 double dbl;
908 int sp;
909 int type_stack[255];
910 LONG_PTR index_stack[255];
911 bool isNothing_stack[255];
912 bool isNeedHeapFreeStructureStack[255];
913 _int64 i64data;
914 int UseReg,XmmReg;
915 BOOL bXmm;
916 for(i=0,sp=0;i<pnum;i++){
917 int idCalc;
918 idCalc=calc[i]%100;
919
920 if(idCalc){
921 if(type_stack[sp-2]==DEF_OBJECT){
922 if( idCalc == CALC_AS
923 && type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
924 && index_stack[sp-1] == index_stack[sp-2]
925 || isNothing_stack[sp-2] ){
926 // 同一の型、またはNothingに対するAsはAs演算子を呼び出さない
927 }
928 else if( idCalc == CALC_AS
929 && type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
930 && ( ((CClass *)index_stack[sp-1])->IsEqualsOrSubClass( (CClass *)index_stack[sp-2] ) || ((CClass *)index_stack[sp-2])->IsEqualsOrSubClass( (CClass *)index_stack[sp-1] )
931 )){
932 // ダウンキャストを許可する
933 }
934 else{
935 //オーバーロードされたオペレータを呼び出す
936 i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,isNeedHeapFreeStructureStack,sp);
937 if(i2==0){
938 if(idCalc==CALC_EQUAL) lstrcpy(temp2,"==");
939 else GetCalcName(idCalc,temp2);
940 sprintf(temporary,"Operator %s",temp2);
941 compiler.errorMessenger.Output(27,temporary,cp);
942 goto error;
943 }
944 else if(i2==-1) goto error;
945
946 continue;
947 }
948 }
949
950 if(!CheckCalcType(idCalc,type_stack,sp)) goto error;
951 }
952
953 switch(idCalc){
954 //数値
955 case 0:
956 index_stack[sp]=-1;
957 isNothing_stack[sp] = false;
958 isNeedHeapFreeStructureStack[sp] = false;
959
960 UseReg=pobj_reg->GetNextReg();
961 XmmReg=pobj_reg->GetNextXmmReg();
962
963 bXmm=0;
964
965 char *term;
966 term=values[i];
967
968 if( calc[i+1]%100 == CALC_AS ){
969 // As演算子の右辺値
970 //型名
971 if( compiler.StringToType( term, resultType ) ){
972 resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
973 }
974 else{
975 compiler.errorMessenger.Output(3, term, cp );
976 goto error;
977 }
978
979 type_stack[sp] = resultType.GetBasicType();
980 index_stack[sp] = resultType.GetIndex();
981 sp++;
982
983 break;
984 }
985
986 if( (term[0]=='e'||term[0]=='E')
987 && (term[1]=='x'||term[1]=='X')
988 && term[2]=='\"'
989 || term[0] == '\"' )
990 {
991 bool isEx = true;
992 if( term[0] == '\"' )
993 {
994 isEx = false;
995 }
996
997 if( isEx )
998 {
999 // 拡張版リテラル文字列(エスケープシーケンス可能)
1000 if(!RemoveStringQuotes(term+2)){
1001 compiler.errorMessenger.Output(43,NULL,cp);
1002 goto error;
1003 }
1004 i3=FormatString_EscapeSequence(term+2);
1005 term+=2;
1006 }
1007 else
1008 {
1009 // 通常文字列
1010 if(!RemoveStringQuotes(term)){
1011 compiler.errorMessenger.Output(43,NULL,cp);
1012 goto error;
1013 }
1014 i3=lstrlen(term);
1015 }
1016
1017 if( !baseType.IsPointer() )
1018 {
1019 //要求タイプがオブジェクト、または未定のとき
1020
1021 //String型オブジェクトを生成
1022 i2 = ActiveBasic::Compiler::DataTableGenerator::MakeConstStringObjectToProcessStaticBuffer( compiler.GetObjectModule().dataTable, term );
1023
1024 //mov reg,i2
1025 compiler.codeGenerator.op_mov_RV(sizeof(_int64),UseReg,i2, Schedule::DataTable);
1026
1027 type_stack[sp]=DEF_OBJECT;
1028 index_stack[sp]=(LONG_PTR)compiler.GetObjectModule().meta.GetClasses().GetStringClassPtr();
1029 bLiteralCalculation=0;
1030
1031 if(bXmm) pobj_reg->LockXmmReg();
1032 else pobj_reg->LockReg();
1033
1034 sp++;
1035 break;
1036 }
1037
1038StrLiteral:
1039
1040 type_stack[sp]=typeOfPtrChar;
1041 bLiteralCalculation=0;
1042
1043 if( compiler.IsUnicode() )
1044 {
1045 i2 = compiler.GetObjectModule().dataTable.AddWString( Jenga::Common::ToWString( std::string( term, i3 ) ) );
1046 }
1047 else
1048 {
1049 i2 = compiler.GetObjectModule().dataTable.AddString( std::string( term, i3 ) );
1050 }
1051
1052 //mov reg,i2
1053 compiler.codeGenerator.op_mov_RV(sizeof(_int64),UseReg,i2, Schedule::DataTable);
1054
1055 if(UseReg==REG_R14){
1056 //mov qword ptr[rsp+offset],r14 ※スタックフレームを利用
1057 pobj_sf->push(REG_R14);
1058 }
1059 }
1060 else if(IsVariableTopChar(term[0])||
1061 term[0]=='*'||
1062 (term[0]=='.'&&IsVariableTopChar(term[1])))
1063 {
1064 //////////////////
1065 // 何らかの識別子
1066
1067 bool isLiteral;
1068 if( TermOpe( term, baseType, resultType, isLiteral, isNeedHeapFreeStructureStack[sp] ) ){
1069 if(resultType.IsNull()){
1070 //戻り値が存在しないとき
1071 for(i2=0;;i2++){
1072 if(term[i2]=='('||term[i2]=='\0'){
1073 term[i2]=0;
1074 break;
1075 }
1076 }
1077 compiler.errorMessenger.Output(38,term,cp);
1078
1079 goto error;
1080 }
1081
1082 type_stack[sp] = resultType.GetBasicType();
1083 index_stack[sp] = resultType.GetIndex();
1084
1085 if( !isLiteral ){
1086 bLiteralCalculation=0;
1087 }
1088
1089 if( resultType.GetBasicType() & FLAG_CAST ){
1090 // 型名のみ
1091 compiler.errorMessenger.OutputFatalError();
1092 }
1093 else{
1094 if( resultType.IsReal() == false && UseReg==REG_R14 ){
1095 //mov qword ptr[rsp+offset],r14 ※スタックフレームを利用
1096 pobj_sf->push(REG_R14);
1097 }
1098 if( resultType.IsReal() && XmmReg==REG_XMM4 ){
1099 if(resultType.IsDouble()){
1100 //movsd qword ptr[rsp+offset],xmm4 ※スタックフレームを利用
1101 pobj_sf->push(REG_XMM4,sizeof(double));
1102 }
1103 if(resultType.IsSingle()){
1104 //movss dword ptr[rsp+offset],xmm4 ※スタックフレームを利用
1105 pobj_sf->push(REG_XMM4,sizeof(float));
1106 }
1107 }
1108
1109 if( resultType.IsReal() ){
1110 pobj_reg->LockXmmReg();
1111 }
1112 else{
1113 pobj_reg->LockReg();
1114 }
1115 }
1116
1117 sp++;
1118 break;
1119 }
1120
1121
1122 // Nothing
1123 if( lstrcmp( term, "Nothing" ) == 0 ){
1124 isNothing_stack[sp] = true;
1125
1126 type_stack[sp] = DEF_OBJECT;
1127 if( baseType.IsObject() ){
1128 index_stack[sp] = baseType.GetIndex();
1129 }
1130 else{
1131 index_stack[sp] = (LONG_PTR)compiler.GetObjectModule().meta.GetClasses().GetObjectClassPtr();
1132 }
1133
1134 bLiteralCalculation = 0;
1135
1136 //xor reg,reg
1137 compiler.codeGenerator.op_zero_reg( UseReg );
1138
1139 if(UseReg==REG_R14){
1140 //mov qword ptr[rsp+offset],r14 ※スタックフレームを利用
1141 pobj_sf->push(REG_R14);
1142 }
1143
1144 pobj_reg->LockReg();
1145 sp++;
1146 break;
1147 }
1148
1149
1150 //////////////
1151 // 定数の場合
1152 //////////////
1153
1154 i3 = compiler.GetObjectModule().meta.GetGlobalConsts().GetBasicType(
1155 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term )
1156 );
1157 if(i3){
1158 if( compiler.GetObjectModule().meta.GetGlobalConsts().IsStringPtr( ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term ) ) ){
1159 //リテラル文字列
1160
1161 if( baseType.IsObject() || baseType.IsNull() )
1162 {
1163 //要求タイプがオブジェクト、または未定のとき
1164
1165 //String型オブジェクトを生成
1166 NewStringObject(UseReg,term);
1167
1168 type_stack[sp]=DEF_OBJECT;
1169 index_stack[sp]=(LONG_PTR)compiler.GetObjectModule().meta.GetClasses().GetStringClassPtr();
1170 bLiteralCalculation=0;
1171
1172 if(bXmm) pobj_reg->LockXmmReg();
1173 else pobj_reg->LockReg();
1174
1175 sp++;
1176 break;
1177 }
1178
1179 double dbl = compiler.GetObjectModule().meta.GetGlobalConsts().GetDoubleData(
1180 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term )
1181 );
1182 memcpy(&i64data,&dbl,sizeof(double));
1183
1184 //バイト数
1185 i3=lstrlen((char *)i64data);
1186
1187 memcpy(term,(char *)i64data,i3);
1188 term[i3]=0;
1189 goto StrLiteral;
1190 }
1191
1192 type_stack[sp] = i3;
1193 if(IsRealNumberType(i3)){
1194 //実数
1195 double dbl = compiler.GetObjectModule().meta.GetGlobalConsts().GetDoubleData(
1196 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term )
1197 );
1198 memcpy(&i64data,&dbl,sizeof(double));
1199 goto Literal;
1200 }
1201 else if(IsWholeNumberType(i3)){
1202 //整数
1203 i64data = compiler.GetObjectModule().meta.GetGlobalConsts().GetWholeData(
1204 ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( term )
1205 );
1206 goto Literal;
1207 }
1208 else{
1209 compiler.errorMessenger.Output(1,NULL,0);
1210 goto error;
1211 }
1212 }
1213
1214
1215 //該当する識別子が見当たらないときはエラー扱いにする
1216 bError=1;
1217 compiler.errorMessenger.Output(3,term,cp);
1218 type_stack[sp]=DEF_DOUBLE;
1219 }
1220 else{
1221 //リテラル値
1222 type_stack[sp]=GetLiteralValue(term,&i64data,baseType.GetBasicType());
1223Literal:
1224 if(type_stack[sp]==DEF_DOUBLE){
1225 //64ビット浮動小数型
1226 bXmm=1;
1227
1228 if(XmmReg==REG_XMM4){
1229 //mov r14,i64data
1230 compiler.codeGenerator.op_mov_RV64(REG_R14,i64data);
1231
1232
1233 //mov qword ptr[rsp+offset],r14 ※スタックフレームを利用
1234 pobj_sf->push(REG_R14);
1235 }
1236 else{
1237 i3 = compiler.GetObjectModule().dataTable.Add( i64data );
1238
1239 //movlpd xmm_reg,qword ptr[data table offset]
1240 compiler.codeGenerator.op_movlpd_RM( XmmReg, 0, i3, MOD_DISP32, Schedule::DataTable );
1241 }
1242 }
1243 else if(type_stack[sp]==DEF_SINGLE){
1244 //32ビット浮動小数型
1245 bXmm=1;
1246
1247 float flt;
1248 int i32data;
1249 memcpy(&dbl,&i64data,sizeof(double));
1250 flt=(float)dbl;
1251 memcpy(&i32data,&flt,sizeof(long));
1252
1253 if(XmmReg==REG_XMM4){
1254 compiler.errorMessenger.OutputFatalError(); // TODO: 未実装
1255 //push term
1256 //compiler.codeGenerator.op_push_value(i32data);
1257 }
1258 else{
1259 i3=compiler.GetObjectModule().dataTable.Add( i32data );
1260
1261 //movss xmm_reg,dword ptr[data table offset]
1262 compiler.codeGenerator.op_movss_RM( XmmReg, 0, i3, MOD_DISP32, Schedule::DataTable );
1263 }
1264 }
1265 else{
1266 //整数
1267
1268 index_stack[sp]=GetLiteralIndex(i64data);
1269
1270 //mov reg,i64data
1271 compiler.codeGenerator.op_mov_RV64(UseReg,i64data);
1272
1273 if(UseReg==REG_R14){
1274 //mov qword ptr[rsp+offset],r14 ※スタックフレームを利用
1275 pobj_sf->push(REG_R14);
1276 }
1277 }
1278 }
1279
1280 if(bXmm) pobj_reg->LockXmmReg();
1281 else pobj_reg->LockReg();
1282
1283 sp++;
1284 break;
1285
1286 //論理演算子
1287 case CALC_XOR:
1288 case CALC_OR:
1289 case CALC_AND:
1290 if(!CalcTwoTerm_Logical(idCalc,type_stack,index_stack,&sp)) goto error;
1291 break;
1292 case CALC_NOT:
1293 //value[sp-1]=Not value[sp-1]
1294 //NOT演算子
1295 if(!Calc_Not(type_stack,sp)) goto error;
1296 break;
1297
1298 //比較演算子
1299 case CALC_PE: //value[sp-2] <= value[sp-1]
1300 case CALC_QE: //value[sp-2] >= value[sp-1]
1301 case CALC_P: //value[sp-2] < value[sp-1]
1302 case CALC_Q: //value[sp-2] > value[sp-1]
1303 case CALC_NOTEQUAL: //value[sp-2] <> value[sp-1]
1304 case CALC_EQUAL: //value[sp-2] = value[sp-1]
1305 if(!CalcTwoTerm_Relational(idCalc,type_stack,index_stack,&sp)) goto error;
1306 break;
1307
1308 //ビットシフト
1309 case CALC_SHL: //value[sp-2] << value[sp-1]
1310 case CALC_SHR: //value[sp-2] >> value[sp-1]
1311 if(!Calc_Shift(idCalc,type_stack,&sp)) goto error;
1312 break;
1313
1314 //算術演算
1315 case CALC_ADDITION:
1316 case CALC_SUBTRACTION:
1317 case CALC_PRODUCT:
1318 if(!CalcTwoTerm_Arithmetic(idCalc,type_stack,index_stack,&sp)) goto error;
1319 break;
1320 case CALC_MOD:
1321 //value[sp-2]%=value[sp-1]
1322 //剰余演算
1323 if(!Calc_Mod(type_stack,index_stack,&sp)) goto error;
1324 break;
1325 case CALC_QUOTIENT:
1326 //value[sp-2]/=value[sp-1];
1327 //除算
1328 if(!Calc_Divide(type_stack,&sp,baseType.GetBasicType())) goto error;
1329 break;
1330 case CALC_INTQUOTIENT:
1331 //value[sp-2]/=value[sp-1]
1332 //整数除算
1333 if(!Calc_IntDivide(type_stack,index_stack,&sp)) goto error;
1334 break;
1335 case CALC_MINUSMARK:
1336 //value[sp-1]=-value[sp-1]
1337 //符号反転
1338 if(!Calc_MinusMark(type_stack,sp)) goto error;
1339 break;
1340 case CALC_POWER:
1341 //べき乗演算(浮動小数点演算のみ)
1342 if(!Calc_Power(type_stack,&sp)) goto error;
1343 break;
1344 case CALC_AS:
1345 //キャスト
1346 if(!Calc_Cast(type_stack,index_stack,&sp)) goto error;
1347 break;
1348 case CALC_BYVAL:
1349 //ポインタ型→参照型
1350 if( PTR_LEVEL( type_stack[sp-1] ) <= 0 ){
1351 //ポインタ型ではないとき
1352 compiler.errorMessenger.Output( 3, NULL, cp );
1353 goto error;
1354 }
1355
1356 type_stack[sp-1] = PTR_LEVEL_DOWN( type_stack[sp-1] );
1357
1358 break;
1359
1360 default:
1361 compiler.errorMessenger.Output(300,NULL,cp);
1362 goto error;
1363 }
1364 }
1365
1366 if(bError) goto error;
1367
1368 if(sp!=1){
1369 compiler.errorMessenger.Output(1,NULL,cp);
1370 goto error;
1371 }
1372
1373 if(bLiteralCalculation){
1374 compiler.errorMessenger.OutputFatalError();
1375 }
1376 else{
1377 //右辺値が数値の定数式ではないとき
1378 if(IS_LITERAL(index_stack[0])) index_stack[0]=-1;
1379 }
1380
1381 if( pbIsNeedHeapFreeStructure )
1382 {
1383 *pbIsNeedHeapFreeStructure = isNeedHeapFreeStructureStack[0];
1384 }
1385
1386 if(IsRealNumberType(type_stack[0]))
1387 *pReg=pobj_reg->UnlockXmmReg();
1388 else
1389 *pReg=pobj_reg->UnlockReg();
1390
1391
1392 resultType.SetType( type_stack[0], index_stack[0] );
1393
1394 bool isSuccessful = true;
1395 goto finish;
1396
1397
1398
1399 //////////////////
1400 // エラー処理
1401 //////////////////
1402
1403error:
1404
1405 isSuccessful = false;
1406 goto finish;
1407
1408
1409
1410
1411finish:
1412
1413 for(i=0;i<pnum;i++){
1414 if(values[i]) HeapDefaultFree(values[i]);
1415 }
1416
1417 return isSuccessful;
1418}
1419
1420bool NumOpe( int *pReg,
1421 const char *expression,
1422 const Type &baseType,
1423 Type &resultType,
1424 bool *pbIsNeedHeapFreeStructure )
1425{
1426 bool isInitRegSwitch = false;
1427 if( !pobj_reg )
1428 {
1429 isInitRegSwitch = true;
1430
1431 //作業用レジスタを取得
1432 pobj_reg = new CRegister( *pReg );
1433 }
1434
1435 //エラー時の復旧用
1436 CRegister objReg_Backup = *pobj_reg;
1437
1438 *pReg = pobj_reg->GetNextReg();
1439
1440
1441 bool result = _numope( pReg, expression, baseType, resultType, pbIsNeedHeapFreeStructure );
1442
1443
1444 if( !result )
1445 {
1446 *pobj_reg = objReg_Backup;
1447 }
1448
1449 if( isInitRegSwitch ){
1450 //整合性をチェック(バグ回避)
1451 if( result )
1452 {
1453 pobj_reg->bug_check();
1454 }
1455
1456 //作業レジスタを解放
1457 delete pobj_reg;
1458 pobj_reg = NULL;
1459 }
1460
1461 return result;
1462}
Note: See TracBrowser for help on using the repository browser.