Commit ad356253 authored by Yi Lin's avatar Yi Lin

init commit

parent 4766e097
......@@ -21,10 +21,26 @@ public class Config {
/** Mark bit in the header or on the side ? */
public final boolean HEADER_MARK_BITS;
public final int YIELDPOINT_IMPL;
public static final int USE_CHECKING_YP = 0;
public static final int USE_PAGE_PROTECTION_YP = 1;
public static final int USE_CODE_PATCHING_YP = 2;
public static final int USE_NO_YP = 9;
Config(BuildTimeConfig config) {
ACTIVE_PLAN = config.getPlanName();
HEADER_MARK_BITS = config.getBooleanProperty("mmtk.headerMarkBit",true);
if (config.getBooleanProperty("mmtk.use_checking_yp", false)) {
YIELDPOINT_IMPL = USE_CHECKING_YP;
} else if (config.getBooleanProperty("mmtk.use_page_protection_yp", false)) {
YIELDPOINT_IMPL = USE_PAGE_PROTECTION_YP;
} else if (config.getBooleanProperty("mmtk.use_code_patching_yp", false)) {
YIELDPOINT_IMPL = USE_CODE_PATCHING_YP;
} else {
YIELDPOINT_IMPL = USE_CHECKING_YP;
}
}
public void printConfig() {
......
#
# This file is part of the Jikes RVM project (http://jikesrvm.org).
#
# This file is licensed to You under the Eclipse Public License (EPL);
# You may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.opensource.org/licenses/eclipse-1.0.php
#
# See the COPYRIGHT.txt file distributed with this work for information
# regarding copyright ownership.
#
# Default MMTk properties file.
mmtk.use_checking_yp = true
#
# This file is part of the Jikes RVM project (http://jikesrvm.org).
#
# This file is licensed to You under the Eclipse Public License (EPL);
# You may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.opensource.org/licenses/eclipse-1.0.php
#
# See the COPYRIGHT.txt file distributed with this work for information
# regarding copyright ownership.
#
# Default MMTk properties file.
mmtk.use_code_patching_yp = true
#
# This file is part of the Jikes RVM project (http://jikesrvm.org).
#
# This file is licensed to You under the Eclipse Public License (EPL);
# You may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.opensource.org/licenses/eclipse-1.0.php
#
# See the COPYRIGHT.txt file distributed with this work for information
# regarding copyright ownership.
#
# Default MMTk properties file.
mmtk.use_no_yp = true
#
# This file is part of the Jikes RVM project (http://jikesrvm.org).
#
# This file is licensed to You under the Eclipse Public License (EPL);
# You may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.opensource.org/licenses/eclipse-1.0.php
#
# See the COPYRIGHT.txt file distributed with this work for information
# regarding copyright ownership.
#
# Default MMTk properties file.
mmtk.use_page_protection_yp = true
......@@ -44,7 +44,7 @@ import org.vmmagic.unboxed.Word;
@Uninterruptible
public final class ThinLock {
private static final boolean ENABLE_BIASED_LOCKING = true;
private static final boolean ENABLE_BIASED_LOCKING = false;
@Inline
@NoNullCheck
......
......@@ -42,32 +42,33 @@ public class TimerThread extends SystemThread {
// TODO: consider allowing GC to be sampled to enable profile-directed optimization of MMTk.
@Override
public void run() {
VM.disableYieldpoints();
if (verbose>=1) VM.sysWriteln("TimerThread run routine entered");
try {
for (;;) {
sysCall.sysNanoSleep(1000L*1000L*VM.interruptQuantum);
if (VM.BuildForAdaptiveSystem) {
// grab the lock to prevent threads from getting GC'd while we are
// iterating (since this thread doesn't stop for GC)
RVMThread.acctLock.lockNoHandshake();
RVMThread.timerTicks++;
for (int i=0;i<RVMThread.numThreads;++i) {
RVMThread candidate=RVMThread.threads[i];
if (candidate!=null && candidate.shouldBeSampled()) {
candidate.timeSliceExpired++;
candidate.takeYieldpoint=1;
}
}
RVMThread.acctLock.unlock();
}
RVMThread.checkDebugRequest();
}
} catch (Throwable e) {
printExceptionAndDie(e);
}
return;
// VM.disableYieldpoints();
// if (verbose>=1) VM.sysWriteln("TimerThread run routine entered");
// try {
// for (;;) {
// sysCall.sysNanoSleep(1000L*1000L*VM.interruptQuantum);
//
// if (VM.BuildForAdaptiveSystem) {
// // grab the lock to prevent threads from getting GC'd while we are
// // iterating (since this thread doesn't stop for GC)
// RVMThread.acctLock.lockNoHandshake();
// RVMThread.timerTicks++;
// for (int i=0;i<RVMThread.numThreads;++i) {
// RVMThread candidate=RVMThread.threads[i];
// if (candidate!=null && candidate.shouldBeSampled()) {
// candidate.timeSliceExpired++;
// candidate.takeYieldpoint=1;
// }
// }
// RVMThread.acctLock.unlock();
// }
//
// RVMThread.checkDebugRequest();
// }
// } catch (Throwable e) {
// printExceptionAndDie(e);
// }
}
@UninterruptibleNoWarn
private static void printExceptionAndDie(Throwable e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment