Skip to content

Commit

Permalink
* profile g1 barrier filters, putfield version * implement C1 profili…
Browse files Browse the repository at this point in the history
…ng code * only actually do counter updates for oop stores * pass through counters to c2 barrier to generate code based on results * re-enable use of non-G1 collectors :D * swap null and same-region check if both needed and the former is more discriminating * move profiling to reference write instead of bool write (oops) * fix compilation errors; barrier_data() is examined for != 0 a lot, but we added additional flags to it... :( Fixes crashes * experimental (UseNewCode2): dirty the young gen cards on TLAB allocation, see if this changes statistics significantly... * experimental (UseNewCode3): change cost estimations for loop unrolling to #instructions (which is ~ C2 nodes in the fast path) * some tests with switching same-region and null check * add missing file * first (incomplete) attempt at handling aastore * aastore should work now; but not a lot of methods get a methoddata? * TraceByteCodes also prints existing profile data * remove debug code * some changes, trying to find crash reason * fix issue with c2 compiler coming across CombinedData and the existing code doing random typecasts which do not apply * enable (buggy) from-young check using XXXDoYoungPreDirty using pre-dirtied young gen cards * -XX:-G1UseConcurrentRefinement disables barrier filters (this is arbitrary) * use UseNewCode3 to not generate any barrier filters instead of tying it to G1UseConcRefinement since they are independent * post barrier costs based on actual generated barrier parts * change pre-barrier costs to align with post barrier, use fast path only for determining its cost * optimize barrier costs

* aarch64 initial not working bring-up

* fix UseNewCode3 path, i.e. generation of no barrier filters at all.
  Only skipped them for nmethods with profiling information, not
everything.
  • Loading branch information
tschatzl committed Dec 11, 2024
1 parent 8f00e62 commit 13a018e
Showing 1 changed file with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright (c) 2024, 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.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/

package sun.jvm.hotspot.oops;

import java.io.*;
import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;

// CounterData
//
// A CounterData corresponds to a simple counter.
public class G1CounterData extends ProfileData {

static final int countOff = 0;
static final int counterCellCount = 4;

public G1CounterData(DataLayout layout) {
super(layout);
}

static int staticCellCount() {
return counterCellCount;
}

public int cellCount() {
return staticCellCount();
}

// Direct accessor
int count(int index) {
return uintAt(index);
}

// Code generation support
static int countOffset(int index) {
return cellOffset(index);
}
static int counterDataSize() {
return cellOffset(counterCellCount);
}

public void printDataOn(PrintStream st) {
printShared(st, "CounterData");
st.println("count0(" + count(0) + ")");
st.println("count1(" + count(1) + ")");
st.println("count2(" + count(2) + ")");
st.println("count3(" + count(3) + ")");
}
}

0 comments on commit 13a018e

Please sign in to comment.