Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8252467: AOT need to process new markId DEOPT_MH_HANDLER_ENTRY in com…
…piled code

Reviewed-by: dlong
  • Loading branch information
Vladimir Kozlov committed Aug 27, 2020
1 parent 2665df9 commit 074cabcb6d91a8fe961f3329279e34666abc3e3e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
@@ -40,6 +40,7 @@ class aot_metadata {
int _verified_entry;
int _exception_handler_offset;
int _deopt_handler_offset;
int _deopt_mh_handler_offset;
int _stubs_offset;
int _frame_size;
// location in frame (offset for sp) that deopt can store the original
@@ -78,6 +79,7 @@ class aot_metadata {
int verified_entry_offset() const { return _verified_entry; }
int exception_handler_offset() const { return _exception_handler_offset; }
int deopt_handler_offset() const { return _deopt_handler_offset; }
int deopt_mh_handler_offset() const { return _deopt_mh_handler_offset; }
int orig_pc_offset() const { return _orig_pc_offset; }

int handler_table_size() const { return handler_table_end() - handler_table_begin(); }
@@ -148,7 +150,11 @@ class AOTCompiledMethod : public CompiledMethod, public CHeapObj<mtCode> {

_scopes_data_begin = (address) _meta->scopes_data_begin();
_deopt_handler_begin = (address) _code + _meta->deopt_handler_offset();
_deopt_mh_handler_begin = (address) this;
if (_meta->deopt_mh_handler_offset() != -1) {
_deopt_mh_handler_begin = (address) _code + _meta->deopt_mh_handler_offset();
} else {
_deopt_mh_handler_begin = (address) this;
}

_pc_desc_container.reset_to(scopes_pcs_begin());

@@ -35,19 +35,22 @@ final class CodeOffsets {
private final int verifiedEntry;
private final int exceptionHandler;
private final int deoptHandler;
private final int deoptMHHandler;

private CodeOffsets(int entry, int verifiedEntry, int exceptionHandler, int deoptHandler) {
private CodeOffsets(int entry, int verifiedEntry, int exceptionHandler, int deoptHandler, int deoptMHHandler) {
this.entry = entry;
this.verifiedEntry = verifiedEntry;
this.exceptionHandler = exceptionHandler;
this.deoptHandler = deoptHandler;
this.deoptMHHandler = deoptMHHandler;
}

static CodeOffsets buildFrom(List<CompilationResult.CodeMark> marks) {
int entry = 0;
int verifiedEntry = 0;
int exceptionHandler = -1;
int deoptHandler = -1;
int deoptMHHandler = -1;

for (CompilationResult.CodeMark mark : marks) {
HotSpotMarkId markId = (HotSpotMarkId) mark.id;
@@ -67,11 +70,14 @@ static CodeOffsets buildFrom(List<CompilationResult.CodeMark> marks) {
case DEOPT_HANDLER_ENTRY:
deoptHandler = mark.pcOffset;
break;
case DEOPT_MH_HANDLER_ENTRY:
deoptMHHandler = mark.pcOffset;
break;
default:
break; // Ignore others
}
}
return new CodeOffsets(entry, verifiedEntry, exceptionHandler, deoptHandler);
return new CodeOffsets(entry, verifiedEntry, exceptionHandler, deoptHandler, deoptMHHandler);
}

int entry() {
@@ -89,4 +95,8 @@ int exceptionHandler() {
int deoptHandler() {
return deoptHandler;
}

int deoptMHHandler() {
return deoptMHHandler;
}
}
@@ -55,6 +55,7 @@ void process(CompiledMethodInfo methodInfo, CompilationResult.CodeMark mark) {
switch (markId) {
case EXCEPTION_HANDLER_ENTRY:
case DEOPT_HANDLER_ENTRY:
case DEOPT_MH_HANDLER_ENTRY:
break;
case POLL_FAR:
case POLL_RETURN_FAR:
@@ -114,6 +114,7 @@ private void createMethodMetadata(AOTCompiledClass compiledClass) {
int verifiedEntry = co.verifiedEntry();
int exceptionHandler = co.exceptionHandler();
int deoptHandler = co.deoptHandler();
int deoptMHHandler = co.deoptMHHandler();
int frameSize = methodInfo.getCompilationResult().getTotalFrameSize();
StackSlot deoptRescueSlot = methodInfo.getCompilationResult().getCustomStackArea();
int origPcOffset = deoptRescueSlot != null ? deoptRescueSlot.getOffset(frameSize) : -1;
@@ -135,6 +136,7 @@ private void createMethodMetadata(AOTCompiledClass compiledClass) {
putInt(verifiedEntry).
putInt(exceptionHandler).
putInt(deoptHandler).
putInt(deoptMHHandler).
putInt(stubsOffset).
putInt(frameSize).
putInt(origPcOffset).

0 comments on commit 074cabc

Please sign in to comment.