source: dev/trunk/ab5.0/abdev/BasicCompiler_Common/gc.cpp@ 797

Last change on this file since 797 was 508, checked in by dai_9181, 17 years ago

Symbolコンストラクタを少なくし、LexicalAnalyzer::FullNameToSymbolメソッドを実装。

File size: 973 bytes
Line 
1#include "stdafx.h"
2
3#include <Compiler.h>
4
5#ifdef _AMD64_
6#include "../compiler_x64/opcode.h"
7#else
8#include "../compiler_x86/opcode.h"
9#endif
10
11using namespace ActiveBasic::Compiler;
12
13void InitGCVariables(void){
14 char temporary[255];
15 Type type;
16 RELATIVE_VAR RelativeVar;
17
18
19 ///////////////////////////////
20 // スタックフレームの開始位置
21 ///////////////////////////////
22
23 if( compiler.GetObjectModule().meta.GetGlobalVars().Find( LexicalAnalyzer::FullNameToSymbol( "_System_gc_StackRoot_StartPtr" ) ) == NULL )
24 {
25 // 未定義の場合は定義する
26 sprintf(temporary,"_System_gc_StackRoot_StartPtr%c%c*LONG_PTR",1,ESC_AS);
27 OpcodeDim(temporary,0);
28 }
29
30 GetVarOffsetReadWrite("_System_gc_StackRoot_StartPtr",&RelativeVar,type);
31
32 //mov rax,rsp
33 compiler.codeGenerator.op_mov_RR(REG_RAX,REG_RSP);
34
35 //mov ptr[offset],rax/eax
36 compiler.codeGenerator.op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32, Schedule::GlobalVar );
37}
Note: See TracBrowser for help on using the repository browser.