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

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

マクロBUILD_X64_COMPILERの導入

File size: 1008 bytes
RevLine 
[206]1#include "stdafx.h"
2
[225]3#include <Compiler.h>
[4]4
[759]5#if defined _AMD64_ || defined BUILD_X64_COMPILER
[485]6#include "../compiler_x64/opcode.h"
[4]7#else
[484]8#include "../compiler_x86/opcode.h"
[4]9#endif
10
[508]11using namespace ActiveBasic::Compiler;
12
[4]13void 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.