Index: trunk/abdev/BasicCompiler32/Compile_CallProc.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_CallProc.cpp	(revision 348)
+++ trunk/abdev/BasicCompiler32/Compile_CallProc.cpp	(revision 349)
@@ -330,14 +330,52 @@
 		//                ->func3
 
-		int vtblMasterListIndex, vtblIndex;
-		pobj_c->GetVtblMasterListIndexAndVtblIndex( pUserProc, vtblMasterListIndex, vtblIndex );
-
-		// vtblマスターリストのポインタを取得
-		//mov edx,dword ptr[ecx]
-		compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, 0, MOD_BASE );
-		
-		// vtblのポインタを取得
-		//mov edx,dword ptr[edx+vtblMasterListIndex]
-		compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex, MOD_BASE_DISP32 );
+		int vtblIndex;
+		if( pobj_c->IsInterface() )
+		{
+			// インターフェイスメソッド呼び出し
+
+			int offset_vtbl = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__vtbl" );
+
+
+			// vtblのポインタを取得
+			//mov edx,dword ptr[ecx+offset_vtbl]
+			compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, offset_vtbl, MOD_BASE_DISP8 );
+
+			int offset_this = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__this" );
+
+
+
+			// インターフェイスの場合は更に__thisを取得する
+			//mov rcx,qword ptr[rcx+offset_this]
+			compiler.codeGenerator.op_mov_RM( sizeof(long), REG_ECX, REG_ECX, offset_this, MOD_BASE_DISP8 );
+
+			int vtblMasterListIndex;
+			pobj_c->GetVtblMasterListIndexAndVtblIndex( pUserProc, vtblMasterListIndex, vtblIndex );
+			if( vtblMasterListIndex != 0 )
+			{
+				SetError();
+			}
+		}
+		else
+		{
+			//仮想関数（オブジェクトメソッド）呼び出し
+			// pObj -> vtbl_master_list -> vtbl1 -> func1
+			//                                   -> func2
+			//                                   -> func3
+			//                          -> vtbl2 -> func1
+			//                                   -> func2
+			//                                   -> func3
+
+			int vtblMasterListIndex;
+			pobj_c->GetVtblMasterListIndexAndVtblIndex( pUserProc, vtblMasterListIndex, vtblIndex );
+
+			// vtblマスターリストのポインタを取得
+			//mov edx,dword ptr[ecx]
+			compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, 0, MOD_BASE );
+			
+			// vtblのポインタを取得
+			//mov edx,dword ptr[edx+vtblMasterListIndex]
+			compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex, MOD_BASE_DISP32 );
+		}
 
 		//call dword ptr[edx+func_index]
Index: trunk/abdev/BasicCompiler32/Compile_Func.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Func.cpp	(revision 348)
+++ trunk/abdev/BasicCompiler32/Compile_Func.cpp	(revision 349)
@@ -269,19 +269,52 @@
 
 
-		//仮想関数（オブジェクトメソッド）
-		//pObj->func_table->func1
-		//                ->func2
-		//                ->func3
-
-		int vtblMasterListIndex, vtblIndex;
-		pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
-
-		// vtblマスターリストのポインタを取得
-		//mov edx,dword ptr[ecx]
-		compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, 0, MOD_BASE );
-		
-		// vtblのポインタを取得
-		//mov edx,dword ptr[edx+vtblMasterListIndex]
-		compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex, MOD_BASE_DISP32 );
+		int vtblIndex;
+		if( pobj_c->IsInterface() )
+		{
+			// インターフェイスメソッド呼び出し
+
+			int offset_vtbl = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__vtbl" );
+
+
+			// vtblのポインタを取得
+			//mov edx,dword ptr[ecx+offset_vtbl]
+			compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, offset_vtbl, MOD_BASE_DISP8 );
+
+			int offset_this = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__this" );
+
+
+
+			// インターフェイスの場合は更に__thisを取得する
+			//mov rcx,qword ptr[rcx+offset_this]
+			compiler.codeGenerator.op_mov_RM( sizeof(long), REG_ECX, REG_ECX, offset_this, MOD_BASE_DISP8 );
+
+			int vtblMasterListIndex;
+			pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
+			if( vtblMasterListIndex != 0 )
+			{
+				SetError();
+			}
+		}
+		else
+		{
+			//仮想関数（オブジェクトメソッド）呼び出し
+			// pObj -> vtbl_master_list -> vtbl1 -> func1
+			//                                   -> func2
+			//                                   -> func3
+			//                          -> vtbl2 -> func1
+			//                                   -> func2
+			//                                   -> func3
+
+			int vtblMasterListIndex;
+			pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
+
+			// vtblマスターリストのポインタを取得
+			//mov edx,dword ptr[ecx]
+			compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_ECX, 0, MOD_BASE );
+			
+			// vtblのポインタを取得
+			//mov edx,dword ptr[edx+vtblMasterListIndex]
+			compiler.codeGenerator.op_mov_RM( sizeof(long), REG_EDX, REG_EDX, vtblMasterListIndex, MOD_BASE_DISP32 );
+		}
 
 		//mov eax,dword ptr[edx+func_index]
Index: trunk/abdev/BasicCompiler32/Compile_Object.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Object.cpp	(revision 348)
+++ trunk/abdev/BasicCompiler32/Compile_Object.cpp	(revision 349)
@@ -97,10 +97,17 @@
 	}
 }
-void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter, const Type &baseType ){
-	int typeSize = classObj.GetSize();
-
-	if(classObj.IsAbstract()){
+void Operator_New( const CClass &objClass, const char *objectSizeStr, const char *parameter, const Type &baseType )
+{
+	const CClass *pClass = &objClass;
+	int typeSize = pClass->GetSize();
+
+	if( pClass->IsInterface() )
+	{
+		pClass = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr();
+	}
+
+	if(pClass->IsAbstract()){
 		//抽象クラスだったとき
-		SetError(125,classObj.GetName(),cp);
+		SetError(125,pClass->GetName(),cp);
 	}
 
@@ -188,5 +195,5 @@
 
 
-	const CMethod *method = classObj.GetDestructorMethod();
+	const CMethod *method = pClass->GetDestructorMethod();
 	if( method == NULL ) return;
 
@@ -207,9 +214,9 @@
 
 	//仮想関数テーブルを初期化
-	if( classObj.IsExistVirtualFunctions()
-		&& !classObj.IsAbstract() )
+	if( pClass->IsExistVirtualFunctions()
+		&& !pClass->IsAbstract() )
 	{
 		// mov ecx,vtblAddress
-		compiler.codeGenerator.op_mov_RV_vtbl( REG_ECX, &classObj );
+		compiler.codeGenerator.op_mov_RV_vtbl( REG_ECX, pClass );
 
 		//mov dword ptr[eax],ecx
@@ -217,5 +224,5 @@
 
 		// 仮想関数になるメソッドに使用チェックをつける
-		BOOST_FOREACH( const CMethod *pMethod, classObj.GetDynamicMethods() )
+		BOOST_FOREACH( const CMethod *pMethod, pClass->GetDynamicMethods() )
 		{
 			if( pMethod->IsVirtual() )
@@ -224,5 +231,5 @@
 			}
 		}
-		BOOST_FOREACH( const ::Interface *pInterface, classObj.GetInterfaces() )
+		BOOST_FOREACH( const ::Interface *pInterface, pClass->GetInterfaces() )
 		{
 			BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() )
@@ -248,5 +255,5 @@
 	////////////////////////////
 
-	_call_constructor(&classObj,parameter,typeSize,bSomeObjects);
+	_call_constructor(pClass,parameter,typeSize,bSomeObjects);
 }
 void OpcodeDelete(const char *Parameter, bool isSweeping){
Index: trunk/abdev/BasicCompiler64/Compile_CallProc.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_CallProc.cpp	(revision 348)
+++ trunk/abdev/BasicCompiler64/Compile_CallProc.cpp	(revision 349)
@@ -356,19 +356,49 @@
 
 	if( pUserProc->IsVirtual() && !isFixedClass ){
-		//仮想関数（オブジェクトメソッド）呼び出し
-		//pObj->func_table->func1
-		//                ->func2
-		//                ->func3
-
-		int vtblMasterListIndex, vtblIndex;
-		pobj_c->GetVtblMasterListIndexAndVtblIndex( pUserProc, vtblMasterListIndex, vtblIndex );
-
-		// vtblマスターリストのポインタを取得
-		//mov r11,qword ptr[rcx]
-		compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,0,MOD_BASE);
-
-		// vtblのポインタを取得
-		//mov r11,dword ptr[r11+vtblMasterListIndex]
-		compiler.codeGenerator.op_mov_RM( sizeof(_int64), REG_R11, REG_R11, vtblMasterListIndex*PTR_SIZE, MOD_BASE_DISP32 );
+		int vtblIndex;
+		if( pobj_c->IsInterface() )
+		{
+			// インターフェイスメソッド呼び出し
+
+			int offset_vtbl = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__vtbl" );
+
+			// vtblのポインタを取得
+			//mov r11,qword ptr[rcx+offset_vtbl]
+			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,offset_vtbl,MOD_BASE_DISP8);
+
+			int offset_this = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__this" );
+
+			// インターフェイスの場合は更に__thisを取得する
+			//mov rcx,qword ptr[rcx+offset_this]
+			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_RCX,REG_RCX,offset_this,MOD_BASE_DISP8);
+
+			int vtblMasterListIndex;
+			pobj_c->GetVtblMasterListIndexAndVtblIndex( pUserProc, vtblMasterListIndex, vtblIndex );
+			if( vtblMasterListIndex != 0 )
+			{
+				SetError();
+			}
+		}
+		else
+		{
+			//仮想関数（オブジェクトメソッド）呼び出し
+			// pObj -> vtbl_master_list -> vtbl1 -> func1
+			//                                   -> func2
+			//                                   -> func3
+			//                          -> vtbl2 -> func1
+			//                                   -> func2
+			//                                   -> func3
+
+			int vtblMasterListIndex;
+			pobj_c->GetVtblMasterListIndexAndVtblIndex( pUserProc, vtblMasterListIndex, vtblIndex );
+
+			// vtblマスターリストのポインタを取得
+			//mov r11,qword ptr[rcx]
+			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,0,MOD_BASE);
+
+			// vtblのポインタを取得
+			//mov r11,dword ptr[r11+vtblMasterListIndex]
+			compiler.codeGenerator.op_mov_RM( sizeof(_int64), REG_R11, REG_R11, vtblMasterListIndex*PTR_SIZE, MOD_BASE_DISP32 );
+		}
 
 		//call qword ptr[r11+func_index]
Index: trunk/abdev/BasicCompiler64/Compile_Func.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Func.cpp	(revision 348)
+++ trunk/abdev/BasicCompiler64/Compile_Func.cpp	(revision 349)
@@ -116,19 +116,49 @@
 
 
-		//仮想関数（オブジェクトメソッド）
-		//pObj->func_table->func1
-		//                ->func2
-		//                ->func3
-
-		int vtblMasterListIndex, vtblIndex;
-		pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
-
-		// vtblマスターリストのポインタを取得
-		//mov r11,qword ptr[rcx]
-		compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,0,MOD_BASE);
-
-		// vtblのポインタを取得
-		//mov r11,dword ptr[r11+vtblMasterListIndex]
-		compiler.codeGenerator.op_mov_RM( sizeof(_int64), REG_R11, REG_R11, vtblMasterListIndex, MOD_BASE_DISP32 );
+		int vtblIndex;
+		if( pobj_c->IsInterface() )
+		{
+			// インターフェイスメソッド
+
+			int offset_vtbl = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__vtbl" );
+
+			// vtblのポインタを取得
+			//mov r11,qword ptr[rcx+offset_vtbl]
+			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,offset_vtbl,MOD_BASE_DISP8);
+
+			int offset_this = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr()->GetMemberOffset( "__this" );
+
+			// インターフェイスの場合は更に__thisを取得する
+			//mov rcx,qword ptr[rcx+offset_this]
+			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_RCX,REG_RCX,offset_this,MOD_BASE_DISP8);
+
+			int vtblMasterListIndex;
+			pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
+			if( vtblMasterListIndex != 0 )
+			{
+				SetError();
+			}
+		}
+		else
+		{
+			//仮想関数（オブジェクトメソッド）
+			// pObj -> vtbl_master_list -> vtbl1 -> func1
+			//                                   -> func2
+			//                                   -> func3
+			//                          -> vtbl2 -> func1
+			//                                   -> func2
+			//                                   -> func3
+
+			int vtblMasterListIndex;
+			pobj_c->GetVtblMasterListIndexAndVtblIndex( &userProc, vtblMasterListIndex, vtblIndex );
+
+			// vtblマスターリストのポインタを取得
+			//mov r11,qword ptr[rcx]
+			compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,0,MOD_BASE);
+
+			// vtblのポインタを取得
+			//mov r11,dword ptr[r11+vtblMasterListIndex]
+			compiler.codeGenerator.op_mov_RM( sizeof(_int64), REG_R11, REG_R11, vtblMasterListIndex, MOD_BASE_DISP32 );
+		}
 
 		//mov rax,qword ptr[r11+func_index]
Index: trunk/abdev/BasicCompiler64/Compile_Object.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Object.cpp	(revision 348)
+++ trunk/abdev/BasicCompiler64/Compile_Object.cpp	(revision 349)
@@ -90,10 +90,17 @@
 	}
 }
-void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter, const Type &baseType ){
-	int typeSize = classObj.GetSize();
-
-	if(classObj.IsAbstract()){
+void Operator_New( const CClass &objClass, const char *objectSizeStr, const char *parameter, const Type &baseType )
+{
+	const CClass *pClass = &objClass;
+	int typeSize = pClass->GetSize();
+
+	if( pClass->IsInterface() )
+	{
+		pClass = compiler.GetObjectModule().meta.GetClasses().GetInterfaceInfoClassPtr();
+	}
+
+	if( pClass->IsAbstract() ){
 		//抽象クラスだったとき
-		SetError(125,classObj.GetName().c_str(),cp);
+		SetError(125,pClass->GetName().c_str(),cp);
 	}
 
@@ -177,5 +184,5 @@
 
 
-	const CMethod *method = classObj.GetDestructorMethod();
+	const CMethod *method = pClass->GetDestructorMethod();
 	if( method == NULL ) return;
 
@@ -201,9 +208,9 @@
 
 	//仮想関数テーブルを初期化
-	if( classObj.IsExistVirtualFunctions()
-		&& !classObj.IsAbstract() )
+	if( pClass->IsExistVirtualFunctions()
+		&& !pClass->IsAbstract() )
 	{
 		// mov rcx,vtblAddress
-		compiler.codeGenerator.op_mov_RV_vtbl( REG_RCX, &classObj );
+		compiler.codeGenerator.op_mov_RV_vtbl( REG_RCX, pClass );
 
 		//mov qword ptr[rax],rcx
@@ -212,5 +219,5 @@
 
 		// 仮想関数になるメソッドに使用チェックをつける
-		BOOST_FOREACH( const CMethod *pMethod, classObj.GetDynamicMethods() )
+		BOOST_FOREACH( const CMethod *pMethod, pClass->GetDynamicMethods() )
 		{
 			if( pMethod->IsVirtual() )
@@ -219,5 +226,5 @@
 			}
 		}
-		BOOST_FOREACH( const ::Interface *pInterface, classObj.GetInterfaces() )
+		BOOST_FOREACH( const ::Interface *pInterface, pClass->GetInterfaces() )
 		{
 			BOOST_FOREACH( const CMethod *pMethod, pInterface->GetDynamicMethods() )
@@ -238,5 +245,5 @@
 	////////////////////////////
 
-	_call_constructor(&classObj,parameter,typeSize,bSomeObjects);
+	_call_constructor(pClass,parameter,typeSize,bSomeObjects);
 
 
Index: trunk/abdev/BasicCompiler_Common/include/Class.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/Class.h	(revision 348)
+++ trunk/abdev/BasicCompiler_Common/include/Class.h	(revision 349)
@@ -562,5 +562,7 @@
 	mutable const CClass *pStringClass;
 	mutable const CClass *pObjectClass;
+	mutable const CClass *pInterfaceInfo;
 	const CClass *GetStringClassPtr() const;
 	const CClass *GetObjectClassPtr() const;
+	const CClass *GetInterfaceInfoClassPtr() const;
 };
Index: trunk/abdev/BasicCompiler_Common/src/Class.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/Class.cpp	(revision 348)
+++ trunk/abdev/BasicCompiler_Common/src/Class.cpp	(revision 349)
@@ -1528,5 +1528,4 @@
 
 			if( pobj_c->GetName() == "Object"
-				|| pobj_c->GetFullName() == "ActiveBasic.Core.InterfaceInfo"
 				|| dwClassType == ESC_TYPE )
 			{
@@ -1988,2 +1987,16 @@
 	return pObjectClass;
 }
+const CClass *Classes::GetInterfaceInfoClassPtr() const
+{
+	if( !pInterfaceInfo ){
+		// キャッシュしておく
+		pInterfaceInfo = this->Find( "ActiveBasic.Core.InterfaceInfo" );
+
+		if( !pInterfaceInfo )
+		{
+			SmoothieException::Throw();
+		}
+		return pInterfaceInfo;
+	}
+	return pInterfaceInfo;
+}
Index: trunk/abdev/res/res.rc
===================================================================
--- trunk/abdev/res/res.rc	(revision 348)
+++ trunk/abdev/res/res.rc	(revision 349)
@@ -138,5 +138,5 @@
         MENUITEM SEPARATOR
         MENUITEM "デバッグ ビルド(&D)\tF7",     IDM_DEBUGCOMPILE
-        MENUITEM "デバッグ実行(&R)\tF8",        IDM_DEBUG
+        MENUITEM "デバッグ実行(&R)\tF5",        IDM_DEBUG
         MENUITEM SEPARATOR
         MENUITEM "ブレークポイントの設置/解除(&B)\tF9", IDM_BREAKPOINT
@@ -367,8 +367,7 @@
     VK_F11,         IDM_STEP_OVER,          VIRTKEY, NOINVERT
     VK_F11,         IDM_STEP_CURSOR,        VIRTKEY, CONTROL, NOINVERT
-    VK_F5,          IDM_WEB_SEARCH,         VIRTKEY, NOINVERT
+    VK_F5,          IDM_DEBUG,              VIRTKEY, NOINVERT
     VK_F6,          IDM_RELEASECOMPILE,     VIRTKEY, NOINVERT
     VK_F7,          IDM_DEBUGCOMPILE,       VIRTKEY, NOINVERT
-    VK_F8,          IDM_DEBUG,              VIRTKEY, NOINVERT
     VK_F9,          IDM_BREAKPOINT,         VIRTKEY, NOINVERT
     "X",            IDM_CUT,                VIRTKEY, CONTROL, NOINVERT
