design and implementation of a 64-bit powerpc port of jikes rvm 2.0.3 sergiy kyrylkov, university of...

21
Design and Implementation of a 64-bit PowerPC Port of Jikes RVM 2.0.3 Sergiy Kyrylkov, University of New Mexico Darko Stefanovic, University of New Mexico Eliot Moss, University of This work is supported in part by NSF grants ITR CCR-0085792, ITR CCR-0219587, QuBIC EIA-0218262, CAREER EIA-0238027, ITR EIA-0324845, Microsoft Research, and Hewlett-Packard gift 88425.1.

Post on 22-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Design and Implementation of a 64-bit PowerPC Port of

Jikes RVM 2.0.3

Sergiy Kyrylkov, University of New Mexico

Darko Stefanovic, University of New Mexico

Eliot Moss, University of Massachusetts AmherstThis work is supported in part by NSF grants ITR CCR-0085792, ITR CCR-0219587, QuBIC EIA-0218262,

CAREER EIA-0238027, ITR EIA-0324845, Microsoft Research, and Hewlett-Packard gift 88425.1.

Motivation for a 64-bit VM

• New set of research opportunities

• Particularly interesting for memory management research

• No 64-bit open-source VM with enough functionality available

Jikes RVM 2.0.3for 64-bit PowerPC

• 32/64-bit clean runtime• 32/64-bit clean baseline compiler• Most of GCTk collectors

(SS, gen, Appel, OF, Beltway)• No optimizing compiler• No adaptive subsystem• No “watson” collectors• No JNI

Jikes RVM 2.0.3for 64-bit PowerPC

• Addresses are ADDRESS• Words are WORD• Offsets are int• JTOC is int[]• Operand stack is WORD[]• Default object header is two words

• Method and interface ID’s are int

Design DecisionsJTOC Layout

Design DecisionsObject Layout

Design DecisionsOperand Stack Layout

Porting Baseline Compiler

• New 64-bit instructions in VM_Assemblerstatic final int LDtemplate = 58<<26;

static final INSTRUCTION LD (int RT, int DS, int RA) {return 58<<26 | RT<<21 | RA<<16 | (DS&0xFFFC);

}

final void emitLD (int RT, int DS, int RA) {if (VM.VerifyAssertions) {

VM.assert(fits(DS, 16));VM.assert(correctds(DS));

}INSTRUCTION mi = LDtemplate | RT<<21 | RA<<16 | (DS&0xFFFC);if (VM.TraceAssembler) asm(mIP, mi, "ld", RT, signedHex(DS), RA);mIP++;mc.addInstruction(mi);

}

Porting Baseline Compiler

• New methods in VM_Assembler

final void emitLint (int RT, int D, int RA) {

//-#if RVM_FOR_POWERPC32

emitLWZ(RT, D, RA);

//-#endif

//-#if RVM_FOR_POWERPC64

emitLWA(RT, D, RA);

//-#endif

}

Porting Baseline Compiler

• 32/64-bit clean VM_Compilercase 0x60: /* --- iadd --- */ {

if (VM.TraceAssembler) asm.noteBytecode("iadd");/*asm.emitLWZ (T0, 0, SP);asm.emitLWZ (T1, 4, SP);asm.emitADDC (T2, T1, T0);asm.emitSTWU (T2, 4, SP);*/asm.emitLint (T0, 0, SP);asm.emitLint (T1, BYTES_IN_WORD, SP);asm.emitADDC (T2, T1, T0);asm.emitSTWU (T2, BYTES_IN_WORD, SP);break;

}

Porting Core Runtime

• Integer/address disambiguationint beg = VM.objectAsAddress(instructions);

private static int obsoleteMethodCount;

vs

ADDRESS beg = VM.objectAsAddress(instructions);

private static int obsoleteMethodCount;

• New system-wide constantsint tibIndex = method.getOffset<<2;

vs

int tibIndex = method.getOffset<<BYTES_IN_ADDRESS_LOG;

Porting Core Runtime

• New naming conventionssysCall1

vs

sysCall_X_rI, sysCall_I_rI, sysCall_A_rI

sysCall_AI_rX, sysCall_AIA_rA

• Method/code splittingint sysCall1(int p1);

vs

int sysCall_I_rI(int p1);

ADDRESS sysCall_A_rA(ADDRESS p1);

Lessons Relearned

• Use appropriate data types (int vs int, ADDRESS, WORD)

• Use system-wide constants and variables(4 vs BYTES_IN_INT, BYTES_IN_ADDRESS)

• Choose appropriate naming conventions(getMemoryWord vs getIntAtAddress, getAddressAtAddress)

jess32 vs jess64

GCTkAppelBaseBaseFast 32-bit versus 64-bit

270

280

290

300

310

320

330

340

350

360

16 24 32 40 48 56 64 72 80 88 96 104 112 120 128

Heap Size, MB

Ru

nn

ing

Tim

e, s

jess32

jess64

javac32 vs javac64

GCTkAppelBaseBaseFast 32-bit versus 64-bit

0

500

1000

1500

2000

2500

24 32 40 48 56 64 72 80 88 96 104 112 120 128

Heap Size, MB

Ru

nn

ing

Tim

e, s

javac32

javac64

jack32 vs jack64

GCTkAppelBaseBaseFast 32-bit versus 64-bit

0

100

200

300

400

500

600

8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128

Heap Size, MB

Ru

nn

ing

Tim

e, s

jack32

jack64

pseudojbb32 vs pseudojbb64GCTkAppelBaseBaseFast 32-bit versus 64-bit

0

500

1000

1500

2000

2500

3000

8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128

Heap Size, MB

Ru

nn

ing

Tim

e, s

jbb32

jbb64

Conclusions

• Open-source 64-bit VM with most complete functionality

• Provides testbed for a number of new research opportunities

• Useful insights for future VM developers to create robust and portable software

Current Work

• Porting Jikes RVM CVS head to 64-bit PowerPC Linux based on IBM 64-bit PowerPC AIX port (Venstermans, Grove, et al.)

• Implementing JMTk version of RealOF

Future Work

• Add optimizing compiler and adaptive subsystem for complete functionality

• Implement new GC algorithms (within JMTk) benefiting from 64-bit address space to evaluate their performance on a 64-bit PowerPC architecture

pseudojbb

pseudojbb (BaseBaseFast)

0

100

200

300

400

500

600

700

800

900

1000

48 56 64 72 80 88 96 104 112 120 128 136

Heap size, MB

Run

ning

tim

e, s

realOF

OF

Appel

SemiSpace

Beltway