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

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

svn:eol-styleとsvn:mime-type(文字コード指定含む)の設定

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/plain; charset=Shift_JIS
File size: 936 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.