Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable FEATURE_ARRAYSTUB_AS_IL on all platforms #103533

Merged
merged 6 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ private static void StelemRef_Helper_NoCacheLookup(ref object? element, void* el
WriteBarrier(ref element, obj);
}

#if FEATURE_ARRAYSTUB_AS_IL
[DebuggerHidden]
private static unsafe void ArrayTypeCheck(object obj, Array array)
{
Expand Down Expand Up @@ -493,6 +492,5 @@ private static unsafe void ArrayTypeCheck_Helper(object obj, void* elementType)
ThrowArrayMismatchException();
}
}
#endif
}
}
3 changes: 0 additions & 3 deletions src/coreclr/clr.featuredefines.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@

<PropertyGroup Condition="'$(TargetsUnix)' == 'true'">
<FeatureXplatEventSource Condition="'$(TargetOS)' == 'linux'">true</FeatureXplatEventSource>
<FeatureArrayStubAsIL>true</FeatureArrayStubAsIL>
<FeatureMulticastStubAsIL>true</FeatureMulticastStubAsIL>
<FeatureComWrappers>true</FeatureComWrappers>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetsWindows)' == 'true'">
<FeatureArrayStubAsIL Condition="'$(Platform)' != 'x86'">true</FeatureArrayStubAsIL>
<FeatureMulticastStubAsIL Condition="'$(Platform)' != 'x86'">true</FeatureMulticastStubAsIL>
<FeatureComWrappers>true</FeatureComWrappers>
<FeatureCominterop>true</FeatureCominterop>
Expand All @@ -32,7 +30,6 @@
</PropertyGroup>

<PropertyGroup>
<DefineConstants Condition="'$(FeatureArrayStubAsIL)' == 'true'">$(DefineConstants);FEATURE_ARRAYSTUB_AS_IL</DefineConstants>
<DefineConstants Condition="'$(FeatureMulticastStubAsIL)' == 'true'">$(DefineConstants);FEATURE_MULTICASTSTUB_AS_IL</DefineConstants>
<DefineConstants Condition="'$(FeatureComWrappers)' == 'true'">$(DefineConstants);FEATURE_COMWRAPPERS</DefineConstants>
<DefineConstants Condition="'$(FeatureCominterop)' == 'true'">$(DefineConstants);FEATURE_COMINTEROP</DefineConstants>
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ endif(CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_TARGET_ARCH_AMD64)
# Features - please keep them alphabetically sorted
if(CLR_CMAKE_TARGET_WIN32)
if(NOT CLR_CMAKE_TARGET_ARCH_I386)
add_definitions(-DFEATURE_ARRAYSTUB_AS_IL)
add_definitions(-DFEATURE_MULTICASTSTUB_AS_IL)
endif()
else(CLR_CMAKE_TARGET_WIN32)
add_definitions(-DFEATURE_ARRAYSTUB_AS_IL)
add_definitions(-DFEATURE_MULTICASTSTUB_AS_IL)
endif(CLR_CMAKE_TARGET_WIN32)

Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"TARGET_64BIT=1",
"DEBUGGING_SUPPORTED",
"FEATURE_METADATA_UPDATER",
"FEATURE_ARRAYSTUB_AS_IL",
"FEATURE_BASICFREEZE",
"FEATURE_CODE_VERSIONING",
"FEATURE_COLLECTIBLE_TYPES",
Expand Down
68 changes: 0 additions & 68 deletions src/coreclr/vm/amd64/AsmHelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,74 +18,6 @@ extern DebugCheckStubUnwindInfoWorker:proc
endif


GenerateArrayOpStubExceptionCase macro ErrorCaseName, ExceptionName

NESTED_ENTRY ErrorCaseName&_RSIRDI_ScratchArea, _TEXT

; account for scratch area, rsi, rdi already on the stack
.allocstack 38h
END_PROLOGUE

mov rcx, CORINFO_&ExceptionName&_ASM

; begin epilogue

add rsp, 28h ; pop callee scratch area
pop rdi
pop rsi
jmp JIT_InternalThrow

NESTED_END ErrorCaseName&_RSIRDI_ScratchArea, _TEXT

NESTED_ENTRY ErrorCaseName&_ScratchArea, _TEXT

; account for scratch area already on the stack
.allocstack 28h
END_PROLOGUE

mov rcx, CORINFO_&ExceptionName&_ASM

; begin epilogue

add rsp, 28h ; pop callee scratch area
jmp JIT_InternalThrow

NESTED_END ErrorCaseName&_ScratchArea, _TEXT

NESTED_ENTRY ErrorCaseName&_RSIRDI, _TEXT

; account for rsi, rdi already on the stack
.allocstack 10h
END_PROLOGUE

mov rcx, CORINFO_&ExceptionName&_ASM

; begin epilogue

pop rdi
pop rsi
jmp JIT_InternalThrow

NESTED_END ErrorCaseName&_RSIRDI, _TEXT

LEAF_ENTRY ErrorCaseName, _TEXT

mov rcx, CORINFO_&ExceptionName&_ASM

; begin epilogue

jmp JIT_InternalThrow

LEAF_END ErrorCaseName, _TEXT

endm


GenerateArrayOpStubExceptionCase ArrayOpStubNullException, NullReferenceException
GenerateArrayOpStubExceptionCase ArrayOpStubRangeException, IndexOutOfRangeException
GenerateArrayOpStubExceptionCase ArrayOpStubTypeMismatchException, ArrayTypeMismatchException


; EXTERN_C int __fastcall HelperMethodFrameRestoreState(
; INDEBUG_COMMA(HelperMethodFrame *pFrame)
; MachState *pState
Expand Down
12 changes: 0 additions & 12 deletions src/coreclr/vm/amd64/asmconstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,22 +208,10 @@ ASMCONSTANTS_C_ASSERT(OFFSETOF__DynamicStaticsInfo__m_pGCStatics
ASMCONSTANTS_C_ASSERT( CORINFO_NullReferenceException_ASM
== CORINFO_NullReferenceException);

#define CORINFO_InvalidCastException_ASM 2
ASMCONSTANTS_C_ASSERT( CORINFO_InvalidCastException_ASM
== CORINFO_InvalidCastException);

#define CORINFO_IndexOutOfRangeException_ASM 3
ASMCONSTANTS_C_ASSERT( CORINFO_IndexOutOfRangeException_ASM
== CORINFO_IndexOutOfRangeException);

#define CORINFO_ArrayTypeMismatchException_ASM 6
ASMCONSTANTS_C_ASSERT( CORINFO_ArrayTypeMismatchException_ASM
== CORINFO_ArrayTypeMismatchException);

#define CORINFO_ArgumentNullException_ASM 8
ASMCONSTANTS_C_ASSERT( CORINFO_ArgumentNullException_ASM
== CORINFO_ArgumentNullException);

#define CORINFO_ArgumentException_ASM 9
ASMCONSTANTS_C_ASSERT( CORINFO_ArgumentException_ASM
== CORINFO_ArgumentException);
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/arm/cgencpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ inline PCODE decodeBackToBackJump(PCODE pBuffer)

//----------------------------------------------------------------------
#include "stublink.h"
struct ArrayOpScript;

inline BOOL IsThumbCode(PCODE pCode)
{
Expand Down
Loading
Loading