< prev index next >
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 43,52 ****
--- 43,53 ----
private int heapWordSize; // 4 for 32bit, 8 for 64 bits
private int IndexSetStart; // for small indexed list
private int IndexSetSize;
private int IndexSetStride;
+ private static long MinChunkSizeInBytes;
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
initialize(VM.getVM().getTypeDataBase());
*** 55,82 ****
}
private static synchronized void initialize(TypeDataBase db) {
long sizeofFreeChunk = db.lookupType("FreeChunk").getSize();
VM vm = VM.getVM();
- MinChunkSizeInBytes = numQuanta(sizeofFreeChunk, vm.getMinObjAlignmentInBytes()) *
- vm.getMinObjAlignmentInBytes();
Type type = db.lookupType("CompactibleFreeListSpace");
collectorField = type.getAddressField("_collector");
collectorField = type.getAddressField("_collector");
dictionaryField = type.getAddressField("_dictionary");
indexedFreeListField = type.getAddressField("_indexedFreeList[0]");
smallLinearAllocBlockFieldOffset = type.getField("_smallLinearAllocBlock").getOffset();
}
public CompactibleFreeListSpace(Address addr) {
super(addr);
VM vm = VM.getVM();
heapWordSize = vm.getHeapWordSize();
IndexSetStart = vm.getMinObjAlignmentInBytes() / heapWordSize;
IndexSetStride = IndexSetStart;
! IndexSetSize = 257;
}
// Accessing block offset table
public CMSCollector collector() {
return (CMSCollector) VMObjectFactory.newObject(
--- 56,82 ----
}
private static synchronized void initialize(TypeDataBase db) {
long sizeofFreeChunk = db.lookupType("FreeChunk").getSize();
VM vm = VM.getVM();
Type type = db.lookupType("CompactibleFreeListSpace");
collectorField = type.getAddressField("_collector");
collectorField = type.getAddressField("_collector");
dictionaryField = type.getAddressField("_dictionary");
indexedFreeListField = type.getAddressField("_indexedFreeList[0]");
smallLinearAllocBlockFieldOffset = type.getField("_smallLinearAllocBlock").getOffset();
+ MinChunkSizeInBytes = (type.getCIntegerField("_min_chunk_size_in_bytes")).getValue();
}
public CompactibleFreeListSpace(Address addr) {
super(addr);
VM vm = VM.getVM();
heapWordSize = vm.getHeapWordSize();
IndexSetStart = vm.getMinObjAlignmentInBytes() / heapWordSize;
IndexSetStride = IndexSetStart;
! IndexSetSize = vm.getIndexSetSize();
}
// Accessing block offset table
public CMSCollector collector() {
return (CMSCollector) VMObjectFactory.newObject(
*** 199,214 ****
//-- Internals only below this point
// Unlike corresponding VM code, we operate on byte size rather than
// HeapWord size for convenience.
- private static long numQuanta(long x, long y) {
- return ((x+y-1)/y);
- }
-
public static long adjustObjectSizeInBytes(long sizeInBytes) {
return Oop.alignObjectSize(Math.max(sizeInBytes, MinChunkSizeInBytes));
}
- // FIXME: should I read this directly from VM?
- private static long MinChunkSizeInBytes;
}
--- 199,208 ----
< prev index next >