Skip to content

Commit

Permalink
[x86/Linux] Enclose stub-linking methods with FEATURE_STUBS_AS_IL (do…
Browse files Browse the repository at this point in the history
  • Loading branch information
parjong authored and janvorli committed Dec 5, 2016
1 parent 567b6d6 commit c987532
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/coreclr/src/vm/i386/cgenx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ Stub *GenerateUMThunkPrestub()
}
CONTRACT_END;

#ifndef FEATURE_STUBS_AS_IL
CPUSTUBLINKER sl;
CPUSTUBLINKER *psl = &sl;

Expand Down Expand Up @@ -808,6 +809,10 @@ Stub *GenerateUMThunkPrestub()
psl->EmitComMethodStubEpilog(UMThkCallFrame::GetMethodFrameVPtr(), rgRareLabels, rgRejoinLabels, FALSE /*Don't profile*/);

RETURN psl->Link(SystemDomain::GetGlobalLoaderAllocator()->GetExecutableHeap());
#else // FEATURE_STUBS_AS_IL
PORTABILITY_ASSERT("GenerateUMThunkPrestub");
return NULL;
#endif // FEATURE_STUBS_AS_IL
}

Stub *GenerateInitPInvokeFrameHelper()
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/src/vm/i386/stublinkerx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2624,6 +2624,7 @@ VOID StubLinkerCPU::EmitProfilerComCallEpilog(TADDR pFrameVptr, X86Reg regFrame)
#endif // PROFILING_SUPPORTED


#ifndef FEATURE_STUBS_AS_IL
//========================================================================
// Prolog for entering managed code from COM
// pushes the appropriate frame ptr
Expand Down Expand Up @@ -2850,6 +2851,7 @@ void StubLinkerCPU::EmitComMethodStubEpilog(TADDR pFrameVptr,
EmitLabel(rgRareLabels[0]); // label for rare setup thread
EmitRareSetup(rgRejoinLabels[0], /*fThrow*/ TRUE); // emit rare setup thread
}
#endif // !FEATURE_STUBS_AS_IL

//---------------------------------------------------------------
// Emit code to store the setup current Thread structure in eax.
Expand Down
11 changes: 7 additions & 4 deletions src/coreclr/src/vm/i386/stublinkerx86.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ class StubLinkerCPU : public StubLinker

VOID EmitSetup(CodeLabel *pForwardRef);
VOID EmitRareSetup(CodeLabel* pRejoinPoint, BOOL fThrow);

#ifndef FEATURE_STUBS_AS_IL
VOID EmitMethodStubProlog(TADDR pFrameVptr, int transitionBlockOffset);
VOID EmitMethodStubEpilog(WORD numArgBytes, int transitionBlockOffset);

VOID EmitCheckGSCookie(X86Reg frameReg, int gsCookieOffset);

#ifdef _TARGET_X86_
Expand All @@ -353,10 +358,8 @@ class StubLinkerCPU : public StubLinker

void EmitComMethodStubEpilog(TADDR pFrameVptr, CodeLabel** rgRareLabels,
CodeLabel** rgRejoinLabels, BOOL bShouldProfile);
#endif

VOID EmitMethodStubProlog(TADDR pFrameVptr, int transitionBlockOffset);
VOID EmitMethodStubEpilog(WORD numArgBytes, int transitionBlockOffset);
#endif // _TARGET_X86_
#endif // !FEATURE_STUBS_AS_IL

VOID EmitUnboxMethodStub(MethodDesc* pRealMD);
#if defined(FEATURE_SHARE_GENERIC_CODE)
Expand Down

0 comments on commit c987532

Please sign in to comment.