Skip to content

Commit

Permalink
Implement card bundles for non-Windows platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamandaleeka authored and jkotas committed Apr 23, 2019
1 parent ae76dbf commit 98f1594
Show file tree
Hide file tree
Showing 8 changed files with 388 additions and 175 deletions.
4 changes: 4 additions & 0 deletions src/Native/Runtime/gcheaputilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ GPTR_IMPL_INIT(uint8_t, g_highest_address, nullptr);
uint8_t* g_ephemeral_low = (uint8_t*)1;
uint8_t* g_ephemeral_high = (uint8_t*)~0;

#ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
uint32_t* g_card_bundle_table = nullptr;
#endif

GcDacVars g_gc_dac_vars;
GPTR_IMPL(GcDacVars, g_gcDacGlobals);
6 changes: 5 additions & 1 deletion src/Native/Runtime/gcheaputilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ GPTR_DECL(uint32_t,g_card_table);
}
#endif // !DACCESS_COMPILE

#ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
extern "C" uint32_t* g_card_bundle_table;
#endif // FEATURE_MANUALLY_MANAGED_CARD_BUNDLES

extern "C" uint8_t* g_ephemeral_low;
extern "C" uint8_t* g_ephemeral_high;

Expand Down Expand Up @@ -82,4 +86,4 @@ class GCHeapUtilities {
GCHeapUtilities() = delete;
};

#endif // _GCHEAPUTILITIES_H_
#endif // _GCHEAPUTILITIES_H_
12 changes: 12 additions & 0 deletions src/Native/Runtime/gcrhenv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1385,8 +1385,14 @@ void GCToEEInterface::StompWriteBarrier(WriteBarrierParameters* args)
assert(args->card_table != nullptr);
assert(args->lowest_address != nullptr);
assert(args->highest_address != nullptr);

g_card_table = args->card_table;

#ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
assert(args->card_bundle_table != nullptr);
g_card_bundle_table = args->card_bundle_table;
#endif

// We need to make sure that other threads executing checked write barriers
// will see the g_card_table update before g_lowest/highest_address updates.
// Otherwise, the checked write barrier may AV accessing the old card table
Expand Down Expand Up @@ -1418,6 +1424,12 @@ void GCToEEInterface::StompWriteBarrier(WriteBarrierParameters* args)
assert(args->is_runtime_suspended && "the runtime must be suspended here!");

g_card_table = args->card_table;

#ifdef FEATURE_MANUALLY_MANAGED_CARD_BUNDLES
assert(g_card_bundle_table == nullptr);
g_card_bundle_table = args->card_bundle_table;
#endif

g_lowest_address = args->lowest_address;
g_highest_address = args->highest_address;
g_ephemeral_low = args->ephemeral_low;
Expand Down

0 comments on commit 98f1594

Please sign in to comment.