summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Koritzinsky <jekoritz@microsoft.com>2019-05-24 13:20:23 -0700
committerGitHub <noreply@github.com>2019-05-24 13:20:23 -0700
commit73217c884caeca4bcfbb9cc93ffe4c90db79cf7a (patch)
tree45ee95e94186fab0fabe05bd1aa351567daa62ac /src
parent5894a0f4ecd7360dc25b1e01afb0120efceb7a11 (diff)
downloadcoreclr-73217c884caeca4bcfbb9cc93ffe4c90db79cf7a.tar.gz
coreclr-73217c884caeca4bcfbb9cc93ffe4c90db79cf7a.tar.bz2
coreclr-73217c884caeca4bcfbb9cc93ffe4c90db79cf7a.zip
Enable LCID marshalling and clean up our LCID marshalling tests. (#24642)
* Enable LCID marshalling and clean up our LCID marshalling tests. * Fix return type. * Enable LCID IDispatch reverse marshalling * Add more tests for LCID marshalling. * Add testing for reverse-IDispatch. Fix bug in Thread::GetCulture when culture has not been initialized on the managed side. * PR Feedback. * Fix install command.
Diffstat (limited to 'src')
-rw-r--r--src/vm/dllimport.cpp9
-rw-r--r--src/vm/interoputil.cpp4
-rw-r--r--src/vm/mscorlib.h2
-rw-r--r--src/vm/threads.cpp21
4 files changed, 4 insertions, 32 deletions
diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp
index 7fc0863a6c..469a06e887 100644
--- a/src/vm/dllimport.cpp
+++ b/src/vm/dllimport.cpp
@@ -451,8 +451,7 @@ public:
STANDARD_VM_CONTRACT;
ILCodeStream* pcs = m_slIL.GetDispatchCodeStream();
-
-#ifdef FEATURE_USE_LCID
+
if (SF_IsReverseStub(m_dwStubFlags))
{
if ((m_slIL.GetStubTargetCallingConv() & IMAGE_CEE_CS_CALLCONV_HASTHIS) == IMAGE_CEE_CS_CALLCONV_HASTHIS)
@@ -504,12 +503,6 @@ public:
pcs->EmitCALL(METHOD__CULTURE_INFO__GET_ID, 1, 1);
}
}
-#else // FEATURE_USE_LCID
- if (SF_IsForwardStub(m_dwStubFlags))
- {
- pcs->EmitLDC(0x0409); // LCID_ENGLISH_US
- }
-#endif // FEATURE_USE_LCID
// add the extra arg to the unmanaged signature
LocalDesc locDescNative(ELEMENT_TYPE_I4);
diff --git a/src/vm/interoputil.cpp b/src/vm/interoputil.cpp
index c516a27eef..a6eab2280e 100644
--- a/src/vm/interoputil.cpp
+++ b/src/vm/interoputil.cpp
@@ -984,7 +984,6 @@ void GetCultureInfoForLCID(LCID lcid, OBJECTREF *pCultureObj)
}
CONTRACTL_END;
-#ifdef FEATURE_USE_LCID
OBJECTREF CultureObj = NULL;
GCPROTECT_BEGIN(CultureObj)
{
@@ -1004,9 +1003,6 @@ void GetCultureInfoForLCID(LCID lcid, OBJECTREF *pCultureObj)
*pCultureObj = CultureObj;
}
GCPROTECT_END();
-#else
- COMPlusThrow(kNotSupportedException);
-#endif
}
#endif // CROSSGEN_COMPILE
diff --git a/src/vm/mscorlib.h b/src/vm/mscorlib.h
index 50188f0407..d328d2a471 100644
--- a/src/vm/mscorlib.h
+++ b/src/vm/mscorlib.h
@@ -272,10 +272,8 @@ DEFINE_CLASS(CULTURE_INFO, Globalization, CultureInfo)
DEFINE_METHOD(CULTURE_INFO, STR_CTOR, .ctor, IM_Str_RetVoid)
DEFINE_FIELD(CULTURE_INFO, CURRENT_CULTURE, s_userDefaultCulture)
DEFINE_PROPERTY(CULTURE_INFO, NAME, Name, Str)
-#ifdef FEATURE_USE_LCID
DEFINE_METHOD(CULTURE_INFO, INT_CTOR, .ctor, IM_Int_RetVoid)
DEFINE_PROPERTY(CULTURE_INFO, ID, LCID, Int)
-#endif
DEFINE_FIELD(CULTURE_INFO, CULTURE, s_currentThreadCulture)
DEFINE_FIELD(CULTURE_INFO, UI_CULTURE, s_currentThreadUICulture)
DEFINE_STATIC_SET_PROPERTY(CULTURE_INFO, CURRENT_CULTURE, CurrentCulture, CultureInfo)
diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp
index 7632bda555..945cb3a601 100644
--- a/src/vm/threads.cpp
+++ b/src/vm/threads.cpp
@@ -7918,8 +7918,6 @@ OBJECTREF Thread::GetCulture(BOOL bUICulture)
}
CONTRACTL_END;
- FieldDesc * pFD;
-
// This is the case when we're building mscorlib and haven't yet created
// the system assembly.
if (SystemDomain::System()->SystemAssembly()==NULL || g_fForbidEnterEE) {
@@ -7927,22 +7925,9 @@ OBJECTREF Thread::GetCulture(BOOL bUICulture)
}
OBJECTREF pCurrentCulture;
- if (bUICulture) {
- // Call the Getter for the CurrentUICulture. This will cause it to populate the field.
- MethodDescCallSite propGet(METHOD__CULTURE_INFO__GET_CURRENT_UI_CULTURE);
- ARG_SLOT retVal = propGet.Call_RetArgSlot(NULL);
- pCurrentCulture = ArgSlotToObj(retVal);
- } else {
- //This is faster than calling the property, because this is what the call does anyway.
- pFD = MscorlibBinder::GetField(FIELD__CULTURE_INFO__CURRENT_CULTURE);
- _ASSERTE(pFD);
-
- pFD->CheckRunClassInitThrowing();
-
- pCurrentCulture = pFD->GetStaticOBJECTREF();
- _ASSERTE(pCurrentCulture!=NULL);
- }
-
+ MethodDescCallSite propGet(bUICulture ? METHOD__CULTURE_INFO__GET_CURRENT_UI_CULTURE : METHOD__CULTURE_INFO__GET_CURRENT_CULTURE);
+ ARG_SLOT retVal = propGet.Call_RetArgSlot(NULL);
+ pCurrentCulture = ArgSlotToObj(retVal);
return pCurrentCulture;
}