|
41 | 41 | #include "runtime/os.hpp" |
42 | 42 | #include "runtime/sharedRuntime.hpp" |
43 | 43 | #include "utilities/align.hpp" |
| 44 | +#include "ci/ciSignature.hpp" |
| 45 | +#include "oops/inlineKlass.hpp" |
| 46 | +#include "runtime/globals.hpp" |
44 | 47 |
|
45 | 48 | // frequently used constants |
46 | 49 | // Allocate them with new so they are never destroyed (otherwise, a |
@@ -778,6 +781,14 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, |
778 | 781 | JVMCI_THROW_MSG_(IllegalArgumentException, "nmethod entry barrier is missing", JVMCI::ok); |
779 | 782 | } |
780 | 783 |
|
| 784 | + if(_offsets.value(CodeOffsets::Verified_Inline_Entry) == -1) { |
| 785 | + _offsets.set_value(CodeOffsets::Verified_Inline_Entry, _offsets.value(CodeOffsets::Verified_Entry)); |
| 786 | + } |
| 787 | + |
| 788 | + if(_offsets.value(CodeOffsets::Verified_Inline_Entry_RO) == -1) { |
| 789 | + _offsets.set_value(CodeOffsets::Verified_Inline_Entry_RO, _offsets.value(CodeOffsets::Verified_Entry)); |
| 790 | + } |
| 791 | + |
781 | 792 | JVMCIObject mirror = installed_code; |
782 | 793 | nmethod* nm = nullptr; // nm is an out parameter of register_method |
783 | 794 | result = runtime()->register_method(jvmci_env(), |
@@ -1098,9 +1109,19 @@ void CodeInstaller::read_virtual_objects(HotSpotCompiledCodeStream* stream, JVMC |
1098 | 1109 | if (is_auto_box) { |
1099 | 1110 | _has_auto_box = true; |
1100 | 1111 | } |
| 1112 | + // see code in output.cpp (PhaseOutput::FillLocArray) |
| 1113 | + bool check_is_not_null = stream->read_bool("nonNull"); |
| 1114 | + ScopeValue *is_init = nullptr; |
| 1115 | + if (check_is_not_null) { |
| 1116 | + ScopeValue* cur_second = nullptr; |
| 1117 | + BasicType type = (BasicType) stream->read_u1("basicType"); |
| 1118 | + ScopeValue* value; |
| 1119 | + u1 tag = stream->read_u1("tag"); |
| 1120 | + is_init = get_scope_value(stream, tag, type, cur_second, JVMCI_CHECK); |
| 1121 | + } |
1101 | 1122 | oop javaMirror = klass->java_mirror(); |
1102 | 1123 | ScopeValue *klass_sv = new ConstantOopWriteValue(JNIHandles::make_local(javaMirror)); |
1103 | | - ObjectValue* sv = is_auto_box ? new AutoBoxObjectValue(id, klass_sv) : new ObjectValue(id, klass_sv); |
| 1124 | + ObjectValue* sv = is_auto_box ? new AutoBoxObjectValue(id, klass_sv) : new ObjectValue(id, klass_sv, true, is_init); |
1104 | 1125 | objects->at_put(id, sv); |
1105 | 1126 | } |
1106 | 1127 | // All the values which could be referenced by the VirtualObjects |
@@ -1128,6 +1149,18 @@ int CodeInstaller::map_jvmci_bci(int bci) { |
1128 | 1149 | return bci; |
1129 | 1150 | } |
1130 | 1151 |
|
| 1152 | +bool has_scalarized_return(methodHandle& methodHandle){ |
| 1153 | + if (!InlineTypeReturnedAsFields) { |
| 1154 | + return false; |
| 1155 | + } |
| 1156 | + Method* method = methodHandle(); |
| 1157 | + InlineKlass* klass = method->returns_inline_type(Thread::current()); |
| 1158 | + if (klass != nullptr) { |
| 1159 | + return !method->is_native() && klass->can_be_returned_as_fields(); |
| 1160 | + } |
| 1161 | + return false; |
| 1162 | +} |
| 1163 | + |
1131 | 1164 | void CodeInstaller::record_scope(jint pc_offset, HotSpotCompiledCodeStream* stream, u1 debug_info_flags, bool full_info, bool is_mh_invoke, bool return_oop, JVMCI_TRAPS) { |
1132 | 1165 | if (full_info) { |
1133 | 1166 | read_virtual_objects(stream, JVMCI_CHECK); |
@@ -1169,7 +1202,7 @@ void CodeInstaller::record_scope(jint pc_offset, HotSpotCompiledCodeStream* stre |
1169 | 1202 | } |
1170 | 1203 |
|
1171 | 1204 | // has_ea_local_in_scope and arg_escape should be added to JVMCI |
1172 | | - const bool return_scalarized = false; |
| 1205 | + const bool return_scalarized = has_scalarized_return(method); |
1173 | 1206 | const bool has_ea_local_in_scope = false; |
1174 | 1207 | const bool arg_escape = false; |
1175 | 1208 | _debug_recorder->describe_scope(pc_offset, method, nullptr, bci, reexecute, rethrow_exception, is_mh_invoke, return_oop, |
@@ -1315,9 +1348,16 @@ void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, HotSpotCompile |
1315 | 1348 | case UNVERIFIED_ENTRY: |
1316 | 1349 | _offsets.set_value(CodeOffsets::Entry, pc_offset); |
1317 | 1350 | break; |
| 1351 | + case INLINE_ENTRY: |
| 1352 | + _offsets.set_value(CodeOffsets::Inline_Entry, pc_offset); |
| 1353 | + break; |
1318 | 1354 | case VERIFIED_ENTRY: |
1319 | 1355 | _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset); |
| 1356 | + break; |
| 1357 | + case VERIFIED_INLINE_ENTRY: |
1320 | 1358 | _offsets.set_value(CodeOffsets::Verified_Inline_Entry, pc_offset); |
| 1359 | + break; |
| 1360 | + case VERIFIED_INLINE_ENTRY_RO: |
1321 | 1361 | _offsets.set_value(CodeOffsets::Verified_Inline_Entry_RO, pc_offset); |
1322 | 1362 | break; |
1323 | 1363 | case OSR_ENTRY: |
|
0 commit comments