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

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

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

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