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

Last change on this file since 494 was 485, checked in by dai_9181, 17 years ago

プロジェクトのリネームが完了

File size: 904 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
11void InitGCVariables(void){
12 char temporary[255];
13 Type type;
14 RELATIVE_VAR RelativeVar;
15
16
17 ///////////////////////////////
18 // スタックフレームの開始位置
19 ///////////////////////////////
20
21 if( compiler.GetObjectModule().meta.GetGlobalVars().Find( Symbol( "_System_gc_StackRoot_StartPtr" ) ) == NULL )
22 {
23 // 未定義の場合は定義する
24 sprintf(temporary,"_System_gc_StackRoot_StartPtr%c%c*LONG_PTR",1,ESC_AS);
25 OpcodeDim(temporary,0);
26 }
27
28 GetVarOffsetReadWrite("_System_gc_StackRoot_StartPtr",&RelativeVar,type);
29
30 //mov rax,rsp
31 compiler.codeGenerator.op_mov_RR(REG_RAX,REG_RSP);
32
33 //mov ptr[offset],rax/eax
34 compiler.codeGenerator.op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32, Schedule::GlobalVar );
35}
Note: See TracBrowser for help on using the repository browser.