[vmkit-commits] [vmkit] r83885 - /vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp

Gael Thomas gael.thomas at lip6.fr
Mon Oct 12 12:58:42 PDT 2009


Author: gthomas
Date: Mon Oct 12 14:58:42 2009
New Revision: 83885

URL: http://llvm.org/viewvc/llvm-project?rev=83885&view=rev
Log:
ClrHelper.GetSemantics is ok. Can execute scimark2.exe and linpack.exe.


Modified:
    vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp

Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83885&r1=83884&r2=83885&view=diff

==============================================================================
--- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original)
+++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Mon Oct 12 14:58:42 2009
@@ -607,7 +607,6 @@
 }
 
 extern "C" VMObject* System_Reflection_Assembly_GetType(VMObject* obj, PNetString* str, bool onError, bool ignoreCase) {
-	printf("Get type\n");
   Assembly* ass = ASSEMBLY_VALUE(obj);
   const ArrayChar* array = str->value;
 	mvm::PrintBuffer pb(array);
@@ -681,23 +680,20 @@
 }
 
 extern "C" VMObject* System_Reflection_ClrHelpers_GetSemantics(mvm::Object* item, uint32 attributes, bool nonPublic) {
-	VMThread::get()->vm->error("implement me: System_Reflection_ClrHelpers_GetSemantics");
-//   if (item->getVirtualTable() == Property::VT) {
-//     Property* prop = (Property*)item;
-//     if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) {
-// 			mvm::PrintBuffer _asciiz(prop->name);
-//       const char* asciiz = _asciiz.cString();
-//       char* buf = (char*)alloca(strlen(asciiz) + 5);
-//       sprintf(buf, "get_%s", asciiz);
-//       N3* vm = VMThread::get()->vm;
-//       VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false);
-//       assert(meth);
-//       return meth->getMethodDelegatee();
-//     }
-//   } else {
-//     VMThread::get()->vm->error("implement me");
-//   }
-  return 0;
+	if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) {
+		Property* prop = (Property*)item;
+		mvm::PrintBuffer _asciiz(prop->name);
+		const char* asciiz = _asciiz.cString();
+		char* buf = (char*)alloca(strlen(asciiz) + 5);
+		sprintf(buf, "get_%s", asciiz);
+		N3* vm = VMThread::get()->vm;
+		VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false);
+		assert(meth);
+		return meth->getMethodDelegatee();
+	} else {
+		VMThread::get()->vm->error("implement me: GetSemantics: %d", attributes);
+		return 0;
+	}
 }
 
 static void decapsulePrimitive(VMObject* arg, const llvm::Type* type, std::vector<llvm::GenericValue>& args) {





More information about the vmkit-commits mailing list