Last change
on this file since 652 was 508, checked in by dai_9181, 17 years ago |
Symbolコンストラクタを少なくし、LexicalAnalyzer::FullNameToSymbolメソッドを実装。
|
File size:
973 bytes
|
Rev | Line | |
---|
[206] | 1 | #include "stdafx.h"
|
---|
| 2 |
|
---|
[225] | 3 | #include <Compiler.h>
|
---|
[4] | 4 |
|
---|
| 5 | #ifdef _AMD64_
|
---|
[485] | 6 | #include "../compiler_x64/opcode.h"
|
---|
[4] | 7 | #else
|
---|
[484] | 8 | #include "../compiler_x86/opcode.h"
|
---|
[4] | 9 | #endif
|
---|
| 10 |
|
---|
[508] | 11 | using namespace ActiveBasic::Compiler;
|
---|
| 12 |
|
---|
[4] | 13 | void InitGCVariables(void){
|
---|
| 14 | char temporary[255];
|
---|
[75] | 15 | Type type;
|
---|
| 16 | RELATIVE_VAR RelativeVar;
|
---|
[4] | 17 |
|
---|
| 18 |
|
---|
| 19 | ///////////////////////////////
|
---|
| 20 | // スタックフレームの開始位置
|
---|
| 21 | ///////////////////////////////
|
---|
| 22 |
|
---|
[508] | 23 | if( compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( "_System_gc_StackRoot_StartPtr" ) ) == NULL )
|
---|
[272] | 24 | {
|
---|
| 25 | // 未定義の場合は定義する
|
---|
| 26 | sprintf(temporary,"_System_gc_StackRoot_StartPtr%c%c*LONG_PTR",1,ESC_AS);
|
---|
| 27 | OpcodeDim(temporary,0);
|
---|
| 28 | }
|
---|
[4] | 29 |
|
---|
[75] | 30 | GetVarOffsetReadWrite("_System_gc_StackRoot_StartPtr",&RelativeVar,type);
|
---|
[4] | 31 |
|
---|
| 32 | //mov rax,rsp
|
---|
[225] | 33 | compiler.codeGenerator.op_mov_RR(REG_RAX,REG_RSP);
|
---|
[4] | 34 |
|
---|
| 35 | //mov ptr[offset],rax/eax
|
---|
[229] | 36 | compiler.codeGenerator.op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32, Schedule::GlobalVar );
|
---|
[4] | 37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.