summaryrefslogtreecommitdiff
path: root/src/vm/arm
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2018-05-04 10:40:28 -0700
committerGitHub <noreply@github.com>2018-05-04 10:40:28 -0700
commit37e643696f860094ca3182c87f1375540b9d704e (patch)
tree5a840c7743873ca6c46e64a89487989a95880887 /src/vm/arm
parentfac17ce1413c2d270eb52e958faf5e869bcd33a2 (diff)
downloadcoreclr-37e643696f860094ca3182c87f1375540b9d704e.tar.gz
coreclr-37e643696f860094ca3182c87f1375540b9d704e.tar.bz2
coreclr-37e643696f860094ca3182c87f1375540b9d704e.zip
Fix System.String over-allocation (#17876)
BaseSize for System.String was not set correctly. It caused unnecessary extra 8 bytes to be allocated at the end of strings that had `Length % 4 < 2` on 64-bit platforms. This change makes affected strings proportionally cheaper. For example, `new string('a', 1)` in a long-running loop is 7% faster.
Diffstat (limited to 'src/vm/arm')
-rw-r--r--src/vm/arm/asmconstants.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/vm/arm/asmconstants.h b/src/vm/arm/asmconstants.h
index ab3d16b9a9..5af778ba36 100644
--- a/src/vm/arm/asmconstants.h
+++ b/src/vm/arm/asmconstants.h
@@ -95,18 +95,6 @@ ASMCONSTANTS_C_ASSERT(MethodTableWriteableData__m_dwFlags == offsetof(MethodTabl
#define MethodTableWriteableData__enum_flag_Unrestored 0x04
ASMCONSTANTS_C_ASSERT(MethodTableWriteableData__enum_flag_Unrestored == MethodTableWriteableData::enum_flag_Unrestored);
-#define StringObject__m_StringLength 0x04
-ASMCONSTANTS_C_ASSERT(StringObject__m_StringLength == offsetof(StringObject, m_StringLength));
-
-#define SIZEOF__BaseStringObject 0xe
-ASMCONSTANTS_C_ASSERT(SIZEOF__BaseStringObject == (ObjSizeOf(StringObject) + sizeof(WCHAR)));
-
-#define SIZEOF__ArrayOfObjectRef 0xc
-ASMCONSTANTS_C_ASSERT(SIZEOF__ArrayOfObjectRef == ObjSizeOf(ArrayBase));
-
-#define SIZEOF__ArrayOfValueType 0xc
-ASMCONSTANTS_C_ASSERT(SIZEOF__ArrayOfValueType == ObjSizeOf(ArrayBase));
-
#define ArrayBase__m_NumComponents 0x4
ASMCONSTANTS_C_ASSERT(ArrayBase__m_NumComponents == offsetof(ArrayBase, m_NumComponents));
@@ -116,33 +104,8 @@ ASMCONSTANTS_C_ASSERT(ArrayTypeDesc__m_Arg == offsetof(ArrayTypeDesc, m_Arg));
#define PtrArray__m_Array 0x8
ASMCONSTANTS_C_ASSERT(PtrArray__m_Array == offsetof(PtrArray, m_Array));
-#define SYSTEM_INFO__dwNumberOfProcessors 0x14
-ASMCONSTANTS_C_ASSERT(SYSTEM_INFO__dwNumberOfProcessors == offsetof(SYSTEM_INFO, dwNumberOfProcessors));
-
#define TypeHandle_CanCast 0x1 // TypeHandle::CanCast
-// Maximum number of characters to be allocated for a string in AllocateStringFast*. Chosen so that we'll
-// never have to check for overflow and will never try to allocate a string on regular heap that should have
-// gone on the large object heap. Additionally the constant has been chosen such that it can be encoded in a
-// single Thumb2 CMP instruction.
-#define MAX_FAST_ALLOCATE_STRING_SIZE 42240
-ASMCONSTANTS_C_ASSERT(MAX_FAST_ALLOCATE_STRING_SIZE < ((LARGE_OBJECT_SIZE - SIZEOF__BaseStringObject) / 2));
-
-
-// Array of objectRef of this Maximum number of elements can be allocated in JIT_NewArr1OBJ_MP*. Chosen so that we'll
-// never have to check for overflow and will never try to allocate the array on regular heap that should have
-// gone on the large object heap. Additionally the constant has been chosen such that it can be encoded in a
-// single Thumb2 CMP instruction.
-#define MAX_FAST_ALLOCATE_ARRAY_OBJECTREF_SIZE 21120
-ASMCONSTANTS_C_ASSERT(MAX_FAST_ALLOCATE_ARRAY_OBJECTREF_SIZE < ((LARGE_OBJECT_SIZE - SIZEOF__ArrayOfObjectRef) / sizeof(void*)));
-
-// Array of valueClass of this Maximum number of characters can be allocated JIT_NewArr1VC_MP*. Chosen so that we'll
-// never have to check for overflow and will never try to allocate the array on regular heap that should have
-// gone on the large object heap. Additionally the constant has been chosen such that it can be encoded in a
-// single Thumb2 CMP instruction.
-#define MAX_FAST_ALLOCATE_ARRAY_VC_SIZE 65280
-ASMCONSTANTS_C_ASSERT(MAX_FAST_ALLOCATE_ARRAY_VC_SIZE < ((4294967296 - 1 - SIZEOF__ArrayOfValueType) / 65536));
-
#define SIZEOF__GSCookie 0x4
ASMCONSTANTS_C_ASSERT(SIZEOF__GSCookie == sizeof(GSCookie));
@@ -203,14 +166,6 @@ ASMCONSTANTS_C_ASSERT(UnmanagedToManagedFrame__m_pvDatum == offsetof(UnmanagedTo
#endif // FEATURE_COMINTEROP
-#ifndef CROSSGEN_COMPILE
-#define Thread__m_alloc_context__alloc_limit 0x44
-ASMCONSTANTS_C_ASSERT(Thread__m_alloc_context__alloc_limit == offsetof(Thread, m_alloc_context) + offsetof(gc_alloc_context, alloc_limit));
-
-#define Thread__m_alloc_context__alloc_ptr 0x40
-ASMCONSTANTS_C_ASSERT(Thread__m_alloc_context__alloc_ptr == offsetof(Thread, m_alloc_context) + offsetof(gc_alloc_context, alloc_ptr));
-#endif // CROSSGEN_COMPILE
-
#define Thread__m_fPreemptiveGCDisabled 0x08
#ifndef CROSSGEN_COMPILE
ASMCONSTANTS_C_ASSERT(Thread__m_fPreemptiveGCDisabled == offsetof(Thread, m_fPreemptiveGCDisabled));