Skip to content

Commit

Permalink
Merge pull request #5042 from fjeremic/improve-ra
Browse files Browse the repository at this point in the history
Deprecate HPR support
  • Loading branch information
0xdaryl authored Mar 19, 2019
2 parents 88ccb82 + 9453525 commit e492ddf
Show file tree
Hide file tree
Showing 27 changed files with 63 additions and 377 deletions.
7 changes: 0 additions & 7 deletions buildspecs/j9.flags
Original file line number Diff line number Diff line change
Expand Up @@ -1098,13 +1098,6 @@ Only available on zOS</description>
<require flag="interp_nativeSupport"/>
</requires>
</flag>
<flag id="jit_highWordRegisters">
<description>Controls whether JIT supports two values in a single wide register.</description>
<ifRemoved>Each register can contain only a single value.</ifRemoved>
<requires>
<require flag="interp_nativeSupport"/>
</requires>
</flag>
<flag id="jit_ia32FixedFrame">
<description>Temp flag to enable IA32 fixed frame linkage</description>
<ifRemoved>JIT works as normal</ifRemoved>
Expand Down
3 changes: 1 addition & 2 deletions buildspecs/linux_390-64.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006, 2018 IBM Corp. and others
Copyright (c) 2006, 2019 IBM Corp. and others

This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -171,7 +171,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="jit_dynamicLoopTransfer" value="true"/>
<flag id="jit_fullSpeedDebug" value="true"/>
<flag id="jit_gcOnResolveSupport" value="true"/>
<flag id="jit_highWordRegisters" value="true"/>
<flag id="jit_newDualHelpers" value="true"/>
<flag id="jit_newInstancePrototype" value="true"/>
<flag id="jit_runtimeInstrumentation" value="true"/>
Expand Down
3 changes: 1 addition & 2 deletions buildspecs/linux_390-64_cmprssptrs.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006, 2018 IBM Corp. and others
Copyright (c) 2006, 2019 IBM Corp. and others

This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -175,7 +175,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="jit_dynamicLoopTransfer" value="true"/>
<flag id="jit_fullSpeedDebug" value="true"/>
<flag id="jit_gcOnResolveSupport" value="true"/>
<flag id="jit_highWordRegisters" value="true"/>
<flag id="jit_newDualHelpers" value="true"/>
<flag id="jit_newInstancePrototype" value="true"/>
<flag id="jit_runtimeInstrumentation" value="true"/>
Expand Down
3 changes: 1 addition & 2 deletions buildspecs/linux_390.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006, 2018 IBM Corp. and others
Copyright (c) 2006, 2019 IBM Corp. and others

This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -172,7 +172,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="jit_dynamicLoopTransfer" value="true"/>
<flag id="jit_fullSpeedDebug" value="true"/>
<flag id="jit_gcOnResolveSupport" value="true"/>
<flag id="jit_highWordRegisters" value="true"/>
<flag id="jit_newDualHelpers" value="true"/>
<flag id="jit_newInstancePrototype" value="true"/>
<flag id="jit_runtimeInstrumentation" value="true"/>
Expand Down
3 changes: 1 addition & 2 deletions buildspecs/linux_ztpf_390-64.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006, 2018 IBM Corp. and others
Copyright (c) 2006, 2019 IBM Corp. and others

This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -163,7 +163,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="jit_dynamicLoopTransfer" value="true"/>
<flag id="jit_fullSpeedDebug" value="true"/>
<flag id="jit_gcOnResolveSupport" value="true"/>
<flag id="jit_highWordRegisters" value="true"/>
<flag id="jit_newDualHelpers" value="true"/>
<flag id="jit_newInstancePrototype" value="true"/>
<flag id="jit_runtimeInstrumentation" value="true"/>
Expand Down
1 change: 0 additions & 1 deletion buildspecs/zos_390-64.spec
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="jit_freeSystemStackPointer" value="true"/>
<flag id="jit_fullSpeedDebug" value="true"/>
<flag id="jit_gcOnResolveSupport" value="true"/>
<flag id="jit_highWordRegisters" value="true"/>
<flag id="jit_newDualHelpers" value="true"/>
<flag id="jit_newInstancePrototype" value="true"/>
<flag id="jit_runtimeInstrumentation" value="true"/>
Expand Down
1 change: 0 additions & 1 deletion buildspecs/zos_390-64_cmprssptrs.spec
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="jit_freeSystemStackPointer" value="true"/>
<flag id="jit_fullSpeedDebug" value="true"/>
<flag id="jit_gcOnResolveSupport" value="true"/>
<flag id="jit_highWordRegisters" value="true"/>
<flag id="jit_newDualHelpers" value="true"/>
<flag id="jit_newInstancePrototype" value="true"/>
<flag id="jit_runtimeInstrumentation" value="true"/>
Expand Down
1 change: 0 additions & 1 deletion buildspecs/zos_390.spec
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<flag id="jit_freeSystemStackPointer" value="true"/>
<flag id="jit_fullSpeedDebug" value="true"/>
<flag id="jit_gcOnResolveSupport" value="true"/>
<flag id="jit_highWordRegisters" value="true"/>
<flag id="jit_newDualHelpers" value="true"/>
<flag id="jit_newInstancePrototype" value="true"/>
<flag id="jit_runtimeInstrumentation" value="true"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2018 IBM Corp. and others
* Copyright (c) 2009, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -1249,18 +1249,16 @@ private static void jitPrintFrameType(WalkState walkState, String frameType) thr
private void jitWalkRegisterMap(WalkState walkState, VoidPointer stackMap, J9JITStackAtlasPointer gcStackAtlas) throws CorruptDataException
{
UDATA registerMap = new UDATA(getJitRegisterMap(walkState.jitInfo, stackMap).bitAnd(J9SW_REGISTER_MAP_MASK));
UDATA highWordRegisterMap = new UDATA(getJitHighWordRegisterMap(walkState.jitInfo, stackMap));

swPrintf(walkState, 200, "\tIn jitWalkRegisterMap. stackMap={0}, gcStackAtlas={1}", Long.toHexString(stackMap.getAddress()), Long.toHexString(gcStackAtlas.getAddress()));

swPrintf(walkState, 3, "\tJIT-RegisterMap = {0}", registerMap);
swPrintf(walkState, 3, "\tJIT-HighWordRegisterMap = {0}", highWordRegisterMap);

if (gcStackAtlas.internalPointerMap().notNull()) {
registerMap = registerMap.bitAnd(new UDATA(INTERNAL_PTR_REG_MASK).bitNot());
}

if (! registerMap.eq(0) || ! highWordRegisterMap.eq(0)) {
if (! registerMap.eq(0)) {
int count = (int)J9SW_POTENTIAL_SAVED_REGISTERS;
int mapCursor = 0;

Expand Down Expand Up @@ -1289,54 +1287,6 @@ private void jitWalkRegisterMap(WalkState walkState, VoidPointer stackMap, J9JIT
if (! oldObject.eq(newObject)) {
swPrintf(walkState, 4, "\t\t\t-> {0}\n", newObject);
}
} else if (J9BuildFlags.jit_highWordRegisters && J9BuildFlags.gc_compressedPointers && highWordRegisterMap.anyBitsIn(3)) {
/* check low word and high word registers separately */
if (highWordRegisterMap.anyBitsIn(1)) {
/* we have a 32-bit compressed reference living in the low word of GPR */
/* low word is at higher offset*/
ObjectReferencePointer targetObject = ObjectReferencePointer.cast(walkState.registerEAs[mapCursor].addOffset(4));
J9ObjectPointer oldObject = targetObject.isNull() ? J9ObjectPointer.NULL : J9ObjectPointer.cast(targetObject.at(0));
J9ObjectPointer newObject;
swPrintf(walkState, 4, "\t\tJIT-RegisterMap-O-Slot[{0}] = {1} ({2}) (Low word)", targetObject.getHexAddress(), oldObject.getHexAddress(), jitRegisterNames[mapCursor]);
walkState.callBacks.objectSlotWalkFunction(walkState.walkThread, walkState, PointerPointer.cast(targetObject), VoidPointer.NULL);

newObject = targetObject.isNull() ? J9ObjectPointer.NULL : J9ObjectPointer.cast(targetObject.at(0));

if (! oldObject.eq(newObject)) {
swPrintf(walkState, 4, "\t\t\t-> {0}\n", newObject);
}
/* check high word for I-slot */
if (!highWordRegisterMap.anyBitsIn(2)) {
U32Pointer targetSlot = U32Pointer.cast(walkState.registerEAs[mapCursor]);

if (targetSlot.notNull()) {
swPrintf(walkState, 5, "\t\tJIT-RegisterMap-I-Slot[{0}] = {1} ({2}) (High word)", targetSlot.getHexAddress(), targetSlot.at(0), jitRegisterNames[mapCursor]);
}
}
}
if (highWordRegisterMap.anyBitsIn(2)) {
/* we have a 32-bit compressed reference living in the high word of GPR */
ObjectReferencePointer targetObject = ObjectReferencePointer.cast(walkState.registerEAs[mapCursor]);
J9ObjectPointer oldObject = targetObject.isNull() ? J9ObjectPointer.NULL : J9ObjectPointer.cast(targetObject.at(0));
J9ObjectPointer newObject;
swPrintf(walkState, 4, "\t\tJIT-RegisterMap-O-Slot[{0}] = {1} ({2}) (High word)", targetObject.getHexAddress(), oldObject.getHexAddress(), jitRegisterNames[mapCursor]);
walkState.callBacks.objectSlotWalkFunction(walkState.walkThread, walkState, PointerPointer.cast(targetObject), VoidPointer.NULL);

newObject = targetObject.isNull() ? J9ObjectPointer.NULL : J9ObjectPointer.cast(targetObject.at(0));

if (! oldObject.eq(newObject)) {
swPrintf(walkState, 4, "\t\t\t-> {0}\n", newObject);
}

/* check low word for I-slot */
if (!highWordRegisterMap.anyBitsIn(1)) {
U32Pointer targetSlot = U32Pointer.cast(walkState.registerEAs[mapCursor].addOffset(4));

if (targetSlot.notNull()) {
swPrintf(walkState, 5, "\t\tJIT-RegisterMap-I-Slot[{0}] = {1} ({2}) (Low word)", targetSlot.getHexAddress(), targetSlot.at(0), jitRegisterNames[mapCursor]);
}
}
}
} else {
UDATAPointer targetSlot = walkState.registerEAs[mapCursor];

Expand All @@ -1349,7 +1299,6 @@ private void jitWalkRegisterMap(WalkState walkState, VoidPointer stackMap, J9JIT
++(walkState.slotIndex);
--count;
registerMap = registerMap.rightShift(1);
highWordRegisterMap = highWordRegisterMap.rightShift(2);

if (J9SW_REGISTER_MAP_WALK_REGISTERS_LOW_TO_HIGH) {
++mapCursor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2018 IBM Corp. and others
* Copyright (c) 2009, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -166,11 +166,6 @@ public static U32 getJitRegisterMap(J9JITExceptionTablePointer methodMetaData, V
{
return getImpl().getJitRegisterMap(methodMetaData,stackMap);
}

public static U32 getJitHighWordRegisterMap(J9JITExceptionTablePointer methodMetaData, VoidPointer stackMap) throws CorruptDataException
{
return getImpl().getJitHighWordRegisterMap(methodMetaData,stackMap);
}

public static U8Pointer getNextDescriptionCursor(J9JITExceptionTablePointer metadata, VoidPointer stackMap, U8Pointer jitDescriptionCursor) throws CorruptDataException
{
Expand Down Expand Up @@ -299,8 +294,6 @@ private static interface MethodMetaDataImpl extends com.ibm.j9ddr.vm29.j9.IAlgor

public U32 getJitRegisterMap(J9JITExceptionTablePointer methodMetaData,VoidPointer stackMap) throws CorruptDataException;

public U32 getJitHighWordRegisterMap(J9JITExceptionTablePointer methodMetaData,VoidPointer stackMap) throws CorruptDataException;

public U16 getJitNumberOfMapBytes(J9JITStackAtlasPointer sa) throws CorruptDataException;

public I16 getJitTotalFrameSize(J9JITExceptionTablePointer md) throws CorruptDataException;
Expand Down Expand Up @@ -529,11 +522,7 @@ public void jitAddSpilledRegisters(WalkState walkState, VoidPointer stackMap) th

private U8Pointer GET_REGISTER_SAVE_DESCRIPTION_CURSOR(boolean fourByteOffset, VoidPointer stackMap)
{
if (J9ConfigFlags.arch_s390) {
return U8Pointer.cast(stackMap).add(SIZEOF_MAP_OFFSET(fourByteOffset)).add(U32.SIZEOF * 2);
} else {
return U8Pointer.cast(stackMap).add(SIZEOF_MAP_OFFSET(fourByteOffset)).add(U32.SIZEOF);
}
return U8Pointer.cast(stackMap).add(SIZEOF_MAP_OFFSET(fourByteOffset)).add(U32.SIZEOF);
}

public U16 getJitProloguePushes(J9JITExceptionTablePointer md) throws CorruptDataException
Expand Down Expand Up @@ -730,11 +719,7 @@ private static U8Pointer ADDRESS_OF_LOW_PC_OFFSET_IN_STACK_MAP(boolean fourByteO
@SuppressWarnings("unused")
private static U8Pointer ADDRESS_OF_REGISTERMAP(boolean fourByteOffset, U8Pointer stackMap)
{
if (J9ConfigFlags.arch_s390) {
return stackMap.add(SIZEOF_MAP_OFFSET(fourByteOffset)).add(3 * U32.SIZEOF);
} else {
return stackMap.add(SIZEOF_MAP_OFFSET(fourByteOffset)).add(2 * U32.SIZEOF);
}
return stackMap.add(SIZEOF_MAP_OFFSET(fourByteOffset)).add(2 * U32.SIZEOF);
}

private static boolean RANGE_NEEDS_FOUR_BYTE_OFFSET(Scalar s)
Expand Down Expand Up @@ -766,11 +751,7 @@ private static boolean IS_BYTECODEINFO_MAP(boolean fourByteOffset, U8Pointer sta
//#define GET_REGISTER_MAP_CURSOR(fourByteOffset, stackMap) ((U_8 *)stackMap + SIZEOF_MAP_OFFSET(fourByteOffset) + 2*sizeof(U_32))
private static U8Pointer GET_REGISTER_MAP_CURSOR(boolean fourByteOffset, U8Pointer stackMap)
{
if (J9ConfigFlags.arch_s390) {
return stackMap.add(SIZEOF_MAP_OFFSET(fourByteOffset).add(3 * U32.SIZEOF));
} else {
return stackMap.add(SIZEOF_MAP_OFFSET(fourByteOffset).add(2 * U32.SIZEOF));
}
return stackMap.add(SIZEOF_MAP_OFFSET(fourByteOffset).add(2 * U32.SIZEOF));
}

/* Note: this differs from the native version in that nextStackMap is returned - not passed by reference */
Expand Down Expand Up @@ -967,15 +948,6 @@ public U16 getJitNumberOfMapBytes(J9JITStackAtlasPointer sa) throws CorruptDataE
public U32 getJitRegisterMap(J9JITExceptionTablePointer methodMetaData, VoidPointer stackMap) throws CorruptDataException
{
return U32Pointer.cast(GET_REGISTER_MAP_CURSOR(HAS_FOUR_BYTE_OFFSET(methodMetaData), stackMap)).at(0);
}

public U32 getJitHighWordRegisterMap(J9JITExceptionTablePointer methodMetaData, VoidPointer stackMap) throws CorruptDataException
{
if (J9ConfigFlags.arch_s390) {
return U32Pointer.cast(GET_HIGHWORD_REGISTER_MAP_CURSOR(HAS_FOUR_BYTE_OFFSET(methodMetaData), stackMap)).at(0);
} else {
return new U32(0);
}
}

public U8Pointer getNextDescriptionCursor(J9JITExceptionTablePointer metadata, VoidPointer stackMap, U8Pointer jitDescriptionCursor) throws CorruptDataException
Expand Down Expand Up @@ -1301,12 +1273,9 @@ that does the stack check failure check (can result in GC). Avoid

swPrintf(walkState, 6, "\tJIT-RegisterMap = {0}", registerMap);
tempJitDescriptionCursorForRegs = U8Pointer.cast(stackMap);

if (J9ConfigFlags.arch_s390) {
tempJitDescriptionCursorForRegs = tempJitDescriptionCursorForRegs.add(12); /*skip register map, register save description word and high word register map*/
} else {
tempJitDescriptionCursorForRegs = tempJitDescriptionCursorForRegs.add(8); /*skip register map and register save description word */
}

/* Skip the register map and register save description word */
tempJitDescriptionCursorForRegs = tempJitDescriptionCursorForRegs.add(8);

if (((walkState.jitInfo.endPC().sub(walkState.jitInfo.startPC()).gte(new UDATA(65535)) || (alignStackMaps))))
{
Expand Down Expand Up @@ -1434,16 +1403,7 @@ public U8Pointer getJitStackSlots(J9JITExceptionTablePointer metaData,

private U8Pointer GET_REGISTER_MAP_CURSOR(boolean fourByteOffset, VoidPointer stackMap)
{
if (J9ConfigFlags.arch_s390) {
return U8Pointer.cast(stackMap).add(SIZEOF_MAP_OFFSET(fourByteOffset).add(U32.SIZEOF * 3));
} else {
return U8Pointer.cast(stackMap).add(SIZEOF_MAP_OFFSET(fourByteOffset).add(U32.SIZEOF * 2));
}
}

private static U8Pointer GET_HIGHWORD_REGISTER_MAP_CURSOR(boolean fourByteOffset, VoidPointer stackMap)
{
return U8Pointer.cast(stackMap).add(SIZEOF_MAP_OFFSET(fourByteOffset).add(U32.SIZEOF));
return U8Pointer.cast(stackMap).add(SIZEOF_MAP_OFFSET(fourByteOffset).add(U32.SIZEOF * 2));
}

private U32 getNumInlinedCallSites(J9JITExceptionTablePointer methodMetaData) throws CorruptDataException
Expand Down
Loading

0 comments on commit e492ddf

Please sign in to comment.