From: 정동헌/Common Platform Lab(SR)/Principal Engineer/삼성전자 Date: Mon, 22 Jun 2020 22:44:28 +0000 (+0900) Subject: [Tizen] Force Inline for Generic Methods (#224) X-Git-Tag: accepted/tizen/unified/20200623.124116^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=982bdae7fce02ab9901b051109dacf060a5d1dfb;p=platform%2Fupstream%2Fcoreclr.git [Tizen] Force Inline for Generic Methods (#224) This patch enables more generic method inlining for methods which are not compiled by NI. --- diff --git a/clrdefinitions.cmake b/clrdefinitions.cmake index 4d366e1..9120cad 100644 --- a/clrdefinitions.cmake +++ b/clrdefinitions.cmake @@ -258,3 +258,7 @@ endif(WIN32) if(CLR_CMAKE_PLATFORM_DARWIN) add_definitions(-DFEATURE_WRITEBARRIER_COPY) endif(CLR_CMAKE_PLATFORM_DARWIN) + +if(TIZEN_AGGRESSIVE_INLINING_GENERIC) + add_definitions(-DTIZEN_AGGRESSIVE_INLINING_GENERIC) +endif(TIZEN_AGGRESSIVE_INLINING_GENERIC) diff --git a/packaging/coreclr.spec b/packaging/coreclr.spec index 77a5481..4a9ad3a 100755 --- a/packaging/coreclr.spec +++ b/packaging/coreclr.spec @@ -212,7 +212,7 @@ export CXXFLAGS+="-fstack-protector-strong" # Build native only. export NUGET_PACKAGES=%{_builddir}/%{name}-%{version}/.packages/ export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/libicu-57.1/ -./build.sh -portablebuild=false -%{_barch} -%{_buildtype} -numproc %{_numproc} -skipmscorlib -skipgenerateversion -skipnuget -msbuildonunsupportedplatform cmakeargs "-DFEATURE_PREJIT=true -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro" %{_ngen_relocs_opts} %{_pgo_flags} +./build.sh -portablebuild=false -%{_barch} -%{_buildtype} -numproc %{_numproc} -skipmscorlib -skipgenerateversion -skipnuget -msbuildonunsupportedplatform cmakeargs "-DFEATURE_PREJIT=true -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true -DTIZEN_AGGRESSIVE_INLINING_GENERIC=true -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro" %{_ngen_relocs_opts} %{_pgo_flags} %endif %else %if 0%{skipnative} @@ -224,7 +224,7 @@ export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/libicu-57.1/ # Build native and mscorlib. export NUGET_PACKAGES=%{_builddir}/%{name}-%{version}/.packages/ export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/libicu-57.1/ -./build.sh -portablebuild=false -%{_barch} -%{_buildtype} -numproc %{_numproc} -skipgenerateversion -skiprestore -skiprestoreoptdata -skipnuget -skipcrossgen -msbuildonunsupportedplatform cmakeargs "-DFEATURE_IBCLOGGER=true -DFEATURE_PREJIT=true -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro" %{_ngen_relocs_opts} %{_pgo_flags} +./build.sh -portablebuild=false -%{_barch} -%{_buildtype} -numproc %{_numproc} -skipgenerateversion -skiprestore -skiprestoreoptdata -skipnuget -skipcrossgen -msbuildonunsupportedplatform cmakeargs "-DFEATURE_IBCLOGGER=true -DFEATURE_PREJIT=true -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION=true -DTIZEN_AGGRESSIVE_INLINING_GENERIC=true -DCLR_ADDITIONAL_LINKER_FLAGS=-Wl,-z,relro" %{_ngen_relocs_opts} %{_pgo_flags} %endif %endif diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp index bf4abe1..b26c5ba 100644 --- a/src/vm/jitinterface.cpp +++ b/src/vm/jitinterface.cpp @@ -6862,6 +6862,17 @@ DWORD CEEInfo::getMethodAttribsInternal (CORINFO_METHOD_HANDLE ftn) } #endif +#if defined(FEATURE_PREJIT) && defined(CROSSGEN_COMPILE) +#ifdef TIZEN_AGGRESSIVE_INLINING_GENERIC + if (!IsReadyToRunCompilation() && pMD->IsIL() && (result & CORINFO_FLG_FORCEINLINE) == 0 && + !pMD->IsTypicalMethodDefinition() && !pMD->IsGenericMethodDefinition() && + Module::GetPreferredZapModuleForMethodDesc(pMD) != pMD->GetLoaderModule()) + { + result |= CORINFO_FLG_FORCEINLINE; + } +#endif +#endif + return result; }