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

Compressed Oops Support #235

Merged
merged 70 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
be337c6
Add a yml file to store expected results for each benchmark, and use a
qinsoon Mar 28, 2023
471c2ce
Format yml properly
qinsoon Mar 29, 2023
a6a38b3
Group results with linux-x64. Update expected results from last run.
qinsoon Mar 29, 2023
899a97e
Add note for some benchmark results
qinsoon Mar 30, 2023
1b7bb69
Compressed pointer support
wenyuzhao Apr 15, 2023
d27da84
Fix import
wenyuzhao Apr 15, 2023
1bce41b
(WIP) Merge branch 'master' into compressed-oops
wenyuzhao Aug 9, 2023
4a3dd51
Fix build errors
wenyuzhao Aug 12, 2023
1cfb888
Merge branch 'master' into compressed-oops
wenyuzhao Aug 12, 2023
1ee1118
Update check script to allow ignoring benchmarks
qinsoon Aug 14, 2023
366cfbb
Merge branch 'master' into check-ci-results
qinsoon Aug 14, 2023
9dba124
Reset expected results: expect all benchmark to pass
qinsoon Aug 14, 2023
0e7eaad
Fix script
qinsoon Aug 15, 2023
a5d0249
Update expected results: 1
qinsoon Aug 15, 2023
02a72ed
Update expected results: 2
qinsoon Aug 15, 2023
72fdab3
Merge branch 'master' into check-ci-results
qinsoon Aug 15, 2023
4612446
Use custom heap args
wenyuzhao Aug 16, 2023
e9c357c
Update inferfaces
wenyuzhao Aug 16, 2023
cd73c37
remove redundant
wenyuzhao Aug 16, 2023
86a4c55
Set release-xalan-GenCopy to ignore
qinsoon Aug 16, 2023
ec82007
cleanup
wenyuzhao Aug 17, 2023
465c4d5
Delete derivable constants
wenyuzhao Aug 17, 2023
c1b7b6f
Remove `vm_space_size`
wenyuzhao Aug 17, 2023
de66ed3
Update
wenyuzhao Aug 17, 2023
7c33b32
Ignore a few more benchmarks
qinsoon Aug 17, 2023
94e4564
Set a few MS results to ignore
qinsoon Aug 22, 2023
102653a
Merge branch 'master' into check-ci-results
qinsoon Aug 22, 2023
bf901a6
Update api
wenyuzhao Aug 22, 2023
384de82
Add a step to free up build space
qinsoon Aug 22, 2023
c615a5a
Update Cargo.lock
wenyuzhao Aug 24, 2023
bc9eb5d
Merge branch 'master' into compressed-oops
wenyuzhao Aug 24, 2023
6416987
cleanup
wenyuzhao Aug 24, 2023
89c109d
cleanup
wenyuzhao Aug 24, 2023
39da263
Update Cargo.lock
wenyuzhao Aug 24, 2023
8303535
Update Cargo.toml
wenyuzhao Aug 24, 2023
14d919a
Merge remote-tracking branch 'origin/master' into compressed-oops
wenyuzhao Aug 28, 2023
4f843b0
cleanup
wenyuzhao Aug 28, 2023
c62992e
Update cargo.lock
wenyuzhao Aug 28, 2023
7a19025
Add comments
wenyuzhao Aug 28, 2023
3bd2bbe
cleanup
wenyuzhao Aug 28, 2023
aea58fa
update mmtk-core
wenyuzhao Aug 31, 2023
5fb55e5
Fix clippy errors
wenyuzhao Aug 31, 2023
939c3ba
Update mmtk-core
wenyuzhao Sep 5, 2023
87e5513
minor update
wenyuzhao Sep 5, 2023
dd2a060
Update mmtk-core
wenyuzhao Sep 6, 2023
52e06d2
Fix nmethod scanning
wenyuzhao Sep 6, 2023
efdcbda
Update msrv
wenyuzhao Sep 6, 2023
219c7cf
Update mmtk-core
wenyuzhao Sep 7, 2023
c9e64e9
[debug] update mmtk-core
wenyuzhao Sep 8, 2023
6680ca5
Disable compressed oops for mallocms
wenyuzhao Sep 11, 2023
3281263
Fix flag
wenyuzhao Sep 11, 2023
64ada3b
Merge branch 'master' into compressed-oops
wenyuzhao Sep 11, 2023
87cb24a
Merge branch 'master' into check-ci-results
qinsoon Sep 14, 2023
9e9044e
Ignore marksweep for release-h2
qinsoon Sep 14, 2023
d281ef9
Set fastdebug-h2 to ignore
qinsoon Sep 14, 2023
fc01230
Ignore semispace/xalan/release and genimmix/tomcat/release
qinsoon Sep 15, 2023
2099f77
Merge branch 'check-ci-results' into compressed-oops
wenyuzhao Sep 17, 2023
968d94d
Update mmtk-core
wenyuzhao Sep 17, 2023
00c162f
Merge branch 'master' into compressed-oops
wenyuzhao Sep 20, 2023
8a769c4
minor
wenyuzhao Sep 21, 2023
3db090d
Merge branch 'master' into compressed-oops
wenyuzhao Sep 21, 2023
b57642e
cleanup
wenyuzhao Sep 21, 2023
8aaaea8
Fix deps
wenyuzhao Sep 21, 2023
52f32e1
Merge branch 'master' into compressed-oops
wenyuzhao Sep 25, 2023
2115d3a
[debug] disable compressed pointers for page protect GC
wenyuzhao Sep 26, 2023
f8e4d90
Add no-compressed-oops tests
wenyuzhao Sep 27, 2023
dad0a97
Trivial fixes
wenyuzhao Sep 29, 2023
ad58259
Fix cargo build and clippy errors
wenyuzhao Sep 29, 2023
e55797c
Update array length slot offset calculation
wenyuzhao Sep 29, 2023
e0e8560
Rename variable
wenyuzhao Sep 29, 2023
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
6 changes: 3 additions & 3 deletions .github/scripts/ci-matrix-result-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def read_in_plans():
value = m.group(1)
else:
raise ValueError(f"Cannot find a plan string in {prop}")

# Store the value in the dictionary
key = chr(97+i)
results[key] = value

return results

def read_in_actual_results(line, plan_dict):
Expand Down Expand Up @@ -144,7 +144,7 @@ def print_log(directory, search_string):
if expected[plan] == "ignore":
print(f"Result for {plan} is ignored")
continue

if expected[plan] != actual[plan]:
error_no = 1
if expected[plan] == "pass":
Expand Down
3 changes: 2 additions & 1 deletion .github/scripts/ci-test-assertions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ sudo sysctl -w vm.max_map_count=655300
export MMTK_PLAN=PageProtect

build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms4G -Xmx4G -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar fop
build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms4G -Xmx4G -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar luindex
# Note: Disable compressed pointers for luindex as it does not work well with GC plans that uses virtual memory excessively.
build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -Xms4G -Xmx4G -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar luindex
2 changes: 1 addition & 1 deletion .github/scripts/ci-test-malloc-mark-sweep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ run_test() {
# Malloc marksweep is horribly slow. We just run fop.

# build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms500M -Xmx500M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar antlr
build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms50M -Xmx50M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar fop
build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms50M -Xmx50M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar fop
# build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms500M -Xmx500M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar luindex
# build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms500M -Xmx500M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar pmd
# build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms500M -Xmx500M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar hsqldb
Expand Down
164 changes: 164 additions & 0 deletions .github/scripts/ci-test-only-normal-no-compressed-oops.sh

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions .github/scripts/ci-test-only-normal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,3 @@ build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHea
# These benchmarks take 40s+ for slowdebug build, we may consider removing them from the CI
build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -XX:TieredStopAtLevel=1 -Xms500M -Xmx500M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar hsqldb
build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -XX:TieredStopAtLevel=1 -Xms500M -Xmx500M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar eclipse

# --- PageProtect ---
# Make sure this runs last in our tests unless we want to set it back to the default limit.
sudo sysctl -w vm.max_map_count=655300

export MMTK_PLAN=PageProtect

build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms4G -Xmx4G -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar antlr
build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms4G -Xmx4G -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar fop
build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms4G -Xmx4G -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar luindex
# build/linux-x86_64-normal-server-$DEBUG_LEVEL/jdk/bin/java -XX:+UseThirdPartyHeap -server -XX:MetaspaceSize=100M -Xms4G -Xmx4G -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar pmd
2 changes: 2 additions & 0 deletions .github/scripts/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ cd $cur
cd $cur
./ci-test-only-normal.sh
cd $cur
./ci-test-only-normal-no-compressed-oops.sh
cd $cur
./ci-test-only-weak-ref.sh
cd $cur
./ci-test-assertions.sh
Expand Down
1 change: 1 addition & 0 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ openjdk_version = "28e56ee32525c32c5a88391d0b01f24e5cd16c0f"
libc = "0.2"
lazy_static = "1.1"
once_cell = "1.10.0"
atomic = "0.5.1"
# Be very careful to commit any changes to the following mmtk dependency, as our CI scripts (including mmtk-core CI)
# rely on matching these lines to modify them: e.g. comment out the git dependency and use the local path.
# These changes are safe:
Expand Down
119 changes: 93 additions & 26 deletions mmtk/src/abi.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
use crate::UPCALLS;
use super::UPCALLS;
use crate::OpenJDKEdge;
use atomic::Atomic;
use atomic::Ordering;
use mmtk::util::constants::*;
use mmtk::util::conversions;
use mmtk::util::ObjectReference;
use mmtk::util::{Address, OpaquePointer};
use std::ffi::CStr;
use std::fmt;
use std::sync::atomic::AtomicUsize;
use std::{mem, slice};

#[repr(i32)]
Expand Down Expand Up @@ -80,7 +84,7 @@ impl Klass {
pub const LH_HEADER_SIZE_SHIFT: i32 = BITS_IN_BYTE as i32 * 2;
pub const LH_HEADER_SIZE_MASK: i32 = (1 << BITS_IN_BYTE) - 1;
pub unsafe fn cast<'a, T>(&self) -> &'a T {
&*(self as *const _ as usize as *const T)
&*(self as *const Self as *const T)
}
/// Force slow-path for instance size calculation?
const fn layout_helper_needs_slow_path(lh: i32) -> bool {
Expand Down Expand Up @@ -168,7 +172,7 @@ impl InstanceKlass {
const VTABLE_START_OFFSET: usize = Self::HEADER_SIZE * BYTES_IN_WORD;

fn start_of_vtable(&self) -> *const usize {
unsafe { (self as *const _ as *const u8).add(Self::VTABLE_START_OFFSET) as _ }
unsafe { (self as *const Self as *const u8).add(Self::VTABLE_START_OFFSET) as _ }
}
wenyuzhao marked this conversation as resolved.
Show resolved Hide resolved

fn start_of_itable(&self) -> *const usize {
Expand Down Expand Up @@ -263,24 +267,53 @@ impl InstanceRefKlass {
}
*DISCOVERED_OFFSET
}
pub fn referent_address(oop: Oop) -> Address {
oop.get_field_address(Self::referent_offset())
pub fn referent_address<const COMPRESSED: bool>(oop: Oop) -> OpenJDKEdge<COMPRESSED> {
oop.get_field_address(Self::referent_offset()).into()
}
pub fn discovered_address(oop: Oop) -> Address {
oop.get_field_address(Self::discovered_offset())
pub fn discovered_address<const COMPRESSED: bool>(oop: Oop) -> OpenJDKEdge<COMPRESSED> {
oop.get_field_address(Self::discovered_offset()).into()
}
}

#[repr(C)]
union KlassPointer {
/// uncompressed Klass pointer
klass: &'static Klass,
/// compressed Klass pointer
narrow_klass: u32,
}

#[repr(C)]
pub struct OopDesc {
pub mark: usize,
pub klass: &'static Klass,
klass: KlassPointer,
}

static COMPRESSED_KLASS_BASE: Atomic<Address> = Atomic::new(Address::ZERO);
static COMPRESSED_KLASS_SHIFT: AtomicUsize = AtomicUsize::new(0);

/// When enabling compressed pointers, the class pointers are also compressed.
/// The c++ part of the binding should pass the compressed klass base and shift to rust binding, as object scanning will need it.
pub fn set_compressed_klass_base_and_shift(base: Address, shift: usize) {
COMPRESSED_KLASS_BASE.store(base, Ordering::Relaxed);
COMPRESSED_KLASS_SHIFT.store(shift, Ordering::Relaxed);
}

impl OopDesc {
pub fn start(&self) -> Address {
unsafe { mem::transmute(self) }
}

pub fn klass<const COMPRESSED: bool>(&self) -> &'static Klass {
if COMPRESSED {
let compressed = unsafe { self.klass.narrow_klass };
let addr = COMPRESSED_KLASS_BASE.load(Ordering::Relaxed)
+ ((compressed as usize) << COMPRESSED_KLASS_SHIFT.load(Ordering::Relaxed));
unsafe { &*addr.to_ptr::<Klass>() }
} else {
unsafe { self.klass.klass }
}
}
}

impl fmt::Debug for OopDesc {
Expand All @@ -294,6 +327,16 @@ impl fmt::Debug for OopDesc {

pub type Oop = &'static OopDesc;

#[repr(transparent)]
#[derive(Clone, Copy)]
pub struct NarrowOop(u32);

impl NarrowOop {
pub fn slot(&self) -> Address {
Address::from_ref(self)
}
}

/// Convert ObjectReference to Oop
impl From<ObjectReference> for &OopDesc {
fn from(o: ObjectReference) -> Self {
Expand Down Expand Up @@ -323,8 +366,8 @@ impl OopDesc {
}

/// Calculate object instance size
pub unsafe fn size(&self) -> usize {
let klass = self.klass;
pub unsafe fn size<const COMPRESSED: bool>(&self) -> usize {
let klass = self.klass::<COMPRESSED>();
let lh = klass.layout_helper;
// The (scalar) instance size is pre-recorded in the TIB?
if lh > Klass::LH_NEUTRAL_VALUE {
Expand All @@ -336,7 +379,7 @@ impl OopDesc {
} else if lh <= Klass::LH_NEUTRAL_VALUE {
if lh < Klass::LH_NEUTRAL_VALUE {
// Calculate array size
let array_length = self.as_array_oop().length();
let array_length = self.as_array_oop().length::<COMPRESSED>();
let mut size_in_bytes: usize =
(array_length as usize) << Klass::layout_helper_log2_element_size(lh);
size_in_bytes += Klass::layout_helper_header_size(lh) as usize;
Expand All @@ -356,34 +399,58 @@ pub struct ArrayOopDesc(OopDesc);
pub type ArrayOop = &'static ArrayOopDesc;

impl ArrayOopDesc {
const LENGTH_OFFSET: usize = mem::size_of::<Self>();
fn length_offset<const COMPRESSED: bool>() -> usize {
if COMPRESSED {
mem::size_of::<usize>() + mem::size_of::<u32>()
} else {
wenyuzhao marked this conversation as resolved.
Show resolved Hide resolved
mem::size_of::<Self>()
}
}

fn element_type_should_be_aligned(ty: BasicType) -> bool {
ty == BasicType::T_DOUBLE || ty == BasicType::T_LONG
}

fn header_size(ty: BasicType) -> usize {
let typesize_in_bytes =
conversions::raw_align_up(Self::LENGTH_OFFSET + BYTES_IN_INT, BYTES_IN_LONG);
fn header_size<const COMPRESSED: bool>(ty: BasicType) -> usize {
let typesize_in_bytes = conversions::raw_align_up(
Self::length_offset::<COMPRESSED>() + BYTES_IN_INT,
BYTES_IN_LONG,
);
if Self::element_type_should_be_aligned(ty) {
conversions::raw_align_up(typesize_in_bytes / BYTES_IN_WORD, BYTES_IN_LONG)
} else {
typesize_in_bytes / BYTES_IN_WORD
}
}
fn length(&self) -> i32 {
unsafe { *((self as *const _ as *const u8).add(Self::LENGTH_OFFSET) as *const i32) }
fn length<const COMPRESSED: bool>(&self) -> i32 {
unsafe {
*((self as *const Self as *const u8).add(Self::length_offset::<COMPRESSED>())
as *const i32)
}
wenyuzhao marked this conversation as resolved.
Show resolved Hide resolved
}
fn base(&self, ty: BasicType) -> Address {
let base_offset_in_bytes = Self::header_size(ty) * BYTES_IN_WORD;
Address::from_ptr(unsafe { (self as *const _ as *const u8).add(base_offset_in_bytes) })
fn base<const COMPRESSED: bool>(&self, ty: BasicType) -> Address {
let base_offset_in_bytes = Self::header_size::<COMPRESSED>(ty) * BYTES_IN_WORD;
Address::from_ptr(unsafe { (self as *const Self as *const u8).add(base_offset_in_bytes) })
}
wenyuzhao marked this conversation as resolved.
Show resolved Hide resolved
// This provides an easy way to access the array data in Rust. However, the array data
// is Java types, so we have to map Java types to Rust types. The caller needs to guarantee:
// 1. <T> matches the actual Java type
// 2. <T> matches the argument, BasicType `ty`
pub unsafe fn data<T>(&self, ty: BasicType) -> &[T] {
slice::from_raw_parts(self.base(ty).to_ptr(), self.length() as _)
/// This provides an easy way to access the array data in Rust. However, the array data
/// is Java types, so we have to map Java types to Rust types. The caller needs to guarantee:
/// 1. <T> matches the actual Java type
/// 2. <T> matches the argument, BasicType `ty`
pub unsafe fn data<T, const COMPRESSED: bool>(&self, ty: BasicType) -> &[T] {
wenyuzhao marked this conversation as resolved.
Show resolved Hide resolved
slice::from_raw_parts(
self.base::<COMPRESSED>(ty).to_ptr(),
self.length::<COMPRESSED>() as _,
)
}

pub unsafe fn slice<const COMPRESSED: bool>(
&self,
ty: BasicType,
) -> crate::OpenJDKEdgeRange<COMPRESSED> {
let base = self.base::<COMPRESSED>(ty);
let start = base;
let end = base + ((self.length::<COMPRESSED>() as usize) << if COMPRESSED { 2 } else { 3 });
(start..end).into()
wenyuzhao marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
25 changes: 12 additions & 13 deletions mmtk/src/active_plan.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::MutatorClosure;
use crate::OpenJDK;
use crate::SINGLETON;
use crate::UPCALLS;
use mmtk::util::opaque_pointer::*;
use mmtk::vm::ActivePlan;
Expand All @@ -9,12 +8,12 @@ use mmtk::Plan;
use std::collections::VecDeque;
use std::marker::PhantomData;

struct OpenJDKMutatorIterator<'a> {
mutators: VecDeque<&'a mut Mutator<OpenJDK>>,
struct OpenJDKMutatorIterator<'a, const COMPRESSED: bool> {
mutators: VecDeque<&'a mut Mutator<OpenJDK<COMPRESSED>>>,
phantom_data: PhantomData<&'a ()>,
}

impl<'a> OpenJDKMutatorIterator<'a> {
impl<'a, const COMPRESSED: bool> OpenJDKMutatorIterator<'a, COMPRESSED> {
fn new() -> Self {
let mut mutators = VecDeque::new();
unsafe {
Expand All @@ -29,8 +28,8 @@ impl<'a> OpenJDKMutatorIterator<'a> {
}
}

impl<'a> Iterator for OpenJDKMutatorIterator<'a> {
type Item = &'a mut Mutator<OpenJDK>;
impl<'a, const COMPRESSED: bool> Iterator for OpenJDKMutatorIterator<'a, COMPRESSED> {
type Item = &'a mut Mutator<OpenJDK<COMPRESSED>>;

fn next(&mut self) -> Option<Self::Item> {
self.mutators.pop_front()
Expand All @@ -39,24 +38,24 @@ impl<'a> Iterator for OpenJDKMutatorIterator<'a> {

pub struct VMActivePlan {}

impl ActivePlan<OpenJDK> for VMActivePlan {
fn global() -> &'static dyn Plan<VM = OpenJDK> {
SINGLETON.get_plan()
impl<const COMPRESSED: bool> ActivePlan<OpenJDK<COMPRESSED>> for VMActivePlan {
fn global() -> &'static dyn Plan<VM = OpenJDK<COMPRESSED>> {
crate::singleton::<COMPRESSED>().get_plan()
}

fn is_mutator(tls: VMThread) -> bool {
unsafe { ((*UPCALLS).is_mutator)(tls) }
}

fn mutator(tls: VMMutatorThread) -> &'static mut Mutator<OpenJDK> {
fn mutator(tls: VMMutatorThread) -> &'static mut Mutator<OpenJDK<COMPRESSED>> {
unsafe {
let m = ((*UPCALLS).get_mmtk_mutator)(tls);
&mut *m
&mut *(m as *mut Mutator<OpenJDK<COMPRESSED>>)
}
}

fn mutators<'a>() -> Box<dyn Iterator<Item = &'a mut Mutator<OpenJDK>> + 'a> {
Box::new(OpenJDKMutatorIterator::new())
fn mutators<'a>() -> Box<dyn Iterator<Item = &'a mut Mutator<OpenJDK<COMPRESSED>>> + 'a> {
Box::new(OpenJDKMutatorIterator::<COMPRESSED>::new())
}

fn number_of_mutators() -> usize {
Expand Down
Loading
Loading