Skip to content

Commit a830641

Browse files
Disable PerfTracing (#2725)
Disable PerfTracing Hack around an issue with Static Abstracts. Fix stack bug in DoGetMethodTable(). Disable Transient code-gen for UnsafeAccessorAttribute. Basic C# "Hello, World" works!
1 parent 6aafd03 commit a830641

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

src/coreclr/clr.featuredefines.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<FeatureCoreCLR>true</FeatureCoreCLR>
44
<FeatureEventTrace>true</FeatureEventTrace>
5-
<FeaturePerfTracing>true</FeaturePerfTracing>
5+
<!-- <FeaturePerfTracing>true</FeaturePerfTracing> -->
66
<FeatureTypeEquivalence>true</FeatureTypeEquivalence>
77
<ProfilingSupportedBuild>true</ProfilingSupportedBuild>
88
</PropertyGroup>

src/coreclr/vm/interpreter.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9625,6 +9625,8 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
96259625
{
96269626
_ASSERTE(m_callThisArg == NULL); // "m_callThisArg" non-null only for .ctor, which are not callvirts.
96279627

9628+
bool staticAbstract = false;
9629+
96289630
// The constrained. prefix will be immediately followed by a ldftn, call or callvirt instruction.
96299631
// See Ecma-335-Augments.md#iii21-constrained---prefix-invoke-a-member-on-a-value-of-a-variable-type-page-316 for more detail
96309632
if (sigInfo.hasThis())
@@ -9637,7 +9639,8 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
96379639
else
96389640
{
96399641
// If the constrained. prefix is applied to a call or ldftn instruction, method must be a virtual static method.
9640-
// TODO: Assert it is a virtual static method.
9642+
OPCODE opcode = (OPCODE)(*m_ILCodePtr);
9643+
staticAbstract = (opcode == CEE_CALL || opcode == CEE_LDFTN) && methToCall->IsStatic();
96419644
}
96429645

96439646
// We only cache for the CORINFO_NO_THIS_TRANSFORM case, so we may assume that if we have a cached call site,
@@ -9683,7 +9686,7 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
96839686
DWORD exactClassAttribs = m_interpCeeInfo.getClassAttribs(exactClass);
96849687
// If the constraint type is a value class, then it is the exact class (which will be the
96859688
// "owner type" in the MDCS below.) If it is not, leave it as the (precise) interface method.
9686-
if (exactClassAttribs & CORINFO_FLG_VALUECLASS)
9689+
if (exactClassAttribs & CORINFO_FLG_VALUECLASS && !staticAbstract)
96879690
{
96889691
MethodTable* exactClassMT = GetMethodTableFromClsHnd(exactClass);
96899692
// Find the method on exactClass corresponding to methToCall.
@@ -9696,6 +9699,8 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
96969699
}
96979700
else
96989701
{
9702+
if (staticAbstract)
9703+
methToCall = reinterpret_cast<MethodDesc*>(callInfoPtr->hMethod);
96999704
exactClass = methTokPtr->hClass;
97009705
}
97019706
}
@@ -10565,7 +10570,11 @@ void Interpreter::CallI()
1056510570
// change the GC mode. (We'll only do this at the call if the calling convention turns out
1056610571
// to be a managed calling convention.)
1056710572
MethodDesc* pStubContextMD = reinterpret_cast<MethodDesc*>(m_stubContext);
10568-
bool transitionToPreemptive = (pStubContextMD != NULL && !pStubContextMD->IsIL());
10573+
bool transitionToPreemptive;
10574+
{
10575+
GCX_PREEMP();
10576+
transitionToPreemptive = (pStubContextMD != NULL && !pStubContextMD->IsIL() && !pStubContextMD->ShouldSuppressGCTransition());
10577+
}
1056910578
mdcs.CallTargetWorker(args, &retVal, sizeof(retVal), transitionToPreemptive);
1057010579
}
1057110580
// retVal is now vulnerable.
@@ -11015,8 +11024,8 @@ void Interpreter::DoGetMethodTable()
1101511024

1101611025
MethodTable* pMT = obj->RawGetMethodTable();
1101711026

11018-
OpStackSet<MethodTable*>(m_curStackHt, pMT);
11019-
OpStackTypeSet(m_curStackHt, InterpreterType(CORINFO_TYPE_NATIVEINT));
11027+
OpStackSet<MethodTable*>(ind, pMT);
11028+
OpStackTypeSet(ind, InterpreterType(CORINFO_TYPE_NATIVEINT));
1102011029
}
1102111030

1102211031
bool Interpreter::DoInterlockedCompareExchange(CorInfoType retType)

src/coreclr/vm/jitinterface.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7704,6 +7704,7 @@ CEEInfo::getMethodInfo(
77047704
getMethodInfoHelper(cxt, methInfo, context);
77057705
result = true;
77067706
}
7707+
#ifndef FEATURE_INTERPRETER
77077708
else if (ftn->IsIL() && ftn->GetRVA() == 0)
77087709
{
77097710
// We will either find or create transient method details.
@@ -7733,6 +7734,7 @@ CEEInfo::getMethodInfo(
77337734

77347735
result = true;
77357736
}
7737+
#endif // !FEATURE_INTERPRETER
77367738

77377739
if (result)
77387740
{

0 commit comments

Comments
 (0)