diff --git a/src/coreclr/clr.featuredefines.props b/src/coreclr/clr.featuredefines.props index 0ccfc347d0a0eb..ba8a70a402217f 100644 --- a/src/coreclr/clr.featuredefines.props +++ b/src/coreclr/clr.featuredefines.props @@ -8,7 +8,6 @@ true true true - true true @@ -60,7 +59,6 @@ $(DefineConstants);FEATURE_EVENTSOURCE_XPLAT $(DefineConstants);FEATURE_WIN32_REGISTRY $(DefineConstants);FEATURE_TYPEEQUIVALENCE - $(DefineConstants);FEATURE_BASICFREEZE $(DefineConstants);FEATURE_PORTABLE_SHUFFLE_THUNKS $(DefineConstants);FEATURE_ICASTABLE $(DefineConstants);FEATURE_EH_FUNCLETS diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake index 00e6673561eb2e..2ae9372817fc88 100644 --- a/src/coreclr/clrdefinitions.cmake +++ b/src/coreclr/clrdefinitions.cmake @@ -92,7 +92,6 @@ if(CLR_CMAKE_TARGET_WIN32) add_definitions(-DFEATURE_COMINTEROP_UNMANAGED_ACTIVATION) endif(CLR_CMAKE_TARGET_WIN32) -add_definitions(-DFEATURE_BASICFREEZE) add_definitions(-DFEATURE_CORECLR) if(FEATURE_DBGIPC) add_definitions(-DFEATURE_DBGIPC_TRANSPORT_DI) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 7e1e862160be9f..1bcae5e1e0fdd9 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -2312,9 +2312,7 @@ size_t gc_heap::g_mark_list_piece_total_size; seg_mapping* seg_mapping_table; -#ifdef FEATURE_BASICFREEZE sorted_table* gc_heap::seg_table; -#endif //FEATURE_BASICFREEZE #ifdef MULTIPLE_HEAPS GCEvent gc_heap::ee_suspend_event; @@ -3536,7 +3534,6 @@ in_range_for_segment(uint8_t* add, heap_segment* seg) return ((add >= heap_segment_mem (seg)) && (add < heap_segment_reserved (seg))); } -#ifdef FEATURE_BASICFREEZE // The array we allocate is organized as follows: // 0th element is the address of the last array we allocated. // starting from the 1st element are the segment addresses, that's @@ -3768,7 +3765,6 @@ sorted_table::clear() count = 1; buckets()[0].add = MAX_PTR; } -#endif //FEATURE_BASICFREEZE #ifdef USE_REGIONS inline @@ -4357,7 +4353,6 @@ size_t seg_mapping_word_of (uint8_t* add) return (size_t)add >> gc_heap::min_segment_size_shr; } -#ifdef FEATURE_BASICFREEZE inline size_t ro_seg_begin_index (heap_segment* seg) { @@ -4415,8 +4410,6 @@ heap_segment* ro_segment_lookup (uint8_t* o) return 0; } -#endif //FEATURE_BASICFREEZE - void gc_heap::seg_mapping_table_add_segment (heap_segment* seg, gc_heap* hp) { #ifndef USE_REGIONS @@ -4549,10 +4542,8 @@ gc_heap* seg_mapping_table_heap_of_worker (uint8_t* o) #ifdef _DEBUG heap_segment* seg = ((o > entry->boundary) ? entry->seg1 : entry->seg0); -#ifdef FEATURE_BASICFREEZE if ((size_t)seg & ro_in_entry) seg = (heap_segment*)((size_t)seg & ~ro_in_entry); -#endif //FEATURE_BASICFREEZE #ifdef TRACE_GC if (seg) @@ -4587,10 +4578,8 @@ gc_heap* seg_mapping_table_heap_of (uint8_t* o) gc_heap* seg_mapping_table_heap_of_gc (uint8_t* o) { -#ifdef FEATURE_BASICFREEZE if ((o < g_gc_lowest_address) || (o >= g_gc_highest_address)) return 0; -#endif //FEATURE_BASICFREEZE return seg_mapping_table_heap_of_worker (o); } @@ -4599,10 +4588,8 @@ gc_heap* seg_mapping_table_heap_of_gc (uint8_t* o) // Only returns a valid seg if we can actually find o on the seg. heap_segment* seg_mapping_table_segment_of (uint8_t* o) { -#ifdef FEATURE_BASICFREEZE if ((o < g_gc_lowest_address) || (o >= g_gc_highest_address)) return ro_segment_lookup (o); -#endif //FEATURE_BASICFREEZE size_t index = (size_t)o >> gc_heap::min_segment_size_shr; seg_mapping* entry = &seg_mapping_table[index]; @@ -4633,10 +4620,8 @@ heap_segment* seg_mapping_table_segment_of (uint8_t* o) (uint8_t*)(entry->seg0), (uint8_t*)(entry->seg1))); heap_segment* seg = ((o > entry->boundary) ? entry->seg1 : entry->seg0); -#ifdef FEATURE_BASICFREEZE if ((size_t)seg & ro_in_entry) seg = (heap_segment*)((size_t)seg & ~ro_in_entry); -#endif //FEATURE_BASICFREEZE #endif //USE_REGIONS if (seg) @@ -4657,7 +4642,6 @@ heap_segment* seg_mapping_table_segment_of (uint8_t* o) dprintf (2, ("could not find obj %p in any existing segments", o)); } -#ifdef FEATURE_BASICFREEZE // TODO: This was originally written assuming that the seg_mapping_table would always contain entries for ro // segments whenever the ro segment falls into the [g_gc_lowest_address,g_gc_highest_address) range. I.e., it had an // extra "&& (size_t)(entry->seg1) & ro_in_entry" expression. However, at the moment, grow_brick_card_table does @@ -4670,7 +4654,6 @@ heap_segment* seg_mapping_table_segment_of (uint8_t* o) if (seg && !in_range_for_segment (o, seg)) seg = 0; } -#endif //FEATURE_BASICFREEZE return seg; } @@ -4776,11 +4759,7 @@ class CObjectHeader : public Object #endif if (fSmallObjectHeapPtr) { -#ifdef FEATURE_BASICFREEZE _ASSERTE(!g_theGCHeap->IsLargeObject(this) || g_theGCHeap->IsInFrozenSegment(this)); -#else - _ASSERTE(!g_theGCHeap->IsLargeObject(this)); -#endif } } @@ -8880,7 +8859,6 @@ uint32_t* translate_mark_array (uint32_t* ma) return (uint32_t*)((uint8_t*)ma - size_mark_array_of (0, g_gc_lowest_address)); } -#ifdef FEATURE_BASICFREEZE // end must be page aligned addresses. void gc_heap::clear_mark_array (uint8_t* from, uint8_t* end) { @@ -8932,7 +8910,6 @@ void gc_heap::clear_mark_array (uint8_t* from, uint8_t* end) #endif //_DEBUG } } -#endif // FEATURE_BASICFREEZE #endif //BACKGROUND_GC //These work on untranslated card tables @@ -9902,7 +9879,6 @@ void gc_heap::copy_brick_card_table() release_card_table (&old_card_table[card_word (card_of(la))]); } -#ifdef FEATURE_BASICFREEZE // Note that we always insert at the head of the max_generation segment list. BOOL gc_heap::insert_ro_segment (heap_segment* seg) { @@ -9959,7 +9935,10 @@ void gc_heap::update_ro_segment (heap_segment* seg, uint8_t* allocated, uint8_t* { enter_spin_lock (&gc_heap::gc_lock); +#ifdef FEATURE_EVENT_TRACE assert (use_frozen_segments_p); +#endif + assert (heap_segment_read_only_p (seg)); assert (allocated <= committed); assert (committed <= heap_segment_reserved (seg)); @@ -10018,7 +9997,6 @@ void gc_heap::remove_ro_segment (heap_segment* seg) leave_spin_lock (&gc_heap::gc_lock); } -#endif //FEATURE_BASICFREEZE BOOL gc_heap::set_ro_segment_in_range (heap_segment* seg) { @@ -11479,7 +11457,6 @@ inline size_t my_get_size (Object* ob) #endif //COLLECTIBLE_CLASS #ifdef BACKGROUND_GC -#ifdef FEATURE_BASICFREEZE inline void gc_heap::seg_clear_mark_array_bits_soh (heap_segment* seg) { @@ -11511,7 +11488,6 @@ void gc_heap::seg_set_mark_array_bits_soh (heap_segment* seg) memset (&mark_array[beg_word], 0xFF, (end_word - beg_word)*sizeof (uint32_t)); } } -#endif //FEATURE_BASICFREEZE void gc_heap::bgc_clear_batch_mark_array_bits (uint8_t* start, uint8_t* end) { @@ -14347,12 +14323,10 @@ gc_heap::init_semi_shared() max_decommit_step_size = max (max_decommit_step_size, MIN_DECOMMIT_SIZE); #endif //MULTIPLE_HEAPS -#ifdef FEATURE_BASICFREEZE seg_table = sorted_table::make_sorted_table(); if (!seg_table) goto cleanup; -#endif //FEATURE_BASICFREEZE #ifndef USE_REGIONS segment_standby_list = 0; @@ -15179,10 +15153,8 @@ gc_heap::destroy_semi_shared() if (seg_mapping_table) delete seg_mapping_table; -#ifdef FEATURE_BASICFREEZE //destroy the segment map seg_table->delete_sorted_table(); -#endif //FEATURE_BASICFREEZE } void @@ -23767,9 +23739,7 @@ void gc_heap::garbage_collect (int n) if (gc_t_join.joined()) #endif //MULTIPLE_HEAPS { -#ifdef FEATURE_BASICFREEZE seg_table->delete_old_slots(); -#endif //FEATURE_BASICFREEZE #ifdef MULTIPLE_HEAPS for (int i = 0; i < n_heaps; i++) @@ -25988,32 +25958,19 @@ BOOL gc_heap::gc_mark1 (uint8_t* o) #ifdef USE_REGIONS inline bool is_in_heap_range (uint8_t* o) { -#ifdef FEATURE_BASICFREEZE // we may have frozen objects in read only segments // outside of the reserved address range of the gc heap assert (((g_gc_lowest_address <= o) && (o < g_gc_highest_address)) || (o == nullptr) || (ro_segment_lookup (o) != nullptr)); return ((g_gc_lowest_address <= o) && (o < g_gc_highest_address)); -#else //FEATURE_BASICFREEZE - // without frozen objects, every non-null pointer must be - // within the heap - assert ((o == nullptr) || (g_gc_lowest_address <= o) && (o < g_gc_highest_address)); - return (o != nullptr); -#endif //FEATURE_BASICFREEZE } inline bool gc_heap::is_in_gc_range (uint8_t* o) { -#ifdef FEATURE_BASICFREEZE // we may have frozen objects in read only segments // outside of the reserved address range of the gc heap assert (((g_gc_lowest_address <= o) && (o < g_gc_highest_address)) || (o == nullptr) || (ro_segment_lookup (o) != nullptr)); -#else //FEATURE_BASICFREEZE - // without frozen objects, every non-null pointer must be - // within the heap - assert ((o == nullptr) || (g_gc_lowest_address <= o) && (o < g_gc_highest_address)); -#endif //FEATURE_BASICFREEZE return ((gc_low <= o) && (o < gc_high)); } #endif //USE_REGIONS @@ -29032,7 +28989,6 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) } } -#ifdef FEATURE_BASICFREEZE #ifdef USE_REGIONS assert (!ro_segments_in_range); #else //USE_REGIONS @@ -29043,7 +28999,6 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) // Should fire an ETW event here. } #endif //USE_REGIONS -#endif //FEATURE_BASICFREEZE dprintf(3,("Marking Roots")); @@ -30094,7 +30049,6 @@ void gc_heap::process_ephemeral_boundaries (uint8_t* x, } #endif //!USE_REGIONS -#ifdef FEATURE_BASICFREEZE inline void gc_heap::seg_set_mark_bits (heap_segment* seg) { @@ -30188,7 +30142,6 @@ void gc_heap::sweep_ro_segments() } #endif //USE_REGIONS } -#endif // FEATURE_BASICFREEZE #ifdef FEATURE_LOH_COMPACTION inline @@ -31750,9 +31703,7 @@ void gc_heap::plan_phase (int condemned_gen_number) dprintf (3, ("mark_list not used")); } -#ifdef FEATURE_BASICFREEZE sweep_ro_segments(); -#endif //FEATURE_BASICFREEZE #ifndef MULTIPLE_HEAPS int condemned_gen_index = get_stop_generation_index (condemned_gen_number); @@ -35201,11 +35152,7 @@ void gc_heap::relocate_address (uint8_t** pold_address THREAD_NUMBER_DCL) #endif { size_t flags = pSegment->flags; - if ((flags & heap_segment_flags_loh) -#ifdef FEATURE_BASICFREEZE - && !(flags & heap_segment_flags_readonly) -#endif - ) + if ((flags & heap_segment_flags_loh) && !(flags & heap_segment_flags_readonly)) { new_address = old_address + loh_node_relocation_distance (old_address); dprintf (4, (ThreadStressLog::gcRelocateReferenceMsg(), pold_address, old_address, new_address)); @@ -37866,7 +37813,6 @@ void gc_heap::background_mark_phase () dprintf (GTC_LOG, ("FM: h%d: loh: %zd, soh: %zd, poh: %zd", heap_number, total_loh_size, total_soh_size, total_poh_size)); -#ifdef FEATURE_BASICFREEZE #ifdef USE_REGIONS assert (!ro_segments_in_range); #else //USE_REGIONS @@ -37878,7 +37824,6 @@ void gc_heap::background_mark_phase () concurrent_print_time_delta ("NRRO"); } #endif //USE_REGIONS -#endif //FEATURE_BASICFREEZE dprintf (2, ("nonconcurrent marking stack roots")); GCScan::GcScanRoots(background_promote, @@ -45323,9 +45268,7 @@ void gc_heap::background_sweep() current_sweep_pos = 0; #endif //DOUBLY_LINKED_FL -#ifdef FEATURE_BASICFREEZE sweep_ro_segments(); -#endif //FEATURE_BASICFREEZE if (current_c_gc_state != c_gc_state_planning) { @@ -48318,7 +48261,7 @@ HRESULT GCHeap::Initialize() GCToEEInterface::DiagUpdateGenerationBounds(); -#if defined(STRESS_REGIONS) && defined(FEATURE_BASICFREEZE) +#if defined(STRESS_REGIONS) #ifdef MULTIPLE_HEAPS gc_heap* hp = gc_heap::g_heaps[0]; #else @@ -48355,7 +48298,7 @@ HRESULT GCHeap::Initialize() break; } } -#endif //STRESS_REGIONS && FEATURE_BASICFREEZE +#endif //STRESS_REGIONS } return hr; @@ -48453,7 +48396,6 @@ void GCHeap::SetYieldProcessorScalingFactor (float scalingFactor) unsigned int GCHeap::WhichGeneration (Object* object) { uint8_t* o = (uint8_t*)object; -#ifdef FEATURE_BASICFREEZE if (!((o < g_gc_highest_address) && (o >= g_gc_lowest_address))) { return INT32_MAX; @@ -48466,7 +48408,6 @@ unsigned int GCHeap::WhichGeneration (Object* object) return INT32_MAX; } #endif -#endif //FEATURE_BASICFREEZE gc_heap* hp = gc_heap::heap_of (o); unsigned int g = hp->object_gennum (o); dprintf (3, ("%zx is in gen %d", (size_t)object, g)); @@ -48556,13 +48497,13 @@ unsigned int GCHeap::GetGenerationWithRange (Object* object, uint8_t** ppStart, bool GCHeap::IsEphemeral (Object* object) { uint8_t* o = (uint8_t*)object; -#if defined(FEATURE_BASICFREEZE) && defined(USE_REGIONS) +#if defined(USE_REGIONS) if (!is_in_heap_range (o)) { // Objects in frozen segments are not ephemeral return FALSE; } -#endif +#endif //USE_REGIONS gc_heap* hp = gc_heap::heap_of (o); return !!hp->ephemeral_pointer_p (o); } @@ -48575,13 +48516,6 @@ Object * GCHeap::NextObj (Object * object) #ifdef VERIFY_HEAP uint8_t* o = (uint8_t*)object; -#ifndef FEATURE_BASICFREEZE - if (!((o < g_gc_highest_address) && (o >= g_gc_lowest_address))) - { - return NULL; - } -#endif //!FEATURE_BASICFREEZE - heap_segment * hs = gc_heap::find_segment (o, FALSE); if (!hs) { @@ -48641,11 +48575,6 @@ Object * GCHeap::NextObj (Object * object) bool GCHeap::IsHeapPointer (void* vpObject, bool small_heap_only) { uint8_t* object = (uint8_t*) vpObject; -#ifndef FEATURE_BASICFREEZE - if (!((object < g_gc_highest_address) && (object >= g_gc_lowest_address))) - return FALSE; -#endif //!FEATURE_BASICFREEZE - heap_segment * hs = gc_heap::find_segment (object, small_heap_only); return !!hs; } @@ -51895,10 +51824,8 @@ inline void testGCShadow(Object** ptr) // TODO: erroneous asserts in here. if(*shadow!=INVALIDGCVALUE) { -#ifdef FEATURE_BASICFREEZE // Write barriers for stores of references to frozen objects may be optimized away. if (!g_theGCHeap->IsInFrozenSegment (*ptr)) -#endif // FEATURE_BASICFREEZE { _ASSERTE(!"Pointer updated without using write barrier"); } @@ -51958,7 +51885,6 @@ void checkGCWriteBarrier() } #endif //WRITE_BARRIER_CHECK && !SERVER_GC -#ifdef FEATURE_BASICFREEZE void gc_heap::walk_read_only_segment(heap_segment *seg, void *pvContext, object_callback_func pfnMethodTable, object_callback_func pfnObjRef) { uint8_t *o = heap_segment_mem(seg); @@ -51982,7 +51908,6 @@ void gc_heap::walk_read_only_segment(heap_segment *seg, void *pvContext, object_ o += Align(size(o), alignment); } } -#endif // FEATURE_BASICFREEZE HRESULT GCHeap::WaitUntilConcurrentGCCompleteAsync(int millisecondsTimeout) { diff --git a/src/coreclr/gc/gcee.cpp b/src/coreclr/gc/gcee.cpp index 32738da9b603ab..3b9ce9e395c818 100644 --- a/src/coreclr/gc/gcee.cpp +++ b/src/coreclr/gc/gcee.cpp @@ -436,7 +436,6 @@ void GCHeap::DiagDescrGenerations (gen_walk_fn fn, void *context) segment_handle GCHeap::RegisterFrozenSegment(segment_info *pseginfo) { -#ifdef FEATURE_BASICFREEZE heap_segment * seg = new (nothrow) heap_segment; if (!seg) { @@ -470,15 +469,10 @@ segment_handle GCHeap::RegisterFrozenSegment(segment_info *pseginfo) } return reinterpret_cast< segment_handle >(seg); -#else - assert(!"Should not call GCHeap::RegisterFrozenSegment without FEATURE_BASICFREEZE defined!"); - return NULL; -#endif // FEATURE_BASICFREEZE } void GCHeap::UnregisterFrozenSegment(segment_handle seg) { -#ifdef FEATURE_BASICFREEZE #ifdef MULTIPLE_HEAPS gc_heap* heap = gc_heap::g_heaps[0]; #else @@ -486,14 +480,10 @@ void GCHeap::UnregisterFrozenSegment(segment_handle seg) #endif //MULTIPLE_HEAPS heap->remove_ro_segment(reinterpret_cast(seg)); -#else - assert(!"Should not call GCHeap::UnregisterFrozenSegment without FEATURE_BASICFREEZE defined!"); -#endif // FEATURE_BASICFREEZE } bool GCHeap::IsInFrozenSegment(Object *object) { -#ifdef FEATURE_BASICFREEZE uint8_t* o = (uint8_t*)object; heap_segment * hs = gc_heap::find_segment (o, FALSE); //We create a frozen object for each frozen segment before the segment is inserted @@ -502,21 +492,16 @@ bool GCHeap::IsInFrozenSegment(Object *object) //So we return true if hs is NULL. It might create a hole about detecting invalidate //object. But given all other checks present, the hole should be very small return !hs || heap_segment_read_only_p (hs); -#else // FEATURE_BASICFREEZE - return false; -#endif } void GCHeap::UpdateFrozenSegment(segment_handle seg, uint8_t* allocated, uint8_t* committed) { -#ifdef FEATURE_BASICFREEZE #ifdef MULTIPLE_HEAPS gc_heap* heap = gc_heap::g_heaps[0]; #else gc_heap* heap = pGenGCHeap; #endif //MULTIPLE_HEAPS heap->update_ro_segment (reinterpret_cast(seg), allocated, committed); -#endif // FEATURE_BASICFREEZE } bool GCHeap::RuntimeStructuresValid() diff --git a/src/coreclr/gc/gcinterface.h b/src/coreclr/gc/gcinterface.h index ee6451249cad9f..c4085bc14c9106 100644 --- a/src/coreclr/gc/gcinterface.h +++ b/src/coreclr/gc/gcinterface.h @@ -965,7 +965,6 @@ class IGCHeap { /* =========================================================================== Routines to register read only segments for frozen objects. - Only valid if FEATURE_BASICFREEZE is defined. =========================================================================== */ diff --git a/src/coreclr/gc/gcpriv.h b/src/coreclr/gc/gcpriv.h index 1a73add83b429f..3066283953fdc6 100644 --- a/src/coreclr/gc/gcpriv.h +++ b/src/coreclr/gc/gcpriv.h @@ -1625,9 +1625,7 @@ class gc_heap PER_HEAP_ISOLATED_METHOD void fire_committed_usage_event(); -#ifdef FEATURE_BASICFREEZE PER_HEAP_ISOLATED_METHOD void walk_read_only_segment(heap_segment *seg, void *pvContext, object_callback_func pfnMethodTable, object_callback_func pfnObjRef); -#endif PER_HEAP_ISOLATED_METHOD int get_plan_gen_num (int gen_number); @@ -2377,11 +2375,9 @@ class gc_heap #endif //USE_REGIONS ); PER_HEAP_METHOD void delete_heap_segment (heap_segment* seg, BOOL consider_hoarding=FALSE); -#ifdef FEATURE_BASICFREEZE PER_HEAP_METHOD BOOL insert_ro_segment (heap_segment* seg); PER_HEAP_METHOD void remove_ro_segment (heap_segment* seg); PER_HEAP_METHOD void update_ro_segment (heap_segment* seg, uint8_t* allocated, uint8_t* committed); -#endif //FEATURE_BASICFREEZE PER_HEAP_METHOD BOOL set_ro_segment_in_range (heap_segment* seg); #ifndef USE_REGIONS PER_HEAP_METHOD heap_segment* soh_get_segment_to_expand(); @@ -2488,11 +2484,9 @@ class gc_heap PER_HEAP_METHOD BOOL mark_array_bit_set (size_t mark_bit); PER_HEAP_METHOD void mark_array_clear_marked (uint8_t* add); -#ifdef FEATURE_BASICFREEZE PER_HEAP_METHOD void seg_set_mark_array_bits_soh (heap_segment* seg); PER_HEAP_METHOD void clear_mark_array (uint8_t* from, uint8_t* end); PER_HEAP_METHOD void seg_clear_mark_array_bits_soh (heap_segment* seg); -#endif // FEATURE_BASICFREEZE PER_HEAP_METHOD void bgc_clear_batch_mark_array_bits (uint8_t* start, uint8_t* end); #ifdef VERIFY_HEAP @@ -2786,12 +2780,10 @@ class gc_heap BOOL& allocate_in_condemned); #endif //!USE_REGIONS -#ifdef FEATURE_BASICFREEZE PER_HEAP_METHOD void seg_set_mark_bits (heap_segment* seg); PER_HEAP_METHOD void seg_clear_mark_bits (heap_segment* seg); PER_HEAP_METHOD void mark_ro_segments(); PER_HEAP_METHOD void sweep_ro_segments(); -#endif // FEATURE_BASICFREEZE PER_HEAP_METHOD void convert_to_pinned_plug (BOOL& last_npinned_plug_p, BOOL& last_pinned_plug_p, @@ -4651,9 +4643,7 @@ class gc_heap PER_HEAP_ISOLATED_FIELD_INIT_ONLY int n_max_heaps; #endif //MULTIPLE_HEAPS -#ifdef FEATURE_BASICFREEZE PER_HEAP_ISOLATED_FIELD_MAINTAINED sorted_table* seg_table; -#endif //FEATURE_BASICFREEZE }; // class gc_heap #ifdef FEATURE_PREMORTEM_FINALIZATION diff --git a/src/coreclr/nativeaot/Runtime/CMakeLists.txt b/src/coreclr/nativeaot/Runtime/CMakeLists.txt index ec7b6d0e3679d1..bbef14637fdf46 100644 --- a/src/coreclr/nativeaot/Runtime/CMakeLists.txt +++ b/src/coreclr/nativeaot/Runtime/CMakeLists.txt @@ -220,7 +220,6 @@ if(FEATURE_EVENT_TRACE) add_definitions(-DFEATURE_EVENT_TRACE) endif() -add_definitions(-DFEATURE_BASICFREEZE) add_definitions(-DFEATURE_CONSERVATIVE_GC) add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP) add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES) diff --git a/src/coreclr/nativeaot/Runtime/gcrhenv.cpp b/src/coreclr/nativeaot/Runtime/gcrhenv.cpp index 3ec488605c1b33..694c9cd9f554b6 100644 --- a/src/coreclr/nativeaot/Runtime/gcrhenv.cpp +++ b/src/coreclr/nativeaot/Runtime/gcrhenv.cpp @@ -370,7 +370,6 @@ void RedhawkGCInterface::BulkEnumGcObjRef(PTR_RtuObjectRef pRefs, uint32_t cRefs // static GcSegmentHandle RedhawkGCInterface::RegisterFrozenSegment(void * pSection, size_t SizeSection) { -#ifdef FEATURE_BASICFREEZE segment_info seginfo; seginfo.pvMem = pSection; @@ -380,9 +379,6 @@ GcSegmentHandle RedhawkGCInterface::RegisterFrozenSegment(void * pSection, size_ seginfo.ibReserved = seginfo.ibAllocated; return (GcSegmentHandle)GCHeapUtilities::GetGCHeap()->RegisterFrozenSegment(&seginfo); -#else // FEATURE_BASICFREEZE - return NULL; -#endif // FEATURE_BASICFREEZE } // static diff --git a/src/coreclr/vm/.vscode/c_cpp_properties.json b/src/coreclr/vm/.vscode/c_cpp_properties.json index 16279d8db9e741..828135f8595cf4 100644 --- a/src/coreclr/vm/.vscode/c_cpp_properties.json +++ b/src/coreclr/vm/.vscode/c_cpp_properties.json @@ -42,7 +42,6 @@ "DEBUGGING_SUPPORTED", "EnC_SUPPORTED", "FEATURE_ARRAYSTUB_AS_IL", - "FEATURE_BASICFREEZE", "FEATURE_CODE_VERSIONING", "FEATURE_COLLECTIBLE_TYPES", "FEATURE_COMINTEROP", diff --git a/src/coreclr/vm/comutilnative.cpp b/src/coreclr/vm/comutilnative.cpp index 3531307550974f..dd632ade597d39 100644 --- a/src/coreclr/vm/comutilnative.cpp +++ b/src/coreclr/vm/comutilnative.cpp @@ -1034,8 +1034,6 @@ FCIMPL1(INT64, GCInterface::GetTotalAllocatedBytes, CLR_BOOL precise) } FCIMPLEND; -#ifdef FEATURE_BASICFREEZE - /*===============================RegisterFrozenSegment=============================== **Action: Registers the frozen segment **Returns: segment_handle @@ -1090,8 +1088,6 @@ extern "C" void QCALLTYPE GCInterface_UnregisterFrozenSegment(void* segment) END_QCALL; } -#endif // FEATURE_BASICFREEZE - /*==============================SuppressFinalize================================ **Action: Indicate that an object's finalizer should not be run by the system **Arguments: Object of interest diff --git a/src/coreclr/vm/comutilnative.h b/src/coreclr/vm/comutilnative.h index 5e65c45d96866a..a4c4639613f3dd 100644 --- a/src/coreclr/vm/comutilnative.h +++ b/src/coreclr/vm/comutilnative.h @@ -201,11 +201,10 @@ extern "C" INT64 QCALLTYPE GCInterface_GetTotalMemory(); extern "C" void QCALLTYPE GCInterface_Collect(INT32 generation, INT32 mode); extern "C" void QCALLTYPE GCInterface_WaitForPendingFinalizers(); -#ifdef FEATURE_BASICFREEZE + extern "C" void* QCALLTYPE GCInterface_RegisterFrozenSegment(void *pSection, SIZE_T sizeSection); extern "C" void QCALLTYPE GCInterface_UnregisterFrozenSegment(void *segmentHandle); -#endif // FEATURE_BASICFREEZE extern "C" int QCALLTYPE GCInterface_StartNoGCRegion(INT64 totalSize, BOOL lohSizeKnown, INT64 lohSize, BOOL disallowFullBlockingGC); diff --git a/src/coreclr/vm/frozenobjectheap.cpp b/src/coreclr/vm/frozenobjectheap.cpp index 41af231816a645..6a448c7ed75555 100644 --- a/src/coreclr/vm/frozenobjectheap.cpp +++ b/src/coreclr/vm/frozenobjectheap.cpp @@ -30,11 +30,6 @@ Object* FrozenObjectHeapManager::TryAllocateObject(PTR_MethodTable type, size_t } CONTRACTL_END -#ifndef FEATURE_BASICFREEZE - // GC is required to support frozen segments - return nullptr; -#else // FEATURE_BASICFREEZE - Object* obj = nullptr; FrozenObjectSegment* curSeg = nullptr; uint8_t* curSegmentCurrent = nullptr; @@ -115,7 +110,6 @@ Object* FrozenObjectHeapManager::TryAllocateObject(PTR_MethodTable type, size_t PublishFrozenObject(obj); return obj; -#endif // !FEATURE_BASICFREEZE } // Reserve sizeHint bytes of memory for the given frozen segment. diff --git a/src/coreclr/vm/qcallentrypoints.cpp b/src/coreclr/vm/qcallentrypoints.cpp index 0725bd7a87f097..bc024b41a161fc 100644 --- a/src/coreclr/vm/qcallentrypoints.cpp +++ b/src/coreclr/vm/qcallentrypoints.cpp @@ -217,10 +217,8 @@ static const Entry s_QCall[] = DllImportEntry(GCInterface_WaitForPendingFinalizers) DllImportEntry(GCInterface_AddMemoryPressure) DllImportEntry(GCInterface_RemoveMemoryPressure) -#ifdef FEATURE_BASICFREEZE DllImportEntry(GCInterface_RegisterFrozenSegment) DllImportEntry(GCInterface_UnregisterFrozenSegment) -#endif DllImportEntry(GCInterface_EnumerateConfigurationValues) DllImportEntry(GCInterface_RefreshMemoryLimit) DllImportEntry(GCInterface_EnableNoGCRegionCallback) diff --git a/src/coreclr/vm/syncblk.cpp b/src/coreclr/vm/syncblk.cpp index bd235093b2d9c9..2784e7de7809f0 100644 --- a/src/coreclr/vm/syncblk.cpp +++ b/src/coreclr/vm/syncblk.cpp @@ -2043,12 +2043,7 @@ BOOL ObjHeader::Validate (BOOL bVerifySyncBlkIndex) { if (!GCHeapUtilities::IsGCInProgress () && !GCHeapUtilities::GetGCHeap()->IsConcurrentGCInProgress ()) { -#ifdef FEATURE_BASICFREEZE ASSERT_AND_CHECK (GCHeapUtilities::GetGCHeap()->IsInFrozenSegment(obj)); -#else //FEATURE_BASICFREEZE - _ASSERTE(!"Reserve bit not cleared"); - return FALSE; -#endif //FEATURE_BASICFREEZE } }