source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/include/CodeGenerator.h@ 828

Last change on this file since 828 was 828, checked in by イグトランス (egtra), 12 years ago

egtraブランチの内容をマージ。

File size: 20.5 KB
RevLine 
[184]1#pragma once
2
[248]3#include <LexicalScope.h>
[225]4
5#ifdef _AMD64_
[485]6#include "../../compiler_x64/MachineFixed.h"
[225]7#else
[484]8#include "../../compiler_x86/MachineFixed.h"
[225]9#endif
10
[248]11// コード生成時の部分的なスケジューリング
12class PertialSchedule
[225]13{
[248]14 int codePos; // バッファ位置
15 int typeSize; // 対象サイズ(一般的には8bit/32bit)
[225]16
[237]17public:
[248]18 PertialSchedule( int codePos, int typeSize )
19 : codePos( codePos )
20 , typeSize( typeSize )
21 {
22 }
23 ~PertialSchedule()
24 {
25 }
[238]26
[248]27 int GetCodePos() const
[237]28 {
[248]29 return codePos;
30 }
31 int GetTypeSize() const
32 {
33 return typeSize;
34 }
[828]35
36private:
37 PertialSchedule(PertialSchedule const&);
38 PertialSchedule& operator =(PertialSchedule const&);
[248]39};
40typedef std::vector<const PertialSchedule *> PertialSchedules;
[238]41
[253]42//Goto未知ラベル
43class GotoLabelSchedule : public PertialSchedule
44{
45 std::string name;
46 int line;
47 int sourceCodePos;
48public:
49 GotoLabelSchedule( const std::string &name, int nativeCodePos, int sourceCodePos )
50 : PertialSchedule( nativeCodePos, sizeof(long) )
51 , name( name )
52 , line( -1 )
53 , sourceCodePos( sourceCodePos )
54 {
55 }
56 GotoLabelSchedule( int line, int nativeCodePos, int sourceCodePos )
57 : PertialSchedule( nativeCodePos, sizeof(long) )
58 , line( line )
59 , sourceCodePos( sourceCodePos )
60 {
61 }
62 const std::string &GetName() const
63 {
64 return name;
65 }
66 int GetLineNum() const
67 {
68 return line;
69 }
70 int GetSourceCodePos() const
71 {
72 return sourceCodePos;
73 }
[828]74
75private:
76 GotoLabelSchedule(GotoLabelSchedule const&);
77 GotoLabelSchedule& operator =(GotoLabelSchedule const&);
[253]78};
79typedef std::vector<const GotoLabelSchedule *> GotoLabelSchedules;
80
[261]81//ラベルアドレス
82class GotoLabel
83{
84public:
85 std::string name;
86 int line;
87 DWORD address;
88
89 GotoLabel( const std::string &name, long nativeCodePos )
90 : name( name )
91 , line( -1 )
92 , address( nativeCodePos )
93 {
94 }
95 GotoLabel( int line, long nativeCodePos )
96 : name( "" )
97 , line( line )
98 , address( nativeCodePos )
99 {
100 }
[828]101
102 GotoLabel(GotoLabel&& y)
103 : name(std::move(y.name))
104 , line(std::move(y.line))
105 , address(std::move(y.address))
106 {
107 }
108
109 GotoLabel(GotoLabel const& y)
110 : name(y.name)
111 , line(y.line)
112 , address(y.address)
113 {
114 }
115
116 GotoLabel& operator =(GotoLabel&& y)
117 {
118 name = std::move(y.name);
119 line = std::move(y.line);
120 address = std::move(y.address);
121 return *this;
122 }
123
124 GotoLabel& operator =(GotoLabel const& y)
125 {
126 return *this = std::move(GotoLabel(y));
127 }
[261]128};
129typedef std::vector<GotoLabel> GotoLabels;
130
[248]131class LexicalScope
132{
133public:
134 enum SCOPE_TYPE{
[364]135 // ベース
[248]136 SCOPE_TYPE_BASE,
[237]137
[364]138 // 分岐
[248]139 SCOPE_TYPE_IF,
140
[364]141 // ループ
[248]142 SCOPE_TYPE_DO,
143 SCOPE_TYPE_FOR,
144 SCOPE_TYPE_WHILE,
145
[364]146 // ケース分け
[248]147 SCOPE_TYPE_SELECT,
[364]148
149 // 例外処理
150 SCOPE_TRY,
151 SCOPE_CATCH,
152 SCOPE_FINALLY,
[237]153 };
154
[225]155private:
[248]156 int level;
157 int StartAddress;
158 SCOPE_TYPE TypeOfStatement;
159
160 PertialSchedules breakPertialSchedules;
161
162public:
163 LexicalScope( int level, int addr, SCOPE_TYPE TypeOfStatement )
164 : level( level )
165 , StartAddress( addr )
166 , TypeOfStatement( TypeOfStatement )
167 {
168 }
169 ~LexicalScope()
170 {
171 }
172
173 int GetStartAddress()
174 {
175 return StartAddress;
176 }
177 SCOPE_TYPE GetTypeOfStatement()
178 {
179 return TypeOfStatement;
180 }
181
182 void Break();
183 void RunScheduleOfBreak();
[828]184
185private:
186 LexicalScope(LexicalScope const&);
187 LexicalScope& operator =(LexicalScope const&);
[248]188};
189
190class LexicalScopes
191{
192 LexicalScope **ppScopes;
193 int level;
194
195public:
196
197 LexicalScopes(){
198 ppScopes = (LexicalScope **)malloc( 1 );
199 level=0;
200 }
201 ~LexicalScopes(){
202 free( ppScopes );
203 }
204
205 //初期化(関数コンパイルの開始時に呼び出される)
206 void Init(int addr);
207
208 // スコープを開始
209 void Start( int addr, LexicalScope::SCOPE_TYPE TypeOfStatement );
210
211 // スコープを検索
212 LexicalScope *SearchScope( LexicalScope::SCOPE_TYPE TypeOfStatement );
213
214 int GetNowLevel(void);
215 void SetNowLevel( int level );
216 int GetStartAddress(void);
217
218 void End();
219
220 //スコープ終了時のデストラクタ呼び出し
221 void CallDestructorsOfScopeEnd();
222
223 //Returnステートメント用のデストラクタ呼び出し
224 void CallDestructorsOfReturn( int BaseLevel = 0 );
[828]225
226private:
227 LexicalScopes(LexicalScopes const&);
228 LexicalScopes& operator =(LexicalScopes const&);
[248]229};
230
231class CodeGenerator
232{
233 NativeCode *pNativeCode;
234
235private:
[241]236 // 部分スケジュールの管理
[237]237 PertialSchedules pertialSchedules;
238
[241]239 // Continue用のコード位置情報の管理
240 std::vector<long> continueCodePositions;
241
[435]242 // コンパイル中のステップにおいて、構造体の一時オブジェクトの解放が必要かどうか
243 bool isNeedFreeTempStructureInCurrentStep;
244
[237]245public:
246
[253]247 // ローカル変数用スケジュールの管理
248 PertialSchedules localVarPertialSchedules;
249
[247]250 // Exit Subスケジュールの管理
251 std::vector<long> exitSubCodePositions;
252
[246]253 // Gotoスケジュールの管理
[261]254 GotoLabels gotoLabels;
[253]255 GotoLabelSchedules gotoLabelSchedules;
[246]256
[248]257 // レキシカルスコープの管理
258 LexicalScopes lexicalScopes;
259
[237]260 CodeGenerator()
261 : pNativeCode( 0 )
[435]262 , isNeedFreeTempStructureInCurrentStep( false )
[225]263 {
264 }
[237]265 ~CodeGenerator()
266 {
267 if( pNativeCode )
268 {
269 CheckUnresolveSchedule();
270 }
271 }
[225]272
273 void Select( NativeCode &nativeCode )
274 {
[237]275 if( pNativeCode )
276 {
277 CheckUnresolveSchedule();
278 }
[225]279 pNativeCode = &nativeCode;
280 }
[276]281 long GetNativeCodeSize() const
282 {
283 return pNativeCode->GetSize();
284 }
[225]285
[641]286 void NextSourceLine( const SourceCodePosition &sourceCodePosition, bool isInSystemProc )
[263]287 {
[641]288 pNativeCode->NextSourceLine( sourceCodePosition, isInSystemProc );
[263]289 }
290
[241]291 long GetContinueCodePos() const
292 {
293 if( continueCodePositions.size() == 0 )
294 {
295 return -1;
296 }
297 return continueCodePositions[continueCodePositions.size()-1];
298 }
299 void ClearContinueArea()
300 {
301 continueCodePositions.clear();
302 }
303 void ContinueAreaBegin()
304 {
305 continueCodePositions.push_back( pNativeCode->GetSize() );
306 }
307 void ContinueAreaEnd()
308 {
309 continueCodePositions.pop_back();
310 }
[551]311
312 void PutWithSchedule( long l, Schedule::Type scheduleType );
313
[247]314 void ResolveExitSubSchedule();
[241]315
[237]316 void CheckUnresolveSchedule();
317
[357]318 void opfix( const PertialSchedule *pPertialSchedule, _int64 newValue );
[253]319 void opfix_offset( const PertialSchedule *pPertialSchedule, long offset );
[238]320 void opfix_JmpPertialSchedule( const PertialSchedule *pPertialSchedule );
[237]321
322
323 /////////////////////////////////////////////////////////////////
324 // 32bit/64bit共通 機械語生成
325 /////////////////////////////////////////////////////////////////
326
327private:
[245]328 const PertialSchedule *__jmp_op_format( char opcode, long offset, int op_size, bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
[237]329public:
[250]330 const PertialSchedule *op_jle( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
331 const PertialSchedule *op_jbe( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
332 const PertialSchedule *op_jge( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
333 const PertialSchedule *op_jae( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
334 const PertialSchedule *op_jl( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
335 const PertialSchedule *op_jb( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
336 const PertialSchedule *op_jg( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
337 const PertialSchedule *op_ja( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
338 const PertialSchedule *op_jne( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
339 const PertialSchedule *op_je( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
[245]340 const PertialSchedule *op_jmp( long offset, int op_size = sizeof(char), bool isPertialSchedule = false, bool isSelfOpcodeOffset = false );
[241]341 void op_jmp_continue();
[247]342 void op_jmp_exitsub();
[253]343 void op_jmp_goto_schedule( const std::string &name, int lineNum, int sourceCodePos );
[435]344 void op_AddNeedFreeTempStructure( int reg );
345 void op_FreeTempStructure();
[237]346
347
[225]348#ifdef _AMD64_
[228]349 /////////////////////////////////////////////////////////////////
[237]350 // 64ビット機械語生成
[228]351 /////////////////////////////////////////////////////////////////
[226]352private:
353 void set_rex(int op_size,int reg,int index_reg,int base_reg);
[254]354 const PertialSchedule *set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,long disp, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
355 const PertialSchedule *__op_format(int op_size,char op_prefix,char opcode1,char opcode2,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[226]356public:
[357]357 const PertialSchedule *op_mov_RV (int op_size,int reg,long i32data, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
358 const PertialSchedule *op_mov_RV64 ( int reg, _int64 i64data, bool isPertialSchedule = false );
[254]359 const PertialSchedule *op_mov_RM (int op_size,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
360 const PertialSchedule *op_mov_RM_ex (int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
361 const PertialSchedule *op_mov_MR (int op_size,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
362 const PertialSchedule *op_mov_MR_ex (int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
363 const PertialSchedule *op_mov_MV (int op_size,int base_reg,int offset, Schedule::Type offsetScheduleType, bool isPertialSchedule, BOOL bUseOffset,long i32data);
[226]364 void op_mov_RR (int reg1,int reg2);
365 void op_movsxd (int reg64,int reg32);
366 void op_movsx64_FromReg16 (int reg64,int reg16);
367 void op_movsx64_FromReg8 (int reg64,int reg8);
368 void op_movsx32_FromReg16 (int reg32,int reg16);
369 void op_movsx32_FromReg8 (int reg32,int reg8);
370 void op_movsx16_FromReg8 (int reg32,int reg8);
[228]371 void op_cqo ();
[226]372 void op_inc (int reg);
373 void op_dec (int reg);
[254]374 const PertialSchedule *op_add_RM (int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
375 const PertialSchedule *op_add_RV (int reg,long offset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[228]376 void op_add_RR (int reg1,int reg2);
[226]377 void op_add32_reg (int reg1,int reg2);
378 void op_sub_RV (int op_size,int reg,long i32data);
379 void op_sub64_reg (int reg1,int reg2);
380 void op_sub32_reg (int reg1,int reg2);
381 void op_sbb_RR ( int op_size, int reg1, int reg2 );
382 void op_imul_RR (int op_size,int reg1,int reg2);
383 void op_imul_RV (int op_size,int reg,long i32data);
384 void op_div64_reg (int reg);
385 void op_idiv64_reg (int reg);
386 void op_shl_reg (int op_size,int reg);
387 void op_sar_reg (int op_size,int reg);
388 void op_shr_reg (int op_size,int reg);
389 void op_and_reg (int op_size,int reg1,int reg2);
390 void op_and64_value (int reg,long offset);
391 void op_and32_value (int reg,long offset);
392 void op_or_reg (int op_size,int reg1,int reg2);
393 void op_xor_reg (int op_size,int reg1,int reg2);
394 void op_not_reg (int op_size,int reg);
395 void op_neg ( int reg );
396 void op_test (int reg1,int reg2);
397 void op_cmp_reg (int op_size,int reg1,int reg2);
398 void op_cmp_value (int op_size,int reg,char byte_data);
399 void op_setne (int reg);
[254]400 const PertialSchedule *op_movlpd_MR (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
401 const PertialSchedule *op_movlpd_RM (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[226]402 void op_movsd_RR (int xmm_reg1,int xmm_reg2);
[254]403 const PertialSchedule *op_movsd_MR (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[226]404 void op_movss_RR (int xmm_reg1,int xmm_reg2);
[254]405 const PertialSchedule *op_movss_RM (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
406 const PertialSchedule *op_movss_MR (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[226]407 void op_movd_RX (int reg,int xmm_reg);
408 void op_cvtsd2ss (int xmm_reg1,int xmm_reg2);
409 void op_cvtss2sd (int xmm_reg1,int xmm_reg2);
410 void op_cvttsd2si_xmm (int op_size,int reg,int xmm_reg);
411 void op_cvttss2si_xmm (int op_size,int reg,int xmm_reg);
412 void op_cvtsi2sd_reg (int op_size,int xmm_reg,int reg);
413 void op_cvtsi2ss_reg (int op_size,int xmm_reg,int reg);
414 void op_comisd (int xmm_reg1,int xmm_reg2);
415 void op_comiss (int xmm_reg1,int xmm_reg2);
416 void op_rep_movs (int op_size);
417 void op_add_rsp(long num);
[255]418 const PertialSchedule *op_sub_rsp( long num, bool isPertialSchedule = false );
[226]419 void op_fld_ptr_esp(int type);
420 void op_zero_reg(int reg);
[317]421
[226]422 void op_call( const UserProc *pUserProc );
423 void op_call( const DllProc *pDllProc );
424 void op_ret();
[262]425 void op_addressof( int reg, const UserProc *pUserProc );
[370]426 void op_mov_RV_com_vtbl( int reg, const CClass *pClass );
[317]427 void op_mov_RV_vtbl( int reg, const CClass *pClass );
[226]428
[225]429#else
[228]430 /////////////////////////////////////////////////////////////////
[237]431 // 32ビット機械語生成
[228]432 /////////////////////////////////////////////////////////////////
[225]433private:
[251]434 const PertialSchedule *set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,long disp, Schedule::Type scheduleType, bool isPertialSchedule );
[225]435 void __op_format(char op_prefix,char opcode,int reg);
[251]436 const PertialSchedule *__op_format(char op_prefix,char opcode1,char opcode2,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[225]437public:
[253]438 const PertialSchedule *op_mov_MV ( int op_size, int base_reg, long offset, Schedule::Type offsetScheduleType, bool isPertialSchedule, long value, Schedule::Type valueScheduleType = Schedule::None );
[357]439 const PertialSchedule *op_mov_RV ( int reg, long offset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[253]440 void op_mov_RR ( int reg1,int reg2);
441 const PertialSchedule *op_mov_RM ( int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
442 const PertialSchedule *op_mov_RM_ex ( int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
443 const PertialSchedule *op_mov_MR ( int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
444 const PertialSchedule *op_mov_MR_ex ( int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
445 void op_movsx_R32R16 ( int reg32,int reg16 = REG_NON);
446 void op_movsx_R32R8 ( int reg32,int reg8 = REG_NON);
447 void op_movsx_R16R8 ( int reg16,int reg8 = REG_NON);
448 const PertialSchedule *op_lea_RM ( int reg, int base_reg, long offset, char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
449 void op_inc (int reg);
450 void op_dec (int reg);
451 void op_add_RV8 (int reg,char cValue);
452 const PertialSchedule *op_add_RV ( int reg, long offset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
453 void op_add_RR ( int reg1, int reg2 );
454 const PertialSchedule *op_add_RM (int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[225]455 void op_adc_RV8 (int reg,char cValue);
456 void op_adc_RR ( int reg1, int reg2 );
457 void op_sub_RV8 (int reg,char cValue);
458 void op_sub_RR ( int reg1, int reg2 );
459 void op_sbb_RV8 (int reg,char cValue);
460 void op_sbb_RR ( int reg1, int reg2 );
461 void op_imul_RR (int reg1,int reg2);
462 void op_imul_RV (int reg,long i32data);
463 void op_imul_RV8 (int reg,char cValue);
464 void op_div_R ( int reg );
465 void op_idiv_R ( int reg );
466 void op_and_RV (int reg,long value);
467 void op_and_RR ( int reg1, int reg2 );
468 void op_or_RR ( int op_size, int reg1, int reg2 );
469 void op_xor_RR ( int reg1, int reg2 = REG_NON );
470 void op_neg ( int reg );
471 void op_cdq ();
472
473 void op_rep_movs (int op_size);
474
475 void op_push(int reg);
[237]476 void op_push_V( long data, Schedule::Type scheduleType = Schedule::None );
[225]477 void op_push_M( int base_reg );
[251]478 const PertialSchedule *op_push_M( int base_reg, long offset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[225]479 void op_pop(int reg = REG_NON);
480 void op_add_esp(long num);
[253]481 const PertialSchedule *op_sub_esp( long num, bool isPertialSchedule = false );
[225]482 void op_cmp_RR( int reg1, int reg2 );
483 void op_cmp_value(int op_size,int reg,char byte_data);
484 void op_setne( int reg );
485 void op_test(int reg1,int reg2);
486 void op_test_ah( char cValue );
487 void op_fld_ptr_esp(int type);
488 void op_fld_basereg (int type,int base_reg);
[253]489 const PertialSchedule *op_fld_base_offset (int type,int base_reg,long offset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
490 const PertialSchedule *op_fld_base_offset_ex (int type,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[225]491 void op_fstp_basereg (int type,int base_reg);
[253]492 const PertialSchedule *op_fstp_base_offset (int type,int base_reg,long offset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
493 const PertialSchedule *op_fstp_base_offset_ex (int type,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None, bool isPertialSchedule = false );
[225]494 void op_fistp_ptr_esp ( int typeSize );
495 void op_fstp_push ( Type &type );
496 void op_fcompp();
497 void op_fnstsw_ax();
498 void op_zero_reg(int reg);
499 void fpu_cast();
500 void fpu_cast_end();
501
[235]502 void op_call_R( int reg );
[225]503 void op_call(const UserProc *pUserProc);
[250]504 void op_call(const DllProc *pDllProc);
[225]505 void op_ret();
[240]506 void op_ret( short stackFrameSize );
[244]507 void op_addressof( int reg, const UserProc *pUserProc );
[370]508 void op_mov_RV_com_vtbl( int reg, const CClass *pClass );
[282]509 void op_mov_RV_vtbl( int reg, const CClass *pClass );
[225]510#endif
511
512
513
[242]514 void PutOld( long l, Schedule::Type scheduleType )
515 {
[551]516 this->PutWithSchedule( l, scheduleType );
[242]517 }
[254]518 const PertialSchedule *PutOld( long l, bool isPertialSchedule )
519 {
520 const PertialSchedule *pPertialSchedule;
521 if( isPertialSchedule )
522 {
523 pertialSchedules.push_back( new PertialSchedule( pNativeCode->GetSize(), sizeof(long) ) );
524 pPertialSchedule = pertialSchedules.back();
525 }
[551]526 pNativeCode->Put( l );
[254]527 return pPertialSchedule;
528 }
[252]529 void PutOld( const NativeCode &nativeCode )
530 {
[287]531 pNativeCode->PutEx( nativeCode );
[252]532 }
[253]533 void PutOld( char c )
534 {
535 pNativeCode->Put( c );
536 }
[225]537 void PutOld( char c1, char c2 )
538 {
539 pNativeCode->Put( c1 );
540 pNativeCode->Put( c2 );
541 }
542 void PutOld( char c1, char c2, char c3 )
543 {
544 pNativeCode->Put( c1 );
545 pNativeCode->Put( c2 );
546 pNativeCode->Put( c3 );
547 }
548 void PutOld( char c1, char c2, char c3, char c4 )
549 {
550 pNativeCode->Put( c1 );
551 pNativeCode->Put( c2 );
552 pNativeCode->Put( c3 );
553 pNativeCode->Put( c4 );
554 }
[228]555 void PutOld( char c1, char c2, char c3, long l )
556 {
557 pNativeCode->Put( c1 );
558 pNativeCode->Put( c2 );
559 pNativeCode->Put( c3 );
560 pNativeCode->Put( l );
561 }
[225]562 void PutOld( char c1, char c2, char c3, char c4, char c5 )
563 {
564 pNativeCode->Put( c1 );
565 pNativeCode->Put( c2 );
566 pNativeCode->Put( c3 );
567 pNativeCode->Put( c4 );
568 pNativeCode->Put( c5 );
569 }
570 void PutOld( char c1, char c2, char c3, char c4, char c5, char c6 )
571 {
572 pNativeCode->Put( c1 );
573 pNativeCode->Put( c2 );
574 pNativeCode->Put( c3 );
575 pNativeCode->Put( c4 );
576 pNativeCode->Put( c5 );
577 pNativeCode->Put( c6 );
578 }
[828]579
580private:
581 CodeGenerator(CodeGenerator const&);
582 CodeGenerator& operator =(CodeGenerator const&);
[225]583};
Note: See TracBrowser for help on using the repository browser.