summaryrefslogtreecommitdiff
path: root/src/vm/jitinterface.cpp
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2018-12-10 07:52:15 -0800
committerGitHub <noreply@github.com>2018-12-10 07:52:15 -0800
commit32d8dfb65f2403c1cb628495ee944a9f35a0eb3a (patch)
tree5679964c2d10f3702a0a14bf64cce64e391d6da6 /src/vm/jitinterface.cpp
parentc1c74f6ff2a12bd33240ea514dca76fc100125b9 (diff)
downloadcoreclr-32d8dfb65f2403c1cb628495ee944a9f35a0eb3a.tar.gz
coreclr-32d8dfb65f2403c1cb628495ee944a9f35a0eb3a.tar.bz2
coreclr-32d8dfb65f2403c1cb628495ee944a9f35a0eb3a.zip
Add support for RVA fields to crossgen/R2R (#21463)
* Add support for RVA fields to crossgen/R2R RVA fields are became more common with pre-inititialized ReadOnlySpan<byte>. Fix crossgen to deal with them for R2R. * Fix tests, map new JIT helper for R2R
Diffstat (limited to 'src/vm/jitinterface.cpp')
-rw-r--r--src/vm/jitinterface.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 63b407c488..7fcdd62d05 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -13964,11 +13964,35 @@ InfoAccessType CEEInfo::emptyStringLiteral(void ** ppValue)
void* CEEInfo::getFieldAddress(CORINFO_FIELD_HANDLE fieldHnd,
void **ppIndirection)
{
- LIMITED_METHOD_CONTRACT;
- _ASSERTE(isVerifyOnly());
+ CONTRACTL{
+ SO_TOLERANT;
+ THROWS;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ } CONTRACTL_END;
+
+ void *result = NULL;
+
if (ppIndirection != NULL)
*ppIndirection = NULL;
- return (void *)0x10;
+
+ // Do not bother with initialization if we are only verifying the method.
+ if (isVerifyOnly())
+ {
+ return (void *)0x10;
+ }
+
+ JIT_TO_EE_TRANSITION();
+
+ FieldDesc* field = (FieldDesc*)fieldHnd;
+
+ _ASSERTE(field->IsRVA());
+
+ result = field->GetStaticAddressHandle(NULL);
+
+ EE_TO_JIT_TRANSITION();
+
+ return result;
}
CORINFO_CLASS_HANDLE CEEInfo::getStaticFieldCurrentClass(CORINFO_FIELD_HANDLE fieldHnd,