Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ Handle CodeInstaller::read_oop(HotSpotCompiledCodeStream* stream, u1 tag, JVMCI_

ScopeValue* CodeInstaller::get_scope_value(HotSpotCompiledCodeStream* stream, u1 tag, BasicType type, ScopeValue* &second, JVMCI_TRAPS) {
second = nullptr;
bool stack_slot_is_s2 = true;
switch (tag) {
case ILLEGAL: {
if (type != T_ILLEGAL) {
Expand Down Expand Up @@ -436,11 +437,17 @@ ScopeValue* CodeInstaller::get_scope_value(HotSpotCompiledCodeStream* stream, u1
return value;
}
}
case STACK_SLOT4_PRIMITIVE:
case STACK_SLOT4_NARROW_OOP:
case STACK_SLOT4_OOP:
case STACK_SLOT4_VECTOR:
stack_slot_is_s2 = false;
// fall through
case STACK_SLOT_PRIMITIVE:
case STACK_SLOT_NARROW_OOP:
case STACK_SLOT_OOP:
case STACK_SLOT_VECTOR: {
jint offset = (jshort) stream->read_s2("offset");
jint offset = stack_slot_is_s2 ? (jshort) stream->read_s2("offset") : stream->read_s4("offset4");
if (stream->read_bool("addRawFrameSize")) {
offset += _total_frame_size;
}
Expand Down Expand Up @@ -854,7 +861,7 @@ void CodeInstaller::initialize_fields(HotSpotCompiledCodeStream* stream, u1 code
if (!is_set(code_flags, HCC_HAS_DEOPT_RESCUE_SLOT)) {
_orig_pc_offset = -1;
} else {
_orig_pc_offset = stream->read_s2("offset");
_orig_pc_offset = stream->read_s4("offset");
if (stream->read_bool("addRawFrameSize")) {
_orig_pc_offset += _total_frame_size;
}
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/jvmci/jvmciCodeInstaller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ class CodeInstaller : public StackObj {
STACK_SLOT_OOP,
STACK_SLOT_NARROW_OOP,
STACK_SLOT_VECTOR,
STACK_SLOT4_PRIMITIVE,
STACK_SLOT4_OOP,
STACK_SLOT4_NARROW_OOP,
STACK_SLOT4_VECTOR,
VIRTUAL_OBJECT_ID,
VIRTUAL_OBJECT_ID2,
NULL_CONSTANT,
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/share/jvmci/vmStructs_jvmci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,10 @@
declare_constant(CodeInstaller::STACK_SLOT_OOP) \
declare_constant(CodeInstaller::STACK_SLOT_NARROW_OOP) \
declare_constant(CodeInstaller::STACK_SLOT_VECTOR) \
declare_constant(CodeInstaller::STACK_SLOT4_PRIMITIVE) \
declare_constant(CodeInstaller::STACK_SLOT4_OOP) \
declare_constant(CodeInstaller::STACK_SLOT4_NARROW_OOP) \
declare_constant(CodeInstaller::STACK_SLOT4_VECTOR) \
declare_constant(CodeInstaller::VIRTUAL_OBJECT_ID) \
declare_constant(CodeInstaller::VIRTUAL_OBJECT_ID2) \
declare_constant(CodeInstaller::NULL_CONSTANT) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT_OOP;
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT_PRIMITIVE;
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT_VECTOR;
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT4_NARROW_OOP;
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT4_OOP;
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT4_PRIMITIVE;
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.STACK_SLOT4_VECTOR;
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.VIRTUAL_OBJECT_ID;
import static jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.VIRTUAL_OBJECT_ID2;

Expand Down Expand Up @@ -178,6 +182,10 @@ enum Tag {
STACK_SLOT_OOP,
STACK_SLOT_NARROW_OOP,
STACK_SLOT_VECTOR,
STACK_SLOT4_PRIMITIVE,
STACK_SLOT4_OOP,
STACK_SLOT4_NARROW_OOP,
STACK_SLOT4_VECTOR,
VIRTUAL_OBJECT_ID,
VIRTUAL_OBJECT_ID2,
NULL_CONSTANT,
Expand Down Expand Up @@ -457,8 +465,12 @@ private void writeU2(String name, int value) {
rawWriteU2(name, value);
}

private static boolean isS2(int value) {
return value >= Short.MIN_VALUE && value <= Short.MAX_VALUE;
}

private void writeS2(String name, int value) {
if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) {
if (!isS2(value)) {
throw error("value not an s2: " + value);
}
rawWriteU2(name, value);
Expand Down Expand Up @@ -581,7 +593,8 @@ private String codeDesc() {
writeInt("targetCodeSize", code.targetCodeSize);
writeInt("totalFrameSize", code.totalFrameSize);
if (isSet(flags, HAS_DEOPT_RESCUE_SLOT)) {
writeS2("offset", deoptRescueSlot.getRawOffset());
int offset = deoptRescueSlot.getRawOffset();
writeInt("offset", offset);
writeBoolean("addRawFrameSize", deoptRescueSlot.getRawAddFrameSize());
}
writeInt("dataSectionSize", code.dataSection.length);
Expand Down Expand Up @@ -1063,17 +1076,25 @@ private void writeJavaValue(JavaValue value, JavaKind kind) {
} else if (value instanceof StackSlot) {
StackSlot slot = (StackSlot) value;
Tag tag;
int offset = slot.getRawOffset();
boolean s2 = isS2(offset);
if (kind == JavaKind.Object) {
if (isVector(slot)) {
tag = STACK_SLOT_VECTOR;
tag = s2 ? STACK_SLOT_VECTOR : STACK_SLOT4_VECTOR;
} else if (isNarrowOop(slot)) {
tag = s2 ? STACK_SLOT_NARROW_OOP : STACK_SLOT4_NARROW_OOP;
} else {
tag = isNarrowOop(slot) ? STACK_SLOT_NARROW_OOP : STACK_SLOT_OOP;
tag = s2 ? STACK_SLOT_OOP : STACK_SLOT4_OOP;
}
} else {
tag = STACK_SLOT_PRIMITIVE;
tag = s2 ? STACK_SLOT_PRIMITIVE : STACK_SLOT4_PRIMITIVE;
}
writeTag(tag);
writeS2("offset", slot.getRawOffset());
if (s2) {
writeS2("offset", slot.getRawOffset());
} else {
writeInt("offset4", slot.getRawOffset());
}
writeBoolean("addRawFrameSize", slot.getRawAddFrameSize());
} else if (value instanceof VirtualObject) {
VirtualObject vo = (VirtualObject) value;
Expand Down