summaryrefslogtreecommitdiff
path: root/src/vm/interpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/interpreter.cpp')
-rw-r--r--src/vm/interpreter.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/vm/interpreter.cpp b/src/vm/interpreter.cpp
index a540cff0b0..b74672f4f0 100644
--- a/src/vm/interpreter.cpp
+++ b/src/vm/interpreter.cpp
@@ -14,7 +14,7 @@
#include "openum.h"
#include "fcall.h"
#include "frames.h"
-#include "gc.h"
+#include "gcheaputilities.h"
#include <float.h>
#include "jitinterface.h"
#include "safemath.h"
@@ -903,9 +903,10 @@ CorJitResult Interpreter::GenerateInterpreterStub(CEEInfo* comp,
#endif
{
// But we also have to use r4, because ThumbEmitCondRegJump below requires a low register.
+ sl.ThumbEmitMovConstant(r11, 0);
sl.ThumbEmitMovConstant(r12, UINT_PTR(interpMethInfo));
sl.ThumbEmitLoadRegIndirect(r12, r12, offsetof(InterpreterMethodInfo, m_jittedCode));
- sl.ThumbEmitCmpImm(r12, 0); // Set condition codes.
+ sl.ThumbEmitCmpReg(r12, r11); // Set condition codes.
// If r12 is zero, then go on to do the interpretation.
CodeLabel* doInterpret = sl.NewCodeLabel();
sl.ThumbEmitCondFlagJump(doInterpret, thumbCondEq.cond);
@@ -1578,7 +1579,7 @@ CorJitResult Interpreter::GenerateInterpreterStub(CEEInfo* comp,
#else
#error unsupported platform
#endif
- stub = sl.Link();
+ stub = sl.Link(SystemDomain::GetGlobalLoaderAllocator()->GetStubHeap());
*nativeSizeOfCode = static_cast<ULONG>(stub->GetNumCodeBytes());
// TODO: manage reference count of interpreter stubs. Look for examples...
@@ -1736,13 +1737,13 @@ void Interpreter::JitMethodIfAppropriate(InterpreterMethodInfo* interpMethInfo,
fprintf(GetLogFile(), "JITting method %s:%s.\n", md->m_pszDebugClassName, md->m_pszDebugMethodName);
}
#endif // _DEBUG
- DWORD dwFlags = CORJIT_FLG_MAKEFINALCODE;
+ CORJIT_FLAGS jitFlags(CORJIT_FLAGS::CORJIT_FLAG_MAKEFINALCODE);
NewHolder<COR_ILMETHOD_DECODER> pDecoder(NULL);
// Dynamic methods (e.g., IL stubs) do not have an IL decoder but may
// require additional flags. Ordinary methods require the opposite.
if (md->IsDynamicMethod())
{
- dwFlags |= md->AsDynamicMethodDesc()->GetILStubResolver()->GetJitFlags();
+ jitFlags.Add(md->AsDynamicMethodDesc()->GetILStubResolver()->GetJitFlags());
}
else
{
@@ -1751,7 +1752,7 @@ void Interpreter::JitMethodIfAppropriate(InterpreterMethodInfo* interpMethInfo,
md->GetMDImport(),
&status);
}
- PCODE res = md->MakeJitWorker(pDecoder, dwFlags, 0);
+ PCODE res = md->MakeJitWorker(pDecoder, jitFlags);
interpMethInfo->m_jittedCode = res;
}
}
@@ -8607,6 +8608,8 @@ void Interpreter::BoxStructRefAt(unsigned ind, CORINFO_CLASS_HANDLE valCls)
if (th.IsTypeDesc())
COMPlusThrow(kInvalidOperationException,W("InvalidOperation_TypeCannotBeBoxed"));
+ MethodTable* pMT = th.AsMethodTable();
+
{
Object* res = OBJECTREFToObject(pMT->Box(valPtr));
@@ -9578,7 +9581,9 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
// This is the argument slot that will be used to hold the return value.
ARG_SLOT retVal = 0;
+#ifndef _ARM_
_ASSERTE (NUMBER_RETURNVALUE_SLOTS == 1);
+#endif
// If the return type is a structure, then these will be initialized.
CORINFO_CLASS_HANDLE retTypeClsHnd = NULL;
@@ -10316,15 +10321,23 @@ void Interpreter::CallI()
}
else
{
- pMD = g_pPrepareConstrainedRegionsMethod; // A random static method.
+ pMD = g_pExecuteBackoutCodeHelperMethod; // A random static method.
}
MethodDescCallSite mdcs(pMD, &mSig, ftnPtr);
+#if 0
// If the current method being interpreted is an IL stub, we're calling native code, so
// change the GC mode. (We'll only do this at the call if the calling convention turns out
// to be a managed calling convention.)
MethodDesc* pStubContextMD = reinterpret_cast<MethodDesc*>(m_stubContext);
bool transitionToPreemptive = (pStubContextMD != NULL && !pStubContextMD->IsIL());
mdcs.CallTargetWorker(args, &retVal, sizeof(retVal), transitionToPreemptive);
+#else
+ // TODO The code above triggers assertion at threads.cpp:6861:
+ // _ASSERTE(thread->PreemptiveGCDisabled()); // Should have been in managed code
+ // The workaround will likely break more things than what it is fixing:
+ // just do not make transition to preemptive GC for now.
+ mdcs.CallTargetWorker(args, &retVal, sizeof(retVal));
+#endif
}
// retVal is now vulnerable.
GCX_FORBID();