Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up type system #544

Merged
merged 1 commit into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/CLR/CorLib/corlib_native_System_Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ static const ExceptionLookup c_ExceptionLookup[] =
EL(CLR_E_NULL_REFERENCE , m_NullReferenceException ),
EL(CLR_E_OUT_OF_MEMORY , m_OutOfMemoryException ),
EL(CLR_E_OBJECT_DISPOSED , m_ObjectDisposedException ),
EL(CLR_E_FILE_IO , m_IOException ),
EL(CLR_E_INVALID_DRIVER , m_IOException ),
EL(CLR_E_FILE_NOT_FOUND , m_IOException ),
EL(CLR_E_DIRECTORY_NOT_FOUND , m_IOException ),
EL(CLR_E_VOLUME_NOT_FOUND , m_IOException ),
EL(CLR_E_PATH_TOO_LONG , m_IOException ),
EL(CLR_E_DIRECTORY_NOT_EMPTY , m_IOException ),
EL(CLR_E_UNAUTHORIZED_ACCESS , m_IOException ),
EL(CLR_E_PATH_ALREADY_EXISTS , m_IOException ),
EL(CLR_E_TOO_MANY_OPEN_HANDLES , m_IOException ),
EL(CLR_E_WATCHDOG_TIMEOUT , m_WatchdogException ),

#undef EL
Expand Down
28 changes: 0 additions & 28 deletions src/CLR/CorLib/corlib_native_System_Resources_ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,6 @@ HRESULT Library_corlib_native_System_Resources_ResourceManager::GetObjectInterna
NANOCLR_SET_AND_LEAVE(CLR_RT_HeapBlock_String::CreateInstance( top, (const char*)buf, pAssm ));
}
break;

// TODO
// https://github.com/nanoframework/nf-interpreter/issues/304
// case CLR_RECORD_RESOURCE::RESOURCE_Bitmap:
// {
// CLR_RT_HeapBlock* ptr;

// NANOCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex( top, g_CLR_RT_WellKnownTypes.m_Bitmap ));

// ptr = top.Dereference();

// NANOCLR_SET_AND_LEAVE(CLR_GFX_Bitmap::CreateInstance( ptr[ CLR_GFX_Bitmap::FIELD__m_bitmap ], buf, size, pAssm ));
// }
// break;

// TODO
// https://github.com/nanoframework/nf-interpreter/issues/305
// case CLR_RECORD_RESOURCE::RESOURCE_Font:
// {
// CLR_RT_HeapBlock* ptr;

// NANOCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex( top, g_CLR_RT_WellKnownTypes.m_Font ));

// ptr = top.Dereference();

// NANOCLR_SET_AND_LEAVE(CLR_GFX_Font::CreateInstance( ptr[ CLR_GFX_Font::FIELD__m_font ], buf, pAssm ));
// }
// break;

case CLR_RECORD_RESOURCE::RESOURCE_Binary:
{
Expand Down
51 changes: 0 additions & 51 deletions src/CLR/Core/TypeSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2620,7 +2620,6 @@ static const TypeIndexLookup c_TypeIndexLookup[] =
TIL( "System" , "NullReferenceException" , m_NullReferenceException ),
TIL( "System" , "OutOfMemoryException" , m_OutOfMemoryException ),
TIL( "System" , "ObjectDisposedException" , m_ObjectDisposedException ),
TIL( "System.IO" , "IOException" , m_IOException ),
TIL( "System.Threading" , "ThreadAbortException" , m_ThreadAbortException ),
TIL( "Microsoft.SPOT" , "ConstraintException" , m_ConstraintException ),
TIL( "Microsoft.SPOT" , "UnknownTypeException" , m_UnknownTypeException ),
Expand All @@ -2644,40 +2643,8 @@ static const TypeIndexLookup c_TypeIndexLookup[] =

TIL( "Microsoft.SPOT" , "SerializationHintsAttribute" , m_SerializationHintsAttribute ),

TIL( "Microsoft.SPOT" , "ExtendedTimeZone" , m_ExtendedTimeZone ),

TIL( "Microsoft.SPOT" , "Bitmap" , m_Bitmap ),
TIL( "Microsoft.SPOT" , "Font" , m_Font ),

TIL( "Microsoft.SPOT.Touch" , "TouchEvent" , m_TouchEvent ),
TIL( "Microsoft.SPOT.Touch" , "TouchInput" , m_TouchInput ),

TIL( "Microsoft.SPOT.Messaging", "Message" , m_Message ),

TIL( "Microsoft.SPOT.Hardware" , "ScreenMetrics" , m_ScreenMetrics ),

TIL( "Microsoft.SPOT.Hardware" , "WatchdogException" , m_WatchdogException ),

TIL( "Microsoft.SPOT.Hardware" , "I2CDevice" , m_I2CDevice ),
TIL( NULL , "I2CReadTransaction" , m_I2CDevice__I2CReadTransaction ),
TIL( NULL , "I2CWriteTransaction" , m_I2CDevice__I2CWriteTransaction ),

TIL( "Microsoft.SPOT.Hardware.UsbClient", "Configuration" , m_UsbClientConfiguration ),
TIL( NULL , "Descriptor" , m_UsbClientConfiguration__Descriptor ),
TIL( NULL , "DeviceDescriptor" , m_UsbClientConfiguration__DeviceDescriptor ),
TIL( NULL , "ClassDescriptor" , m_UsbClientConfiguration__ClassDescriptor ),
TIL( NULL , "Endpoint" , m_UsbClientConfiguration__Endpoint ),
TIL( NULL , "UsbInterface" , m_UsbClientConfiguration__UsbInterface ),
TIL( NULL , "ConfigurationDescriptor" , m_UsbClientConfiguration__ConfigurationDescriptor ),
TIL( NULL , "StringDescriptor" , m_UsbClientConfiguration__StringDescriptor ),
TIL( NULL , "GenericDescriptor" , m_UsbClientConfiguration__GenericDescriptor ),

TIL( "Microsoft.SPOT.Net.NetworkInformation", "NetworkInterface" , m_NetworkInterface ),
TIL( "Microsoft.SPOT.Net.NetworkInformation", "Wireless80211" , m_Wireless80211 ),

TIL( "Microsoft.SPOT.Time" , "TimeServiceSettings" , m_TimeServiceSettings ),
TIL( "Microsoft.SPOT.Time" , "TimeServiceStatus" , m_TimeServiceStatus ),

#if defined(NANOCLR_APPDOMAINS)
TIL( "System" , "AppDomain" , m_AppDomain ),
TIL( "System" , "MarshalByRefObject" , m_MarshalByRefObject ),
Expand All @@ -2686,24 +2653,6 @@ static const TypeIndexLookup c_TypeIndexLookup[] =
TIL( "System.Threading" , "Thread" , m_Thread ),
TIL( "System.Resources" , "ResourceManager" , m_ResourceManager ),

TIL( "System.Net.Sockets" , "SocketException" , m_SocketException ),

TIL( "Microsoft.SPOT.IO" , "NativeFileInfo" , m_NativeFileInfo ),
TIL( "Microsoft.SPOT.IO" , "VolumeInfo" , m_VolumeInfo ),

TIL( "System.Xml" , "XmlNameTable_Entry" , m_XmlNameTable_Entry ),
TIL( "System.Xml" , "XmlReader_XmlNode" , m_XmlReader_XmlNode ),
TIL( "System.Xml" , "XmlReader_XmlAttribute" , m_XmlReader_XmlAttribute ),
TIL( "System.Xml" , "XmlReader_NamespaceEntry" , m_XmlReader_NamespaceEntry ),

TIL( "System.Security.Cryptography", "CryptoKey" , m_CryptoKey ),
TIL( "Microsoft.SPOT.Cryptoki" , "CryptokiObject" , m_CryptokiObject ),
TIL( "Microsoft.SPOT.Cryptoki" , "Session" , m_CryptokiSession ),
TIL( "Microsoft.SPOT.Cryptoki" , "Slot" , m_CryptokiSlot ),
TIL( "Microsoft.SPOT.Cryptoki" , "MechanismType" , m_CryptokiMechanismType ),
TIL( "System.Security.Cryptography", "CryptographicException" , m_CryptoException ),
TIL( "Microsoft.SPOT.Cryptoki" , "CryptokiCertificate" , m_CryptokiCertificate ),

#undef TIL
};

Expand Down
20 changes: 0 additions & 20 deletions src/CLR/Diagnostics/Info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,26 +738,6 @@ void CLR_RT_DUMP::EXCEPTION( CLR_RT_StackFrame& stack, CLR_RT_HeapBlock& ref )

void CLR_RT_DUMP::POST_PROCESS_EXCEPTION( CLR_RT_HeapBlock& ref )
{
// socket exceptions have an extra field (ErrorCode), so lets display that as well
if (CLR_RT_ExecutionEngine::IsInstanceOf( ref, g_CLR_RT_WellKnownTypes.m_SocketException ))
{
CLR_RT_HeapBlock* obj = ref.Dereference();
if(obj != NULL)
{
// UNDONE: FIXME: CLR_INT32 errorCode = obj[ Library_system_sockets_System_Net_Sockets_SocketException::FIELD___errorCode ].NumericByRef().s4;
// UNDONE: FIXME: CLR_Debug::Printf( " #### SocketException ErrorCode = %d\r\n", errorCode );
}
}
else if(CLR_RT_ExecutionEngine::IsInstanceOf( ref, g_CLR_RT_WellKnownTypes.m_CryptoException ))
{
CLR_RT_HeapBlock* obj = ref.Dereference();
if(obj != NULL)
{
// m_errorCode field
CLR_INT32 errorCode = obj[5].NumericByRef().s4;
CLR_Debug::Printf( " #### CryptoException ErrorCode = %d\r\n", errorCode );
}
}
}

const char* CLR_RT_DUMP::GETERRORMESSAGE( HRESULT hrError )
Expand Down
51 changes: 0 additions & 51 deletions src/CLR/Include/nanoCLR_Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,6 @@ struct CLR_RT_WellKnownTypes
CLR_RT_TypeDef_Index m_Exception;
CLR_RT_TypeDef_Index m_IndexOutOfRangeException;
CLR_RT_TypeDef_Index m_ThreadAbortException;
CLR_RT_TypeDef_Index m_IOException;
CLR_RT_TypeDef_Index m_InvalidOperationException;
CLR_RT_TypeDef_Index m_InvalidCastException;
CLR_RT_TypeDef_Index m_NotSupportedException;
Expand Down Expand Up @@ -1232,38 +1231,6 @@ struct CLR_RT_WellKnownTypes

CLR_RT_TypeDef_Index m_SerializationHintsAttribute;

CLR_RT_TypeDef_Index m_ExtendedTimeZone;

CLR_RT_TypeDef_Index m_Bitmap;
CLR_RT_TypeDef_Index m_Font;

CLR_RT_TypeDef_Index m_TouchEvent;
CLR_RT_TypeDef_Index m_TouchInput;

CLR_RT_TypeDef_Index m_Message;

CLR_RT_TypeDef_Index m_ScreenMetrics;

CLR_RT_TypeDef_Index m_I2CDevice;
CLR_RT_TypeDef_Index m_I2CDevice__I2CReadTransaction;
CLR_RT_TypeDef_Index m_I2CDevice__I2CWriteTransaction;

CLR_RT_TypeDef_Index m_UsbClientConfiguration;
CLR_RT_TypeDef_Index m_UsbClientConfiguration__Descriptor;
CLR_RT_TypeDef_Index m_UsbClientConfiguration__DeviceDescriptor;
CLR_RT_TypeDef_Index m_UsbClientConfiguration__ClassDescriptor;
CLR_RT_TypeDef_Index m_UsbClientConfiguration__Endpoint;
CLR_RT_TypeDef_Index m_UsbClientConfiguration__UsbInterface;
CLR_RT_TypeDef_Index m_UsbClientConfiguration__ConfigurationDescriptor;
CLR_RT_TypeDef_Index m_UsbClientConfiguration__StringDescriptor;
CLR_RT_TypeDef_Index m_UsbClientConfiguration__GenericDescriptor;

CLR_RT_TypeDef_Index m_NetworkInterface;
CLR_RT_TypeDef_Index m_Wireless80211;

CLR_RT_TypeDef_Index m_TimeServiceSettings;
CLR_RT_TypeDef_Index m_TimeServiceStatus;

#if defined(NANOCLR_APPDOMAINS)
CLR_RT_TypeDef_Index m_AppDomain;
CLR_RT_TypeDef_Index m_MarshalByRefObject;
Expand All @@ -1272,24 +1239,6 @@ struct CLR_RT_WellKnownTypes
CLR_RT_TypeDef_Index m_Thread;
CLR_RT_TypeDef_Index m_ResourceManager;

CLR_RT_TypeDef_Index m_SocketException;

CLR_RT_TypeDef_Index m_NativeFileInfo;
CLR_RT_TypeDef_Index m_VolumeInfo;

CLR_RT_TypeDef_Index m_XmlNameTable_Entry;
CLR_RT_TypeDef_Index m_XmlReader_XmlNode;
CLR_RT_TypeDef_Index m_XmlReader_XmlAttribute;
CLR_RT_TypeDef_Index m_XmlReader_NamespaceEntry;

CLR_RT_TypeDef_Index m_CryptoKey;
CLR_RT_TypeDef_Index m_CryptokiObject;
CLR_RT_TypeDef_Index m_CryptokiSession;
CLR_RT_TypeDef_Index m_CryptokiSlot;
CLR_RT_TypeDef_Index m_CryptokiMechanismType;
CLR_RT_TypeDef_Index m_CryptoException;
CLR_RT_TypeDef_Index m_CryptokiCertificate;

PROHIBIT_COPY_CONSTRUCTORS(CLR_RT_WellKnownTypes);
};

Expand Down