Skip to content

Commit

Permalink
Calling runtime addr mapper from barrier - Dev iteration.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinuy committed Jan 16, 2025
1 parent 6f9cb8f commit 7caae3d
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 11 deletions.
5 changes: 5 additions & 0 deletions src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/g1/customMapper.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BarrierSetAssembler.hpp"
#include "gc/g1/g1BarrierSetRuntime.hpp"
Expand Down Expand Up @@ -299,6 +300,10 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
const Register card_addr = tmp;
const Register cardtable = tmp2;

if (SanitizeGC) {
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SanitizerGCMapper::mapNewAddrToOriginalAddr), store_addr);
}

__ movptr(card_addr, store_addr);
__ shrptr(card_addr, CardTable::card_shift());
// Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT
Expand Down
9 changes: 7 additions & 2 deletions src/hotspot/share/gc/g1/customMapper.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#include "customMapper.h"
#include "customMapper.hpp"

void * beforeAddr = nullptr;
void * afterAddr = nullptr;
void * afterAddr = nullptr;

void* SanitizerGCMapper::mapNewAddrToOriginalAddr(void* newAddr) {
volatile int a = 1;
return nullptr;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
extern void * beforeAddr;
extern void * afterAddr;

class SanitizerGCMapper {
public:
static void* mapNewAddrToOriginalAddr(void* newAddr);
};

#endif //CUSTOMMAPPER_H
3 changes: 1 addition & 2 deletions src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#ifndef SHARE_GC_G1_G1BLOCKOFFSETTABLE_INLINE_HPP
#define SHARE_GC_G1_G1BLOCKOFFSETTABLE_INLINE_HPP

#include "gc/g1/customMapper.h"

#include "gc/g1/customMapper.hpp"
#include "gc/g1/g1BlockOffsetTable.hpp"
#include "gc/g1/g1HeapRegion.hpp"
#include "gc/shared/cardTable.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1CollectedHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifndef SHARE_GC_G1_G1COLLECTEDHEAP_HPP
#define SHARE_GC_G1_G1COLLECTEDHEAP_HPP

#include "gc/g1/customMapper.h"
#include "gc/g1/customMapper.hpp"

#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BiasedArray.hpp"
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
#define SHARE_GC_G1_G1COLLECTEDHEAP_INLINE_HPP

#include "gc/g1/g1CollectedHeap.hpp"

#include "customMapper.h"

#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1ConcurrentMark.inline.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1HeapRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include "runtime/globals_extension.hpp"
#include "utilities/powerOfTwo.hpp"

#include "gc/g1/customMapper.h"
#include "gc/g1/customMapper.hpp"

uint G1HeapRegion::LogOfHRGrainBytes = 0;
uint G1HeapRegion::LogCardsPerRegion = 0;
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/gc/shared/cardTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@

#include <fstream>

#include "gc/g1/customMapper.hpp"
#include "memory/allocation.hpp"
#include "memory/memRegion.hpp"
#include "oops/oopsHierarchy.hpp"
#include "runtime/globals.hpp"
#include "utilities/align.hpp"

#include "gc/g1/customMapper.h"

class CardTable: public CHeapObj<mtGC> {
friend class VMStructs;
public:
Expand Down

0 comments on commit 7caae3d

Please sign in to comment.