210 likes | 324 Views
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 Amherst.
E N D
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 Amherst 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.
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
Porting Baseline Compiler • New 64-bit instructions in VM_Assembler static 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_Compiler case 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 disambiguation int beg = VM.objectAsAddress(instructions); private static int obsoleteMethodCount; vs ADDRESS beg = VM.objectAsAddress(instructions); private static int obsoleteMethodCount; • New system-wide constants int tibIndex = method.getOffset<<2; vs int tibIndex = method.getOffset<<BYTES_IN_ADDRESS_LOG;
Porting Core Runtime • New naming conventions sysCall1 vs sysCall_X_rI, sysCall_I_rI, sysCall_A_rI sysCall_AI_rX, sysCall_AIA_rA • Method/code splitting int 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)
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