Skip to content

Commit

Permalink
Support for building the DBT/PearColator project into MRP.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Rogers committed Apr 23, 2009
1 parent 374f901 commit a51b7a0
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 28 deletions.
19 changes: 17 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ Check to make sure all required properties are specified. This includes properti
</javac>
</target>

<target name="package" depends="compile,compile-vmmagic,package-classpath,package-harmony"/>
<target name="package" depends="compile,compile-vmmagic,compile-projects,package-classpath,package-harmony"/>

<target name="package-harmony" if="harmony.classlib">
<zip destfile="${build.rt.jar}" duplicate="preserve" basedir="${build.classes}" compress="false">
Expand Down Expand Up @@ -1290,7 +1290,9 @@ Check to make sure all required properties are specified. This includes properti
<target name="gen-primordial-list">

<fileset id="primordials.main" dir="${build.classes}">
<include name="org/**/*.class" />
<include name="org/jikesrvm/**/*.class" />
<include name="org/mmtk/**/*.class" />
<include name="org/vmutil/**/*.class" />
<include name="com/ibm/tuningfork/**/*.class" />
<exclude name="**/ppc/*.class" unless="include.ppc"/>
<exclude name="**/ia32/*.class" if="include.ppc"/>
Expand Down Expand Up @@ -1917,6 +1919,19 @@ const char *rvm_target_configuration = "${target.file}";
</exec>
</target>

<!-- **************************************************************************** -->
<!-- * * -->
<!-- * Section for compiling and packaging external projects * -->
<!-- * * -->
<!-- **************************************************************************** -->
<target name="compile-projects"
depends="compile"
description="Build any projects included with the RVM">
<subant target="" inheritall="true">
<fileset dir="projects" includes="*/build.xml" />
</subant>
</target>

<!-- **************************************************************************** -->
<!-- * * -->
<!-- * Section for building an image * -->
Expand Down
1 change: 1 addition & 0 deletions rvm/src/Dummy.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ class Dummy {
static org.vmmagic.unboxed.WordArray x;
static org.vmmagic.unboxed.OffsetArray y;
static org.vmmagic.unboxed.ExtentArray z;
static org.jikesrvm.ppc.Disassembler project1; // needed by projects/dbt
}
70 changes: 49 additions & 21 deletions rvm/src/org/jikesrvm/classloader/NormalMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@
import org.jikesrvm.compilers.common.BootImageCompiler;
import org.jikesrvm.compilers.common.CompiledMethod;
import org.jikesrvm.compilers.common.RuntimeCompiler;
import org.jikesrvm.compilers.opt.bc2ir.BC2IR;
import org.jikesrvm.compilers.opt.bc2ir.GenerationContext;
import org.jikesrvm.compilers.opt.ir.HIRGenerator;
import org.jikesrvm.runtime.DynamicLink;
import org.jikesrvm.util.HashMapRVM;
import org.vmmagic.pragma.Uninterruptible;

/**
* A method of a java class that has bytecodes.
*/
public final class NormalMethod extends RVMMethod implements BytecodeConstants {
public class NormalMethod extends RVMMethod implements BytecodeConstants {

/* As we read the bytecodes for the method, we compute
* a simple summary of some interesting properties of the method.
Expand Down Expand Up @@ -68,29 +71,29 @@ public final class NormalMethod extends RVMMethod implements BytecodeConstants {
public static final int SWITCH_COST = CALL_COST;

// Definition of flag bits
private static final char HAS_MAGIC = 0x8000;
private static final char HAS_SYNCH = 0x4000;
private static final char HAS_ALLOCATION = 0x2000;
private static final char HAS_THROW = 0x1000;
private static final char HAS_INVOKE = 0x0800;
private static final char HAS_FIELD_READ = 0x0400;
private static final char HAS_FIELD_WRITE = 0x0200;
private static final char HAS_ARRAY_READ = 0x0100;
private static final char HAS_ARRAY_WRITE = 0x0080;
private static final char HAS_JSR = 0x0040;
private static final char HAS_COND_BRANCH = 0x0020;
private static final char HAS_SWITCH = 0x0010;
private static final char HAS_BACK_BRANCH = 0x0008;
private static final char IS_RS_METHOD = 0x0004;
protected static final char HAS_MAGIC = 0x8000;
protected static final char HAS_SYNCH = 0x4000;
protected static final char HAS_ALLOCATION = 0x2000;
protected static final char HAS_THROW = 0x1000;
protected static final char HAS_INVOKE = 0x0800;
protected static final char HAS_FIELD_READ = 0x0400;
protected static final char HAS_FIELD_WRITE = 0x0200;
protected static final char HAS_ARRAY_READ = 0x0100;
protected static final char HAS_ARRAY_WRITE = 0x0080;
protected static final char HAS_JSR = 0x0040;
protected static final char HAS_COND_BRANCH = 0x0020;
protected static final char HAS_SWITCH = 0x0010;
protected static final char HAS_BACK_BRANCH = 0x0008;
protected static final char IS_RS_METHOD = 0x0004;

/**
* storage for bytecode summary flags
*/
private char summaryFlags;
protected char summaryFlags;
/**
* storage for bytecode summary size
*/
private char summarySize;
protected char summarySize;

/**
* words needed for local variables (including parameters)
Expand Down Expand Up @@ -159,9 +162,12 @@ public final class NormalMethod extends RVMMethod implements BytecodeConstants {
* @param parameterAnnotations array of runtime visible paramter annotations
* @param ad annotation default value for that appears in annotation classes
*/
NormalMethod(TypeReference dc, MemberReference mr, short mo, TypeReference[] et, short lw, short ow,
byte[] bc, ExceptionHandlerMap eMap, int[] lm, LocalVariableTable lvt, int[] constantPool, Atom sig,
RVMAnnotation[] annotations, RVMAnnotation[][] parameterAnnotations, Object ad) {
protected NormalMethod(TypeReference dc, MemberReference mr, short mo,
TypeReference[] et, short lw, short ow,
byte[] bc, ExceptionHandlerMap eMap, int[] lm,
LocalVariableTable lvt, int[] constantPool, Atom sig,
RVMAnnotation[] annotations, RVMAnnotation[][] parameterAnnotations,
Object ad) {
super(dc, mr, mo, et, sig, annotations, parameterAnnotations, ad);
localWords = lw;
operandWords = ow;
Expand Down Expand Up @@ -213,7 +219,7 @@ public BytecodeStream getBytecodes() {
* @param dynamicLink the dynamicLink object to initialize
* @param bcIndex the bcIndex of the invoke instruction
*/
@Uninterruptible
@Uninterruptible("Called from within GC map iterators")
public void getDynamicLink(DynamicLink dynamicLink, int bcIndex) {
if (VM.VerifyAssertions) VM._assert(bytecodes != null);
if (VM.VerifyAssertions) VM._assert(bcIndex + 2 < bytecodes.length);
Expand Down Expand Up @@ -799,4 +805,26 @@ private void computeSummary(int[] constantPool) {
public LocalVariableTable getLocalVariableTable() {
return localVariableTables.get(this);
}

/**
* Create an optimizing compiler HIR code generator for this type of method
*
* @param context
* the generation context for the HIR generation
* @return a HIR generator
*/
public HIRGenerator createHIRGenerator(GenerationContext context) {
return new BC2IR(context);
}

/**
* Must this method be OPT compiled?
*
* @param context
* the generation context for the HIR generation
* @return a HIR generator
*/
public boolean optCompileOnly() {
return false;
}
}
2 changes: 1 addition & 1 deletion rvm/src/org/jikesrvm/classloader/RVMMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ public final synchronized void compile() {
* ("type information blocks")
* for this class and its subclasses
*/
public final synchronized void replaceCompiledMethod(CompiledMethod compiledMethod) {
public synchronized void replaceCompiledMethod(CompiledMethod compiledMethod) {
if (VM.VerifyAssertions) VM._assert(getDeclaringClass().isInstantiated());
// If we're replacing with a non-null compiledMethod, ensure that is still valid!
if (compiledMethod != null) {
Expand Down
7 changes: 4 additions & 3 deletions rvm/src/org/jikesrvm/compilers/opt/bc2ir/BC2IR.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import org.jikesrvm.compilers.opt.ir.Goto;
import org.jikesrvm.compilers.opt.ir.GuardedBinary;
import org.jikesrvm.compilers.opt.ir.GuardedUnary;
import org.jikesrvm.compilers.opt.ir.HIRGenerator;
import org.jikesrvm.compilers.opt.ir.IRTools;
import org.jikesrvm.compilers.opt.ir.IfCmp;
import org.jikesrvm.compilers.opt.ir.InstanceOf;
Expand Down Expand Up @@ -149,7 +150,7 @@
* @see ConvertBCtoHIR
*/
public final class BC2IR
implements IRGenOptions, Operators, BytecodeConstants, ClassLoaderConstants, OptConstants, OSRConstants {
implements IRGenOptions, Operators, BytecodeConstants, ClassLoaderConstants, OptConstants, OSRConstants, HIRGenerator {
/**
* Dummy slot.
* Used to deal with the fact the longs/doubles take
Expand Down Expand Up @@ -291,7 +292,7 @@ private BC2IR() {}
*
* @param context the context to generate HIR into
*/
private BC2IR(GenerationContext context) {
public BC2IR(GenerationContext context) {
start(context);
for (int argIdx = 0, localIdx = 0; argIdx < context.arguments.length;) {
TypeReference argType = context.arguments[argIdx].getType();
Expand Down Expand Up @@ -358,7 +359,7 @@ private void finish(GenerationContext context) {
/**
* Main generation loop.
*/
private void generateHIR() {
public void generateHIR() {
// Constructor initialized generation state to start
// generating from bytecode 0, so get the ball rolling.
if (DBG_BB || DBG_SELECTED) db("bbl: " + printBlocks());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public final class GenerationContext implements org.jikesrvm.compilers.opt.drive
* The Register to which BC2IR should assign the return value(s)
* of the method. It will be null when the method has a void return.
*/
Register resultReg;
public Register resultReg;

/**
* The enclosing exception handlers (null if there are none).
Expand Down

0 comments on commit a51b7a0

Please sign in to comment.