|
63 | 63 | import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT_OOP;
|
64 | 64 | import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT_PRIMITIVE;
|
65 | 65 | import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT_VECTOR;
|
| 66 | +import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT4_NARROW_OOP; |
| 67 | +import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT4_OOP; |
| 68 | +import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT4_PRIMITIVE; |
| 69 | +import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT4_VECTOR; |
66 | 70 | import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.VIRTUAL_OBJECT_ID;
|
67 | 71 | import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.VIRTUAL_OBJECT_ID2;
|
68 | 72 |
|
@@ -178,6 +182,10 @@ enum Tag {
|
178 | 182 | STACK_SLOT_OOP,
|
179 | 183 | STACK_SLOT_NARROW_OOP,
|
180 | 184 | STACK_SLOT_VECTOR,
|
| 185 | + STACK_SLOT4_PRIMITIVE, |
| 186 | + STACK_SLOT4_OOP, |
| 187 | + STACK_SLOT4_NARROW_OOP, |
| 188 | + STACK_SLOT4_VECTOR, |
181 | 189 | VIRTUAL_OBJECT_ID,
|
182 | 190 | VIRTUAL_OBJECT_ID2,
|
183 | 191 | NULL_CONSTANT,
|
@@ -457,8 +465,12 @@ private void writeU2(String name, int value) {
|
457 | 465 | rawWriteU2(name, value);
|
458 | 466 | }
|
459 | 467 |
|
| 468 | + private static boolean isS2(int value) { |
| 469 | + return value >= Short.MIN_VALUE && value <= Short.MAX_VALUE; |
| 470 | + } |
| 471 | + |
460 | 472 | private void writeS2(String name, int value) {
|
461 |
| - if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) { |
| 473 | + if (!isS2(value)) { |
462 | 474 | throw error("value not an s2: " + value);
|
463 | 475 | }
|
464 | 476 | rawWriteU2(name, value);
|
@@ -581,7 +593,8 @@ private String codeDesc() {
|
581 | 593 | writeInt("targetCodeSize", code.targetCodeSize);
|
582 | 594 | writeInt("totalFrameSize", code.totalFrameSize);
|
583 | 595 | if (isSet(flags, HAS_DEOPT_RESCUE_SLOT)) {
|
584 |
| - writeS2("offset", deoptRescueSlot.getRawOffset()); |
| 596 | + int offset = deoptRescueSlot.getRawOffset(); |
| 597 | + writeInt("offset", offset); |
585 | 598 | writeBoolean("addRawFrameSize", deoptRescueSlot.getRawAddFrameSize());
|
586 | 599 | }
|
587 | 600 | writeInt("dataSectionSize", code.dataSection.length);
|
@@ -1063,17 +1076,25 @@ private void writeJavaValue(JavaValue value, JavaKind kind) {
|
1063 | 1076 | } else if (value instanceof StackSlot) {
|
1064 | 1077 | StackSlot slot = (StackSlot) value;
|
1065 | 1078 | Tag tag;
|
| 1079 | + int offset = slot.getRawOffset(); |
| 1080 | + boolean s2 = isS2(offset); |
1066 | 1081 | if (kind == JavaKind.Object) {
|
1067 | 1082 | if (isVector(slot)) {
|
1068 |
| - tag = STACK_SLOT_VECTOR; |
| 1083 | + tag = s2 ? STACK_SLOT_VECTOR : STACK_SLOT4_VECTOR; |
| 1084 | + } else if (isNarrowOop(slot)) { |
| 1085 | + tag = s2 ? STACK_SLOT_NARROW_OOP : STACK_SLOT4_NARROW_OOP; |
1069 | 1086 | } else {
|
1070 |
| - tag = isNarrowOop(slot) ? STACK_SLOT_NARROW_OOP : STACK_SLOT_OOP; |
| 1087 | + tag = s2 ? STACK_SLOT_OOP : STACK_SLOT4_OOP; |
1071 | 1088 | }
|
1072 | 1089 | } else {
|
1073 |
| - tag = STACK_SLOT_PRIMITIVE; |
| 1090 | + tag = s2 ? STACK_SLOT_PRIMITIVE : STACK_SLOT4_PRIMITIVE; |
1074 | 1091 | }
|
1075 | 1092 | writeTag(tag);
|
1076 |
| - writeS2("offset", slot.getRawOffset()); |
| 1093 | + if (s2) { |
| 1094 | + writeS2("offset", slot.getRawOffset()); |
| 1095 | + } else { |
| 1096 | + writeInt("offset4", slot.getRawOffset()); |
| 1097 | + } |
1077 | 1098 | writeBoolean("addRawFrameSize", slot.getRawAddFrameSize());
|
1078 | 1099 | } else if (value instanceof VirtualObject) {
|
1079 | 1100 | VirtualObject vo = (VirtualObject) value;
|
|
0 commit comments