source: dev/branches/x64_compiler_on_32/abdev/BasicCompiler_Common/gc.cpp

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

マクロBUILD_X64_COMPILERの導入

File size: 1008 bytes
Line 
1#include "stdafx.h"
2
3#include <Compiler.h>
4
5#if defined _AMD64_ || defined BUILD_X64_COMPILER
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.