Index: trunk/abdev/BasicCompiler64/Compile_Var.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Var.cpp	(revision 243)
+++ trunk/abdev/BasicCompiler64/Compile_Var.cpp	(revision 254)
@@ -4,5 +4,4 @@
 #include <jenga/include/smoothie/LexicalAnalysis.h>
 
-#include <LexicalScopingImpl.h>
 #include <CodeGenerator.h>
 #include <Compiler.h>
@@ -989,8 +988,7 @@
 
 		//mov qword ptr[rsp+offset],rax
-		compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32);
-		obp-=sizeof(long);
-		AddLocalVarAddrSchedule();
-		obp+=sizeof(long);
+		compiler.codeGenerator.localVarPertialSchedules.push_back(
+			compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::None, true )
+		);
 	}
 	else if( type.IsSingle() ){
@@ -999,5 +997,7 @@
 
 		//mov dword ptr[rsp+offset],value
-		compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::LocalVar, USE_OFFSET,*(int *)&flt);
+		compiler.codeGenerator.localVarPertialSchedules.push_back(
+			compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::None, true, USE_OFFSET,*(int *)&flt)
+		);
 	}
 	else if( type.Is64() || type.IsPointer() ){
@@ -1014,5 +1014,7 @@
 
 			//mov qword ptr[rsp+offset],rax
-			compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::LocalVar );
+			compiler.codeGenerator.localVarPertialSchedules.push_back(
+				compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::None, true )
+			);
 		}
 		else{
@@ -1022,9 +1024,13 @@
 
 				//mov qword ptr[rsp+offset],rax
-				compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::LocalVar );
+				compiler.codeGenerator.localVarPertialSchedules.push_back(
+					compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32, Schedule::None, true )
+				);
 			}
 			else{
 				//mov qword ptr[rsp+offset],value
-				compiler.codeGenerator.op_mov_MV(sizeof(_int64),REG_RSP,offset, Schedule::LocalVar, USE_OFFSET,(int)i64data);
+				compiler.codeGenerator.localVarPertialSchedules.push_back(
+					compiler.codeGenerator.op_mov_MV(sizeof(_int64),REG_RSP,offset, Schedule::None, true, USE_OFFSET,(int)i64data)
+				);
 			}
 		}
@@ -1032,13 +1038,19 @@
 	else if( type.IsDWord() || type.IsLong() ){
 		//mov dword ptr[rsp+offset],value
-		compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data);
+		compiler.codeGenerator.localVarPertialSchedules.push_back(
+			compiler.codeGenerator.op_mov_MV(sizeof(long),REG_RSP,offset, Schedule::None, true, USE_OFFSET,(int)i64data)
+		);
 	}
 	else if( type.IsWord() || type.IsInteger() ){
 		//mov word ptr[rsp+offset],value
-		compiler.codeGenerator.op_mov_MV(sizeof(short),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data);
+		compiler.codeGenerator.localVarPertialSchedules.push_back(
+			compiler.codeGenerator.op_mov_MV(sizeof(short),REG_RSP,offset, Schedule::None, true, USE_OFFSET,(int)i64data)
+		);
 	}
 	else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){
 		//mov byte ptr[rsp+offset],value
-		compiler.codeGenerator.op_mov_MV(sizeof(char),REG_RSP,offset, Schedule::LocalVar,USE_OFFSET,(int)i64data);
+		compiler.codeGenerator.localVarPertialSchedules.push_back(
+			compiler.codeGenerator.op_mov_MV(sizeof(char),REG_RSP,offset, Schedule::None, true, USE_OFFSET,(int)i64data)
+		);
 	}
 	return true;
@@ -1074,6 +1086,6 @@
 
 		//レキシカルスコープ
-		pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() );
-		pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() );
+		pVar->SetScopeLevel( compiler.codeGenerator.lexicalScopes.GetNowLevel() );
+		pVar->SetScopeStartAddress( compiler.codeGenerator.lexicalScopes.GetStartAddress() );
 		pVar->bLiving=TRUE;
 
@@ -1109,6 +1121,6 @@
 
 		//レキシカルスコープ
-		pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() );
-		pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() );
+		pVar->SetScopeLevel( compiler.codeGenerator.lexicalScopes.GetNowLevel() );
+		pVar->SetScopeStartAddress( compiler.codeGenerator.lexicalScopes.GetStartAddress() );
 		pVar->bLiving=TRUE;
 
@@ -1151,8 +1163,7 @@
 
 			//add rcx, offset
-			compiler.codeGenerator.op_add_RV( REG_RCX, -pVar->GetOffsetAddress() );
-			obp-=sizeof(long);
-			AddLocalVarAddrSchedule();
-			obp+=sizeof(long);
+			compiler.codeGenerator.localVarPertialSchedules.push_back(
+				compiler.codeGenerator.op_add_RV( REG_RCX, -pVar->GetOffsetAddress(), Schedule::None, true )
+			);
 
 			//call FillMemory
@@ -1217,5 +1228,7 @@
 		if(pRelativeVar->bOffsetOffset){
 			//add r11,offset
-			compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::LocalVar );
+			compiler.codeGenerator.localVarPertialSchedules.push_back(
+				compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::None, true )
+			);
 
 			//add r11,rsp
@@ -1230,5 +1243,7 @@
 
 			//add reg,offset
-			compiler.codeGenerator.op_add_RV(reg,(long)pRelativeVar->offset, Schedule::LocalVar );
+			compiler.codeGenerator.localVarPertialSchedules.push_back(
+				compiler.codeGenerator.op_add_RV(reg,(long)pRelativeVar->offset, Schedule::None, true )
+			);
 		}
 	}
@@ -1236,9 +1251,13 @@
 		if(pRelativeVar->bOffsetOffset){
 			//add r11,qword ptr[rsp+offset]
-			compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::LocalVar );
+			compiler.codeGenerator.localVarPertialSchedules.push_back(
+				compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::None, true )
+			);
 		}
 		else{
 			//mov r11,qword ptr[rsp+offset]
-			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar );
+			compiler.codeGenerator.localVarPertialSchedules.push_back(
+				compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::None, true )
+			);
 		}
 
