Skip to content

Commit 4852b5c

Browse files
committed
cleanup
1 parent 290ee6c commit 4852b5c

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoDecoder.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private static FrameInfoQueryResult decodeUncompressedFrameInfo(boolean isDeoptE
250250
return result;
251251
}
252252

253-
assert !(!state.isFirstFrame && isDeoptEntry) : "Deoptimization entry must not have inlined frames";
253+
assert state.isFirstFrame || !isDeoptEntry : "Deoptimization entry must not have inlined frames";
254254

255255
cur.encodedBci = encodedBci;
256256
cur.isDeoptEntry = isDeoptEntry;
@@ -281,17 +281,15 @@ private static FrameInfoQueryResult decodeUncompressedFrameInfo(boolean isDeoptE
281281
cur.valueInfos = decodeValues(valueInfoAllocator, curValueInfosLength, readBuffer, CodeInfoAccess.getFrameInfoObjectConstants(info));
282282
}
283283

284-
if (state.isFirstFrame) {
284+
if (state.isFirstFrame && needLocalValues) {
285285
/* This is the first frame, i.e., the top frame that will be returned. */
286-
if (needLocalValues) {
287-
int numVirtualObjects = readBuffer.getUVInt();
288-
virtualObjects = valueInfoAllocator.newValueInfoArrayArray(numVirtualObjects);
289-
for (int i = 0; i < numVirtualObjects; i++) {
290-
int numValues = readBuffer.getUVInt();
291-
ValueInfo[] decodedValues = decodeValues(valueInfoAllocator, numValues, readBuffer, CodeInfoAccess.getFrameInfoObjectConstants(info));
292-
if (virtualObjects != null) {
293-
virtualObjects[i] = decodedValues;
294-
}
286+
int numVirtualObjects = readBuffer.getUVInt();
287+
virtualObjects = valueInfoAllocator.newValueInfoArrayArray(numVirtualObjects);
288+
for (int i = 0; i < numVirtualObjects; i++) {
289+
int numValues = readBuffer.getUVInt();
290+
ValueInfo[] decodedValues = decodeValues(valueInfoAllocator, numValues, readBuffer, CodeInfoAccess.getFrameInfoObjectConstants(info));
291+
if (virtualObjects != null) {
292+
virtualObjects[i] = decodedValues;
295293
}
296294
}
297295
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/FrameInfoEncoder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,12 +824,12 @@ public static long encodeBci(int bci, boolean duringCall, boolean rethrowExcepti
824824

825825
/**
826826
* The source line number also encodes whether the is it the end of or a frame slice or not. The
827-
* original value is shifted to guarantee all source line numbers are greater than 0.
827+
* original value is incremented to guarantee all source line numbers are greater than 0.
828828
*/
829829
private static int encodeCompressedSourceLineNumber(int sourceLineNumber, boolean isSliceEnd) {
830-
int shiftedLineNumber = sourceLineNumber + FrameInfoDecoder.COMPRESSED_SOURCE_LINE_ADDEND;
831-
VMError.guarantee(shiftedLineNumber > 0);
832-
return isSliceEnd ? -(shiftedLineNumber) : (shiftedLineNumber);
830+
int lineNumberWithAddend = sourceLineNumber + FrameInfoDecoder.COMPRESSED_SOURCE_LINE_ADDEND;
831+
VMError.guarantee(lineNumberWithAddend > 0);
832+
return isSliceEnd ? -(lineNumberWithAddend) : (lineNumberWithAddend);
833833
}
834834

835835
void verifyEncoding(CodeInfo info) {

0 commit comments

Comments
 (0)